diff --git a/api/config/bundles.php b/api/config/bundles.php index 0b350522..4f75440e 100644 --- a/api/config/bundles.php +++ b/api/config/bundles.php @@ -1,20 +1,20 @@ ['all' => true], - Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], - Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], - Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true], - Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], - Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], - ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], - Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], - Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], - Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], - Conduction\CommonGroundBundle\CommonGroundBundle::class => ['all' => true], - Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], + Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], + Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], + Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], + Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true], + Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], + Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], + ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true], + Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], + Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], + Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], + Conduction\CommonGroundBundle\CommonGroundBundle::class => ['all' => true], + Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true], - Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true], - Tbbc\MoneyBundle\TbbcMoneyBundle::class => ['all' => true], - Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true], + Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true], + Tbbc\MoneyBundle\TbbcMoneyBundle::class => ['all' => true], + Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true], ]; diff --git a/api/helm/values.yaml b/api/helm/values.yaml index 88bdaaaa..ccae99f3 100644 --- a/api/helm/values.yaml +++ b/api/helm/values.yaml @@ -10,7 +10,7 @@ settings: version: V.0.1 description: ''Naast deze JSON rest API is er ook een [graphql](/graphql) interface beschikbaar.'' repro: 'https://github.com/ConductionNL/verzoektypecatalogus' - subdomain: + subdomain: vtc domains: - conduction.nl - zaakonline.nl @@ -48,7 +48,7 @@ settings: php: - repository: docker.io/conduction/vtc-php + repository: docker.io/conduction/protocomponent-php tag: latest mercure: jwtSecret: "" @@ -64,7 +64,7 @@ nginx: varnish: enabled: true #url: https://example.com - repository: docker.io/conduction/vtc-varnish + repository: docker.io/conduction/protocomponent-varnish tag: latest pullPolicy: Always replicaCount: 1 diff --git a/api/public/schema/Datamodel_Modelio.zip b/api/public/schema/Datamodel_Modelio.zip new file mode 100644 index 00000000..396529b4 Binary files /dev/null and b/api/public/schema/Datamodel_Modelio.zip differ diff --git a/api/public/schema/openapi.yaml b/api/public/schema/openapi.yaml index 9b83cb55..1095b37b 100644 --- a/api/public/schema/openapi.yaml +++ b/api/public/schema/openapi.yaml @@ -1714,7 +1714,7 @@ components: type: boolean RequestType-read: type: object - description: '' + description: 'All properties contained in the RequestType type' properties: id: readOnly: true @@ -1734,6 +1734,7 @@ components: description: 'An short description of this RequestType' type: string properties: + description: 'The properties for this request type' type: array items: $ref: '#/components/schemas/Property-read' @@ -1743,7 +1744,7 @@ components: - source_organization RequestType-write: type: object - description: '' + description: 'All properties contained in the RequestType type' required: - source_organization properties: @@ -1751,12 +1752,13 @@ components: description: 'The RSIN of the organization that owns this process' type: string properties: + description: 'The properties for this request type' type: array items: $ref: '#/components/schemas/Property-write' 'RequestType:jsonld-read': type: object - description: '' + description: 'All properties contained in the RequestType type' properties: '@context': readOnly: true @@ -1785,6 +1787,7 @@ components: description: 'An short description of this RequestType' type: string properties: + description: 'The properties for this request type' type: array items: $ref: '#/components/schemas/Property:jsonld-read' @@ -1794,7 +1797,7 @@ components: - source_organization 'RequestType:jsonld-write': type: object - description: '' + description: 'All properties contained in the RequestType type' required: - source_organization properties: @@ -1811,6 +1814,7 @@ components: description: 'The RSIN of the organization that owns this process' type: string properties: + description: 'The properties for this request type' type: array items: $ref: '#/components/schemas/Property:jsonld-write' @@ -1818,218 +1822,400 @@ definitions: Property-read: properties: id: + description: 'The UUID identifier of this object' + type: string example: e2984465-190a-4562-829e-a8cca81aa35d format: uuid title: + description: 'The title of this property' + type: string example: 'My Property' maxLength: 255 minLength: 15 type: + description: 'The type of this property' + type: string example: string maxLength: 255 format: + description: 'The swagger type of the property as used in api calls' + type: string example: string maxLength: 255 multipleOf: + description: '*Can only be used in combination with type integer* Specifies a number where the value should be a multiple of, e.g. a multiple of 2 would validate 2,4 and 6 but would prevent 5' + type: string example: '2' maximum: + description: '*Can only be used in combination with type integer* The maximum allowed value' + type: string example: '2' exclusiveMaximum: + description: '*Can only be used in combination with type integer* Defines if the maximum is exclusive, e.g. a exclusive maximum of 5 would invalidate 5 but validate 4' + type: string example: 'true' minimum: + description: '*Can only be used in combination with type integer* The minimum allowed value' + type: string example: '2' exclusiveMinimum: + description: '*Can only be used in combination with type integer* Defines if the minimum is exclusive, e.g. a exclusive minimum of 5 would invalidate 5 but validate 6' + type: string example: 'true' maxLength: + description: 'The maximum amount of characters in the value' + type: string example: '2' minLength: + description: 'The minimal amount of characters in the value' + type: int example: '2' pattern: + description: 'A [regular expression](https://en.wikipedia.org/wiki/Regular_expression) that the value should comply to' + type: string example: regex maxLength: 255 - additionalItems: [] + additionalItems: + description: 'Not yet supported by business logic' + type: bool maxItems: + description: '*Can only be used in combination with type array* The maximum array length' + type: string example: '2' minItems: + description: '*Can only be used in combination with type array* The minimum allowed value' + type: string example: '2' uniqueItems: + description: '*Can only be used in combination with type array* Define whether or not values in an array should be unique' + type: bool example: 'false' maxProperties: + description: '*Can only be used in combination with type integer* The maximum amount of properties an object should contain' + type: string example: '2' minProperties: + description: '*Can only be used in combination with type object* The minimum amount of properties an object should contain' + type: int example: '2' required: + description: 'Only whether or not this property is required' + type: bool example: 'false' - properties: [] - additionalProperties: [] - object: [] - enum: [] + properties: + description: 'Not yet supported by business logic' + type: '\Property[]|\ArrayCollection' + additionalProperties: + description: 'Not yet supported by business logic' + type: '\Property[]|\ArrayCollection' + object: + description: 'Not yet supported by business logic' + type: object + enum: + description: 'An array of possible values, input is limited to this array]' + type: array description: + description: 'An description of the value asked, supports markdown syntax as described by [CommonMark 0.27.](https://spec.commonmark.org/0.27/)' + type: string example: 'My value' defaultValue: + description: 'An default value for this value that will be used if a user doesn''t supply a value' + type: string example: 'My value' maxLength: 255 nullable: + description: 'Whether or not this property can be left empty' + type: bool example: 'false' discriminator: + description: 'To help API consumers detect the object type, you can add the discriminator/propertyName keyword to model definitions. This keyword points to the property that specifies the data type name' + type: string example: name maxLength: 255 readOnly: + description: 'Whether or not this property is read only' + type: bool example: 'false' writeOnly: + description: 'Whether or not this property is write only' + type: bool example: 'false' xml: + description: 'An XML representation of the swagger docs' + type: string example: '''''' externalDoc: + description: 'An link to any external documentation for the value' + type: string example: 'https://www.w3.org/TR/NOTE-datetime' maxLength: 255 example: + description: 'An example of the value that should be supplied' + type: string example: 'My value' maxLength: 255 deprecated: + description: 'Whether or not this property has been deprecated and wil be removed in the future' + type: bool example: 'false' availableFrom: - example: '2019-09-16T14:26:51+00:00' + description: 'The moment from which this value is available' + type: string + example: '2020-01-13 20:28:20' + format: date-time availableUntil: - example: '2019-09-16T14:26:51+00:00' + description: '*should be used in combination with deprecated* The moment where until this value is available' + type: string + example: '2020-01-13 20:28:20' + format: date-time minDate: + description: 'The minimal date for value, either a date, datetime or duration (ISO_8601)' + type: string example: '2019-09-16T14:26:51+00:00' maxDate: + description: 'The maximum date for value, either a date, datetime or duration (ISO_8601)' + type: string example: '2019-09-16T14:26:51+00:00' icon: + description: 'The icon of this property' + type: string example: 'My Property' maxLength: 255 minLength: 15 slug: + description: 'The slug of this property' + type: string example: my-slug maxLength: 255 minLength: 15 start: + description: 'Whether or not this proerty is the starting oint of a process' + type: string example: 'true' - requestType: [] + requestType: + description: 'The requestType that this property belongs to' + type: object required: [] Property-write: properties: title: + description: 'The title of this property' + type: string example: 'My Property' maxLength: 255 minLength: 15 type: + description: 'The type of this property' + type: string example: string maxLength: 255 format: + description: 'The swagger type of the property as used in api calls' + type: string example: string maxLength: 255 multipleOf: + description: '*Can only be used in combination with type integer* Specifies a number where the value should be a multiple of, e.g. a multiple of 2 would validate 2,4 and 6 but would prevent 5' + type: string example: '2' maximum: + description: '*Can only be used in combination with type integer* The maximum allowed value' + type: string example: '2' exclusiveMaximum: + description: '*Can only be used in combination with type integer* Defines if the maximum is exclusive, e.g. a exclusive maximum of 5 would invalidate 5 but validate 4' + type: string example: 'true' minimum: + description: '*Can only be used in combination with type integer* The minimum allowed value' + type: string example: '2' exclusiveMinimum: + description: '*Can only be used in combination with type integer* Defines if the minimum is exclusive, e.g. a exclusive minimum of 5 would invalidate 5 but validate 6' + type: string example: 'true' maxLength: + description: 'The maximum amount of characters in the value' + type: string example: '2' minLength: + description: 'The minimal amount of characters in the value' + type: int example: '2' pattern: + description: 'A [regular expression](https://en.wikipedia.org/wiki/Regular_expression) that the value should comply to' + type: string example: regex maxLength: 255 - additionalItems: [] + additionalItems: + description: 'Not yet supported by business logic' + type: bool maxItems: + description: '*Can only be used in combination with type array* The maximum array length' + type: string example: '2' minItems: + description: '*Can only be used in combination with type array* The minimum allowed value' + type: string example: '2' uniqueItems: + description: '*Can only be used in combination with type array* Define whether or not values in an array should be unique' + type: bool example: 'false' maxProperties: + description: '*Can only be used in combination with type integer* The maximum amount of properties an object should contain' + type: string example: '2' minProperties: + description: '*Can only be used in combination with type object* The minimum amount of properties an object should contain' + type: int example: '2' required: + description: 'Only whether or not this property is required' + type: bool example: 'false' - properties: [] - additionalProperties: [] - object: [] - enum: [] + properties: + description: 'Not yet supported by business logic' + type: '\Property[]|\ArrayCollection' + additionalProperties: + description: 'Not yet supported by business logic' + type: '\Property[]|\ArrayCollection' + object: + description: 'Not yet supported by business logic' + type: object + enum: + description: 'An array of possible values, input is limited to this array]' + type: array description: + description: 'An description of the value asked, supports markdown syntax as described by [CommonMark 0.27.](https://spec.commonmark.org/0.27/)' + type: string example: 'My value' defaultValue: + description: 'An default value for this value that will be used if a user doesn''t supply a value' + type: string example: 'My value' maxLength: 255 nullable: + description: 'Whether or not this property can be left empty' + type: bool example: 'false' discriminator: + description: 'To help API consumers detect the object type, you can add the discriminator/propertyName keyword to model definitions. This keyword points to the property that specifies the data type name' + type: string example: name maxLength: 255 readOnly: + description: 'Whether or not this property is read only' + type: bool example: 'false' writeOnly: + description: 'Whether or not this property is write only' + type: bool example: 'false' xml: + description: 'An XML representation of the swagger docs' + type: string example: '''''' externalDoc: + description: 'An link to any external documentation for the value' + type: string example: 'https://www.w3.org/TR/NOTE-datetime' maxLength: 255 example: + description: 'An example of the value that should be supplied' + type: string example: 'My value' maxLength: 255 deprecated: + description: 'Whether or not this property has been deprecated and wil be removed in the future' + type: bool example: 'false' availableFrom: - example: '2019-09-16T14:26:51+00:00' + description: 'The moment from which this value is available' + type: string + example: '2020-01-13 20:28:20' + format: date-time availableUntil: - example: '2019-09-16T14:26:51+00:00' + description: '*should be used in combination with deprecated* The moment where until this value is available' + type: string + example: '2020-01-13 20:28:20' + format: date-time minDate: + description: 'The minimal date for value, either a date, datetime or duration (ISO_8601)' + type: string example: '2019-09-16T14:26:51+00:00' maxDate: + description: 'The maximum date for value, either a date, datetime or duration (ISO_8601)' + type: string example: '2019-09-16T14:26:51+00:00' icon: + description: 'The icon of this property' + type: string example: 'My Property' maxLength: 255 minLength: 15 slug: + description: 'The slug of this property' + type: string example: my-slug maxLength: 255 minLength: 15 start: + description: 'Whether or not this proerty is the starting oint of a process' + type: string example: 'true' - requestType: [] + requestType: + description: 'The requestType that this property belongs to' + type: object required: [] RequestType-read: properties: id: + description: 'The UUID identifier of this object' + type: string example: e2984465-190a-4562-829e-a8cca81aa35d format: uuid sourceOrganization: + description: 'The RSIN of the organization that owns this process' + type: string example: '002851234' maxLength: 11 minLength: 8 name: + description: 'The name of this RequestType' + type: string example: 'My RequestType' maxLength: 255 description: + description: 'An short description of this RequestType' + type: string example: 'This is the best request ever' maxLength: 2550 - properties: [] + properties: + description: 'The properties for this request type' + type: '\Property[]|\ArrayCollection' required: - sourceOrganization - name RequestType-write: properties: sourceOrganization: + description: 'The RSIN of the organization that owns this process' + type: string example: '002851234' maxLength: 11 minLength: 8 - properties: [] + properties: + description: 'The properties for this request type' + type: '\Property[]|\ArrayCollection' required: - sourceOrganization - name RequestType-write-requesttype: properties: - extends: [] + extends: + description: 'The requestType that this requestType extends' + type: object required: - sourceOrganization - name @@ -2046,7 +2232,7 @@ tags: - name: RequestType description: | - + All properties contained in the RequestType type securityDefinitions: diff --git a/api/public/schema/publiccode.yaml b/api/public/schema/publiccode.yaml index 22556a84..f60afa33 100644 --- a/api/public/schema/publiccode.yaml +++ b/api/public/schema/publiccode.yaml @@ -6,7 +6,7 @@ url: "https://github.com/ConductionNL/verzoektypecatalogus" landingURL: "vtc.zaakonline.nl" isBasedOn: "https://github.com/ConductionNL/Proto-component-commonground.git" softwareVersion: "V.0.1" -releaseDate: "2020-09-01" +releaseDate: "2020-13-01" logo: pc.zaakonline.nl monochromeLogo: img/logo-mono.svg diff --git a/api/src/Command/ApiHelmCommand.php b/api/src/Command/ApiHelmCommand.php index 0caa16f6..72c6793c 100644 --- a/api/src/Command/ApiHelmCommand.php +++ b/api/src/Command/ApiHelmCommand.php @@ -65,9 +65,9 @@ protected function execute(InputInterface $input, OutputInterface $output) } else { // outputs multiple lines to the console (adding "\n" at the end of each line) $output->writeln([ - 'Helm Chart Creator', - '============', - $chart, + 'Helm Chart Creator', + '============', + $chart, ]); } } diff --git a/api/src/Command/PubliccodeCommand.php b/api/src/Command/PubliccodeCommand.php index 75c24371..1ff5e1fe 100644 --- a/api/src/Command/PubliccodeCommand.php +++ b/api/src/Command/PubliccodeCommand.php @@ -57,14 +57,14 @@ protected function execute(InputInterface $input, OutputInterface $output) $publiccode = $this->twig->render('publiccode/publiccode.yaml.twig'); if (!empty($location = $input->getOption('location')) && \is_string($location)) { - file_put_contents($location.'/publiccode.yaml', $publiccode); + file_put_contents($location.'/publiccode.yaml', $publiccode); $io->success(sprintf('Data written to %s/publiccode.yaml (specification version %s).', $location, $version)); } else { // outputs multiple lines to the console (adding "\n" at the end of each line) $output->writeln([ - 'Publiccode Chart', - '============', - $chart, + 'Publiccode Chart', + '============', + $chart, ]); } } diff --git a/api/src/DataFixtures/AppFixtures.php b/api/src/DataFixtures/AppFixtures.php index fa28ec02..afa0ec07 100644 --- a/api/src/DataFixtures/AppFixtures.php +++ b/api/src/DataFixtures/AppFixtures.php @@ -2,119 +2,115 @@ namespace App\DataFixtures; +use App\Entity\Property; +use App\Entity\RequestType; use Doctrine\Bundle\FixturesBundle\Fixture; use Doctrine\Common\Persistence\ObjectManager; - use Ramsey\Uuid\Uuid; -use App\Entity\RequestType; -use App\Entity\Property; - class AppFixtures extends Fixture { public function load(ObjectManager $manager) { - /* - * Verhuizen + /* + * Verhuizen */ - $id = Uuid::fromString('2bfb3cea-b5b5-459c-b3e0-e1100089a11a'); - - $verhuizenNL = new RequestType(); - $verhuizenNL->setId($id); - $verhuizenNL->setSourceOrganization('0000'); - $verhuizenNL->setName('Verhuizen'); - $verhuizenNL->setDescription('Het doorgeven van een verhuizing aan een gemeente'); - $manager->persist($verhuizenNL); - - $property= new Property(); - //$property->setId(''); - $property->setTitle('Datum'); - $property->setType('string'); - $property->setFormat('date'); - $property->setDescription('Wat is de verhuisdatum?'); - $property->setRequestType($verhuizenNL); - $manager->persist($property); - - $property= new Property(); - //$property->setId(''); - $property->setTitle('Adress'); - $property->setType('string'); - $property->setFormat('bag'); - $property->setRequired(true); - $property->setDescription('Wat is het nieuwe adres?'); - $property->setRequestType($verhuizenNL); - $manager->persist($property); - - $property= new Property(); - //$property->setId(''); - $property->setTitle('Wie'); - $property->setType('array'); - $property->setFormat('bsn'); - $property->setRequired(true); - $property->setDescription('Wie gaan er verhuizen?'); - $property->setRequestType($verhuizenNL); - $manager->persist($property); - - $id = Uuid::fromString('9d76fb58-0711-4437-acc4-9f4d9d403cdf'); - $verhuizenDenBosh = new RequestType(); - $verhuizenDenBosh->setName('Verhuizen'); - $verhuizenDenBosh->setDescription('Het doorgeven van een verhuizing aan de gemeente \'s-Hertogenbosch'); - $verhuizenDenBosh->setSourceOrganization('001709124'); - $verhuizenDenBosh->setExtends($verhuizenNL); - $manager->persist($verhuizenDenBosh); - $verhuizenDenBosh->setId($id); - $manager->persist($verhuizenDenBosh); - - - $property = new Property(); - //$verhuizenNL->setId(''); - $property->setTitle('Email'); - $property->setDescription('Het e-mail addres dat wordt gebruikt om contact op te nemen (indien nodig) over deze verhuizing'); - $property->setType('string'); - $property->setFormat('email'); - $property->setRequired(true); - $property->setRequestType($verhuizenNL); - $manager->persist($property); - - - $property = new Property(); - //$verhuizenNL->setId(''); - $property->setTitle('Telefoon'); - $property->setDescription('Het telefoon nummer dat wordt gebruikt om contact op te nemen (indien nodig) over deze verhuizing'); - $property->setType('string'); - $property->setFormat('string'); - $property->setRequired(true); - $property->setRequestType($verhuizenNL); - $manager->persist($property); - - $verhuizenEindhoven = new RequestType(); - //$verhuizenEindhoven->setId('fc79c4c9-b3b3-4258-bdbb-449262f3e5d7'); - $verhuizenEindhoven->setName('Verhuizen'); - $verhuizenEindhoven->setDescription('Het doorgeven van een verhuizing aan de gemeente Eindhoven'); - $verhuizenEindhoven->setSourceOrganization('001902763'); - $verhuizenEindhoven->setExtends($verhuizenNL); - $manager->persist($verhuizenEindhoven); - - $property = new Property(); - //$verhuizenNL->setId(''); - $property->setTitle('Eigenaar'); - $property->setDescription('Bent u de eigenaar van de woning waar u heen verhuist?'); - $property->setType('boolean'); - $property->setFormat('boolean'); - $property->setRequired(true); - $property->setRequestType($verhuizenNL); - $manager->persist($property); - - $property = new Property(); - //$verhuizenNL->setId(''); - $property->setTitle('Doorgeven gegevens'); - $property->setDescription('Wilt u dat we uw verhuizing ook doorgeven aan postNl?'); - $property->setType('boolean'); - $property->setFormat('boolean'); - $property->setRequestType($verhuizenNL); - $manager->persist($property); - - /* + $id = Uuid::fromString('2bfb3cea-b5b5-459c-b3e0-e1100089a11a'); + + $verhuizenNL = new RequestType(); + $verhuizenNL->setId($id); + $verhuizenNL->setSourceOrganization('0000'); + $verhuizenNL->setName('Verhuizen'); + $verhuizenNL->setDescription('Het doorgeven van een verhuizing aan een gemeente'); + $manager->persist($verhuizenNL); + + $property = new Property(); + //$property->setId(''); + $property->setTitle('Datum'); + $property->setType('string'); + $property->setFormat('date'); + $property->setDescription('Wat is de verhuisdatum?'); + $property->setRequestType($verhuizenNL); + $manager->persist($property); + + $property = new Property(); + //$property->setId(''); + $property->setTitle('Adress'); + $property->setType('string'); + $property->setFormat('bag'); + $property->setRequired(true); + $property->setDescription('Wat is het nieuwe adres?'); + $property->setRequestType($verhuizenNL); + $manager->persist($property); + + $property = new Property(); + //$property->setId(''); + $property->setTitle('Wie'); + $property->setType('array'); + $property->setFormat('bsn'); + $property->setRequired(true); + $property->setDescription('Wie gaan er verhuizen?'); + $property->setRequestType($verhuizenNL); + $manager->persist($property); + + $id = Uuid::fromString('9d76fb58-0711-4437-acc4-9f4d9d403cdf'); + $verhuizenDenBosh = new RequestType(); + $verhuizenDenBosh->setName('Verhuizen'); + $verhuizenDenBosh->setDescription('Het doorgeven van een verhuizing aan de gemeente \'s-Hertogenbosch'); + $verhuizenDenBosh->setSourceOrganization('001709124'); + $verhuizenDenBosh->setExtends($verhuizenNL); + $manager->persist($verhuizenDenBosh); + $verhuizenDenBosh->setId($id); + $manager->persist($verhuizenDenBosh); + + $property = new Property(); + //$verhuizenNL->setId(''); + $property->setTitle('Email'); + $property->setDescription('Het e-mail addres dat wordt gebruikt om contact op te nemen (indien nodig) over deze verhuizing'); + $property->setType('string'); + $property->setFormat('email'); + $property->setRequired(true); + $property->setRequestType($verhuizenNL); + $manager->persist($property); + + $property = new Property(); + //$verhuizenNL->setId(''); + $property->setTitle('Telefoon'); + $property->setDescription('Het telefoon nummer dat wordt gebruikt om contact op te nemen (indien nodig) over deze verhuizing'); + $property->setType('string'); + $property->setFormat('string'); + $property->setRequired(true); + $property->setRequestType($verhuizenNL); + $manager->persist($property); + + $verhuizenEindhoven = new RequestType(); + //$verhuizenEindhoven->setId('fc79c4c9-b3b3-4258-bdbb-449262f3e5d7'); + $verhuizenEindhoven->setName('Verhuizen'); + $verhuizenEindhoven->setDescription('Het doorgeven van een verhuizing aan de gemeente Eindhoven'); + $verhuizenEindhoven->setSourceOrganization('001902763'); + $verhuizenEindhoven->setExtends($verhuizenNL); + $manager->persist($verhuizenEindhoven); + + $property = new Property(); + //$verhuizenNL->setId(''); + $property->setTitle('Eigenaar'); + $property->setDescription('Bent u de eigenaar van de woning waar u heen verhuist?'); + $property->setType('boolean'); + $property->setFormat('boolean'); + $property->setRequired(true); + $property->setRequestType($verhuizenNL); + $manager->persist($property); + + $property = new Property(); + //$verhuizenNL->setId(''); + $property->setTitle('Doorgeven gegevens'); + $property->setDescription('Wilt u dat we uw verhuizing ook doorgeven aan postNl?'); + $property->setType('boolean'); + $property->setFormat('boolean'); + $property->setRequestType($verhuizenNL); + $manager->persist($property); + + /* * Trouwen */ $meldingTrouwenNL= new RequestType(); diff --git a/api/src/Entity/Property.php b/api/src/Entity/Property.php index 71f8fcc5..bf75ff87 100644 --- a/api/src/Entity/Property.php +++ b/api/src/Entity/Property.php @@ -2,27 +2,20 @@ namespace App\Entity; -use ApiPlatform\Core\Annotation\ApiProperty; use ApiPlatform\Core\Annotation\ApiResource; -use ApiPlatform\Core\Annotation\ApiFilter; -use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; -use Gedmo\Mapping\Annotation as Gedmo; use Doctrine\ORM\Mapping as ORM; use Ramsey\Uuid\UuidInterface; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Serializer\Annotation\MaxDepth; - - -use App\Entity\RequestType; +use Symfony\Component\Validator\Constraints as Assert; /** * This property follows the following schemes (in order of importance) * https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md * https://tools.ietf.org/html/draft-wright-json-schema-validation-00 - * http://json-schema.org/ + * http://json-schema.org/. * * @ApiResource( * normalizationContext={"groups"={"read"}, "enable_max_depth"=true}, @@ -32,22 +25,23 @@ */ class Property { - /** - * @var UuidInterface $id The UUID identifier of this object - * @example e2984465-190a-4562-829e-a8cca81aa35d - * + /** + * @var UuidInterface The UUID identifier of this object + * + * @example e2984465-190a-4562-829e-a8cca81aa35d + * * @Groups({"read"}) - * @Assert\Uuid - * @ORM\Id - * @ORM\Column(type="uuid", unique=true) - * @ORM\GeneratedValue(strategy="CUSTOM") - * @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator") - */ - private $id; + * @Assert\Uuid + * @ORM\Id + * @ORM\Column(type="uuid", unique=true) + * @ORM\GeneratedValue(strategy="CUSTOM") + * @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator") + */ + private $id; /** - * @var Object $requestType The requestType that this property belongs to - * + * @var object The requestType that this property belongs to + * * @Assert\NotBlank * @Assert\Valid * @MaxDepth(1) @@ -58,7 +52,8 @@ class Property private $requestType; /** - * @var string The title of this property + * @var string The title of this property + * * @example My Property * @Assert\NotBlank * @Assert\Length(min = 15, max = 255) @@ -67,9 +62,9 @@ class Property */ private $title; - - /** - * @var string $name The name of the property as used in api calls, extracted from title on snake_case basis + /** + * @var string The name of the property as used in api calls, extracted from title on snake_case basis + * * @example my_property * @Assert\Length(min = 15, max = 255) * @Groups({"read"}) @@ -77,7 +72,8 @@ class Property private $name; /** - * @var string $type The type of this property + * @var string The type of this property + * * @example string * * @Assert\NotBlank @@ -89,9 +85,10 @@ class Property private $type; /** - * @var string $type The swagger type of the property as used in api calls + * @var string The swagger type of the property as used in api calls + * * @example string - * + * * @Assert\NotBlank * @Assert\Length(max = 255) * @Assert\Choice({"int32","int64","float","double","byte","binary","date","date-time","duration","password","boolean","string","uuid","uri","email","rsin","bag","bsn","iban","challenge","service","assent"}) @@ -101,9 +98,10 @@ class Property private $format; /** - * @var string $multipleOf *Can only be used in combination with type integer* Specifies a number where the value should be a multiple of, e.g. a multiple of 2 would validate 2,4 and 6 but would prevent 5 + * @var string *Can only be used in combination with type integer* Specifies a number where the value should be a multiple of, e.g. a multiple of 2 would validate 2,4 and 6 but would prevent 5 + * * @example 2 - * + * * * @Assert\Type("integer") * @Groups({"read", "write"}) @@ -112,9 +110,10 @@ class Property private $multipleOf; /** - * @var string $multipleOf *Can only be used in combination with type integer* The maximum allowed value - * @example 2 - * + * @var string *Can only be used in combination with type integer* The maximum allowed value + * + * @example 2 + * * * @Assert\Type("integer") * @Groups({"read", "write"}) @@ -123,7 +122,8 @@ class Property private $maximum; /** - * @var string $exclusiveMaximum *Can only be used in combination with type integer* Defines if the maximum is exclusive, e.g. a exclusive maximum of 5 would invalidate 5 but validate 4 + * @var string *Can only be used in combination with type integer* Defines if the maximum is exclusive, e.g. a exclusive maximum of 5 would invalidate 5 but validate 4 + * * @example true * * @Assert\Type("bool") @@ -133,7 +133,8 @@ class Property private $exclusiveMaximum; /** - * @var string $minimum *Can only be used in combination with type integer* The minimum allowed value + * @var string *Can only be used in combination with type integer* The minimum allowed value + * * @example 2 * * @Assert\Type("integer") @@ -143,9 +144,10 @@ class Property private $minimum; /** - * @var string $exclusiveMinimum *Can only be used in combination with type integer* Defines if the minimum is exclusive, e.g. a exclusive minimum of 5 would invalidate 5 but validate 6 + * @var string *Can only be used in combination with type integer* Defines if the minimum is exclusive, e.g. a exclusive minimum of 5 would invalidate 5 but validate 6 + * * @example true - * + * * * @Assert\Type("bool") * @Groups({"read", "write"}) @@ -154,9 +156,10 @@ class Property private $exclusiveMinimum; /** - * @var string $maxLength The maximum amount of characters in the value + * @var string The maximum amount of characters in the value + * * @example 2 - * + * * * @Assert\Type("integer") * @Groups({"read", "write"}) @@ -165,7 +168,8 @@ class Property private $maxLength; /** - * @var int $minLength The minimal amount of characters in the value + * @var int The minimal amount of characters in the value + * * @example 2 * * @Assert\Type("integer") @@ -175,9 +179,10 @@ class Property private $minLength; /** - * @var string $pattern A [regular expression](https://en.wikipedia.org/wiki/Regular_expression) that the value should comply to + * @var string A [regular expression](https://en.wikipedia.org/wiki/Regular_expression) that the value should comply to + * * @example regex - * + * * * @Assert\Length(max = 255) * @Groups({"read", "write"}) @@ -186,14 +191,14 @@ class Property private $pattern; /** - * Not yet supported by business logic + * Not yet supported by business logic. * * @ORM\ManyToMany(targetEntity="App\Entity\Property") */ private $items; /** - * Not yet supported by business logic + * @var bool Not yet supported by business logic * * @Assert\Type("bool") * @Groups({"read", "write"}) @@ -202,9 +207,10 @@ class Property private $additionalItems; /** - * @var string $maxItems *Can only be used in combination with type array* The maximum array length + * @var string *Can only be used in combination with type array* The maximum array length + * * @example 2 - * + * * * @Assert\Type("integer") * @Groups({"read", "write"}) @@ -213,9 +219,10 @@ class Property private $maxItems; /** - * @var string $minItems *Can only be used in combination with type array* The minimum allowed value + * @var string *Can only be used in combination with type array* The minimum allowed value + * * @example 2 - * + * * * @Assert\Type("integer") * @Groups({"read", "write"}) @@ -224,7 +231,8 @@ class Property private $minItems; /** - * @var boolean *Can only be used in combination with type array* Define whether or not values in an array should be unique + * @var bool *Can only be used in combination with type array* Define whether or not values in an array should be unique + * * @example false * * @Assert\Type("bool") @@ -234,9 +242,10 @@ class Property private $uniqueItems; /** - * @var string $maxProperties *Can only be used in combination with type integer* The maximum amount of properties an object should contain + * @var string *Can only be used in combination with type integer* The maximum amount of properties an object should contain + * * @example 2 - * + * * * @Assert\Type("integer") * @Groups({"read", "write"}) @@ -245,7 +254,8 @@ class Property private $maxProperties; /** - * @var int $minProperties *Can only be used in combination with type object* The minimum amount of properties an object should contain + * @var int *Can only be used in combination with type object* The minimum amount of properties an object should contain + * * @example 2 * * @Assert\Type("integer") @@ -255,7 +265,8 @@ class Property private $minProperties; /** - * @var boolean $required Only whether or not this property is required + * @var bool Only whether or not this property is required + * * @example false * * @Assert\Type("bool") @@ -265,7 +276,7 @@ class Property private $required; /** - * Not yet supported by business logic + * @var Property[]|ArrayCollection Not yet supported by business logic * * @Groups({"read", "write"}) * @ORM\Column(type="object", nullable=true) @@ -273,7 +284,7 @@ class Property private $properties; /** - * Not yet supported by business logic + * @var Property[]|ArrayCollection Not yet supported by business logic * * @Groups({"read", "write"}) * @ORM\Column(type="object", nullable=true) @@ -281,7 +292,7 @@ class Property private $additionalProperties; /** - * Not yet supported by business logic + * @var object Not yet supported by business logic * * @Groups({"read", "write"}) * @ORM\Column(type="object", nullable=true) @@ -289,8 +300,8 @@ class Property private $object; /** - * @var array $enum An array of possible values, input is limited to this array] - * + * @var array An array of possible values, input is limited to this array] + * * * @Groups({"read", "write"}) * @ORM\Column(type="array", nullable=true) @@ -298,38 +309,39 @@ class Property private $enum = []; /** - * @var array $allOf *mutually exclusive with using type* An array of possible types that an property should confirm to] - * + * @var array *mutually exclusive with using type* An array of possible types that an property should confirm to] + * * * @ORM\Column(type="array", nullable=true) */ private $allOf = []; /** - * @var array $anyOf *mutually exclusive with using type* An array of possible types that an property might confirm to] - * + * @var array *mutually exclusive with using type* An array of possible types that an property might confirm to] + * * * @ORM\Column(type="array", nullable=true) */ private $anyOf = []; /** - * @var array $oneOf *mutually exclusive with using type* An array of possible types that an property must confirm to] - * + * @var array *mutually exclusive with using type* An array of possible types that an property must confirm to] + * * * @ORM\Column(type="array", nullable=true) */ private $oneOf = []; /** - * Not yet supported by business logic + * Not yet supported by business logic. * * @ORM\Column(type="object", nullable=true) */ private $definitions; /** - * @var string An description of the value asked, supports markdown syntax as described by [CommonMark 0.27.](https://spec.commonmark.org/0.27/) + * @var string An description of the value asked, supports markdown syntax as described by [CommonMark 0.27.](https://spec.commonmark.org/0.27/) + * * @example My value * * @Groups({"read", "write"}) @@ -338,7 +350,8 @@ class Property private $description; /** - * @var string An default value for this value that will be used if a user doesn't supply a value + * @var string An default value for this value that will be used if a user doesn't supply a value + * * @example My value * * @Assert\Length(max = 255) @@ -347,9 +360,9 @@ class Property */ private $defaultValue; - /** - * @var boolean Whether or not this property can be left empty + * @var bool Whether or not this property can be left empty + * * @example false * * @Assert\Type("bool") @@ -359,7 +372,8 @@ class Property private $nullable; /** - * @var string To help API consumers detect the object type, you can add the discriminator/propertyName keyword to model definitions. This keyword points to the property that specifies the data type name + * @var string To help API consumers detect the object type, you can add the discriminator/propertyName keyword to model definitions. This keyword points to the property that specifies the data type name + * * @example name * * @Assert\Length(max = 255) @@ -369,7 +383,8 @@ class Property private $discriminator; /** - * @var boolean Whether or not this property is read only + * @var bool Whether or not this property is read only + * * @example false * * @Assert\Type("bool") @@ -379,7 +394,8 @@ class Property private $readOnly; /** - * @var boolean Whether or not this property is write only + * @var bool Whether or not this property is write only + * * @example false * * @Assert\Type("bool") @@ -389,7 +405,8 @@ class Property private $writeOnly; /** - * @var string An XML representation of the swagger docs + * @var string An XML representation of the swagger docs + * * @example '' * * @Groups({"read", "write"}) @@ -398,7 +415,8 @@ class Property private $xml; /** - * @var string An link to any external documentation for the value + * @var string An link to any external documentation for the value + * * @example https://www.w3.org/TR/NOTE-datetime * * @Assert\Length(max = 255) @@ -408,9 +426,10 @@ class Property private $externalDoc; /** - * @var string An example of the value that should be supplied + * @var string An example of the value that should be supplied + * * @example My value - * + * * @Assert\Length(max = 255) * @Groups({"read", "write"}) * @ORM\Column(type="string", length=255, nullable=true) @@ -418,7 +437,8 @@ class Property private $example; /** - * @var boolean Whether or not this property has been deprecated and wil be removed in the future + * @var bool Whether or not this property has been deprecated and wil be removed in the future + * * @example false * * @Assert\Type("bool") @@ -428,7 +448,8 @@ class Property private $deprecated; /** - * @var string The moment from which this value is available + * @var string The moment from which this value is available + * * @example 2019-09-16T14:26:51+00:00 * * @Groups({"read", "write"}) @@ -438,7 +459,8 @@ class Property private $availableFrom; /** - * @var string *should be used in combination with deprecated* The moment where until this value is available + * @var string *should be used in combination with deprecated* The moment where until this value is available + * * @example 2019-09-16T14:26:51+00:00 * * @Groups({"read", "write"}) @@ -448,7 +470,8 @@ class Property private $availableUntil; /** - * @var string The minimal date for value, either a date, datetime or duration (ISO_8601) + * @var string The minimal date for value, either a date, datetime or duration (ISO_8601) + * * @example 2019-09-16T14:26:51+00:00 * * @Groups({"read", "write"}) @@ -457,7 +480,8 @@ class Property private $minDate; /** - * @var string The maximum date for value, either a date, datetime or duration (ISO_8601) + * @var string The maximum date for value, either a date, datetime or duration (ISO_8601) + * * @example 2019-09-16T14:26:51+00:00 * * @Groups({"read", "write"}) @@ -465,7 +489,6 @@ class Property */ private $maxDate; - /** * @ORM\ManyToOne(targetEntity="App\Entity\Property", inversedBy="previous") */ @@ -477,9 +500,10 @@ class Property private $previous; /** - * @var string The icon of this property + * @var string The icon of this property + * * @example My Property - * + * * @Assert\Length(min = 15, max = 255) * @Groups({"read", "write"}) * @ORM\Column(type="string", length=255, nullable=true) @@ -487,9 +511,10 @@ class Property private $icon; /** - * @var string The slug of this property + * @var string The slug of this property + * * @example my-slug - * + * * @Assert\Length(min = 15, max = 255) * @Groups({"read", "write"}) * @ORM\Column(type="string", length=255, nullable=true) @@ -497,9 +522,10 @@ class Property private $slug; /** - * @var string Whether or not this proerty is the starting oint of a process + * @var string Whether or not this proerty is the starting oint of a process + * * @example true - * + * * @Groups({"read", "write"}) * @ORM\Column(type="boolean", nullable=true) */ @@ -518,26 +544,26 @@ public function getId() public function setId(string $id): self { - $this->id = $id; + $this->id = $id; - return $this; + return $this; } public function getRequestType(): ?RequestType { - return $this->requestType; + return $this->requestType; } public function setRequestType(?RequestType $requestType): self { - $this->requestType = $requestType; + $this->requestType = $requestType; return $this; } public function getTitle(): ?string { - return $this->title; + return $this->title; } public function setTitle(string $title): self @@ -549,13 +575,13 @@ public function setTitle(string $title): self public function getName(): ?string { - // titles wil be used as strings so lets convert the to camelcase - $string = $this->title; - $string = trim($string); //removes whitespace at begin and ending - $string = preg_replace('/\s+/', '_', $string); // replaces other whitespaces with _ - $string = strtolower($string); + // titles wil be used as strings so lets convert the to camelcase + $string = $this->title; + $string = trim($string); //removes whitespace at begin and ending + $string = preg_replace('/\s+/', '_', $string); // replaces other whitespaces with _ + $string = strtolower($string); - return $string; + return $string; } public function getMultipleOf(): ?int diff --git a/api/src/Entity/RequestType.php b/api/src/Entity/RequestType.php index 176e2d48..3056ca18 100644 --- a/api/src/Entity/RequestType.php +++ b/api/src/Entity/RequestType.php @@ -2,22 +2,22 @@ namespace App\Entity; -use ApiPlatform\Core\Annotation\ApiSubresource; -use ApiPlatform\Core\Annotation\ApiProperty; -use ApiPlatform\Core\Annotation\ApiResource; use ApiPlatform\Core\Annotation\ApiFilter; +use ApiPlatform\Core\Annotation\ApiResource; use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\Common\Collections\Criteria; use Doctrine\ORM\Mapping as ORM; -use Gedmo\Mapping\Annotation as Gedmo; +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\UuidInterface; use Symfony\Component\Serializer\Annotation\Groups; -use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Serializer\Annotation\MaxDepth; -use Ramsey\Uuid\Uuid; +use Symfony\Component\Validator\Constraints as Assert; /** + * All properties contained in the RequestType type. + * * @ApiResource( * normalizationContext={"groups"={"read"}, "enable_max_depth"=true}, * denormalizationContext={"groups"={"write"}, "enable_max_depth"=true}, @@ -47,21 +47,23 @@ */ class RequestType { - /** - * @var \Ramsey\Uuid\UuidInterface $id The UUID identifier of this object - * @example e2984465-190a-4562-829e-a8cca81aa35d - * - * @Groups({"read"}) - * @Assert\Uuid - * @ORM\Id - * @ORM\Column(type="uuid", unique=true) - * @ORM\GeneratedValue(strategy="CUSTOM") - * @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator") - */ - private $id; + /** + * @var UuidInterface The UUID identifier of this object + * + * @example e2984465-190a-4562-829e-a8cca81aa35d + * + * @Groups({"read"}) + * @Assert\Uuid + * @ORM\Id + * @ORM\Column(type="uuid", unique=true) + * @ORM\GeneratedValue(strategy="CUSTOM") + * @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator") + */ + private $id; /** - * @var string $sourceOrganization The RSIN of the organization that owns this process + * @var string The RSIN of the organization that owns this process + * * @example 002851234 * @Assert\NotNull * @Assert\Length( @@ -75,29 +77,32 @@ class RequestType private $sourceOrganization; /** - * @var string $name The name of this RequestType + * @var string The name of this RequestType + * * @example My RequestType * @Assert\NotNull * @Assert\Length( * max = 255 * ) - * @Groups({"read"}) + * @Groups({"read"}) * @ORM\Column(type="string", length=255) */ private $name; /** - * @var string $description An short description of this RequestType + * @var string An short description of this RequestType + * * @example This is the best request ever * @Assert\Length( * max = 2550 * ) - * @Groups({"read"}) + * @Groups({"read"}) * @ORM\Column(type="text", nullable=true) */ private $description; /** + * @var Property[]|ArrayCollection The properties for this request type * @Groups({"read", "write"}) * @MaxDepth(1) * @ORM\OneToMany(targetEntity="App\Entity\Property", mappedBy="requestType", orphanRemoval=true, fetch="EAGER", cascade={"persist"}) @@ -105,7 +110,6 @@ class RequestType */ private $properties; - /** * @Groups({"read"}) * @MaxDepth(1) @@ -113,7 +117,7 @@ class RequestType private $stages; /** - * @var object $extends The requestType that this requestType extends + * @var object The requestType that this requestType extends * * @Groups({"write-requesttype"}) * @ORM\ManyToOne(targetEntity="App\Entity\RequestType", inversedBy="extendedBy", fetch="EAGER") @@ -121,8 +125,8 @@ class RequestType private $extends; /** - * @var object $extendedBy The requestTypes that extend this requestType - * + * @var object The requestTypes that extend this requestType + * * @ORM\OneToMany(targetEntity="App\Entity\RequestType", mappedBy="extends") */ private $extendedBy; @@ -137,33 +141,32 @@ class RequestType */ private $availableUntil; - public function __construct() { - $this->properties= new ArrayCollection(); - $this->extendedBy = new ArrayCollection(); + $this->properties = new ArrayCollection(); + $this->extendedBy = new ArrayCollection(); } public function getId(): Uuid { return $this->id; } - + public function setId(Uuid $id): self { - $this->id = $id; + $this->id = $id; - return $this; + return $this; } public function getSourceOrganization(): ?string { - return $this->sourceOrganization; + return $this->sourceOrganization; } public function setSourceOrganization(string $sourceOrganization): self { - $this->sourceOrganization = $sourceOrganization; + $this->sourceOrganization = $sourceOrganization; return $this; } @@ -173,7 +176,6 @@ public function getName(): ?string return $this->name; } - public function setName(string $name): self { $this->name = $name; @@ -198,14 +200,14 @@ public function setDescription(string $description): self */ public function getProperties(): Collection { - return $this->properties; + return $this->properties; } public function addProperty(Property $property): self { - if (!$this->properties->contains($property)) { - $this->properties[] = $property; - $property->setRequestType($this); + if (!$this->properties->contains($property)) { + $this->properties[] = $property; + $property->setRequestType($this); } return $this; @@ -216,20 +218,20 @@ public function addProperty(Property $property): self */ public function extendProperty(Property $property): self { - if (!$this->properties->contains($property)) { - $this->properties[] = $property; - } + if (!$this->properties->contains($property)) { + $this->properties[] = $property; + } - return $this; + return $this; } public function removeProperty(Property $property): self { - if ($this->properties->contains($property)) { - $this->properties->removeElement($property); + if ($this->properties->contains($property)) { + $this->properties->removeElement($property); // set the owning side to null (unless already changed) - if ($property->getRequestType() === $this) { - $property->setRequestType(null); + if ($property->getRequestType() === $this) { + $property->setRequestType(null); } } @@ -302,43 +304,41 @@ public function setAvailableUntil(?\DateTimeInterface $availableUntil): self return $this; } - - + public function getStages() { - $stages = []; - $stage = $this->getFirstStage(); - while ($stage){ - - $array = [ - "id"=>$stage->getId(), - "name"=>$stage->getName(), - "description"=>$stage->getDescription(), - "icon"=>$stage->getIcon(), - "slug"=>$stage->getSlug() - ]; - - if($stage->getNext()){ - $array["next"] = $stage->getNext()->getSlug(); - } - - if($stage->getPrevious()->first()){ - $array["previous"] = $stage->getPrevious()->first()->getSlug(); - } - - $stages[] = $array; - - $stage = $stage->getNext(); - } - - return $stages; + $stages = []; + $stage = $this->getFirstStage(); + while ($stage) { + $array = [ + 'id' => $stage->getId(), + 'name' => $stage->getName(), + 'description'=> $stage->getDescription(), + 'icon' => $stage->getIcon(), + 'slug' => $stage->getSlug(), + ]; + + if ($stage->getNext()) { + $array['next'] = $stage->getNext()->getSlug(); + } + + if ($stage->getPrevious()->first()) { + $array['previous'] = $stage->getPrevious()->first()->getSlug(); + } + + $stages[] = $array; + + $stage = $stage->getNext(); + } + + return $stages; } - + public function getFirstStage() { - $criteria = Criteria::create() - ->andWhere(Criteria::expr()->eq('start', true)); - - return $this->getProperties()->matching($criteria)->first(); + $criteria = Criteria::create() + ->andWhere(Criteria::expr()->eq('start', true)); + + return $this->getProperties()->matching($criteria)->first(); } } diff --git a/api/src/Filter/LikeFilter.php b/api/src/Filter/LikeFilter.php index 029c73e9..0bff7b42 100644 --- a/api/src/Filter/LikeFilter.php +++ b/api/src/Filter/LikeFilter.php @@ -36,14 +36,14 @@ public function getDescription(string $resourceClass): array $description = []; foreach ($this->properties as $property => $strategy) { $description["like_$property"] = [ - 'property' => $property, - 'type' => 'string', - 'required' => false, - 'swagger' => [ - 'description' => 'This filter narows your result using the * and _ wildcards, where * is assumed to be one or more characters and _ is assumed to be a single character', - 'name' => $property, - 'type' => 'string', - ], + 'property' => $property, + 'type' => 'string', + 'required' => false, + 'swagger' => [ + 'description' => 'This filter narows your result using the * and _ wildcards, where * is assumed to be one or more characters and _ is assumed to be a single character', + 'name' => $property, + 'type' => 'string', + ], ]; } diff --git a/api/src/Filter/RegexpFilter.php b/api/src/Filter/RegexpFilter.php index da1f747e..257b8f7b 100644 --- a/api/src/Filter/RegexpFilter.php +++ b/api/src/Filter/RegexpFilter.php @@ -36,14 +36,14 @@ public function getDescription(string $resourceClass): array $description = []; foreach ($this->properties as $property => $strategy) { $description["regexp_$property"] = [ - 'property' => $property, - 'type' => 'string', - 'required' => false, - 'swagger' => [ - 'description' => 'Filter for an exact match using a [Regular expression](https://en.wikipedia.org/wiki/Regular_expression).', - 'name' => $property, - 'type' => 'string', - ], + 'property' => $property, + 'type' => 'string', + 'required' => false, + 'swagger' => [ + 'description' => 'Filter for an exact match using a [Regular expression](https://en.wikipedia.org/wiki/Regular_expression).', + 'name' => $property, + 'type' => 'string', + ], ]; } diff --git a/api/src/Repository/NLXRequestLogRepository.php b/api/src/Repository/NLXRequestLogRepository.php index 69add53c..33986f87 100644 --- a/api/src/Repository/NLXRequestLogRepository.php +++ b/api/src/Repository/NLXRequestLogRepository.php @@ -6,7 +6,6 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Common\Persistence\ManagerRegistry; - /** * @method NLXRequestLog|null find($id, $lockMode = null, $lockVersion = null) * @method NLXRequestLog|null findOneBy(array $criteria, array $orderBy = null) @@ -15,10 +14,10 @@ */ class NLXRequestLogRepository extends ServiceEntityRepository { - public function __construct(ManagerRegistry $registry) - { - parent::__construct($registry, ExampleEntity::class); - } + public function __construct(ManagerRegistry $registry) + { + parent::__construct($registry, ExampleEntity::class); + } /** * @return NLXRequestLog[] Returns an array of NLXRequestLog objects diff --git a/api/src/Repository/PropertyRepository.php b/api/src/Repository/PropertyRepository.php index d1d281fa..4d0139f1 100644 --- a/api/src/Repository/PropertyRepository.php +++ b/api/src/Repository/PropertyRepository.php @@ -16,7 +16,7 @@ class PropertyRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $registry) { - parent::__construct($registry, Property::class); + parent::__construct($registry, Property::class); } // /** diff --git a/api/src/Repository/RequestTypeRepository.php b/api/src/Repository/RequestTypeRepository.php index 2bdc2580..0adf35d5 100644 --- a/api/src/Repository/RequestTypeRepository.php +++ b/api/src/Repository/RequestTypeRepository.php @@ -14,10 +14,9 @@ */ class RequestTypeRepository extends ServiceEntityRepository { - - public function __construct(ManagerRegistry $registry) + public function __construct(ManagerRegistry $registry) { - parent::__construct($registry, RequestType::class); + parent::__construct($registry, RequestType::class); } // /** diff --git a/api/src/Service/RequestTypeService.php b/api/src/Service/RequestTypeService.php index 62e97045..45993111 100644 --- a/api/src/Service/RequestTypeService.php +++ b/api/src/Service/RequestTypeService.php @@ -1,4 +1,5 @@ em = $em; - } - - public function extendRequestType(RequestType $requestType) - { - $requestTypesProcessed = [(string) $requestType->getId()]; - $extendedRequest = $requestType->getExtends(); - $propertiesTitles = []; - // Let loop this for as long as we can extend requests - while($extendedRequest){ - // But kill it the moment we spot an invinate loop - if(in_array((string) $extendedRequest->getId(), $requestTypesProcessed)){ - throw new \Exception('Request type '.$extendedRequest->getName().'(id:'.(string) $extendedRequest->getId().') has been referenced more then once in this extention, posible loop detected'); - } - - // lets add the id to the check array, so that we can prefend loops - $requestTypesProcessed[(string) $extendedRequest->getId()] = true; - - // Then we need to do the actual extending - foreach ($extendedRequest->getProperties() as $property){ - - /* @todo we should als check on dubble property titles - if(in_array($property->getTitle(), $propertiesTitles)){ - throw new \Exception('There is more then one property titled '.$property->getTitle().' in this extention'); - }*/ - - $propertiesTitles[$property->getTitle()] = true; - $requestType->extendProperty($property); - } - - $extendedRequest = $extendedRequest->getExtends(); - } - - return $requestType; - } - + private $em; + + public function __construct(EntityManagerInterface $em) + { + $this->em = $em; + } + + public function extendRequestType(RequestType $requestType) + { + $requestTypesProcessed = [(string) $requestType->getId()]; + $extendedRequest = $requestType->getExtends(); + $propertiesTitles = []; + // Let loop this for as long as we can extend requests + while ($extendedRequest) { + // But kill it the moment we spot an invinate loop + if (in_array((string) $extendedRequest->getId(), $requestTypesProcessed)) { + throw new \Exception('Request type '.$extendedRequest->getName().'(id:'.(string) $extendedRequest->getId().') has been referenced more then once in this extention, posible loop detected'); + } + + // lets add the id to the check array, so that we can prefend loops + $requestTypesProcessed[(string) $extendedRequest->getId()] = true; + + // Then we need to do the actual extending + foreach ($extendedRequest->getProperties() as $property) { + + /* @todo we should als check on dubble property titles + if(in_array($property->getTitle(), $propertiesTitles)){ + throw new \Exception('There is more then one property titled '.$property->getTitle().' in this extention'); + }*/ + + $propertiesTitles[$property->getTitle()] = true; + $requestType->extendProperty($property); + } + + $extendedRequest = $extendedRequest->getExtends(); + } + + return $requestType; + } } diff --git a/api/src/Subscriber/FieldsAndExtendSubscriber.php b/api/src/Subscriber/FieldsAndExtendSubscriber.php index d50440c7..e4e45b7a 100644 --- a/api/src/Subscriber/FieldsAndExtendSubscriber.php +++ b/api/src/Subscriber/FieldsAndExtendSubscriber.php @@ -8,8 +8,8 @@ use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\Serializer\SerializerInterface; use Symfony\Component\PropertyAccess\PropertyAccess; +use Symfony\Component\Serializer\SerializerInterface; class FieldsAndExtendSubscriber implements EventSubscriberInterface { @@ -27,13 +27,13 @@ public function __construct(ParameterBagInterface $params, SerializerInterface $ public static function getSubscribedEvents() { return [ - KernelEvents::VIEW => ['FilterFields', EventPriorities::PRE_SERIALIZE], + KernelEvents::VIEW => ['FilterFields', EventPriorities::PRE_SERIALIZE], ]; } public function FilterFields(GetResponseForControllerResultEvent $event) { - /* @todo Contains a bug + /* @todo Contains a bug $result = $event->getControllerResult(); $fields = $event->getRequest()->query->get('fields'); $extends = $event->getRequest()->query->get('extend'); @@ -42,14 +42,14 @@ public function FilterFields(GetResponseForControllerResultEvent $event) $contentType= $event->getRequest()->headers->get('Accept'); } - + // Only do somthing if fields is query supplied if (!$fields && !$extends) { return $result; } - + // This needs to be bassed on the content-type - + // Lets set a return content type switch ($contentType) { case 'application/json': @@ -73,15 +73,15 @@ public function FilterFields(GetResponseForControllerResultEvent $event) if (!is_array($extends)) { $extends= explode(',', $extends); } - + // Its possible to nest fields for filterins foreach($fields as $key=>$value){ // Lets check if the fields contain one or more .'s if (strpos($value, '.') !== false) { - // This is where it gets complicated couse it could go on indevinitly + // This is where it gets complicated couse it could go on indevinitly } } - + // Overwrite maxdepth for extended properties // we always need to return an id and links (in order not to break stuff) @@ -95,18 +95,18 @@ public function FilterFields(GetResponseForControllerResultEvent $event) // now we need to overide the normal subscriber $json = $this->serializer->serialize( $result, - $renderType, - ['enable_max_depth' => true, + $renderType, + ['enable_max_depth' => true, 'attributes'=> $fields] ); - - + + $jsonArray = json_decode($json, true); - - + + // The we want to extend properties from the extend query foreach($extends as $extend){ - // @todo add security checks + // @todo add security checks // Get new object for the extend $extendObject = $this->propertyAccessor->getValue($result, $extend); // turn to json @@ -115,12 +115,12 @@ public function FilterFields(GetResponseForControllerResultEvent $event) $type, ['enable_max_depth' => true, 'attributes'=> $fields] - ); + ); // add to the array $jsonArray[$extend] = json_decode($extendjson, true); } - - + + $json = json_encode($jsonArray); $response = new Response( diff --git a/api/src/Subscriber/NLXSubscriber.php b/api/src/Subscriber/NLXSubscriber.php index 5411001e..09cd5e55 100644 --- a/api/src/Subscriber/NLXSubscriber.php +++ b/api/src/Subscriber/NLXSubscriber.php @@ -33,8 +33,8 @@ public function __construct(ParameterBagInterface $params, EntityManagerInterfac public static function getSubscribedEvents() { return [ - KernelEvents::VIEW => ['NLXLog', EventPriorities::PRE_VALIDATE], - KernelEvents::VIEW => ['NLXAudit', EventPriorities::PRE_SERIALIZE], + KernelEvents::VIEW => ['NLXLog', EventPriorities::PRE_VALIDATE], + KernelEvents::VIEW => ['NLXAudit', EventPriorities::PRE_SERIALIZE], ]; } diff --git a/api/src/Subscriber/RequestTypeSubscriber.php b/api/src/Subscriber/RequestTypeSubscriber.php index caff0d71..cdff5a16 100644 --- a/api/src/Subscriber/RequestTypeSubscriber.php +++ b/api/src/Subscriber/RequestTypeSubscriber.php @@ -2,57 +2,51 @@ namespace App\Subscriber; -use ApiPlatform\Core\Exception\InvalidArgumentException; use ApiPlatform\Core\EventListener\EventPriorities; +use App\Service\RequestTypeService; +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\HttpFoundation\Request; -use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent; use Symfony\Component\HttpKernel\KernelEvents; -use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\Serializer\SerializerInterface; -use Doctrine\ORM\EntityManagerInterface; -use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; - -use App\Service\RequestTypeService; class RequestTypeSubscriber implements EventSubscriberInterface { - private $params; - private $requestTypeService; - private $serializer; - - public function __construct(ParameterBagInterface $params, RequestTypeService $requestTypeService, SerializerInterface $serializer) - { - $this->params = $params; - $this->requestTypeService= $requestTypeService; - $this->serializer= $serializer; - } - - public static function getSubscribedEvents() - { - return [ - KernelEvents::VIEW => ['getRequestType', EventPriorities::PRE_VALIDATE], - ]; - - } - - public function getRequestType(GetResponseForControllerResultEvent $event) - { - $requestType = $event->getControllerResult(); - $route = $event->getRequest()->get('_route'); - $method = $event->getRequest()->getMethod(); - $extend = $event->getRequest()->query->get('extend'); - - //!$requestType instanceof RequestType || Request::METHOD_GET !== $method || - if ( $extend != "true" || $route !='api_request_types_get_item') { - return $requestType; - } - - //var_dump($method); - - $requestType = $this->requestTypeService->extendRequestType($requestType); - - return $requestType; - } + private $params; + private $requestTypeService; + private $serializer; + + public function __construct(ParameterBagInterface $params, RequestTypeService $requestTypeService, SerializerInterface $serializer) + { + $this->params = $params; + $this->requestTypeService = $requestTypeService; + $this->serializer = $serializer; + } + + public static function getSubscribedEvents() + { + return [ + KernelEvents::VIEW => ['getRequestType', EventPriorities::PRE_VALIDATE], + ]; + } + + public function getRequestType(GetResponseForControllerResultEvent $event) + { + $requestType = $event->getControllerResult(); + $route = $event->getRequest()->get('_route'); + $method = $event->getRequest()->getMethod(); + $extend = $event->getRequest()->query->get('extend'); + + //!$requestType instanceof RequestType || Request::METHOD_GET !== $method || + if ($extend != 'true' || $route != 'api_request_types_get_item') { + return $requestType; + } + + //var_dump($method); + + $requestType = $this->requestTypeService->extendRequestType($requestType); + + return $requestType; + } } diff --git a/api/src/Subscriber/ValidOnSubscriber.php b/api/src/Subscriber/ValidOnSubscriber.php index 4aac9f15..dd237ae9 100644 --- a/api/src/Subscriber/ValidOnSubscriber.php +++ b/api/src/Subscriber/ValidOnSubscriber.php @@ -29,7 +29,7 @@ public function __construct(ParameterBagInterface $params, EntityManagerInterfac public static function getSubscribedEvents() { return [ - KernelEvents::VIEW => ['validOn', EventPriorities::PRE_SERIALIZE], + KernelEvents::VIEW => ['validOn', EventPriorities::PRE_SERIALIZE], ]; } diff --git a/api/src/Swagger/SwaggerDecorator.php b/api/src/Swagger/SwaggerDecorator.php index b0610232..e0883841 100644 --- a/api/src/Swagger/SwaggerDecorator.php +++ b/api/src/Swagger/SwaggerDecorator.php @@ -23,13 +23,13 @@ final class SwaggerDecorator implements NormalizerInterface private $camelCaseToSnakeCaseNameConverter; public function __construct( - NormalizerInterface $decorated, - ParameterBagInterface $params, - CacheInterface $cache, - EntityManagerInterface $em, - AnnotationReader $annotationReader, - CamelCaseToSnakeCaseNameConverter $camelCaseToSnakeCaseNameConverter - ) { + NormalizerInterface $decorated, + ParameterBagInterface $params, + CacheInterface $cache, + EntityManagerInterface $em, + AnnotationReader $annotationReader, + CamelCaseToSnakeCaseNameConverter $camelCaseToSnakeCaseNameConverter + ) { $this->decorated = $decorated; $this->params = $params; $this->cash = $cache; @@ -63,17 +63,17 @@ public function normalize($object, $format = null, array $context = []) // Lets add JWT-Oauth $docs['securityDefinitions']['JWT-Oauth'] = [ - 'type' => 'oauth2', - 'authorizationUrl'=> 'http://petstore.swagger.io/api/oauth/dialog', - 'flow' => 'implicit', - 'scopes' => [], //scopes will be filled later autmaticly + 'type' => 'oauth2', + 'authorizationUrl'=> 'http://petstore.swagger.io/api/oauth/dialog', + 'flow' => 'implicit', + 'scopes' => [], //scopes will be filled later autmaticly ]; $docs['securityDefinitions']['JWT-Token'] = [ - 'type' => 'apiKey', - 'in' => 'header', // can be "header", "query" or "cookie" - 'name' => 'Authorization', // name of the header, query parameter or cookie - 'scopes'=> [], //scopes will be filled later autmaticly + 'type' => 'apiKey', + 'in' => 'header', // can be "header", "query" or "cookie" + 'name' => 'Authorization', // name of the header, query parameter or cookie + 'scopes'=> [], //scopes will be filled later autmaticly ]; // Lets get al the entities known to doctrine @@ -114,8 +114,8 @@ public function normalize($object, $format = null, array $context = []) //$additionalEntityDocs = $this->getAdditionalEntityDocs($entity); $entityDocs = $this->getAdditionalEntityDocs($entity); // Only run if we have aditional docs - if(array_key_exists('properties',$entityDocs)){ - $additionalDocs = array_merge($additionalDocs, $entityDocs['properties']); + if (array_key_exists('properties', $entityDocs)) { + $additionalDocs = array_merge($additionalDocs, $entityDocs['properties']); } // Security @@ -196,16 +196,16 @@ public function normalize($object, $format = null, array $context = []) // NLX loging headers $call['parameters'][] = [ - 'name' => 'Authorization', - 'description' => 'The JWT of the entity performing the request', - 'in' => 'header', + 'name' => 'Authorization', + 'description' => 'The JWT of the entity performing the request', + 'in' => 'header', ]; // NLX loging headers $call['parameters'][] = [ - 'name' => 'API-Version', - 'description' => 'The version of the API conform [Landelijke API-strategie.](https://geonovum.github.io/KP-APIs/#versioning)', - 'example' => '1.0.1', - 'in' => 'header', + 'name' => 'API-Version', + 'description' => 'The version of the API conform [Landelijke API-strategie.](https://geonovum.github.io/KP-APIs/#versioning)', + 'example' => '1.0.1', + 'in' => 'header', ]; /* // NLX loging headers @@ -223,33 +223,33 @@ public function normalize($object, $format = null, array $context = []) */ // NLX loging headers $call['parameters'][] = [ - 'name' => 'X-NLX-Logrecord-ID', - 'description' => 'A globally unique id of the request, which makes a request traceable throughout the network.', - 'in' => 'header', + 'name' => 'X-NLX-Logrecord-ID', + 'description' => 'A globally unique id of the request, which makes a request traceable throughout the network.', + 'in' => 'header', ]; // NLX loging headers $call['parameters'][] = [ - 'name' => 'X-NLX-Request-Process-Id', - 'description' => 'A process id for purpose registration (doelbinding)', - 'in' => 'header', + 'name' => 'X-NLX-Request-Process-Id', + 'description' => 'A process id for purpose registration (doelbinding)', + 'in' => 'header', ]; // NLX loging headers $call['parameters'][] = [ - 'name' => 'X-NLX-Request-Data-Elements', - 'description' => 'A list of requested data elements', - 'in' => 'header', + 'name' => 'X-NLX-Request-Data-Elements', + 'description' => 'A list of requested data elements', + 'in' => 'header', ]; // NLX loging headers $call['parameters'][] = [ - 'name' => 'X-NLX-Request-Data-Subject', - 'description' => 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`', - 'in' => 'header', + 'name' => 'X-NLX-Request-Data-Subject', + 'description' => 'A key-value list of data subjects related to this request. e.g. `bsn=12345678, kenteken=ab-12-fg`', + 'in' => 'header', ]; // NLX loging headers $call['parameters'][] = [ - 'name' => 'X-NLX-Audit-Clarification', - 'description' => 'A clarification as to why a request has been made (doelbinding)', - 'in' => 'header', + 'name' => 'X-NLX-Audit-Clarification', + 'description' => 'A clarification as to why a request has been made (doelbinding)', + 'in' => 'header', ]; if ($method == 'get') { @@ -259,48 +259,48 @@ public function normalize($object, $format = null, array $context = []) // WEBSUB header $call['parameters'][] = [ - 'name' => 'Link', - 'description' => 'A [websub](https://www.w3.org/TR/websub/#discovery) header like ; rel="hub"', - 'in' => 'header', + 'name' => 'Link', + 'description' => 'A [websub](https://www.w3.org/TR/websub/#discovery) header like ; rel="hub"', + 'in' => 'header', ]; // Lets add the extend functionality $call['parameters'][] = [ - 'name' => 'extend[]', - 'required' => false, - 'description' => 'An array of nested objects to include in the return object', - 'in' => 'query', - 'schema' => ['type'=>'array'], + 'name' => 'extend[]', + 'required' => false, + 'description' => 'An array of nested objects to include in the return object', + 'in' => 'query', + 'schema' => ['type'=>'array'], ]; // Lets add the fields functionality $call['parameters'][] = [ - 'name' => 'fields[]', - 'required' => false, - 'description' => 'An array of fields to return in output, wil return all fields is not supplied', - 'in' => 'query', - 'schema' => ['type'=>'array'], + 'name' => 'fields[]', + 'required' => false, + 'description' => 'An array of fields to return in output, wil return all fields is not supplied', + 'in' => 'query', + 'schema' => ['type'=>'array'], ]; // Lets add some time travel $call['parameters'][] = [ - 'name' => 'validOn', - 'required' => false, - 'description' => 'Returns object as valid on a given date time', - 'schema' => ['type'=>'string', 'format' => 'date-time'], - 'in' => 'query', + 'name' => 'validOn', + 'required' => false, + 'description' => 'Returns object as valid on a given date time', + 'schema' => ['type'=>'string', 'format' => 'date-time'], + 'in' => 'query', ]; $call['parameters'][] = [ - 'name' => 'validFrom', - 'required' => false, - 'description' => 'Returns objects valid from a given date time', - 'schema' => ['type'=>'string', 'format' => 'date-time'], - 'in' => 'query', + 'name' => 'validFrom', + 'required' => false, + 'description' => 'Returns objects valid from a given date time', + 'schema' => ['type'=>'string', 'format' => 'date-time'], + 'in' => 'query', ]; $call['parameters'][] = [ - 'name' => 'validUntil', - 'required' => false, - 'description' => 'Returns objects valid until a given date time', - 'schema' => ['type'=>'string', 'format' => 'date-time'], - 'in' => 'query', + 'name' => 'validUntil', + 'required' => false, + 'description' => 'Returns objects valid until a given date time', + 'schema' => ['type'=>'string', 'format' => 'date-time'], + 'in' => 'query', ]; } } @@ -421,10 +421,16 @@ private function getAdditionalEntityDocs($entity) foreach ($tags as $tag) { $name = $tag->getName(); $description = $tag->getDescription(); - // - //$description = (string) $description; switch ($name) { + + // Description + case 'var': + $atributes['description'] = (string) $description; + $atributes['type'] = (string) $tag->getType(); + + break; + // Docblocks case 'example': $atributes['example'] = (string) $description; @@ -437,22 +443,48 @@ private function getAdditionalEntityDocs($entity) break; // Constrainds (Validation) + case "Assert\Date": + $atributes['type'] = 'string'; + $atributes['format'] = 'date'; + $atributes['example'] = \date('Y-m-d'); + break; + case "Assert\DateTime": + $atributes['type'] = 'string'; + $atributes['format'] = 'date-time'; + $atributes['example'] = \date('Y-m-d H:i:s'); + break; + case "Assert\Time": + $atributes['type'] = 'string'; + $atributes['format'] = 'time'; + $atributes['example'] = \date('H:i:s'); + break; + case "Assert\Timezone": + $atributes['type'] = 'string'; + $atributes['format'] = 'timezone'; + $atributes['example'] = 'America/New_York'; + break; case "Assert\Uuid": + $atributes['type'] = 'string'; $atributes['format'] = 'uuid'; break; case "Assert\Email": + $atributes['type'] = 'string'; $atributes['format'] = 'email'; break; case "Assert\Url": + $atributes['type'] = 'string'; $atributes['format'] = 'url'; break; case "Assert\Regex": + $atributes['type'] = 'string'; $atributes['format'] = 'regex'; break; case "Assert\Ip": + $atributes['type'] = 'string'; $atributes['format'] = 'ip'; break; case "Assert\Json": + $atributes['type'] = 'string'; $atributes['format'] = 'json'; break; case "Assert\Choice":