import { IsEnum, IsOptional, IsString, IsUUID, MaxLength } from 'class-validator';
import { PaginationDto } from '../../../common/dto/pagination.dto';
import { OverallSettlementStatus } from '../../../entities/booking-settlement-master.entity';

/**
 * Filters for the master-level Settlements list.
 *
 * One row per booking (operational view). Orders by `last_activity_at`
 * DESC so the dispatcher's recent work bubbles up. Status filter is on
 * the booking-level `overall_status` (PENDING / IN_PROGRESS / COMPLETED
 * / HOLD / REFUND_DUE) — per-party customer/supplier statuses live on
 * the master columns but aren't separately filterable here (drill in
 * for the breakdown).
 *
 * Search matches booking_number / guest_name / guest_mobile.
 * Supplier-name search lives on the analytical /by-supplier view
 * instead — different mental model.
 */
export class MasterListQueryDto extends PaginationDto {
  @IsEnum(OverallSettlementStatus)
  @IsOptional()
  status?: OverallSettlementStatus;

  @IsUUID()
  @IsOptional()
  destination_id?: string;

  @IsString()
  @IsOptional()
  @MaxLength(20)
  date_from?: string;

  @IsString()
  @IsOptional()
  @MaxLength(20)
  date_to?: string;
}
