export interface FiscalYearDTO {
  id: string;
  year: number;
  startDate: string; // YYYY-MM-DD
  endDate: string; // YYYY-MM-DD
  status: 'DRAFT' | 'OPEN' | 'CLOSED';
}

export interface CreateFiscalYearDTO {
  year: number;
  startDate: string;
  endDate: string;
}

export interface BudgetLineDTO {
  id: string;
  fiscalYearId: string;
  code: string;
  description: string;
  ministryId: string;
  orgUnitId: string;
  economicClass: string;
  // Campos calculados
  totalAllocated?: number;
  totalCommitted?: number;
  availableBalance?: number;
}

export interface CreateBudgetLineDTO {
  fiscalYearId: string;
  code: string;
  description: string;
  ministryId: string;
  orgUnitId: string;
  economicClass: string;
}

export interface BudgetExecutionDTO {
  id: string;
  budgetLineId: string;
  periodId?: number;
  movementType: 'COMMITMENT' | 'LIQUIDATION' | 'PAYMENT';
  amount: number;
  createdAt?: string;
  sourceModule: string;
  referenceId?: string;
  budgetLineCode?: string;
  description?: string;
}

export interface CreateBudgetExecutionDTO {
  budgetLineId: string;
  periodId?: number;
  movementType: 'COMMITMENT' | 'LIQUIDATION' | 'PAYMENT';
  amount: number;
  sourceModule: string;
  referenceId?: string;
}

export type BudgetEntryType =
  | 'INITIAL_ALLOCATION'
  | 'SUPPLEMENTARY_CREDIT'
  | 'SPECIAL_CREDIT'
  | 'CANCELLATION'
  | 'TRANSFER_IN'
  | 'TRANSFER_OUT';

export interface BudgetEntryDTO {
  id: string;
  budgetLineId: string;
  type: BudgetEntryType;
  amount: number;
  transactionDate: string;
  documentReference: string;
  description?: string;
}

export interface CreateBudgetEntryDTO {
  budgetLineId: string;
  type: BudgetEntryType;
  amount: number;
  transactionDate: string;
  documentReference: string;
  description?: string;
}


export interface EconomicClassificationDTO {
  id: string;
  code: string;
  description: string;
  type: string;
  uemoaCode?: string;
  label: string;
}
