- 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
27 lines
765 B
PHP
27 lines
765 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Domain\Models\ValueObjects;
|
|
|
|
final readonly class OrderEmployee
|
|
{
|
|
public function __construct(
|
|
public readonly Matricule $matricule,
|
|
public readonly string $firstname,
|
|
public readonly string $lastname,
|
|
public readonly ShopperEstablishmentCode $facility,
|
|
public readonly ShopperSiteCode $site,
|
|
public readonly ShopperServiceCode $service,
|
|
) {
|
|
$this->assertNotEmpty('firstname', $firstname);
|
|
$this->assertNotEmpty('lastname', $lastname);
|
|
}
|
|
|
|
private function assertNotEmpty(string $attribute, string $value): void
|
|
{
|
|
if (empty(trim($value))) {
|
|
throw new \DomainException("{$attribute} cannot be empty");
|
|
}
|
|
}
|
|
}
|