import type {
  CustomerDetailDto,
  CustomerListItemDto,
  CustomerListStatsDto,
  CustomerOrderCountRangeFilter,
  CustomerProfileDto,
  CustomerRegisterPeriodFilter,
  CustomerTagFilter,
} from '#/api/customer';

export interface CustomerFilterState {
  keyword: string;
  orderCountRange: CustomerOrderCountRangeFilter;
  registerPeriod: CustomerRegisterPeriodFilter;
  tag: CustomerTagFilter;
}

export interface CustomerPaginationState {
  page: number;
  pageSize: number;
  total: number;
}

export interface CustomerListPageState {
  detail: CustomerDetailDto | null;
  filters: CustomerFilterState;
  isDetailDrawerOpen: boolean;
  isDetailLoading: boolean;
  isExporting: boolean;
  isListLoading: boolean;
  isProfileDrawerOpen: boolean;
  isProfileLoading: boolean;
  isStatsLoading: boolean;
  pagination: CustomerPaginationState;
  profile: CustomerProfileDto | null;
  rows: CustomerListItemDto[];
  stats: CustomerListStatsDto;
}

export interface OptionItem {
  label: string;
  value: string;
}

export interface CustomerListQueryPayload {
  keyword?: string;
  orderCountRange?: CustomerOrderCountRangeFilter;
  page: number;
  pageSize: number;
  registerPeriod?: CustomerRegisterPeriodFilter;
  storeId: string;
  tag?: CustomerTagFilter;
}

export interface CustomerFilterQueryPayload {
  keyword?: string;
  orderCountRange?: CustomerOrderCountRangeFilter;
  registerPeriod?: CustomerRegisterPeriodFilter;
  storeId: string;
  tag?: CustomerTagFilter;
}
