fix enrollment logic, add financial aid, fix class distribution
Tests / PHPUnit (push) Failing after 1m6s

This commit is contained in:
root
2026-08-15 15:07:16 -04:00
parent c12bb59372
commit 4603d9ced2
95 changed files with 6892 additions and 1295 deletions
@@ -0,0 +1,48 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateEnrollmentExceptions extends Migration
{
public function up()
{
if ($this->db->tableExists('enrollment_exceptions')) {
return;
}
$this->forge->addField([
'id' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'auto_increment' => true],
'parent_id' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true],
'student_id' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true],
'school_year' => ['type' => 'VARCHAR', 'constraint' => 20],
'source_school_year' => ['type' => 'VARCHAR', 'constraint' => 20, 'null' => true],
'status' => ['type' => 'VARCHAR', 'constraint' => 20, 'default' => 'active'],
'reason_code' => ['type' => 'VARCHAR', 'constraint' => 80],
'reason_note' => ['type' => 'TEXT'],
'bypassed_rule_codes_json' => ['type' => 'TEXT', 'null' => true],
'created_by' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'null' => true],
'approved_by' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'null' => true],
'starts_at' => ['type' => 'DATETIME', 'null' => true],
'expires_at' => ['type' => 'DATETIME', 'null' => true],
'used_at' => ['type' => 'DATETIME', 'null' => true],
'enrollment_id' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'null' => true],
'revoked_at' => ['type' => 'DATETIME', 'null' => true],
'revoked_by' => ['type' => 'INT', 'constraint' => 11, 'unsigned' => true, 'null' => true],
'revocation_reason' => ['type' => 'TEXT', 'null' => true],
'created_at' => ['type' => 'DATETIME', 'null' => true],
'updated_at' => ['type' => 'DATETIME', 'null' => true],
]);
$this->forge->addKey('id', true);
$this->forge->addKey(['parent_id', 'student_id', 'school_year', 'status'], false, false, 'idx_enrollment_exceptions_scope_status');
$this->forge->addKey(['student_id', 'school_year'], false, false, 'idx_enrollment_exceptions_student_year');
$this->forge->addKey(['status', 'expires_at'], false, false, 'idx_enrollment_exceptions_status_expiry');
$this->forge->createTable('enrollment_exceptions', true);
}
public function down()
{
$this->forge->dropTable('enrollment_exceptions', true);
}
}