2026-09-30 12:08:22 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
use App\Dto\PickupExceptionDto;
|
|
|
|
|
use App\Models\PickupException;
|
|
|
|
|
use App\Queries\PickupExceptions\GetPaginatedPickupExceptionsQuery;
|
|
|
|
|
use App\Queries\PickupExceptions\GetPaginatedPickupExceptionsQueryInput;
|
|
|
|
|
use App\Services\DataTableService;
|
|
|
|
|
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
|
|
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
|
|
|
|
|
|
describe('GetPaginatedPickupExceptionsQuery', function () {
|
|
|
|
|
test('it executes and returns paginated pickup exception DTOs', function () {
|
|
|
|
|
// GIVEN
|
|
|
|
|
PickupException::factory()->count(3)->create();
|
|
|
|
|
|
|
|
|
|
$dataTableService = resolve(DataTableService::class);
|
|
|
|
|
$query = new GetPaginatedPickupExceptionsQuery($dataTableService);
|
|
|
|
|
$input = new GetPaginatedPickupExceptionsQueryInput(
|
feat(employees): automated sync with Arcadia API, BO settings, Shopper value objects, and pagination migration
- Implement automated synchronization of employees via Arcadia API (EmployeeSyncService, SynchronizeEmployeesWithArcadiaApi, FetchAndUpsertArcadiaEmployees)
- Add Back-Office application settings for employee sites (Setting singleton, GetSettingsQuery, UpdateSettings, SettingsController, EmployeeSitesInputComponent.vue)
- Strongly type Employee attributes using Domain Value Objects (ShopperEstablishmentCode, ShopperSiteCode, ShopperServiceCode) and Eloquent Casts
- Migrate pagination from Domain to Shared\Pagination namespace across queries and inputs
- Remove legacy and dead CSV employee import/export code
- Restore Domain\Ports\Services\CsvGenerator interface for Regate order generation
- Add comprehensive Pest unit, integration, and feature test coverage
2026-10-01 17:26:30 +02:00
|
|
|
pagination: \Pagination::ofPage(1, 10),
|
2026-09-30 12:08:22 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// WHEN
|
|
|
|
|
$paginator = $query($input);
|
|
|
|
|
|
|
|
|
|
// THEN
|
|
|
|
|
expect($paginator)->toBeInstanceOf(LengthAwarePaginator::class)
|
|
|
|
|
->and($paginator->total())->toBe(3)
|
|
|
|
|
->and($paginator->items())->toHaveCount(3)
|
|
|
|
|
->and($paginator->items()[0])->toBeInstanceOf(PickupExceptionDto::class);
|
|
|
|
|
});
|
|
|
|
|
});
|