Skip to content

Commit

Permalink
Merge pull request #19 from ConductionNL/dev-robert_remarks
Browse files Browse the repository at this point in the history
Datamodel update, add remarks to invoices
  • Loading branch information
rubenvdlinde authored Feb 21, 2020
2 parents bc6370a + 95f2f63 commit 8a6151c
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 13 deletions.
Binary file modified api/public/schema/Datamodel_Modelio.zip
Binary file not shown.
Binary file modified api/public/schema/datamodel.pdf
Binary file not shown.
37 changes: 34 additions & 3 deletions api/public/schema/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3305,6 +3305,9 @@ components:
paymentUrl:
readOnly: true
type: string
remark:
description: 'Remarks on this invoice'
type: string
required:
- name
- targetOrganization
Expand Down Expand Up @@ -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.'
Expand Down Expand Up @@ -3431,6 +3437,9 @@ components:
paymentUrl:
readOnly: true
type: string
remark:
description: 'Remarks on this invoice'
type: string
required:
- name
- targetOrganization
Expand Down Expand Up @@ -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.'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
27 changes: 24 additions & 3 deletions api/src/Entity/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
}


}
30 changes: 25 additions & 5 deletions api/src/Entity/InvoiceItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 0 additions & 2 deletions api/src/Subscriber/InvoiceSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 8a6151c

Please sign in to comment.