refactor(arch): enforce gateway compliance and remove service-wrapping gateways
This commit is contained in:
@@ -2,10 +2,14 @@
|
||||
|
||||
namespace MintyPHP\Service\Import\Profile;
|
||||
|
||||
use MintyPHP\Service\Org\DepartmentService;
|
||||
|
||||
class DepartmentImportProfile implements ImportProfileInterface
|
||||
{
|
||||
public function __construct(private readonly DepartmentImportGateway $gateway)
|
||||
{
|
||||
public function __construct(
|
||||
private readonly DepartmentImportGateway $gateway,
|
||||
private readonly DepartmentService $departmentService
|
||||
) {
|
||||
}
|
||||
|
||||
public function key(): string
|
||||
@@ -139,7 +143,7 @@ class DepartmentImportProfile implements ImportProfileInterface
|
||||
return ['status' => 'skipped', 'code' => 'department_exists'];
|
||||
}
|
||||
|
||||
$result = $this->gateway->createDepartmentFromAdmin([
|
||||
$result = $this->departmentService->createFromAdmin([
|
||||
'description' => (string) ($normalized['description'] ?? ''),
|
||||
'tenant_id' => (int) ($normalized['tenant_id'] ?? 0),
|
||||
'code' => (string) ($normalized['code'] ?? ''),
|
||||
|
||||
Reference in New Issue
Block a user