add tests batch 20

This commit is contained in:
root
2026-06-09 01:03:53 -04:00
parent 95efb9652e
commit 6be4875c5e
1502 changed files with 13797 additions and 11313 deletions
@@ -13,7 +13,8 @@ class EventManagementService
public function __construct(
private EventChargeService $charges,
private InvoiceGenerationService $invoiceGeneration
) {}
) {
}
public function create(array $payload, ?UploadedFile $flyer, int $actorId): array
{
@@ -53,7 +54,7 @@ class EventManagementService
public function update(int $eventId, array $payload, ?UploadedFile $flyer): array
{
$event = Event::query()->find($eventId);
if (! $event) {
if (!$event) {
return ['ok' => false, 'message' => 'Event not found.'];
}
@@ -80,7 +81,7 @@ class EventManagementService
public function delete(int $eventId, int $actorId): array
{
$event = Event::query()->find($eventId);
if (! $event) {
if (!$event) {
return ['ok' => false, 'message' => 'Event not found.'];
}
@@ -98,7 +99,7 @@ class EventManagementService
private function storeFlyer(?UploadedFile $file): ?string
{
if (! $file || ! $file->isValid()) {
if (!$file || !$file->isValid()) {
return null;
}
@@ -119,13 +120,13 @@ class EventManagementService
}
$dir = public_path('uploads/event_flyers');
if (! File::exists($dir)) {
if (!File::exists($dir)) {
File::makeDirectory($dir, 0755, true);
}
$name = bin2hex(random_bytes(16)).'.'.$allowed[$mime];
$name = bin2hex(random_bytes(16)) . '.' . $allowed[$mime];
$file->move($dir, $name);
return 'event_flyers/'.$name;
return 'event_flyers/' . $name;
}
}