export type RequestStatus = "ACCEPTED" | "ACTIVE" | "COMPLETED" | "EXPIRED" | "DELETED";
export type SurveyType = "OPTICS" | "RSA" | "COMBINED";

export type RequestSummary = {
  id: string;
  name: string;
  status: RequestStatus;
  surveyType: SurveyType;
  importance: number;
  beginDateTime: string;
  endDateTime: string;
  kpp?: number[];
  highPriorityTransmit: boolean;
  coveragePercent: number;
  createdAt: string;
  updatedAt: string;
};

export type RequestDetail = {
  id: string;
  name: string;
  status: RequestStatus;
  surveyType: SurveyType;
  geometry: string;
  importance: number;
  beginDateTime: string;
  endDateTime: string;
  kpp?: number[];
  highPriorityTransmit: boolean;
  createdAt: string;
  updatedAt: string;
};

export type RequestListResponse = {
  items: RequestSummary[];
  page: number;
  size: number;
  totalItems: number;
  totalPages: number;
};

export type RequestFilter = {
  beginFrom?: string;
  beginTo?: string;
  endFrom?: string;
  endTo?: string;
  status?: RequestStatus;
  surveyType?: SurveyType;
};

export type RequestMapItem = {
  id: string;
  name: string;
  status: RequestStatus;
  surveyType: SurveyType;
  geometry: string;
  importance: number;
  beginDateTime: string;
  endDateTime: string;
  kpp?: number[];
  highPriorityTransmit: boolean;
  coveragePercent: number;
  createdAt: string;
  updatedAt: string;
};

export type OpticsResultType = "PANCHROMATIC" | "MULTISPECTRAL" | "PANSHARPENING";
export type RsaResultType = "SPOTLIGHT" | "STRIPMAP" | "SCANSAR";
export type Polarisation = "HH" | "VV";

export type OpticsParams = {
  resultType: OpticsResultType;
  resolution: number;
  sunAngleMin: number;
  sunAngleMax: number;
  clouds: number;
};

export type RsaParams = {
  resultType: RsaResultType;
  interferometry: boolean;
  polarisation: Polarisation;
  resolution: number;
};

export type CreateRequestPayload = {
  id: string;
  name: string;
  geometry: string;
  importance: number;
  beginDateTime: string;
  endDateTime: string;
  kpp: number[];
  highPriorityTransmit: boolean;
  optics?: OpticsParams;
  rsa?: RsaParams;
};

export type CreateRequestResult = {
  id: string;
  name: string;
  status: RequestStatus;
  surveyType: SurveyType;
  importance: number;
  message?: string;
};
