diff --git a/app-modules/event-importer/src/Data/EventData.php b/app-modules/event-importer/src/Data/EventData.php index d8d14a35..a8c6427a 100644 --- a/app-modules/event-importer/src/Data/EventData.php +++ b/app-modules/event-importer/src/Data/EventData.php @@ -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; @@ -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, diff --git a/app-modules/event-importer/src/Services/EventBriteHandler.php b/app-modules/event-importer/src/Services/EventBriteHandler.php index f73830b4..d3e4744c 100644 --- a/app-modules/event-importer/src/Services/EventBriteHandler.php +++ b/app-modules/event-importer/src/Services/EventBriteHandler.php @@ -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; @@ -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), ]); } diff --git a/app-modules/event-importer/src/Services/LumaHandler.php b/app-modules/event-importer/src/Services/LumaHandler.php index d9c1068e..113f767e 100644 --- a/app-modules/event-importer/src/Services/LumaHandler.php +++ b/app-modules/event-importer/src/Services/LumaHandler.php @@ -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; @@ -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 @@ -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, diff --git a/app-modules/event-importer/src/Services/MeetupGraphqlHandler.php b/app-modules/event-importer/src/Services/MeetupGraphqlHandler.php index d057f466..242d1025 100644 --- a/app-modules/event-importer/src/Services/MeetupGraphqlHandler.php +++ b/app-modules/event-importer/src/Services/MeetupGraphqlHandler.php @@ -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; @@ -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(), diff --git a/app-modules/event-importer/src/Services/MeetupRestHandler.php b/app-modules/event-importer/src/Services/MeetupRestHandler.php index 290dea4d..d7030c65 100644 --- a/app-modules/event-importer/src/Services/MeetupRestHandler.php +++ b/app-modules/event-importer/src/Services/MeetupRestHandler.php @@ -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; @@ -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 @@ -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 diff --git a/app/Enums/EventType.php b/app/Enums/EventType.php deleted file mode 100644 index f2a707de..00000000 --- a/app/Enums/EventType.php +++ /dev/null @@ -1,10 +0,0 @@ -