Files
breadcrumb-the-shire/lib/Service/Import/Profile/DepartmentImportGateway.php

36 lines
996 B
PHP
Raw Normal View History

2026-02-23 12:58:19 +01:00
<?php
namespace MintyPHP\Service\Import\Profile;
2026-03-05 08:26:51 +01:00
use MintyPHP\Repository\Org\DepartmentRepositoryInterface;
use MintyPHP\Repository\Tenant\TenantRepositoryInterface;
2026-02-23 12:58:19 +01:00
class DepartmentImportGateway
{
public function __construct(
2026-03-05 08:26:51 +01:00
private readonly DepartmentRepositoryInterface $departmentRepository,
private readonly TenantRepositoryInterface $tenantRepository
2026-02-23 12:58:19 +01:00
) {
}
public function findTenantByUuid(string $uuid): ?array
{
return $this->tenantRepository->findByUuid($uuid);
2026-02-23 12:58:19 +01:00
}
public function findTenantById(int $id): ?array
{
return $this->tenantRepository->find($id);
2026-02-23 12:58:19 +01:00
}
public function existsDepartmentCode(string $code): bool
{
return $this->departmentRepository->existsByCode($code);
2026-02-23 12:58:19 +01:00
}
public function existsDepartmentByTenantAndDescription(int $tenantId, string $description): bool
{
return $this->departmentRepository->existsByTenantAndDescription($tenantId, $description);
2026-02-23 12:58:19 +01:00
}
}