Sfoglia il codice sorgente

dit und dat

master
Daniel 1 anno fa
parent
commit
acd81e9994
5 ha cambiato i file con 36 aggiunte e 10 eliminazioni
  1. +1
    -1
      export/openapi.json
  2. +28
    -2
      export/openapi.yaml
  3. +1
    -1
      src/ApiResource/SaleApi.php
  4. +2
    -2
      src/Filter/PartnerProductUnassignedFilter.php
  5. +4
    -4
      src/Filter/ProductUnassignedFilter.php

+ 1
- 1
export/openapi.json
File diff soppresso perché troppo grande
Vedi File


+ 28
- 2
export/openapi.yaml Vedi File

@@ -1824,7 +1824,7 @@ paths:
explode: true explode: true
allowReserved: false allowReserved: false
- -
name: productPartnerUnassigned
name: excludeContactId
in: query in: query
description: '' description: ''
required: false required: false
@@ -2658,7 +2658,7 @@ paths:
explode: false explode: false
allowReserved: false allowReserved: false
- -
name: partnerIdUnassigned
name: excludePartnerId
in: query in: query
description: '' description: ''
required: false required: false
@@ -3057,6 +3057,32 @@ paths:
style: form style: form
explode: true explode: true
allowReserved: false allowReserved: false
-
name: product
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: string
style: form
explode: false
allowReserved: false
-
name: 'product[]'
in: query
description: ''
required: false
deprecated: false
allowEmptyValue: true
schema:
type: array
items:
type: string
style: form
explode: true
allowReserved: false
deprecated: false deprecated: false
post: post:
operationId: api_sales_post operationId: api_sales_post


+ 1
- 1
src/ApiResource/SaleApi.php Vedi File

@@ -48,7 +48,7 @@ use Symfony\Component\Validator\Constraints\NotBlank;
processor: EntityClassDtoStateProcessor::class, processor: EntityClassDtoStateProcessor::class,
stateOptions: new Options(entityClass: Sale::class), stateOptions: new Options(entityClass: Sale::class),
)] )]
#[ApiFilter(SearchFilter::class, properties: ['owner' => 'exact', 'partner' => 'exact'])]
#[ApiFilter(SearchFilter::class, properties: ['owner' => 'exact', 'partner' => 'exact', 'product' => 'exact'])]
class SaleApi implements OwnerInterface class SaleApi implements OwnerInterface
{ {
#[ApiProperty(readable: false, writable: false, identifier: true)] #[ApiProperty(readable: false, writable: false, identifier: true)]


+ 2
- 2
src/Filter/PartnerProductUnassignedFilter.php Vedi File

@@ -18,7 +18,7 @@ use Psr\Log\LoggerInterface;
#[ApiFilter(PartnerProductUnassignedFilter::class)] #[ApiFilter(PartnerProductUnassignedFilter::class)]
class PartnerProductUnassignedFilter extends AbstractFilter class PartnerProductUnassignedFilter extends AbstractFilter
{ {
public const FILTER_NAME = "productPartnerUnassigned";
public const FILTER_NAME = "excludeContactId";


public function __construct(ManagerRegistry $managerRegistry, ?LoggerInterface $logger = null, ?array $properties = null) public function __construct(ManagerRegistry $managerRegistry, ?LoggerInterface $logger = null, ?array $properties = null)
{ {
@@ -27,7 +27,7 @@ class PartnerProductUnassignedFilter extends AbstractFilter


protected function filterProperty(string $property, $value, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?\ApiPlatform\Metadata\Operation $operation = null, array $context = []): void protected function filterProperty(string $property, $value, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?\ApiPlatform\Metadata\Operation $operation = null, array $context = []): void
{ {
if ($property !== 'unassignedContactId') {
if ($property !== self::FILTER_NAME) {
return; return;
} }




+ 4
- 4
src/Filter/ProductUnassignedFilter.php Vedi File

@@ -18,7 +18,7 @@ use Psr\Log\LoggerInterface;
#[ApiFilter(ProductUnassignedFilter::class)] #[ApiFilter(ProductUnassignedFilter::class)]
class ProductUnassignedFilter extends AbstractFilter class ProductUnassignedFilter extends AbstractFilter
{ {
public const FILTER_NAME = "partnerIdUnassigned";
public const FILTER_NAME = "excludePartnerId";


public function __construct(ManagerRegistry $managerRegistry, ?LoggerInterface $logger = null, ?array $properties = null) public function __construct(ManagerRegistry $managerRegistry, ?LoggerInterface $logger = null, ?array $properties = null)
{ {
@@ -27,7 +27,7 @@ class ProductUnassignedFilter extends AbstractFilter


protected function filterProperty(string $property, $value, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?\ApiPlatform\Metadata\Operation $operation = null, array $context = []): void protected function filterProperty(string $property, $value, QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, ?\ApiPlatform\Metadata\Operation $operation = null, array $context = []): void
{ {
if ($property !== 'unassignedPartnerId') {
if ($property !== self::FILTER_NAME) {
return; return;
} }


@@ -51,8 +51,8 @@ class ProductUnassignedFilter extends AbstractFilter
'required' => false, 'required' => false,
'swagger' => [ 'swagger' => [
'description' => 'Filter products that are not assigned to a given partner id', 'description' => 'Filter products that are not assigned to a given partner id',
'type' => 'integer', // Hier wird der Datentyp auf 'integer' gesetzt
'format' => 'partner_id', // Optional: Format 'partner_id' angeben, um klarzustellen, dass es sich um eine Partner-ID handelt
'type' => 'integer',
'format' => 'partner_id',
], ],
], ],
]; ];


Caricamento…
Annulla
Salva