import dayjs from 'dayjs';
import type { OrderData } from '../../server/modules/order/types';
import type { BookingData } from '../../server/modules/order/types';
import type { ResourceData, ResourceId } from '../../server/modules/resource/types';
export declare enum SalesHooks {
    onInited = "sales:onInited",
    onDestroy = "sales:onDestroy",
    onCurrentDayChanged = "sales:onCurrentDayChanged",
    onReservationListChanged = "sales:onReservationListChanged"
}
/**
 * 预订记录类型（暂用 OrderData 占位）
 *
 * TODO(Rolo): 等领导提供 reservationList 的目标结构后，
 * 将 Server/Order 原始数据转换为真正的 Reservation DTO，
 * 当前不要直接把 OrderData 当作最终 UI 数据结构。
 */
export type Reservation = OrderData;
export type SalesBookingStatus = 'reserved' | 'occupied' | 'locked' | 'completed' | undefined;
export type SalesReservedStatus = 'not_arrived' | 'late' | undefined;
export interface SalesResourceMatchedBooking extends Omit<BookingData, 'status'> {
    status: SalesBookingStatus;
    isNext?: boolean;
    isTimeout: boolean;
    timeoutTime?: number;
    progressPercent?: number;
    lateTime?: number;
    remainingReserveTime?: number;
    reserved_status: SalesReservedStatus;
}
export interface SalesResourceBookingItem extends Omit<ResourceData, 'bookings'> {
    resource_id: ResourceId;
    orderCount: number;
    bookingCount: number;
    compeleteBookingCount: number;
    bookings: SalesResourceMatchedBooking[];
}
export interface SalesResourceBookingItemWithGroups extends SalesResourceBookingItem {
    completedBookings: SalesResourceMatchedBooking[];
    unpaidBookings: SalesResourceMatchedBooking[];
}
export type SalesTimelineHighlights = number[];
export interface ChangeBookingStatusParams {
    booking_id: number | string;
    appointment_status: string;
}
export interface GetResourceBookingItemParams {
    resourceId: ResourceId;
    currentTime: string;
    bookingList: BookingData[];
    deviceTime?: string;
}
/**
 * Sales 解决方案状态
 *
 * - currentDay: 当前选择的日期，默认当天 00:00:00
 * - reservationList: currentDay 对应的预约列表（数据来源于 Server/Order，转换逻辑待补）
 */
export interface SalesState {
    /** 当前选择的日期，默认当天 00:00:00 */
    currentDay: dayjs.Dayjs;
    /** 当前日期对应的预约列表 */
    reservationList: Reservation[];
}
/**
 * Sales 解决方案最小 API 面
 */
export interface SalesModuleAPI {
    /** 获取当前 store 快照 */
    getState: () => SalesState;
    /** 获取当前选择日期 */
    getCurrentDay: () => dayjs.Dayjs;
    /** 设置当前选择日期，会自动归一到当天 00:00:00 */
    setCurrentDay: (currentDay: dayjs.ConfigType) => dayjs.Dayjs;
    /** 获取当前预约列表 */
    getReservationList: () => Reservation[];
    /** 覆盖设置当前预约列表 */
    setReservationList: (reservationList: Reservation[]) => Reservation[];
    /** 重置预约列表为空 */
    resetReservationList: () => Reservation[];
    /** 取消订单 */
    cancelOrder: (orderIds: Array<number | string>) => Promise<any>;
    /** 变更预约状态 */
    changeBookingStatus: (params: ChangeBookingStatusParams) => Promise<any>;
    /** 获取资源维度的预约占用列表 */
    getResourceBookingList: (currentTime: string, bookingList: BookingData[], deviceTime?: string) => Promise<SalesResourceBookingItem[]>;
    /** 获取单个资源维度的预约占用、已完成、未支付列表 */
    getResourceBookingItem: (params: GetResourceBookingItemParams) => Promise<SalesResourceBookingItemWithGroups | null>;
    /** 获取时间轴每个时间片的预约数量 */
    getTimelineHighlights: (bookingList: BookingData[], startDateTime?: string, endDateTime?: string) => SalesTimelineHighlights;
}
