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\UpdateSettings;
|
|
|
|
|
use App\Actions\Settings\UpdateSettingsInput;
|
|
|
|
|
use App\Models\Setting;
|
|
|
|
|
use Domain\Models\ValueObjects\ShopperSiteCode;
|
|
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
|
|
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
|
|
|
|
|
|
describe('UpdateSettings', function (): void {
|
|
|
|
|
it('updates employee sites configuration', function (): void {
|
|
|
|
|
/** @var \Tests\TestCase $this */
|
|
|
|
|
|
|
|
|
|
// GIVEN
|
|
|
|
|
$action = new UpdateSettings();
|
|
|
|
|
$input = new UpdateSettingsInput([
|
|
|
|
|
new ShopperSiteCode('PA'),
|
|
|
|
|
new ShopperSiteCode('LY'),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
// WHEN
|
|
|
|
|
$setting = $action($input);
|
|
|
|
|
|
|
|
|
|
// THEN
|
|
|
|
|
expect($setting)->toBeInstanceOf(Setting::class)
|
2026-10-02 12:14:48 +02:00
|
|
|
->and($setting->employee_sites)->toBe(['PA', 'LY']);
|
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
|
|
|
|
|
|
|
|
$this->assertDatabaseHas('settings', [
|
|
|
|
|
'id' => Setting::SINGLETON_ID,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$fresh = Setting::getSingleton();
|
|
|
|
|
expect($fresh->employee_sites)->toBe(['PA', 'LY']);
|
|
|
|
|
});
|
|
|
|
|
});
|