Skip to content

Commit

Permalink
Merge pull request #38 from ConductionNL/dev-robert_1
Browse files Browse the repository at this point in the history
Small bugfixes on fixtures and add duration
  • Loading branch information
rubenvdlinde authored Feb 1, 2020
2 parents e1bb8f5 + b3a2ffa commit ce687d8
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 8 deletions.
28 changes: 24 additions & 4 deletions api/public/schema/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5617,6 +5617,9 @@ components:
description: 'The moment this request last Modified'
type: string
format: date-time
duration:
description: 'The duration of this product, entered according to the [ISO 8601-standard](https://en.wikipedia.org/wiki/ISO_8601#Durations)'
type: string
required:
- name
- sourceOrganization
Expand Down Expand Up @@ -5704,6 +5707,9 @@ components:
type: array
items:
$ref: '#/components/schemas/PropertyValue-write'
duration:
description: 'The duration of this product, entered according to the [ISO 8601-standard](https://en.wikipedia.org/wiki/ISO_8601#Durations)'
type: string
required:
- name
- sourceOrganization
Expand Down Expand Up @@ -5836,6 +5842,9 @@ components:
description: 'The moment this request last Modified'
type: string
format: date-time
duration:
description: 'The duration of this product, entered according to the [ISO 8601-standard](https://en.wikipedia.org/wiki/ISO_8601#Durations)'
type: string
required:
- name
- sourceOrganization
Expand Down Expand Up @@ -5932,6 +5941,9 @@ components:
type: array
items:
$ref: '#/components/schemas/PropertyValue:jsonld-write'
duration:
description: 'The duration of this product, entered according to the [ISO 8601-standard](https://en.wikipedia.org/wiki/ISO_8601#Durations)'
type: string
required:
- name
- sourceOrganization
Expand Down Expand Up @@ -6575,12 +6587,12 @@ definitions:
availabilityEnds:
description: 'the date this offer ends'
type: string
example: '2020-01-30'
example: '2020-01-31'
format: date
availabilityStarts:
description: 'the date this offer has started'
type: string
example: '2020-01-30'
example: '2020-01-31'
format: date
dateCreated:
description: 'The moment this request was created'
Expand Down Expand Up @@ -6637,12 +6649,12 @@ definitions:
availabilityEnds:
description: 'the date this offer ends'
type: string
example: '2020-01-30'
example: '2020-01-31'
format: date
availabilityStarts:
description: 'the date this offer has started'
type: string
example: '2020-01-30'
example: '2020-01-31'
format: date
product:
description: 'The product that is sold via this offer'
Expand Down Expand Up @@ -6744,6 +6756,10 @@ definitions:
dateModified:
description: 'The moment this request last Modified'
type: \Datetime
duration:
description: 'The duration of this product, entered according to the [ISO 8601-standard](https://en.wikipedia.org/wiki/ISO_8601#Durations)'
type: string
example: PT10M
groups:
description: 'The product groups that this product is a part of'
type: \ArrayCollection
Expand Down Expand Up @@ -6831,6 +6847,10 @@ definitions:
audience:
description: 'The audience this product is intended for'
type: string
duration:
description: 'The duration of this product, entered according to the [ISO 8601-standard](https://en.wikipedia.org/wiki/ISO_8601#Durations)'
type: string
example: PT10M
groups:
description: 'The product groups that this product is a part of'
type: \ArrayCollection
Expand Down
2 changes: 1 addition & 1 deletion api/public/schema/publiccode.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ url: "https://github.com/ConductionNL/productenendienstencatalogus"
landingURL: "pdc.zaakonline.nl"
isBasedOn: "https://github.com/ConductionNL/Proto-component-commonground.git"
softwareVersion: "V.0.1"
releaseDate: "2020-30-01"
releaseDate: "2020-31-01"
logo: pc.zaakonline.nl
monochromeLogo: img/logo-mono.svg

Expand Down
13 changes: 10 additions & 3 deletions api/src/DataFixtures/AppFixtures.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ private function loadCatalogue(
$catalogue->setLogo($logo);
}
$manager->persist($catalogue);

return $catalogue;
}

Expand Down Expand Up @@ -104,7 +103,7 @@ public function load(ObjectManager $manager)
$manager->flush();
$manager->refresh($burgerzakerEindhoven);

$id = Uuid::fromString('d1a8b316-5966-4a29-8cf7-be15b8302301');
$id = Uuid::fromString('1138c620-223e-4def-ac84-f21a46369d56');
$burgerzakenUtrecht = new Group();
$burgerzakenUtrecht->setName('Burgerzaken');
$burgerzakenUtrecht->setDescription('Alle producten met betrekking tot burgerzaken');
Expand Down Expand Up @@ -197,7 +196,7 @@ public function load(ObjectManager $manager)
$trouwenLocatiesUtrecht = $manager->getRepository('App:Group')->findOneBy(['id'=> '170788e7-b238-4c28-8efc-97bdada02c2e']);
$trouwenAmbtenarenUtrecht = $manager->getRepository('App:Group')->findOneBy(['id'=> '7f4ff7ae-ed1b-45c9-9a73-3ed06a36b9cc']);
$trouwenUtrecht = $manager->getRepository('App:Group')->findOneBy(['id'=> '0c1f993d-f9e2-46c5-8d83-0b6dfb702069']);
$burgerzakenUtrecht = $manager->getRepository('App:Group')->findOneBy(['id'=> 'd1a8b316-5966-4a29-8cf7-be15b8302301']);
$burgerzakenUtrecht = $manager->getRepository('App:Group')->findOneBy(['id'=> '1138c620-223e-4def-ac84-f21a46369d56']);

$id = Uuid::fromString('d1a8b316-5966-4a29-8cf7-be15b8302301');
$product = new Product();
Expand Down Expand Up @@ -363,6 +362,12 @@ public function load(ObjectManager $manager)
$product->setId($id);
$manager->persist($product);
$manager->flush();
$product = $manager->getRepository('App:Product')->findOneBy(['id'=> $id]);
foreach ([$trouwenUtrecht, $trouwenAmbtenarenUtrecht] as $group) {
$product->addGroup($group);
}
$manager->persist($product);
$manager->flush();

$id = Uuid::fromString('ea984e7b-0d0d-48ff-86ea-bd5d15286ae7');
$product = new Product();
Expand Down Expand Up @@ -540,6 +545,8 @@ public function load(ObjectManager $manager)
foreach ([$trouwenUtrecht, $trouwenExtraUtrecht] as $group) {
$product->addGroup($group);
}
$manager->persist($product);
$manager->flush();

$id = Uuid::fromString('1fa3fbbc-0dee-442a-8431-3381b8cbc78a');
$product = new Product();
Expand Down
21 changes: 21 additions & 0 deletions api/src/Entity/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,15 @@ class Product
*/
private $dateModified;

/**
* @var string The duration of this product, entered according to the [ISO 8601-standard](https://en.wikipedia.org/wiki/ISO_8601#Durations)
* @example PT10M
*
* @Groups({"read","write"})
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $duration;

public function __construct()
{
$this->groups = new ArrayCollection();
Expand Down Expand Up @@ -787,4 +796,16 @@ public function setDateModified(\DateTimeInterface $dateModified): self

return $this;
}

public function getDuration(): ?string
{
return $this->duration;
}

public function setDuration(?string $duration): self
{
$this->duration = $duration;

return $this;
}
}

0 comments on commit ce687d8

Please sign in to comment.