package com.zioinfo.mall.schedule.mapper;

import com.zioinfo.mall.schedule.MallHoliday;
import com.zioinfo.mall.schedule.MallScheduleSlot;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

@Mapper
public interface ScheduleMapper {
    List<MallScheduleSlot> findSlots(@Param("storeId") Long storeId, @Param("slotDate") LocalDate slotDate);
    MallScheduleSlot findSlot(@Param("id") Long id);
    int insertSlot(MallScheduleSlot s);
    int bookSlot(@Param("id") Long id);
    int setSlotActive(@Param("id") Long id, @Param("active") boolean active);

    List<MallHoliday> findHolidays();
    MallHoliday findHoliday(@Param("date") LocalDate date, @Param("storeId") Long storeId);
    int upsertHoliday(MallHoliday h);
    int setHolidayBlocked(@Param("id") Long id, @Param("blocked") boolean blocked);
}
