Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions webapp/src/DataTransferObject/Shadowing/EventType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ enum EventType: string
case PROBLEMS = 'problems';
case RUNS = 'runs';
case STATE = 'state';
case START_STATUS = 'start-status';
case SUBMISSIONS = 'submissions';
case TEAMS = 'teams';
case TEAM_MEMBERS = 'team-members';
Expand All @@ -28,6 +29,11 @@ public static function fromString(string $value): EventType
return EventType::CONTESTS;
}

// When encountering an error for an unknown event
// consider if we need to verify this as shadow or
// ignore it by adding the case in:
// webapp/src/DataTransferObject/Shadowing/EventType.php
// webapp/src/Service/ExternalContestSourceService.php
return EventType::from($value);
}

Expand Down
2 changes: 1 addition & 1 deletion webapp/src/Service/ExternalContestSourceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ public function importEvent(Event $event, array $eventsToSkip): void

// Note the @vars here are to make PHPStan understand the correct types.
$method = match ($event->type) {
EventType::ACCOUNTS, EventType::AWARDS, EventType::MAP_INFO, EventType::PERSONS, EventType::TEAM_MEMBERS => $this->ignoreEvent(...),
EventType::ACCOUNTS, EventType::AWARDS, EventType::MAP_INFO, EventType::PERSONS, EventType::START_STATUS, EventType::TEAM_MEMBERS => $this->ignoreEvent(...),
EventType::STATE => $this->validateState(...),
EventType::CONTESTS => $this->validateAndUpdateContest(...),
EventType::JUDGEMENT_TYPES => $this->importJudgementType(...),
Expand Down
Loading