diff --git a/api/public/schema/Datamodel_Modelio.zip b/api/public/schema/Datamodel_Modelio.zip index 3f2bce47..34050f47 100644 Binary files a/api/public/schema/Datamodel_Modelio.zip and b/api/public/schema/Datamodel_Modelio.zip differ diff --git a/api/public/schema/datamodel.pdf b/api/public/schema/datamodel.pdf index 44592dd6..6a58dd10 100644 Binary files a/api/public/schema/datamodel.pdf and b/api/public/schema/datamodel.pdf differ diff --git a/api/public/schema/openapi.yaml b/api/public/schema/openapi.yaml index 88d2b2be..9c0bd776 100644 --- a/api/public/schema/openapi.yaml +++ b/api/public/schema/openapi.yaml @@ -3305,6 +3305,9 @@ components: paymentUrl: readOnly: true type: string + remark: + description: 'Remarks on this invoice' + type: string required: - name - targetOrganization @@ -3357,6 +3360,9 @@ components: externalDocs: url: 'http://schema.org/url' type: string + remark: + description: 'Remarks on this invoice' + type: string 'Invoice:jsonld-read': type: object description: 'An entity representing an invoice.' @@ -3431,6 +3437,9 @@ components: paymentUrl: readOnly: true type: string + remark: + description: 'Remarks on this invoice' + type: string required: - name - targetOrganization @@ -3492,6 +3501,9 @@ components: externalDocs: url: 'http://schema.org/url' type: string + remark: + description: 'Remarks on this invoice' + type: string InvoiceItem-read: type: object description: 'An entity representing an item of an invoice.' @@ -3532,7 +3544,12 @@ components: taxPercentage: description: 'The tax percentage for this offer as an integer e.g. 9% makes 9' type: integer - createdAt: + dateCreated: + readOnly: true + description: 'The moment this request was created by the submitter' + type: string + format: date-time + dateModified: readOnly: true description: 'The moment this request was created by the submitter' type: string @@ -3635,7 +3652,12 @@ components: taxPercentage: description: 'The tax percentage for this offer as an integer e.g. 9% makes 9' type: integer - createdAt: + dateCreated: + readOnly: true + description: 'The moment this request was created by the submitter' + type: string + format: date-time + dateModified: readOnly: true description: 'The moment this request was created by the submitter' type: string @@ -4109,6 +4131,9 @@ definitions: example: 'https://example.org/people/1' format: url paymentUrl: [] + remark: + description: 'Remarks on this invoice' + type: string items: description: 'The items in this invoice' type: \ArrayCollection @@ -4159,6 +4184,9 @@ definitions: type: string example: 'https://example.org/people/1' format: url + remark: + description: 'Remarks on this invoice' + type: string items: description: 'The items in this invoice' type: \ArrayCollection @@ -4212,7 +4240,10 @@ definitions: description: 'The tax percentage for this offer as an integer e.g. 9% makes 9' type: int example: '9' - createdAt: + dateCreated: + description: 'The moment this request was created by the submitter' + type: \DateTime + dateModified: description: 'The moment this request was created by the submitter' type: \DateTime invoice: diff --git a/api/src/Entity/Invoice.php b/api/src/Entity/Invoice.php index 0acd4bad..2db61533 100644 --- a/api/src/Entity/Invoice.php +++ b/api/src/Entity/Invoice.php @@ -234,6 +234,15 @@ class Invoice */ private $paymentUrl; + /** + * @var string Remarks on this invoice + * + * @Groups({"read","write"}) + * + * @ORM\Column(type="text", nullable=true) + */ + private $remark; + public function __construct() { $this->items = new ArrayCollection(); @@ -368,12 +377,12 @@ public function setDateCreated(DateTimeInterface $dateCreated): self } public function getDateModified(): ?DateTimeInterface { - return $this->dateCreated; + return $this->dateModified; } - public function setDateModified(DateTimeInterface $dateCreated): self + public function setDateModified(DateTimeInterface $dateModified): self { - $this->dateCreated = $dateCreated; + $this->dateModified = $dateModified; return $this; } @@ -481,5 +490,17 @@ public function setPaymentUrl(?string $paymentUrl): self return $this; } + public function getRemark(): ?string + { + return $this->remark; + } + + public function setRemark(?string $remark): self + { + $this->remark = $remark; + + return $this; + } + } diff --git a/api/src/Entity/InvoiceItem.php b/api/src/Entity/InvoiceItem.php index 8b780ef0..a11b133a 100644 --- a/api/src/Entity/InvoiceItem.php +++ b/api/src/Entity/InvoiceItem.php @@ -157,7 +157,16 @@ class InvoiceItem * @Gedmo\Timestampable(on="create") * @ORM\Column(type="datetime", nullable=true) */ - private $createdAt; + private $dateCreated; + + /** + * @var DateTime The moment this request was created by the submitter + * + * @Groups({"read"}) + * @Gedmo\Timestampable(on="create") + * @ORM\Column(type="datetime", nullable=true) + */ + private $dateModified; public function getId() { @@ -282,14 +291,25 @@ public function setDescription(?string $description): self return $this; } - public function getCreatedAt(): ?\DateTimeInterface + public function getDateCreated(): ?\DateTimeInterface + { + return $this->dateCreated; + } + + public function setDateCreated(?\DateTimeInterface $dateCreated): self + { + $this->dateCreated = $dateCreated; + + return $this; + } + public function getDateModified(): ?\DateTimeInterface { - return $this->createdAt; + return $this->dateModified; } - public function setCreatedAt(?\DateTimeInterface $createdAt): self + public function setDateModified(?\DateTimeInterface $dateModified): self { - $this->createdAt = $createdAt; + $this->dateModified = $dateModified; return $this; } diff --git a/api/src/Subscriber/InvoiceSubscriber.php b/api/src/Subscriber/InvoiceSubscriber.php index e2456919..e72d088b 100644 --- a/api/src/Subscriber/InvoiceSubscriber.php +++ b/api/src/Subscriber/InvoiceSubscriber.php @@ -70,8 +70,6 @@ public function invoice(RequestEvent $event) $invoice->setPriceCurrency($order->priceCurrency); $invoice->setTax($order->tax); $invoice->setCustomer($order->customer); - //@TODO: ORC locatie inregelbaar maken - $invoice->setOrder('https://orc.larping.eu'.$order->_links->self->href); $organization = $this->em->getRepository('App:Organization')->findOrCreateByRsin($order->organization->rsin); if ($organization instanceof Organization) {