/api/part_lots: add user_barcode filter (#1280)

* /api/part_lots: add user_barcode filter

* support LIKE filtering for part lot user_barcode
This commit is contained in:
Niklas 2026-03-07 19:31:47 +01:00 committed by GitHub
parent 0d58262e19
commit 3ed27f6c0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 27 additions and 1 deletions

View file

@ -47,6 +47,32 @@ final class PartLotsEndpointTest extends CrudEndpointTestCase
$this->_testGetItem(2);
}
public function testFilterByUserBarcode(): void
{
$response = self::createAuthenticatedClient()->request('GET', '/api/part_lots?user_barcode=lot2_vendor_barcode');
self::assertResponseIsSuccessful();
self::assertJsonContains([
'hydra:totalItems' => 1,
]);
$json = $response->toArray();
self::assertSame('/api/part_lots/2', $json['hydra:member'][0]['@id']);
}
public function testFilterByUserBarcodeUsingWildcard(): void
{
$response = self::createAuthenticatedClient()->request('GET', '/api/part_lots?user_barcode=lot2_%');
self::assertResponseIsSuccessful();
self::assertJsonContains([
'hydra:totalItems' => 1,
]);
$json = $response->toArray();
self::assertSame('/api/part_lots/2', $json['hydra:member'][0]['@id']);
}
public function testCreateItem(): void
{
$this->_testPostItem([