Skip to content

Commit

Permalink
Comply with api resource class naming suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
subiabre committed Dec 11, 2024
1 parent 9297770 commit 8e8bdf0
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 75 deletions.
64 changes: 0 additions & 64 deletions src/ApiResource/Project/Project.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use ApiPlatform\Doctrine\Orm\State\Options;
use ApiPlatform\Metadata as API;
use App\Entity\Money;
use App\Entity\Project as Entity;
use App\Entity\Project\Reward;
use App\State\ApiResourceStateProcessor;
use App\State\ApiResourceStateProvider;
use AutoMapper\Attribute\MapTo;
Expand All @@ -16,11 +16,11 @@
*/
#[API\ApiResource(
shortName: 'ProjectReward',
stateOptions: new Options(entityClass: Entity\Reward::class),
stateOptions: new Options(entityClass: Reward::class),
provider: ApiResourceStateProvider::class,
processor: ApiResourceStateProcessor::class
)]
class Reward
class RewardApiResource
{
#[API\ApiProperty(identifier: true, writable: false)]
public int $id;
Expand All @@ -29,7 +29,7 @@ class Reward
* The project which gives this reward.
*/
#[Assert\NotBlank()]
public Project $project;
public ProjectApiResource $project;

/**
* A short, descriptive title for this reward.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use ApiPlatform\Doctrine\Orm\State\Options;
use ApiPlatform\Metadata as API;
use App\Entity\Project as Entity;
use App\Entity\User;
use App\ApiResource\User\UserApiResource;
use App\Entity\Project\RewardClaim;
use App\State\ApiResourceStateProcessor;
use App\State\ApiResourceStateProvider;
use Symfony\Component\Validator\Constraints as Assert;
Expand All @@ -15,11 +15,11 @@
*/
#[API\ApiResource(
shortName: 'ProjectRewardClaim',
stateOptions: new Options(entityClass: Entity\Reward::class),
stateOptions: new Options(entityClass: RewardClaim::class),
provider: ApiResourceStateProvider::class,
processor: ApiResourceStateProcessor::class
)]
class RewardClaim
class RewardClaimApiResource
{
#[API\ApiProperty(identifier: true, writable: false)]
public int $id;
Expand All @@ -28,11 +28,11 @@ class RewardClaim
* The ProjectReward being claimed.
*/
#[Assert\NotBlank()]
public Reward $reward;
public RewardApiResource $reward;

/**
* The User claiming the ProjectReward.
*/
#[API\ApiProperty(writable: false)]
public User $owner;
public UserApiResource $owner;
}
2 changes: 1 addition & 1 deletion src/Entity/Project/RewardClaim.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\Entity\Project;

use App\Entity\Interface\UserOwnedInterface;
use App\Entity\User;
use App\Entity\User\User;
use App\Repository\Project\RewardClaimRepository;
use Doctrine\ORM\Mapping as ORM;

Expand Down

0 comments on commit 8e8bdf0

Please sign in to comment.