Skip to content

Commit

Permalink
Remove unused EventType enum (#396)
Browse files Browse the repository at this point in the history
  • Loading branch information
irby committed Sep 9, 2024
1 parent a4721f1 commit 676edc9
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 40 deletions.
2 changes: 0 additions & 2 deletions app-modules/event-importer/src/Data/EventData.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace HackGreenville\EventImporter\Data;

use App\Enums\EventServices;
use App\Enums\EventType;
use App\Traits\HasUniqueIdentifier;
use Carbon\Carbon;
use Spatie\LaravelData\Attributes\Validation\Timezone;
Expand All @@ -23,7 +22,6 @@ public function __construct(
public null|Carbon $cancelled_at,
#[Timezone()]
public string $timezone,
public EventType $event_type,
public EventServices $service,
public string $service_id,
public null|VenueData $venue,
Expand Down
6 changes: 0 additions & 6 deletions app-modules/event-importer/src/Services/EventBriteHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace HackGreenville\EventImporter\Services;

use App\Enums\EventServices;
use App\Enums\EventType;
use Carbon\Carbon;
use HackGreenville\EventImporter\Data\EventData;
use HackGreenville\EventImporter\Data\VenueData;
Expand Down Expand Up @@ -32,11 +31,6 @@ protected function mapIntoEventData(array $data): EventData
'cancelled_at' => 'canceled' === $data['status'] || 'event_cancelled' === Arr::get($data, 'event_sales_status.message_code')
? now()
: null,
'event_type' => match ($data['online_event']) {
true => EventType::Online,
false => EventType::Live,
default => throw new RuntimeException("Unable to determine event type {$data['eventType']}"),
},
'venue' => $this->mapIntoVenueData($data),
]);
}
Expand Down
7 changes: 0 additions & 7 deletions app-modules/event-importer/src/Services/LumaHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace HackGreenville\EventImporter\Services;

use App\Enums\EventServices;
use App\Enums\EventType;
use Carbon\Carbon;
use HackGreenville\EventImporter\Data\EventData;
use HackGreenville\EventImporter\Data\VenueData;
Expand All @@ -13,7 +12,6 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Facades\Log;
use RuntimeException;
use Throwable;

class LumaHandler extends AbstractEventHandler
Expand All @@ -28,11 +26,6 @@ protected function mapIntoEventData(array $data): EventData
'starts_at' => Carbon::parse($data['event']['start_at'])->setTimezone($data['event']['timezone']),
'ends_at' => Carbon::parse($data['event']['end_at'])->setTimezone($data['event']['timezone']),
'timezone' => $data['event']['timezone'],
'event_type' => match ($data['event']['location_type']) {
'online', 'zoom', => EventType::Online,
'offline', 'unknown' => EventType::Live,
default => throw new RuntimeException("Unable to determine event type {$data['event']['location_type']}"),
},
'cancelled_at' => null,
'rsvp' => $data['guest_count'],
'service' => EventServices::Luma,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace HackGreenville\EventImporter\Services;

use App\Enums\EventServices;
use App\Enums\EventType;
use Carbon\Carbon;
use Firebase\JWT\JWT;
use HackGreenville\EventImporter\Data\EventData;
Expand Down Expand Up @@ -32,12 +31,6 @@ protected function mapIntoEventData(array $data): EventData
// Meetup (graphql) does not provide an event end time
'ends_at' => Carbon::parse($event['dateTime'])->addHours(2),
'timezone' => Carbon::parse($event['dateTime'])->timezoneName,
'event_type' => match ($event['eventType']) {
'ONLINE' => EventType::Online,
'HYBRID' => EventType::Live,
'PHYSICAL' => EventType::Live,
default => throw new RuntimeException("Unable to determine event type {$event['eventType']}"),
},
'cancelled_at' => match ($event['status']) {
'CANCELLED' => now(),
'cancelled' => now(),
Expand Down
8 changes: 0 additions & 8 deletions app-modules/event-importer/src/Services/MeetupRestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace HackGreenville\EventImporter\Services;

use App\Enums\EventServices;
use App\Enums\EventType;
use Carbon\Carbon;
use HackGreenville\EventImporter\Data\EventData;
use HackGreenville\EventImporter\Data\VenueData;
Expand All @@ -12,7 +11,6 @@
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Http;
use Illuminate\Support\Str;
use RuntimeException;
use Throwable;

class MeetupRestHandler extends AbstractEventHandler
Expand Down Expand Up @@ -53,12 +51,6 @@ protected function mapIntoEventData(array $data): EventData
// Meetup (rest) does not provide an event end time
'ends_at' => Carbon::createFromTimestampMs($data['time'])->addHours(2),
'timezone' => Carbon::createFromTimestampMs($data['time'])->utcOffset($data['utc_offset'] / 1000)->timezoneName,
'event_type' => match ($data['eventType']) {
'ONLINE' => EventType::Online,
'HYBRID' => EventType::Live,
'PHYSICAL' => EventType::Live,
default => throw new RuntimeException("Unable to determine event type {$data['eventType']}"),
},
'cancelled_at' => match ($data['status']) {
'cancelled' => now(),
default => null
Expand Down
10 changes: 0 additions & 10 deletions app/Enums/EventType.php

This file was deleted.

0 comments on commit 676edc9

Please sign in to comment.