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);
|
|
|
|
|
|
2026-11-10 14:28:00 +01:00
|
|
|
namespace App\Cqs\Actions\Settings;
|
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
|
|
|
|
|
|
|
|
use App\Contracts\Action;
|
|
|
|
|
use App\Contracts\ActionInput;
|
|
|
|
|
use App\Models\Setting;
|
|
|
|
|
use Domain\Models\ValueObjects\ShopperSiteCode;
|
|
|
|
|
use Webmozart\Assert\Assert;
|
|
|
|
|
|
|
|
|
|
/**
|
2026-11-10 14:28:00 +01:00
|
|
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Settings\UpdateSettingsInput, \App\Models\Setting>
|
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
|
|
|
*/
|
|
|
|
|
final class UpdateSettings implements Action
|
|
|
|
|
{
|
|
|
|
|
/**
|
2026-11-10 14:28:00 +01:00
|
|
|
* @param \App\Cqs\Actions\Settings\UpdateSettingsInput $input
|
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
|
|
|
*/
|
|
|
|
|
#[\Override]
|
|
|
|
|
public function __invoke(ActionInput $input): Setting
|
|
|
|
|
{
|
|
|
|
|
Assert::isInstanceOf($input, UpdateSettingsInput::class);
|
|
|
|
|
|
|
|
|
|
$setting = Setting::getSingleton();
|
|
|
|
|
$setting->fill([
|
|
|
|
|
'employee_sites' => array_values(
|
|
|
|
|
array_map(
|
|
|
|
|
static fn (ShopperSiteCode $siteCode): string => $siteCode->value,
|
|
|
|
|
$input->employeeSites
|
|
|
|
|
)
|
|
|
|
|
),
|
|
|
|
|
]);
|
|
|
|
|
$setting->saveOrFail();
|
|
|
|
|
|
|
|
|
|
return $setting;
|
|
|
|
|
}
|
|
|
|
|
}
|