Merge pull request #166 from goteo/feat/update-match-call-api-shape
[feat] Update MatchCall API shape
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\ApiResource\Matchfunding;
|
||||
|
||||
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
|
||||
use ApiPlatform\Doctrine\Orm\State\Options;
|
||||
use ApiPlatform\Metadata as API;
|
||||
use App\ApiResource\Accounting\AccountingApiResource;
|
||||
@@ -72,11 +73,13 @@ class MatchCallApiResource
|
||||
* Main display title.
|
||||
*/
|
||||
#[Assert\NotBlank()]
|
||||
#[API\ApiFilter(SearchFilter::class, strategy: 'partial')]
|
||||
public string $title;
|
||||
|
||||
/**
|
||||
* Long-form secondary display text.
|
||||
*/
|
||||
#[API\ApiFilter(SearchFilter::class, strategy: 'partial')]
|
||||
public string $description;
|
||||
|
||||
/**
|
||||
@@ -84,10 +87,16 @@ class MatchCallApiResource
|
||||
*/
|
||||
#[Assert\NotBlank()]
|
||||
#[Assert\Valid]
|
||||
#[API\ApiFilter(
|
||||
SearchFilter::class,
|
||||
strategy: 'exact',
|
||||
properties: ['territory.country', 'territory.subLvl1', 'territory.subLvl2'],
|
||||
)]
|
||||
public Territory $territory;
|
||||
|
||||
/**
|
||||
* The current status of the MatchCall.
|
||||
*/
|
||||
#[API\ApiFilter(SearchFilter::class, strategy: 'exact')]
|
||||
public MatchCallStatus $status = MatchCallStatus::InEditing;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\ApiResource\Matchfunding;
|
||||
|
||||
use ApiPlatform\Doctrine\Orm\Filter\SearchFilter;
|
||||
use ApiPlatform\Doctrine\Orm\State\Options;
|
||||
use ApiPlatform\Metadata as API;
|
||||
use App\ApiResource\Project\ProjectApiResource;
|
||||
@@ -40,17 +41,20 @@ class MatchCallSubmissionApiResource
|
||||
* The MatchCall to which this MatchCallSubmission belongs to.
|
||||
*/
|
||||
#[API\ApiProperty(writable: false)]
|
||||
#[API\ApiFilter(SearchFilter::class, strategy: 'exact')]
|
||||
public MatchCallApiResource $call;
|
||||
|
||||
/**
|
||||
* The Project that applied for the MatchCall.
|
||||
*/
|
||||
#[API\ApiProperty(writable: false)]
|
||||
#[API\ApiFilter(SearchFilter::class, strategy: 'exact')]
|
||||
public ProjectApiResource $project;
|
||||
|
||||
/**
|
||||
* The status of the Project's application for the MatchCall.\
|
||||
* Only MatchCallSubmissions with an status `accepted` will receive matchfunding.
|
||||
*/
|
||||
#[API\ApiFilter(SearchFilter::class, strategy: 'exact')]
|
||||
public MatchCallSubmissionStatus $status = MatchCallSubmissionStatus::DEFAULT;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ use ApiPlatform\Doctrine\Orm\State\Options;
|
||||
use ApiPlatform\Metadata as API;
|
||||
use App\ApiResource\Accounting\AccountingApiResource;
|
||||
use App\ApiResource\LocalizedApiResourceTrait;
|
||||
use App\ApiResource\Matchfunding\MatchCallSubmissionApiResource;
|
||||
use App\ApiResource\User\UserApiResource;
|
||||
use App\Dto\ProjectCreationDto;
|
||||
use App\Dto\ProjectUpdationDto;
|
||||
@@ -172,4 +173,10 @@ class ProjectApiResource
|
||||
*/
|
||||
#[API\ApiProperty(writable: false)]
|
||||
public array $updates;
|
||||
|
||||
/**
|
||||
* @var array<int, MatchCallSubmissionApiResource>
|
||||
*/
|
||||
#[API\ApiProperty(writable: false)]
|
||||
public array $matchCallSubmissions;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user