fix enrollment logic, add financial aid, fix class distribution
Tests / PHPUnit (push) Failing after 1m6s
Tests / PHPUnit (push) Failing after 1m6s
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class EnrollmentExceptionModel extends Model
|
||||
{
|
||||
protected $table = 'enrollment_exceptions';
|
||||
protected $primaryKey = 'id';
|
||||
protected $returnType = 'array';
|
||||
protected $useTimestamps = true;
|
||||
|
||||
protected $allowedFields = [
|
||||
'parent_id',
|
||||
'student_id',
|
||||
'school_year',
|
||||
'source_school_year',
|
||||
'status',
|
||||
'reason_code',
|
||||
'reason_note',
|
||||
'bypassed_rule_codes_json',
|
||||
'created_by',
|
||||
'approved_by',
|
||||
'starts_at',
|
||||
'expires_at',
|
||||
'used_at',
|
||||
'enrollment_id',
|
||||
'revoked_at',
|
||||
'revoked_by',
|
||||
'revocation_reason',
|
||||
'family_student_ids_json',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
protected $validationRules = [
|
||||
'parent_id' => 'required|integer',
|
||||
'student_id' => 'required|integer',
|
||||
'school_year' => 'required|string|max_length[20]',
|
||||
'source_school_year' => 'permit_empty|string|max_length[20]',
|
||||
'status' => 'required|in_list[active,used,revoked,expired]',
|
||||
'reason_code' => 'required|string|max_length[80]',
|
||||
'reason_note' => 'required|string',
|
||||
'created_by' => 'permit_empty|integer',
|
||||
'approved_by' => 'permit_empty|integer',
|
||||
'enrollment_id' => 'permit_empty|integer',
|
||||
'revoked_by' => 'permit_empty|integer',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class FinancialAidRequestModel extends Model
|
||||
{
|
||||
protected $table = 'financial_aid_requests';
|
||||
protected $primaryKey = 'id';
|
||||
protected $returnType = 'array';
|
||||
protected $useTimestamps = true;
|
||||
|
||||
protected $allowedFields = [
|
||||
'parent_id',
|
||||
'school_year',
|
||||
'student_ids_json',
|
||||
'household_size',
|
||||
'need_statement',
|
||||
'requested_amount',
|
||||
'status',
|
||||
'admin_amount',
|
||||
'admin_note',
|
||||
'reviewed_by',
|
||||
'reviewed_at',
|
||||
'invoice_id',
|
||||
'discount_usage_id',
|
||||
'voucher_id',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
];
|
||||
|
||||
public function openRequestForParent(int $parentId, string $schoolYear): ?array
|
||||
{
|
||||
return $this->where('parent_id', $parentId)
|
||||
->where('school_year', $schoolYear)
|
||||
->whereIn('status', ['submitted', 'under_review'])
|
||||
->orderBy('id', 'DESC')
|
||||
->first();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user