fix gitlab tests

This commit is contained in:
root
2026-06-09 02:32:58 -04:00
parent 20a0b6c4e5
commit 6def9993da
1489 changed files with 10449 additions and 11356 deletions
@@ -10,7 +10,8 @@ class AttendanceNotificationLogService
{
public function __construct(
protected ParentNotification $notificationModel
) {}
) {
}
public function notificationAlreadySent(
int $studentId,
@@ -30,14 +31,13 @@ class AttendanceNotificationLogService
->where('incident_date', $ymd)
->where('channel', $channel);
if (! empty($to)) {
if (!empty($to)) {
$query->where('to_address', $to);
}
return $query->exists();
} catch (Throwable $e) {
Log::debug('notificationAlreadySent(): '.$e->getMessage());
Log::debug('notificationAlreadySent(): ' . $e->getMessage());
return false;
}
}
@@ -61,37 +61,37 @@ class AttendanceNotificationLogService
->whereDate('incident_date', $ymd)
->where('channel', $channel);
if (! empty($to)) {
if (!empty($to)) {
$existingQuery->where('to_address', $to);
}
$existing = $existingQuery->orderByDesc('id')->first();
if ($existing && ! empty($existing->id)) {
if ($existing && !empty($existing->id)) {
$existing->update([
'subject' => $subject,
'status' => $status,
'response' => $response,
'semester' => $semester,
'school_year' => $schoolYear,
'updated_at' => now(),
'subject' => $subject,
'status' => $status,
'response' => $response,
'semester' => $semester,
'school_year' => $schoolYear,
'updated_at' => now(),
]);
} else {
$this->notificationModel->query()->create([
'student_id' => $studentId,
'code' => $code,
'student_id' => $studentId,
'code' => $code,
'incident_date' => $ymd,
'channel' => $channel,
'to_address' => $to,
'subject' => $subject,
'status' => $status,
'response' => $response,
'semester' => $semester,
'school_year' => $schoolYear,
'channel' => $channel,
'to_address' => $to,
'subject' => $subject,
'status' => $status,
'response' => $response,
'semester' => $semester,
'school_year' => $schoolYear,
]);
}
} catch (Throwable $e) {
Log::debug('logNotification(): '.$e->getMessage());
Log::debug('logNotification(): ' . $e->getMessage());
}
}
}