diff --git a/src/ApiResource/Matchfunding/MatchCallApiResource.php b/src/ApiResource/Matchfunding/MatchCallApiResource.php index 1048333..e8e2576 100644 --- a/src/ApiResource/Matchfunding/MatchCallApiResource.php +++ b/src/ApiResource/Matchfunding/MatchCallApiResource.php @@ -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; } diff --git a/src/ApiResource/Matchfunding/MatchCallSubmissionApiResource.php b/src/ApiResource/Matchfunding/MatchCallSubmissionApiResource.php index 10bcfbc..87f4b87 100644 --- a/src/ApiResource/Matchfunding/MatchCallSubmissionApiResource.php +++ b/src/ApiResource/Matchfunding/MatchCallSubmissionApiResource.php @@ -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; } diff --git a/src/ApiResource/Project/ProjectApiResource.php b/src/ApiResource/Project/ProjectApiResource.php index 72650c5..af64ffb 100644 --- a/src/ApiResource/Project/ProjectApiResource.php +++ b/src/ApiResource/Project/ProjectApiResource.php @@ -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 + */ + #[API\ApiProperty(writable: false)] + public array $matchCallSubmissions; }