Fix API writable properties and remove PUT op from Accounting

This commit is contained in:
2024-07-25 11:05:47 +02:00
parent 0ae1f701aa
commit 460bbb7d01
+5 -3
View File
@@ -16,7 +16,6 @@ use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: AccountingRepository::class)]
#[API\ApiResource]
#[API\Get()]
#[API\Put(security: 'is_granted("ACCOUNTING_EDIT", object)')]
#[API\Patch(security: 'is_granted("ACCOUNTING_EDIT", object)')]
class Accounting
{
@@ -37,20 +36,23 @@ class Accounting
#[ORM\Column(length: 255)]
private ?string $ownerClass = null;
#[API\ApiProperty(writable: false)]
#[ORM\OneToOne(mappedBy: 'accounting', cascade: ['persist', 'remove'])]
private ?User $user = null;
#[API\ApiProperty(writable: false)]
#[ORM\OneToOne(mappedBy: 'accounting', cascade: ['persist', 'remove'])]
private ?Project $project = null;
#[API\ApiProperty(writable: false)]
#[ORM\OneToOne(mappedBy: 'accounting', cascade: ['persist', 'remove'])]
private ?Tipjar $tipjar = null;
#[API\ApiProperty(readableLink: false)]
#[API\ApiProperty(writable: false, readableLink: false)]
#[ORM\OneToMany(mappedBy: 'origin', targetEntity: AccountingTransaction::class)]
private Collection $transactionsIssued;
#[API\ApiProperty(readableLink: false)]
#[API\ApiProperty(writable: false, readableLink: false)]
#[ORM\OneToMany(mappedBy: 'target', targetEntity: AccountingTransaction::class)]
private Collection $transactionsReceived;