export interface BudgetLine {
  id?: number;
  budget_id?: number;
  account_id: number;
  cost_center_id?: number | null;
  annual_amount: number;
  m1: number; m2: number; m3: number; m4: number;
  m5: number; m6: number; m7: number; m8: number;
  m9: number; m10: number; m11: number; m12: number;
  account?: { id: number; code: string; name: string; name_ar: string; name_en: string };
  cost_center?: { id: number; code: string; name: string; name_ar: string } | null;
  created_at?: string;
  updated_at?: string;
}

export interface Budget {
  id: number;
  name: string;
  name_en: string | null;
  name_ar: string;
  fiscal_year_id: number;
  budget_type: 'estimated' | 'revised';
  budget_type_label: string;
  status: 'draft' | 'approved';
  status_label: string;
  notes: string | null;
  lines: BudgetLine[];
  fiscal_year?: { id: number; name: string; name_en: string };
  created_at?: string;
  updated_at?: string;
}

export interface CreateBudget {
  name: string;
  name_ar: string;
  name_en?: string;
  fiscal_year_id: number;
  budget_type?: string;
  notes?: string;
  lines: {
    account_id: number;
    cost_center_id?: number | null;
    annual_amount: number;
    m1?: number; m2?: number; m3?: number; m4?: number;
    m5?: number; m6?: number; m7?: number; m8?: number;
    m9?: number; m10?: number; m11?: number; m12?: number;
  }[];
}

export interface UpdateBudget extends Partial<CreateBudget> {}
