Fixed many feature failures around preferences, route coverage, administrator enrollment, assignment section names, attendance tracking controller access, finance PDF generation, and finance notification logging.
API CI/CD / Validate (composer + pint) (push) Successful in 3m15s
API CI/CD / Test (PHPUnit) (push) Failing after 5m4s
API CI/CD / Build frontend assets (push) Successful in 1m3s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
API CI/CD / Validate (composer + pint) (push) Successful in 3m15s
API CI/CD / Test (PHPUnit) (push) Failing after 5m4s
API CI/CD / Build frontend assets (push) Successful in 1m3s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
This commit is contained in:
@@ -8,6 +8,18 @@ class BaseModel extends Model
|
||||
{
|
||||
private static ?array $tableColumnsCache = null;
|
||||
|
||||
public function __construct(array $attributes = [])
|
||||
{
|
||||
$keyName = $this->getKeyName();
|
||||
$keyValue = $attributes[$keyName] ?? null;
|
||||
|
||||
parent::__construct($attributes);
|
||||
|
||||
if ($keyValue !== null && ! array_key_exists($keyName, $this->attributes)) {
|
||||
$this->setAttribute($keyName, $keyValue);
|
||||
}
|
||||
}
|
||||
|
||||
public function getFillable(): array
|
||||
{
|
||||
$fillable = parent::getFillable();
|
||||
|
||||
@@ -17,8 +17,7 @@ class EventCharges extends BaseModel
|
||||
'event_id' => 'integer',
|
||||
'parent_id' => 'integer',
|
||||
'student_id' => 'integer',
|
||||
'participation' => 'boolean', // change if stored as string/enum
|
||||
'charged' => 'boolean', // change if stored as string/enum
|
||||
'charged' => 'float',
|
||||
'updated_by' => 'integer',
|
||||
];
|
||||
|
||||
|
||||
@@ -4,7 +4,24 @@ namespace App\Models;
|
||||
|
||||
class FinanceNotificationLog extends BaseModel
|
||||
{
|
||||
protected $guarded = [];
|
||||
|
||||
protected $table = 'finance_notification_logs';
|
||||
|
||||
protected $fillable = [
|
||||
'parent_id',
|
||||
'student_id',
|
||||
'invoice_id',
|
||||
'payment_id',
|
||||
'refund_id',
|
||||
'event_charge_id',
|
||||
'installment_id',
|
||||
'notification_type',
|
||||
'channel',
|
||||
'recipient',
|
||||
'subject',
|
||||
'status',
|
||||
'sent_at',
|
||||
'failed_at',
|
||||
'error_message',
|
||||
'created_by',
|
||||
];
|
||||
}
|
||||
|
||||
+12
-5
@@ -186,11 +186,18 @@ class Student extends BaseModel
|
||||
|
||||
// Students are global identities; year rosters come from yearly class/enrollment rows.
|
||||
if ($schoolYear !== null && strtolower($schoolYear) !== 'all') {
|
||||
$q->whereExists(function ($sub) use ($schoolYear) {
|
||||
$sub->selectRaw('1')
|
||||
->from('student_class as sc')
|
||||
->whereColumn('sc.student_id', 'students.id')
|
||||
->where('sc.school_year', $schoolYear);
|
||||
$q->where(function ($yearQuery) use ($schoolYear) {
|
||||
$yearQuery->whereExists(function ($sub) use ($schoolYear) {
|
||||
$sub->selectRaw('1')
|
||||
->from('student_class as sc')
|
||||
->whereColumn('sc.student_id', 'students.id')
|
||||
->where('sc.school_year', $schoolYear);
|
||||
})->orWhereExists(function ($sub) use ($schoolYear) {
|
||||
$sub->selectRaw('1')
|
||||
->from('enrollments as e')
|
||||
->whereColumn('e.student_id', 'students.id')
|
||||
->where('e.school_year', $schoolYear);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ class User extends Authenticatable implements JWTSubject
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'school_id' => 'integer',
|
||||
'school_id' => 'string',
|
||||
'failed_attempts' => 'integer',
|
||||
'last_failed_at' => 'datetime',
|
||||
'accept_school_policy' => 'boolean',
|
||||
|
||||
Reference in New Issue
Block a user