All files / shared/config eventConfigTypes.ts

100% Statements 24/24
100% Branches 0/0
100% Functions 6/6
100% Lines 24/24

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105                    618x 618x 618x 618x     618x 618x 618x 618x     618x 618x 618x 618x     618x 618x 618x 618x 618x                   618x 618x 618x     618x 618x 618x 618x                                                                                                            
import { Dayjs } from "dayjs";
import {
  AgeGroup,
  Language,
  ProgramType,
  SignupType,
  Tag,
} from "shared/types/models/programItem";
import { SignupQuestion } from "shared/types/models/settings";
 
export enum EventSignupStrategy {
  DIRECT = "direct",
  LOTTERY = "lottery",
  LOTTERY_AND_DIRECT = "lottery+direct",
}
 
export enum AssignmentAlgorithm {
  PADG = "padg",
  RANDOM = "random",
  RANDOM_PADG = "random+padg",
}
 
export enum LoginProvider {
  LOCAL = "local",
  KOMPASSI = "kompassi",
  LOCAL_KOMPASSI = "local+kompassi",
}
 
export enum EventName {
  ROPECON = "Ropecon",
  HITPOINT = "Tracon Hitpoint",
  SOLMUKOHTA = "Solmukohta",
  TRACON = "Tracon",
}
 
type ArrMin1<T> = [T, ...T[]];
 
interface SignupWindow {
  signupWindowStart: Dayjs;
  signupWindowClose: Dayjs;
}
 
export enum EntryConditionText {
  K16 = "k16",
  K18 = "k18",
}
 
export enum RemoveLotterySignupsStrategy {
  NONE = "none",
  OVERLAP = "overlap",
  ALL_UPCOMING = "allUpcoming",
}
 
export interface EventConfig {
  assignmentAlgorithm: AssignmentAlgorithm;
  enableGroups: boolean;
  eventName: EventName;
  eventYear: string;
  eventStartTime: string;
  preConventionWeekSignupStartTime: string | null;
  mainEventProgramVisibleTime: string | null;
  directSignupPhaseStart: number;
  preSignupStart: number;
  phaseGap: number;
  directSignupWindows: Partial<
    Record<ProgramType, ArrMin1<SignupWindow>>
  > | null;
  rollingDirectSignupProgramTypes: ProgramType[];
  enableRollingDirectSignupPreviousDay: boolean;
  directSignupAlwaysOpenIds: string[];
  twoPhaseSignupProgramTypes: ProgramType[];
  addToKonstiOther: string[];
  noKonstiSignupIds: string[];
  ignoreProgramItemsIds: string[];
  signupQuestions: SignupQuestion[];
  tournamentSignupQuestion: Omit<SignupQuestion, "programItemId"> | null;
  tournamentSignupQuestionExcludeIds: string[];
  addRevolvingDoorIds: string[];
  hideParticipantListProgramTypes: ProgramType[];
  fixedLotterySignupTime: string | null;
  entryConditions: {
    conditionText: EntryConditionText;
    programItemIds: string[];
  }[];
  activeProgramTypes: ProgramType[];
  removeLotterySignupsStrategy: RemoveLotterySignupsStrategy;
  customDetailsProgramItems: Record<
    string,
    | {
        tags?: Tag[];
        ageGroups?: AgeGroup[];
        languages?: Language[];
      }
    | undefined
  >;
  enableRevolvingDoor: boolean;
  programGuideUrlFi: string;
  programGuideUrlEn: string;
  startTimesByParentIds: Map<string, string>;
  defaultSignupType: SignupType;
  enableTagDropdown: boolean;
  defaultSignupStrategy: EventSignupStrategy;
  defaultLoginProvider: LoginProvider;
}