import axiosInstance from 'api/axios';
import { CALENDAR } from 'api/URL';

export interface CalendarData {
  id: 0;
  monday: string;
  tuesday: string;
  wednesday: string;
  thursday: string;
  friday: string;
  saturday: string;
  sunday: string;
  weekStartDate: string;
  createdAt: string;
  updatedAt: string;
  isActive: boolean;
  cargoType: string;
}

interface Params {
  cargoType: 'AUTO' | 'AVIA';
}

const calendarAPi = {
  async getCalendar(params: Params): Promise<CalendarData> {
    const response = await axiosInstance.get<CalendarData>(CALENDAR, {
      params,
    });
    return response.data;
  },
};

export default calendarAPi;
