import instance from './interceptor';

export interface DataList {
  position: string;
  company: string;
  id: string;
  name: string;
  nameCh: string;
  picture: string;
  result: string;
  time: string;
}

export interface RecordListRes {
  data: DataList[];
  total: number;
  update: number;
}
export interface RecordParams {
  pageIndex: number;
  personNumber: number;
}
export async function queryRecordList(
  params: RecordParams
): Promise<RecordListRes> {
  const res = await instance.post('/api/getPassengerRecord', params);
  return res.data;
}
export async function fetchCheckIn(params: object): Promise<RecordListRes> {
  const res = await instance.post('/api/TimeCards', params);
  return res.data;
}
export async function getCheckInList(params: object): Promise<any> {
  const res = await instance.post('/api/GetOneMonthTimeCards', params, {
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json',
    },
  });
  return res;
}
