| @@ -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 | ||||
| @@ -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)] | ||||
| @@ -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; | ||||
| } | } | ||||
| @@ -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', | |||||
| ], | ], | ||||
| ], | ], | ||||
| ]; | ]; | ||||