fix logic and tests, update docker CI file

This commit is contained in:
root
2026-03-09 15:58:44 -04:00
parent 1cb3573d4b
commit 79e44fe037
188 changed files with 1776 additions and 524 deletions
@@ -55,21 +55,17 @@ class AttendanceNotificationLogService
?string $schoolYear = null
): void {
try {
$where = [
'student_id' => $studentId,
'code' => $code,
'incident_date' => $ymd,
'channel' => $channel,
];
$existingQuery = $this->notificationModel->query()
->where('student_id', $studentId)
->where('code', $code)
->whereDate('incident_date', $ymd)
->where('channel', $channel);
if (!empty($to)) {
$where['to_address'] = $to;
$existingQuery->where('to_address', $to);
}
$existing = $this->notificationModel->query()
->where($where)
->orderByDesc('id')
->first();
$existing = $existingQuery->orderByDesc('id')->first();
if ($existing && !empty($existing->id)) {
$existing->update([
@@ -98,4 +94,4 @@ class AttendanceNotificationLogService
Log::debug('logNotification(): ' . $e->getMessage());
}
}
}
}