import { District, Province, SubDistrict } from '../address';
import { Branch } from '../branch/types';
import { Status } from '../types';

export type User = {
  selectedImage?: string;
  subDistrict: SubDistrict | null;
  district: District | null;
  province: Province | null;
  updatedAt: string;
  updatedBy: string;
  createdAt: string;
  createdBy: string;
  status: Status;
  trainingPlace: string | null;
  importNationality: string | null;
  sourceNationality: string | null;
  licenseExpireDate: Date | null;
  licenseIssueDate: Date | null;
  licenseNo: string | null;
  discountCondition: string | null;
  gender: string;
  userRole: string;
  userType: string;
  username: string;
  retireDate: Date | null;
  startDate: Date | null;
  registrationNo: string | null;
  telephoneNo: string;
  email: string;
  zipCode: string;
  subDistrictId: string | null;
  districtId: string | null;
  provinceId: string | null;
  addressEN: string;
  address: string;
  mooEN: string;
  moo: string;
  soiEN: string;
  soi: string;
  streetEN: string;
  street: string;
  lastNameEN: string;
  lastName: string;
  middleNameEN?: string | null;
  middleName?: string | null;
  firstNameEN: string;
  firstName: string;
  namePrefix?: string | null;
  id: string;
  code: string;
  birthDate?: Date | null;
  responsibleArea: string;
  checkpoint?: string | null;
  checkpointEN?: string | null;
  citizenExpire?: Date | null;
  citizenIssue?: Date | null;
  citizenId: string;
  branch: Branch[];
};

export type UserCreate = {
  selectedImage?: string;
  branchId: string;
  provinceId?: string | null;
  districtId?: string | null;
  subDistrictId?: string | null;
  telephoneNo: string;
  email: string;
  zipCode: string;
  gender: string;
  addressEN: string;
  address: string;
  mooEN: string;
  moo: string;
  soiEN: string;
  soi: string;
  streetEN: string;
  street: string;
  trainingPlace?: string | null;
  importNationality?: string | null;
  sourceNationality?: string | null;
  licenseExpireDate?: Date | null;
  licenseIssueDate?: Date | null;
  licenseNo?: string | null;
  discountCondition?: string | null;
  retireDate?: Date | null;
  startDate?: Date | null;
  registrationNo?: string | null;
  lastNameEN: string;
  lastName: string;
  middleNameEN?: string | null;
  middleName?: string | null;
  firstNameEN: string;
  firstName: string;
  namePrefix?: string | null;
  userRole: string;
  userType: string;
  username: string;
  status?: Status;
  birthDate?: Date | null;
  responsibleArea?: string | null;
  checkpoint?: string | null;
  checkpointEN?: string | null;
  citizenExpire?: Date | null;
  citizenIssue?: Date | null;
  citizenId: string;
};

export type UserAttachment = {
  name: string;
  url: string;
};

export type UserAttachmentCreate = {
  file: File[];
};

export type UserAttachmentDelete = {
  file: string[];
};

export type UserTypeStats = {
  [x: string]: number;
  USER: number;
  MESSENGER: number;
  DELEGATE: number;
  AGENCY: number;
};

export type UserOption = {
  hqOpts: Option[];
  brOpts: Option[];
  genderOpts: Option[];
  userTypeOpts: Option[];
  roleOpts: Option[];
  responsibleAreaOpts: Option[];
  nationalityOpts: Option[];
  trainingPlaceOpts: Option[];
};

export type Option = {
  label: string;
  value?: string;
};

export type RoleData = {
  id: string;
  name: string;
};
