// PRC-001 — ChargeableCharConfig feature types

export type ChargeableCharCategory =
  | 'Currency'
  | 'Percentage'
  | 'Exclamation'
  | 'Question'
  | 'Other'

export interface ChargeableCharConfig {
  id: number
  productTypeId: number | null
  symbol: string
  category: ChargeableCharCategory
  pricePerUnit: number
  /** yyyy-MM-dd — Cat2 civil date, NEVER a Date object */
  validFrom: string
  /** yyyy-MM-dd | null — null means still active */
  validTo: string | null
  isActive: boolean
}

export interface CreateChargeableCharConfigRequest {
  productTypeId: number | null
  symbol: string
  category: ChargeableCharCategory
  pricePerUnit: number
  /** yyyy-MM-dd */
  validFrom: string
}

export interface SchedulePriceChangeRequest {
  newPricePerUnit: number
  /** yyyy-MM-dd */
  newValidFrom: string
}

export interface SchedulePriceChangeResponse {
  created: ChargeableCharConfig
  closed: ChargeableCharConfig | null
}

export interface ChargeableCharConfigsQuery {
  productTypeId?: number
  activeOnly?: boolean
  page?: number
  pageSize?: number
}

export interface PagedResult<T> {
  items: T[]
  page: number
  pageSize: number
  total: number
}

export type ReactivateChargeableCharConfigResponse = {
  id: number
  symbol: string
  productTypeId: number | null
  pricePerUnit: number
  validFrom: string
}

export type DeleteChargeableCharConfigResponse = { id: number }
