import { request } from '@/utils/request';

export function getRoomCalendar(roomId: number, startDate: string, endDate: string) {
  return request({
    url: `/api/merchant/room-calendar/${roomId}`,
    method: 'GET',
    data: { startDate, endDate },
    useSellerToken: true,
  });
}

export function batchUpdateCalendar(data: {
  roomId: number;
  startDate: string;
  endDate: string;
  price?: number;
  stock?: number;
  status?: string;
}) {
  return request({
    url: '/api/merchant/room-calendar/batch',
    method: 'PUT',
    data,
    useSellerToken: true,
  });
}

export function singleDayUpdate(data: {
  roomId: number;
  date: string;
  price?: number;
  stock?: number;
  status?: string;
}) {
  return request({
    url: '/api/merchant/room-calendar/single',
    method: 'PUT',
    data,
    useSellerToken: true,
  });
}
