| @@ -5591,6 +5591,11 @@ components: | |||||
| - 'null' | - 'null' | ||||
| format: iri-reference | format: iri-reference | ||||
| example: 'https://example.com/' | example: 'https://example.com/' | ||||
| contactName: | |||||
| readOnly: true | |||||
| type: | |||||
| - string | |||||
| - 'null' | |||||
| sale: | sale: | ||||
| type: | type: | ||||
| - string | - string | ||||
| @@ -5740,6 +5745,11 @@ components: | |||||
| - 'null' | - 'null' | ||||
| format: iri-reference | format: iri-reference | ||||
| example: 'https://example.com/' | example: 'https://example.com/' | ||||
| contactName: | |||||
| readOnly: true | |||||
| type: | |||||
| - string | |||||
| - 'null' | |||||
| sale: | sale: | ||||
| type: | type: | ||||
| - string | - string | ||||
| @@ -5896,6 +5906,11 @@ components: | |||||
| - 'null' | - 'null' | ||||
| format: iri-reference | format: iri-reference | ||||
| example: 'https://example.com/' | example: 'https://example.com/' | ||||
| contactName: | |||||
| readOnly: true | |||||
| type: | |||||
| - string | |||||
| - 'null' | |||||
| sale: | sale: | ||||
| type: | type: | ||||
| - string | - string | ||||
| @@ -107,6 +107,9 @@ class PostingApi implements OwnerInterface | |||||
| #[Groups(['posting:create'])] | #[Groups(['posting:create'])] | ||||
| public ?ContactApi $contact = null; | public ?ContactApi $contact = null; | ||||
| #[ApiProperty(writable: false)] | |||||
| public ?string $contactName = null; | |||||
| #[ApiProperty(writable: true)] | #[ApiProperty(writable: true)] | ||||
| #[Groups(['posting:create'])] | #[Groups(['posting:create'])] | ||||
| public ?SaleApi $sale = null; | public ?SaleApi $sale = null; | ||||
| @@ -61,10 +61,12 @@ class PostingEntityToApiMapper implements MapperInterface | |||||
| $dto->productName = $entity->getProduct()?->getName(); | $dto->productName = $entity->getProduct()?->getName(); | ||||
| $dto->contact = null; | $dto->contact = null; | ||||
| $dto->contactName = null; | |||||
| if ($entity->getContact() !== null) { | if ($entity->getContact() !== null) { | ||||
| $dto->contact = $this->microMapper->map($entity->getContact(), ContactApi::class, [ | $dto->contact = $this->microMapper->map($entity->getContact(), ContactApi::class, [ | ||||
| MicroMapperInterface::MAX_DEPTH => 1, | MicroMapperInterface::MAX_DEPTH => 1, | ||||
| ]); | ]); | ||||
| $dto->contactName = $entity->getContact()->getFirstName() . ' ' . $entity->getContact()->getLastName(); | |||||
| } | } | ||||
| $dto->sale = null; | $dto->sale = null; | ||||