import type { SourceType } from '../../third-party/entities/category.entity';

export type ThirdPartyCourseQueryDto = {
  productId?: string;
  school?: string;
  account?: string;
  password?: string;
  expand?: Record<string, unknown> | null;
};

export type SelectedCourseDto = {
  courseName?: string;
  courseId?: string | null;
  raw?: Record<string, unknown> | null;
};

export type CreateOrderDto = {
  productId?: string;
  quantity?: number;
  orderPayload?: Record<string, unknown> | null;
  selectedCourse?: SelectedCourseDto | null;
  expand?: Record<string, unknown> | null;
  remark?: string | null;
};

export type OrderListQuery = {
  page?: number;
  pageSize?: number;
  keyword?: string;
  sourceType?: SourceType | 'all';
  paymentStatus?: string;
  fulfillmentStatus?: string;
};

export type ThirdPartyOrderAction =
  | 'budan'
  | 'gaimi'
  | 'stop'
  | 'priority'
  | 'convert'
  | 'update-time'
  | 'update-cycle';

export type ThirdPartyOrderActionDto = {
  externalOrderNo?: string | null;
  username?: string | null;
  newPwd?: string | null;
  remark?: string | string[] | null;
  city?: string | null;
  tag?: string | null;
  config?: Record<string, unknown> | string | null;
  autoReset?: boolean | number | string | null;
  convertToClassId?: string | number | null;
  time?: string | number | null;
  cycle?: string | number | null;
};

export type ThirdPartyOrderListSyncDto = {
  page?: string | number | null;
  limit?: string | number | null;
  recent?: string | number | null;
};

export type LocalOrderAction =
  | 'process'
  | 'complete'
  | 'cancel'
  | 'close'
  | 'remark';

export type LocalOrderActionDto = {
  remark?: string | null;
};
