add test batches

This commit is contained in:
root
2026-06-08 23:45:55 -04:00
parent c792b8be05
commit 8d4d610b82
1480 changed files with 22587 additions and 10762 deletions
@@ -11,7 +11,8 @@ class SchoolCalendarMutationService
public function __construct(
private SchoolCalendarContextService $context,
private SchoolCalendarNotificationService $notificationService
) {}
) {
}
public function create(array $payload, array $targets = []): array
{
@@ -22,7 +23,7 @@ class SchoolCalendarMutationService
return CalendarEvent::query()->create($data);
});
} catch (\Throwable $e) {
Log::error('SchoolCalendar create failed: '.$e->getMessage());
Log::error('SchoolCalendar create failed: ' . $e->getMessage());
throw $e;
}
@@ -44,7 +45,7 @@ class SchoolCalendarMutationService
$event->save();
});
} catch (\Throwable $e) {
Log::error('SchoolCalendar update failed: '.$e->getMessage());
Log::error('SchoolCalendar update failed: ' . $e->getMessage());
throw $e;
}
@@ -64,7 +65,7 @@ class SchoolCalendarMutationService
$event->delete();
});
} catch (\Throwable $e) {
Log::error('SchoolCalendar delete failed: '.$e->getMessage());
Log::error('SchoolCalendar delete failed: ' . $e->getMessage());
throw $e;
}
}
@@ -76,15 +77,15 @@ class SchoolCalendarMutationService
'description' => $payload['description'] ?? null,
'event_type' => $payload['event_type'] ?? null,
'date' => $payload['date'] ?? $payload['start'] ?? null,
'notify_parent' => ! empty($payload['notify_parent']) ? 1 : 0,
'notify_teacher' => ! empty($payload['notify_teacher']) ? 1 : 0,
'notify_admin' => ! empty($payload['notify_admin']) ? 1 : 0,
'no_school' => ! empty($payload['no_school']) ? 1 : 0,
'notify_parent' => !empty($payload['notify_parent']) ? 1 : 0,
'notify_teacher' => !empty($payload['notify_teacher']) ? 1 : 0,
'notify_admin' => !empty($payload['notify_admin']) ? 1 : 0,
'no_school' => !empty($payload['no_school']) ? 1 : 0,
'school_year' => $payload['school_year'] ?? $this->context->defaultSchoolYear(),
'semester' => $payload['semester'] ?? $this->context->defaultSemester(),
];
if (! CalendarEvent::supportsEventType()) {
if (!CalendarEvent::supportsEventType()) {
unset($data['event_type']);
}