inti project
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'default_status' => 'unknown',
|
||||
'controllers' => [
|
||||
App\Http\Controllers\Api\V2\Students\StudentController::class => [
|
||||
'status' => 'canonical',
|
||||
'module' => 'students',
|
||||
'risk' => 'high',
|
||||
'contract' => App\Domain\SchoolCore\Students\Contracts\StudentServiceContract::class,
|
||||
],
|
||||
App\Http\Controllers\Api\V2\Finance\PaymentController::class => [
|
||||
'status' => 'canonical',
|
||||
'module' => 'finance',
|
||||
'risk' => 'critical',
|
||||
'contract' => App\Domain\SchoolCore\Finance\Contracts\PaymentServiceContract::class,
|
||||
],
|
||||
App\Http\Controllers\Api\V2\Finance\PaymentFileController::class => [
|
||||
'status' => 'canonical',
|
||||
'module' => 'finance',
|
||||
'risk' => 'critical',
|
||||
'contract' => App\Domain\SchoolCore\Finance\Contracts\FinanceFileServiceContract::class,
|
||||
],
|
||||
App\Http\Controllers\Api\V2\Attendance\ScanController::class => [
|
||||
'status' => 'canonical',
|
||||
'module' => 'attendance',
|
||||
'risk' => 'high',
|
||||
'contract' => App\Domain\SchoolCore\Attendance\Contracts\ScannerServiceContract::class,
|
||||
],
|
||||
App\Http\Controllers\Api\V2\Communication\RecipientPreviewController::class => [
|
||||
'status' => 'canonical',
|
||||
'module' => 'communication',
|
||||
'risk' => 'high',
|
||||
'contract' => App\Domain\SchoolCore\Communication\Contracts\RecipientPreviewServiceContract::class,
|
||||
],
|
||||
App\Http\Controllers\Api\V2\Communication\BulkSendController::class => [
|
||||
'status' => 'canonical',
|
||||
'module' => 'communication',
|
||||
'risk' => 'critical',
|
||||
'contract' => App\Domain\SchoolCore\Communication\Contracts\CommunicationServiceContract::class,
|
||||
],
|
||||
App\Http\Controllers\Api\V2\Reporting\ReportController::class => [
|
||||
'status' => 'canonical',
|
||||
'module' => 'reporting',
|
||||
'risk' => 'high',
|
||||
'contract' => App\Domain\SchoolCore\Reporting\Contracts\ReportRunnerContract::class,
|
||||
],
|
||||
App\Http\Controllers\Api\V2\IslamicSundaySchool\QuranProgressController::class => [
|
||||
'status' => 'extension',
|
||||
'module' => 'islamic_sunday_school',
|
||||
'risk' => 'high',
|
||||
'domain_profile' => 'islamic_sunday_school',
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,120 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'mode' => env('ARCHITECTURE_GOVERNANCE_MODE', 'warning'),
|
||||
'controller_thresholds' => [
|
||||
'max_class_lines' => 250,
|
||||
'max_action_lines' => 40,
|
||||
'private_methods' => 'discouraged',
|
||||
],
|
||||
'service_context_required_modules' => [
|
||||
'app/Domain/SchoolCore/Finance/Services',
|
||||
'app/Domain/SchoolCore/Attendance/Services',
|
||||
'app/Domain/SchoolCore/Students/Services',
|
||||
'app/Domain/SchoolCore/Communication/Services',
|
||||
'app/Domain/SchoolCore/Reporting/Services',
|
||||
'app/Domain/IslamicSundaySchool',
|
||||
],
|
||||
'rules' => [
|
||||
[
|
||||
'id' => 'ARCH-001',
|
||||
'description' => 'SchoolCore must not import IslamicSundaySchool.',
|
||||
'severity' => 'error',
|
||||
'paths' => ['app/Domain/SchoolCore'],
|
||||
'patterns' => ['App\\\\Domain\\\\IslamicSundaySchool', 'IslamicSundaySchool\\\\'],
|
||||
'message' => 'SchoolCore references IslamicSundaySchool. Extension dependencies only go the other direction.',
|
||||
'suggested_fix' => 'Move behavior behind a SchoolCore contract and bind the IslamicSundaySchool implementation in an extension provider.',
|
||||
],
|
||||
[
|
||||
'id' => 'ARCH-002',
|
||||
'description' => 'Domain services must not use HTTP/global request state.',
|
||||
'severity' => 'error',
|
||||
'paths' => ['app/Domain'],
|
||||
'patterns' => ['Illuminate\\\\Http\\\\Request', '\bauth\s*\(', '\brequest\s*\(', '\bsession\s*\(', '\$_GET', '\$_POST', '\$_SERVER'],
|
||||
'message' => 'Domain code is reading HTTP/global state directly.',
|
||||
'suggested_fix' => 'Pass SchoolContext and validated DTOs from the controller/application layer.',
|
||||
],
|
||||
[
|
||||
'id' => 'ARCH-003',
|
||||
'description' => 'Controllers must not perform domain DB mutations.',
|
||||
'severity' => 'warning',
|
||||
'paths' => ['app/Http/Controllers'],
|
||||
'patterns' => ['DB::table', '->update\s*\(', '->delete\s*\(', '::query\s*\(\)->update'],
|
||||
'message' => 'Controller appears to perform direct persistence logic.',
|
||||
'suggested_fix' => 'Move mutation into a domain service contract.',
|
||||
],
|
||||
[
|
||||
'id' => 'ARCH-004',
|
||||
'description' => 'Controllers must not call external providers directly.',
|
||||
'severity' => 'error',
|
||||
'paths' => ['app/Http/Controllers'],
|
||||
'patterns' => ['Mail::', 'Notification::send', 'Twilio', 'WhatsApp', 'Vonage', 'Nexmo'],
|
||||
'message' => 'Controller calls a provider directly.',
|
||||
'suggested_fix' => 'Use Communication channel contracts/adapters.',
|
||||
],
|
||||
[
|
||||
'id' => 'ARCH-005',
|
||||
'description' => 'Core contracts must not contain extension vocabulary.',
|
||||
'severity' => 'error',
|
||||
'paths' => ['app/Domain/SchoolCore'],
|
||||
'patterns' => ['Islamic', 'Quran', "Qur'an", 'ArabicLevel', 'Halaqa', 'Masjid', 'Imam', 'Sadaqah', 'Zakat', 'SundaySchool'],
|
||||
'message' => 'Extension vocabulary leaked into SchoolCore.',
|
||||
'suggested_fix' => 'Move the term into IslamicSundaySchool extension code or neutralize the core contract name.',
|
||||
'exclude_paths' => ['README.md'],
|
||||
],
|
||||
[
|
||||
'id' => 'FIN-001',
|
||||
'description' => 'Finance module must not use float math.',
|
||||
'severity' => 'error',
|
||||
'paths' => ['app/Domain/SchoolCore/Finance'],
|
||||
'patterns' => ['\(float\)', 'floatval\s*\('],
|
||||
'message' => 'Finance code uses float math.',
|
||||
'suggested_fix' => 'Use Money or integer minor units.',
|
||||
],
|
||||
[
|
||||
'id' => 'FIN-002',
|
||||
'description' => 'Payment files must not be served by filename-only route.',
|
||||
'severity' => 'error',
|
||||
'paths' => ['routes', 'app/Http/Controllers'],
|
||||
'patterns' => ['payment.*\{filename\}', 'serveCheckFile\s*\(\$filename', 'response\(\)->download'],
|
||||
'message' => 'Possible unsafe filename-based payment file access.',
|
||||
'suggested_fix' => 'Route through FinanceFileServiceContract using payment ID or file ID.',
|
||||
],
|
||||
[
|
||||
'id' => 'STU-001',
|
||||
'description' => 'Student identifier must not use max(id)+1.',
|
||||
'severity' => 'error',
|
||||
'paths' => ['app'],
|
||||
'patterns' => ['max\s*\(\s*[\'\"]id[\'\"]\s*\)', 'MAX\(id\)'],
|
||||
'message' => 'Potential unsafe max(id)+1 identifier generation.',
|
||||
'suggested_fix' => 'Generate identifiers after insert through StudentIdentifierGeneratorContract and enforce a unique constraint.',
|
||||
],
|
||||
[
|
||||
'id' => 'COM-001',
|
||||
'description' => 'Bulk sends must require preview.',
|
||||
'severity' => 'error',
|
||||
'paths' => ['app/Http/Controllers', 'routes'],
|
||||
'patterns' => ['bulk.*send.*without.*preview', 'sendBulkMessage\s*\([^;]*new\s+BulkSendMessageData'],
|
||||
'message' => 'Bulk send path may bypass recipient preview.',
|
||||
'suggested_fix' => 'Require RecipientPreviewServiceContract preview_id and confirmation_token.',
|
||||
],
|
||||
[
|
||||
'id' => 'REP-001',
|
||||
'description' => 'Report exports must be audited.',
|
||||
'severity' => 'warning',
|
||||
'paths' => ['app/Domain/SchoolCore/Reporting', 'app/Http/Controllers/Api/V2/Reporting'],
|
||||
'patterns' => ['export\s*\(', 'ReportExport'],
|
||||
'message' => 'Report export path should be reviewed for authorization and audit logging.',
|
||||
'suggested_fix' => 'Use ReportExportServiceContract and ReportAuditLoggerContract.',
|
||||
],
|
||||
[
|
||||
'id' => 'EXT-001',
|
||||
'description' => 'Islamic extension routes require domain profile middleware.',
|
||||
'severity' => 'error',
|
||||
'paths' => ['routes'],
|
||||
'patterns' => ['islamic-sunday-school'],
|
||||
'message' => 'Islamic Sunday School route must include ensure.domain.profile middleware.',
|
||||
'suggested_fix' => 'Add ensure.domain.profile:islamic_sunday_school to the route group.',
|
||||
],
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'default_environment' => env('MODULAR_RELEASE_ENVIRONMENT', env('APP_ENV', 'local')),
|
||||
'flags' => [
|
||||
'school_context.enabled' => ['owner' => 'platform', 'default' => true, 'removal_target' => null],
|
||||
'core_contracts.enabled' => ['owner' => 'platform', 'default' => true, 'removal_target' => null],
|
||||
'finance.modular_payments.enabled' => ['owner' => 'finance', 'default' => false, 'removal_target' => '2026-12-31'],
|
||||
'finance.modular_file_access.enabled' => ['owner' => 'finance', 'default' => true, 'removal_target' => '2026-09-30'],
|
||||
'attendance.modular_scanner.enabled' => ['owner' => 'attendance', 'default' => false, 'removal_target' => '2026-12-31'],
|
||||
'attendance.modular_manual_override.enabled' => ['owner' => 'attendance', 'default' => false, 'removal_target' => '2026-12-31'],
|
||||
'students.modular_creation.enabled' => ['owner' => 'students', 'default' => false, 'removal_target' => '2026-12-31'],
|
||||
'students.modular_enrollment.enabled' => ['owner' => 'students', 'default' => false, 'removal_target' => '2026-12-31'],
|
||||
'communication.preview_required.enabled' => ['owner' => 'communication', 'default' => true, 'removal_target' => '2026-09-30'],
|
||||
'communication.modular_send.enabled' => ['owner' => 'communication', 'default' => false, 'removal_target' => '2026-12-31'],
|
||||
'reporting.modular_reports.enabled' => ['owner' => 'reporting', 'default' => false, 'removal_target' => '2027-01-31'],
|
||||
'api.v2.enabled' => ['owner' => 'api', 'default' => false, 'removal_target' => null],
|
||||
'islamic_sunday_school.extension.enabled' => ['owner' => 'islamic-sunday-school', 'default' => true, 'removal_target' => null],
|
||||
'boundary_enforcement.fail_ci.enabled' => ['owner' => 'platform', 'default' => false, 'removal_target' => '2026-10-31'],
|
||||
],
|
||||
'rollout_tracks' => ['internal', 'staging', 'pilot', 'islamic_sunday_school_production', 'broader_rollout', 'legacy_removal'],
|
||||
'validation' => [
|
||||
'output_path' => storage_path('app/generated/release-validation'),
|
||||
'shadow_output_path' => storage_path('app/generated/shadow-comparisons'),
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'SchoolContext' => ['owner' => 'Platform owner', 'reviewers' => ['platform']],
|
||||
'Core Contracts' => ['owner' => 'Platform owner', 'reviewers' => ['platform']],
|
||||
'Finance' => ['owner' => 'Finance domain owner', 'reviewers' => ['finance', 'platform', 'security']],
|
||||
'Attendance' => ['owner' => 'Attendance domain owner', 'reviewers' => ['attendance', 'platform']],
|
||||
'Students' => ['owner' => 'Student lifecycle owner', 'reviewers' => ['students', 'platform', 'security']],
|
||||
'Communication' => ['owner' => 'Communication owner', 'reviewers' => ['communication', 'platform', 'security']],
|
||||
'Reporting' => ['owner' => 'Reporting owner', 'reviewers' => ['reporting', 'data-security']],
|
||||
'IslamicSundaySchool' => ['owner' => 'Islamic Sunday School domain owner', 'reviewers' => ['islamic-sunday-school', 'platform']],
|
||||
'API/Controllers' => ['owner' => 'API owner', 'reviewers' => ['api', 'module-owner']],
|
||||
'Security/Auth' => ['owner' => 'Security owner', 'reviewers' => ['security']],
|
||||
];
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'critical_flags' => [
|
||||
'finance.modular_file_access.enabled',
|
||||
'communication.preview_required.enabled',
|
||||
'islamic_sunday_school.extension.enabled',
|
||||
],
|
||||
'required_artifacts' => [
|
||||
'docs/release/feature-flag-rollout-map.md',
|
||||
'docs/release/rollback-playbooks.md',
|
||||
'docs/release/uat-scenarios.md',
|
||||
'docs/release/support-playbooks.md',
|
||||
'docs/release/production-readiness-review.md',
|
||||
'docs/release/post-release-review-template.md',
|
||||
'storage/app/generated/release-validation/validation-summary.json',
|
||||
],
|
||||
'unsafe_legacy_routes' => [
|
||||
'filename_based_payment_file_download',
|
||||
'blind_bulk_send',
|
||||
'unsafe_student_identifier_generation',
|
||||
'legacy_scanner_mutation',
|
||||
],
|
||||
];
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use App\Domain\SchoolCore\Context\SchoolContext;
|
||||
|
||||
return [
|
||||
'defaults' => [
|
||||
'timezone' => env('SCHOOL_CONTEXT_TIMEZONE', 'UTC'),
|
||||
'locale' => env('SCHOOL_CONTEXT_LOCALE', 'en'),
|
||||
'currency' => env('SCHOOL_CONTEXT_CURRENCY', 'USD'),
|
||||
'domain_profile' => env('SCHOOL_CONTEXT_DOMAIN_PROFILE', SchoolContext::DOMAIN_STANDARD_SCHOOL),
|
||||
],
|
||||
|
||||
'supported_domain_profiles' => [
|
||||
SchoolContext::DOMAIN_STANDARD_SCHOOL,
|
||||
SchoolContext::DOMAIN_ISLAMIC_SUNDAY_SCHOOL,
|
||||
SchoolContext::DOMAIN_TRAINING_CENTER,
|
||||
],
|
||||
|
||||
'supported_locales' => ['en', 'ar'],
|
||||
|
||||
// Keep false outside controlled test/dev tooling.
|
||||
'allow_domain_profile_header' => env('SCHOOL_CONTEXT_ALLOW_DOMAIN_PROFILE_HEADER', false),
|
||||
|
||||
'models' => [
|
||||
'school' => env('SCHOOL_MODEL', App\Models\School::class),
|
||||
'configuration' => env('CONFIGURATION_MODEL', App\Models\Configuration::class),
|
||||
'student' => env('STUDENT_MODEL', App\Models\Student::class),
|
||||
],
|
||||
|
||||
// Use only during migration. Remove after academic period tables are reliable.
|
||||
'extensions' => [
|
||||
'islamic_sunday_school' => [
|
||||
'students' => false,
|
||||
'enabled' => env('ISLAMIC_SUNDAY_SCHOOL_EXTENSION_ENABLED', false),
|
||||
],
|
||||
],
|
||||
|
||||
'legacy_fallbacks' => [
|
||||
'school_year' => env('LEGACY_SCHOOL_YEAR'),
|
||||
'semester' => env('LEGACY_SEMESTER'),
|
||||
],
|
||||
'finance' => [
|
||||
'payment_files_disk' => env('FINANCE_PAYMENT_FILES_DISK', 'local'),
|
||||
],
|
||||
];
|
||||
Reference in New Issue
Block a user