import { IsBooleanString, IsDateString, IsEnum, IsOptional, IsUUID } from 'class-validator';

export enum TaxLedgerGroupBy {
  SERVICE = 'service',
  BOOKING = 'booking',
  SUPPLIER = 'supplier',
  COMPONENT = 'component',
}

/**
 * GET /accounting/tax-ledger query params.
 *
 * Date semantic is **start_date** (travel date) — matches the supply
 * date the FTA cares about, and is the stakeholder choice.
 *
 * `include_cancelled` is on by default so refunded amounts emit as
 * negative rows and the running totals self-balance. Set to "false"
 * for an unadjusted gross ledger.
 */
export class TaxLedgerQueryDto {
  @IsDateString()
  from: string;

  @IsDateString()
  to: string;

  @IsEnum(TaxLedgerGroupBy)
  @IsOptional()
  group_by?: TaxLedgerGroupBy;

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

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

  @IsBooleanString()
  @IsOptional()
  include_cancelled?: string;
}
