Explorar el Código

adjustments

master
Daniel hace 1 año
padre
commit
5485039843
Se han modificado 4 ficheros con 21 adiciones y 1 borrados
  1. +1
    -1
      export/openapi.json
  2. +15
    -0
      export/openapi.yaml
  3. +3
    -0
      src/ApiResource/PostingApi.php
  4. +2
    -0
      src/Mapper/PostingEntityToApiMapper.php

+ 1
- 1
export/openapi.json
La diferencia del archivo ha sido suprimido porque es demasiado grande
Ver fichero


+ 15
- 0
export/openapi.yaml Ver fichero

@@ -5591,6 +5591,11 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
contactName:
readOnly: true
type:
- string
- 'null'
sale:
type:
- string
@@ -5740,6 +5745,11 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
contactName:
readOnly: true
type:
- string
- 'null'
sale:
type:
- string
@@ -5896,6 +5906,11 @@ components:
- 'null'
format: iri-reference
example: 'https://example.com/'
contactName:
readOnly: true
type:
- string
- 'null'
sale:
type:
- string


+ 3
- 0
src/ApiResource/PostingApi.php Ver fichero

@@ -107,6 +107,9 @@ class PostingApi implements OwnerInterface
#[Groups(['posting:create'])]
public ?ContactApi $contact = null;

#[ApiProperty(writable: false)]
public ?string $contactName = null;

#[ApiProperty(writable: true)]
#[Groups(['posting:create'])]
public ?SaleApi $sale = null;


+ 2
- 0
src/Mapper/PostingEntityToApiMapper.php Ver fichero

@@ -61,10 +61,12 @@ class PostingEntityToApiMapper implements MapperInterface
$dto->productName = $entity->getProduct()?->getName();

$dto->contact = null;
$dto->contactName = null;
if ($entity->getContact() !== null) {
$dto->contact = $this->microMapper->map($entity->getContact(), ContactApi::class, [
MicroMapperInterface::MAX_DEPTH => 1,
]);
$dto->contactName = $entity->getContact()->getFirstName() . ' ' . $entity->getContact()->getLastName();
}

$dto->sale = null;


Cargando…
Cancelar
Guardar