- 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
31 lines
875 B
PHP
31 lines
875 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Contracts\QueryInputEmpty;
|
|
use App\Dto\SettingDto;
|
|
use App\Models\Setting;
|
|
use App\Queries\Settings\GetSettingsQuery;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
describe('GetSettingsQuery', function (): void {
|
|
it('returns settings as SettingDto', function (): void {
|
|
// GIVEN
|
|
$setting = Setting::getSingleton();
|
|
$setting->employee_sites = ['NA', 'BO'];
|
|
$setting->saveOrFail();
|
|
|
|
$query = new GetSettingsQuery();
|
|
|
|
// WHEN
|
|
$dto = $query(new QueryInputEmpty());
|
|
|
|
// THEN
|
|
expect($dto)->toBeInstanceOf(SettingDto::class)
|
|
->and($dto->id)->toBe(Setting::SINGLETON_ID)
|
|
->and($dto->employeeSites)->toBe(['NA', 'BO'])
|
|
->and($dto->arcadiaSites)->toBe(['NA', 'BO']);
|
|
});
|
|
});
|