new API\Link( description: 'Project identifier or slug', ), ] )] #[API\Patch( input: ProjectUpdationDto::class, processor: ProjectStateProcessor::class, security: 'is_granted("PROJECT_EDIT", previous_object)', )] #[API\Delete(security: 'is_granted("PROJECT_EDIT", previous_object)')] class ProjectApiResource { use LocalizedApiResourceTrait; #[API\ApiProperty(identifier: true, writable: false)] public int $id; /** * A unique, non white space, string identifier for this Project. */ #[API\ApiProperty(writable: false)] #[API\ApiFilter(SearchFilter::class, strategy: 'exact')] public string $slug; /** * The Accounting holding the funds raised by this Project. */ #[API\ApiProperty(writable: false)] public AccountingApiResource $accounting; /** * The User who owns this Project. */ #[API\ApiProperty(writable: false)] public UserApiResource $owner; /** * Main headline for the Project. */ #[API\ApiFilter(filterClass: SearchFilter::class, strategy: 'partial')] #[Assert\NotBlank()] public string $title; /** * Secondary headline for the Project. */ #[API\ApiFilter(filterClass: SearchFilter::class, strategy: 'partial')] #[Assert\NotBlank()] public string $subtitle; /** * On `minimum`, Project will campaign until the minimum deadline.\ * On `optimum`, Project will campaing until the minimum deadline, * and then until the optimum deadline if it did raise the minimum. */ #[API\ApiProperty(writable: false)] public ProjectDeadline $deadline; /** * Deadlines and important Project dates. */ #[API\ApiProperty(writable: false)] public ProjectCalendar $calendar; /** * A list of the available categories most relevant to this Project. */ #[Assert\NotBlank()] #[API\ApiFilter(filterClass: SearchFilter::class, strategy: 'exact')] public array $categories; /** * ISO 3166 data about the Project's territory of interest. */ #[Assert\NotBlank()] #[Assert\Valid()] public Territory $territory; /** * Free-form rich text description for the Project. */ #[API\ApiFilter(filterClass: SearchFilter::class, strategy: 'partial')] #[Assert\NotBlank()] public string $description; /** * Extracted embedding data from the Project's video. */ #[API\ApiProperty(writable: false)] #[MapFrom(source: Project::class, property: 'video')] public ProjectVideo $video; /** * The status of a Project represents how far it is in it's life-cycle. */ #[API\ApiFilter(filterClass: SearchFilter::class, strategy: 'exact')] #[API\ApiProperty(securityPostDenormalize: 'is_granted("PROJECT_EDIT", previous_object)')] public ProjectStatus $status = ProjectStatus::InEditing; /** * List of the ProjectRewards this Project offers. * * @var array */ #[API\ApiProperty(writable: false)] public array $rewards; /** * A detailed breakdown of the budget for this Project, as described by the associated BudgetItems. */ #[API\ApiProperty(writable: false)] #[MapFrom(source: Project::class, transformer: BudgetMapTransformer::class)] public Budget $budget; /** * A list of the BudgetItems composing the budget of this Project. * * @var array */ #[API\ApiProperty(writable: false)] public array $budgetItems; /** * A list of the ProjectUpdates this Project has. * * @var array */ #[API\ApiProperty(writable: false)] public array $updates; /** * @var array */ #[API\ApiProperty(writable: false)] public array $matchCallSubmissions; }