export const TERMS = ["winter", "spring", "fall"] as const;
export type Term = (typeof TERMS)[number];

export interface PosterInfo {
  sourceUrl: string;
  filename: string;
  contentType: string;
}

export interface EventInput {
  name: string;
  short: string;
  startDate: string;
  endDate?: string | null;
  online: boolean;
  location: string;
  descriptionMarkdown: string;
  registerLink?: string | null;
  year: number;
  term: Term;
  slug: string;
  poster?: PosterInfo | null;
}

export interface PublishRequest {
  requestId: string;
  submittedByEmail: string;
  event: EventInput;
}

export type JobStatus =
  | "processing"
  | "pr_created"
  | "pr_skipped_no_credentials"
  | "failed";

export interface DiscordOutcome {
  notified: boolean;
  reason: string;
}

export interface Job {
  requestId: string;
  requestBody: PublishRequest;
  status: JobStatus;
  branchName?: string;
  pullRequestUrl?: string | null;
  discord?: DiscordOutcome;
  error?: string;
  createdAt: number;
  updatedAt: number;
}
