- Add single-line class docblocks to all 59 repository classes and interfaces describing scope and responsibility - Add multi-line docblocks to key services documenting business rules: AuthService (6-step login cascade), ImportService (3-phase CSV workflow), TenantScopeService (strict/permissive modes), PermissionService (RBAC resolution + two-tier caching), UserAccountService (atomicity + audit) - Add transaction(callable) wrapper to DatabaseSessionRepository to DRY up begin/commit/rollback boilerplate Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace MintyPHP\Repository\Org;
|
|
|
|
/** Contract for department CRUD, existence checks, and filtered listing. */
|
|
interface DepartmentRepositoryInterface
|
|
{
|
|
public function list(): array;
|
|
|
|
public function listIds(): array;
|
|
|
|
public function listActiveIdsByTenantIds(array $tenantIds): array;
|
|
|
|
public function listByTenantIds(array $tenantIds): array;
|
|
|
|
public function listByIds(array $departmentIds, bool $includeInactive = false): array;
|
|
|
|
public function listPaged(array $options): array;
|
|
|
|
public function find(int $id): ?array;
|
|
|
|
public function findByUuid(string $uuid): ?array;
|
|
|
|
public function existsByCode(string $code, int $excludeId = 0): bool;
|
|
|
|
public function existsByTenantAndDescription(int $tenantId, string $description, int $excludeId = 0): bool;
|
|
|
|
public function countByTenantId(int $tenantId): int;
|
|
|
|
public function create(array $data): mixed;
|
|
|
|
public function update(int $id, array $data): bool;
|
|
|
|
public function setTenant(int $id, int $tenantId): bool;
|
|
|
|
public function delete(int $id): bool;
|
|
}
|