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\Casts\ShopperServiceCodeCast;
|
|
|
|
|
use Domain\Models\ValueObjects\ShopperServiceCode;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
it('gets a ShopperServiceCode', function () {
|
|
|
|
|
// GIVEN
|
|
|
|
|
$cast = new ShopperServiceCodeCast();
|
2026-10-02 12:14:48 +02:00
|
|
|
$model = \Mockery::mock(Model::class);
|
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
|
|
|
|
|
|
|
|
// WHEN
|
|
|
|
|
$code = $cast->get($model, 'service', '101', []);
|
|
|
|
|
|
|
|
|
|
// THEN
|
|
|
|
|
expect($code)->toBeInstanceOf(ShopperServiceCode::class)
|
|
|
|
|
->and($code->value)->toBe('101');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('throws exception when getting invalid ShopperServiceCode type', function () {
|
|
|
|
|
// GIVEN
|
|
|
|
|
$cast = new ShopperServiceCodeCast();
|
2026-10-02 12:14:48 +02:00
|
|
|
$model = \Mockery::mock(Model::class);
|
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
|
|
|
|
|
|
|
|
// WHEN
|
|
|
|
|
$cast->get($model, 'service', 123, []);
|
|
|
|
|
|
|
|
|
|
// THEN
|
|
|
|
|
})->throws(\UnexpectedValueException::class, 'ShopperServiceCode must be a string.');
|
|
|
|
|
|
|
|
|
|
it('throws exception when getting null ShopperServiceCode', function () {
|
|
|
|
|
// GIVEN
|
|
|
|
|
$cast = new ShopperServiceCodeCast();
|
2026-10-02 12:14:48 +02:00
|
|
|
$model = \Mockery::mock(Model::class);
|
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
|
|
|
|
|
|
|
|
// WHEN
|
|
|
|
|
$cast->get($model, 'service', null, []);
|
|
|
|
|
|
|
|
|
|
// THEN
|
|
|
|
|
})->throws(\UnexpectedValueException::class, 'ShopperServiceCode must be a string.');
|
|
|
|
|
|
|
|
|
|
it('sets a ShopperServiceCode from instance', function () {
|
|
|
|
|
// GIVEN
|
|
|
|
|
$cast = new ShopperServiceCodeCast();
|
2026-10-02 12:14:48 +02:00
|
|
|
$model = \Mockery::mock(Model::class);
|
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
|
|
|
$vo = new ShopperServiceCode('101');
|
|
|
|
|
|
|
|
|
|
// WHEN
|
|
|
|
|
$value = $cast->set($model, 'service', $vo, []);
|
|
|
|
|
|
|
|
|
|
// THEN
|
|
|
|
|
expect($value)->toBe('101');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('sets a ShopperServiceCode from valid string', function () {
|
|
|
|
|
// GIVEN
|
|
|
|
|
$cast = new ShopperServiceCodeCast();
|
2026-10-02 12:14:48 +02:00
|
|
|
$model = \Mockery::mock(Model::class);
|
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
|
|
|
|
|
|
|
|
// WHEN
|
|
|
|
|
$value = $cast->set($model, 'service', '101', []);
|
|
|
|
|
|
|
|
|
|
// THEN
|
|
|
|
|
expect($value)->toBe('101');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it('throws exception when setting invalid ShopperServiceCode type', function () {
|
|
|
|
|
// GIVEN
|
|
|
|
|
$cast = new ShopperServiceCodeCast();
|
2026-10-02 12:14:48 +02:00
|
|
|
$model = \Mockery::mock(Model::class);
|
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
|
|
|
|
|
|
|
|
// WHEN
|
|
|
|
|
$cast->set($model, 'service', 123, []);
|
|
|
|
|
|
|
|
|
|
// THEN
|
|
|
|
|
})->throws(\UnexpectedValueException::class, 'The given value is not an instance of ShopperServiceCode.');
|