update project
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
use DateTimeInterface;
|
||||
|
||||
interface AcademicCalendarProviderContract
|
||||
{
|
||||
public function currentAcademicYear(SchoolContext $context): ?int;
|
||||
public function currentTerm(SchoolContext $context): ?int;
|
||||
|
||||
/** @return array<int, array<string, mixed>> */
|
||||
public function sessionsForDate(SchoolContext $context, DateTimeInterface $date): array;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
use DateTimeInterface;
|
||||
|
||||
interface AttendancePolicyContract
|
||||
{
|
||||
public function isSchoolDay(SchoolContext $context, DateTimeInterface $date): bool;
|
||||
|
||||
/** @param array<string, mixed> $session */
|
||||
public function determineStatus(SchoolContext $context, DateTimeInterface $scanTime, array $session): string;
|
||||
|
||||
public function duplicateScanWindowSeconds(SchoolContext $context): int;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Attendance\Data\AttendanceMarkData;
|
||||
use App\Domain\SchoolCore\Attendance\Data\AttendanceResult;
|
||||
use App\Domain\SchoolCore\Attendance\Data\AttendanceScanData;
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
|
||||
interface AttendanceServiceContract
|
||||
{
|
||||
public function markStudent(SchoolContext $context, AttendanceMarkData $data): AttendanceResult;
|
||||
public function processScan(SchoolContext $context, AttendanceScanData $data): AttendanceResult;
|
||||
|
||||
/** @return array<string, mixed> */
|
||||
public function summarizeDay(SchoolContext $context, string $date): array;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
|
||||
interface CommunicationPreferencePolicyContract
|
||||
{
|
||||
public function mayContact(SchoolContext $context, int $recipientId, string $channel, string $purpose): bool;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Communication\Data\MessageData;
|
||||
use App\Domain\SchoolCore\Communication\Data\RecipientQuery;
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
|
||||
interface CommunicationServiceContract
|
||||
{
|
||||
/** @return array<int, mixed> */
|
||||
public function previewRecipients(SchoolContext $context, RecipientQuery $query): array;
|
||||
|
||||
/** @return array<string, mixed> */
|
||||
public function send(SchoolContext $context, MessageData $message): array;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
use App\Domain\SchoolCore\Enrollment\Data\EnrollmentData;
|
||||
|
||||
interface EnrollmentServiceContract
|
||||
{
|
||||
public function enroll(SchoolContext $context, int $studentId, EnrollmentData $data): void;
|
||||
public function transfer(SchoolContext $context, int $studentId, EnrollmentData $data): void;
|
||||
public function withdraw(SchoolContext $context, int $studentId, string $reason): void;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
|
||||
interface FileAccessPolicyContract
|
||||
{
|
||||
/** @param array<string, mixed> $metadata */
|
||||
public function canAccess(SchoolContext $context, string $filePurpose, int $ownerId, array $metadata = []): bool;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
|
||||
interface FileStorageServiceContract
|
||||
{
|
||||
/** @param array<string, mixed> $metadata */
|
||||
public function store(SchoolContext $context, string $purpose, mixed $file, array $metadata = []): string;
|
||||
public function resolvePath(SchoolContext $context, string $fileReference): string;
|
||||
public function delete(SchoolContext $context, string $fileReference): void;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
|
||||
interface GradeScalePolicyContract
|
||||
{
|
||||
public function gradeForScore(SchoolContext $context, float $score): string;
|
||||
public function passingScore(SchoolContext $context): float;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
use App\Domain\SchoolCore\Guardians\Data\GuardianRelationshipData;
|
||||
|
||||
interface GuardianServiceContract
|
||||
{
|
||||
public function attachGuardian(SchoolContext $context, int $studentId, GuardianRelationshipData $data): void;
|
||||
public function detachGuardian(SchoolContext $context, int $studentId, int $guardianId): void;
|
||||
|
||||
/** @return array<int, mixed> */
|
||||
public function listForStudent(SchoolContext $context, int $studentId): array;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
use App\Domain\SchoolCore\Finance\Data\CreateInvoiceData;
|
||||
use App\Domain\SchoolCore\Finance\Data\InvoiceReadModel;
|
||||
|
||||
interface InvoiceServiceContract
|
||||
{
|
||||
public function create(SchoolContext $context, CreateInvoiceData $data): InvoiceReadModel;
|
||||
public function recalculate(SchoolContext $context, int $invoiceId): InvoiceReadModel;
|
||||
public function find(SchoolContext $context, int $invoiceId): ?InvoiceReadModel;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
|
||||
interface PaymentAllocationPolicyContract
|
||||
{
|
||||
/** @return array<int, array<string, mixed>> */
|
||||
public function allocate(SchoolContext $context, int $invoiceId, float $amount): array;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
use App\Domain\SchoolCore\Finance\Data\EditPaymentData;
|
||||
use App\Domain\SchoolCore\Finance\Data\PaymentReadModel;
|
||||
use App\Domain\SchoolCore\Finance\Data\RecordPaymentData;
|
||||
|
||||
interface PaymentServiceContract
|
||||
{
|
||||
public function record(SchoolContext $context, RecordPaymentData $data): PaymentReadModel;
|
||||
public function edit(SchoolContext $context, int $paymentId, EditPaymentData $data): PaymentReadModel;
|
||||
public function void(SchoolContext $context, int $paymentId, string $reason): void;
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
|
||||
interface PromotionPolicyContract
|
||||
{
|
||||
public function canPromote(SchoolContext $context, int $studentId): bool;
|
||||
|
||||
/** @return array<string, mixed> */
|
||||
public function nextPlacement(SchoolContext $context, int $studentId): array;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Communication\Data\RecipientQuery;
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
|
||||
interface RecipientResolverContract
|
||||
{
|
||||
/** @return array<int, mixed> */
|
||||
public function resolve(SchoolContext $context, RecipientQuery $query): array;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
|
||||
interface ReportServiceContract
|
||||
{
|
||||
/** @param array<string, mixed> $filters @return array<string, mixed> */
|
||||
public function generate(SchoolContext $context, string $reportKey, array $filters = []): array;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
/**
|
||||
* Marker interface for services/commands that require an explicit SchoolContext.
|
||||
*/
|
||||
interface RequiresSchoolContext
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
|
||||
interface StudentIdentifierGeneratorContract
|
||||
{
|
||||
/**
|
||||
* Generate a context-aware external student identifier after the database row exists.
|
||||
*/
|
||||
public function generate(SchoolContext $context, int $studentId): string;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Domain\SchoolCore\Contracts;
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
use App\Domain\SchoolCore\Students\Data\CreateStudentData;
|
||||
use App\Domain\SchoolCore\Students\Data\StudentReadModel;
|
||||
use App\Domain\SchoolCore\Students\Data\UpdateStudentData;
|
||||
|
||||
interface StudentServiceContract
|
||||
{
|
||||
/**
|
||||
* Authorization: caller must be allowed to create students in the selected context.
|
||||
* Transaction: implementation owns the transaction and identifier assignment.
|
||||
*/
|
||||
public function create(SchoolContext $context, CreateStudentData $data): StudentReadModel;
|
||||
|
||||
/** Authorization: caller must be allowed to edit the selected student. */
|
||||
public function update(SchoolContext $context, int $studentId, UpdateStudentData $data): StudentReadModel;
|
||||
|
||||
/** Authorization: result must be scoped to the selected context. */
|
||||
public function find(SchoolContext $context, int $studentId): ?StudentReadModel;
|
||||
|
||||
/** Transaction: implementation owns the archive mutation. */
|
||||
public function archive(SchoolContext $context, int $studentId, string $reason): void;
|
||||
}
|
||||
Reference in New Issue
Block a user