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
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
use App\Actions\Settings\UpdateSettingsInput;
|
|
|
|
|
use Domain\Models\ValueObjects\ShopperSiteCode;
|
|
|
|
|
|
|
|
|
|
describe('UpdateSettingsInput', function (): void {
|
|
|
|
|
it('creates an input with valid ShopperSiteCode objects', function (): void {
|
|
|
|
|
// GIVEN
|
|
|
|
|
$sites = [
|
|
|
|
|
new ShopperSiteCode('PA'),
|
|
|
|
|
new ShopperSiteCode('LY'),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
// WHEN
|
|
|
|
|
$input = new UpdateSettingsInput(employeeSites: $sites);
|
|
|
|
|
|
|
|
|
|
// THEN
|
2026-10-02 12:14:48 +02:00
|
|
|
expect($input->employeeSites)->toBe($sites);
|
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
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('creates an empty input', function (): void {
|
|
|
|
|
// GIVEN
|
|
|
|
|
$sites = [];
|
|
|
|
|
|
|
|
|
|
// WHEN
|
|
|
|
|
$input = new UpdateSettingsInput(employeeSites: $sites);
|
|
|
|
|
|
|
|
|
|
// THEN
|
|
|
|
|
expect($input->employeeSites)->toBeEmpty();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('throws when site elements are not ShopperSiteCode', function (): void {
|
|
|
|
|
// GIVEN
|
|
|
|
|
$invalidSites = ['PA', 'LY'];
|
|
|
|
|
|
|
|
|
|
// WHEN / THEN
|
|
|
|
|
/** @phpstan-ignore argument.type */
|
|
|
|
|
expect(fn () => new UpdateSettingsInput(employeeSites: $invalidSites))
|
|
|
|
|
->toThrow(\InvalidArgumentException::class);
|
|
|
|
|
});
|
|
|
|
|
});
|