export interface OpeningBalanceLine {
  id?: number;
  opening_balance_id?: number;
  account_id: number;
  debit: number;
  credit: number;
  partner_id?: number | null;
  cost_center_id?: number | null;
  description?: string | null;
  account?: { id: number; code: string; name: string; name_ar: string; name_en: string };
  created_at?: string;
  updated_at?: string;
}

export interface OpeningBalance {
  id: number;
  fiscal_year_id: number;
  status: 'draft' | 'confirmed';
  status_label: string;
  total_debit: number;
  total_credit: number;
  notes: string | null;
  confirmed_by: number | null;
  confirmed_at: string | null;
  lines: OpeningBalanceLine[];
  fiscal_year?: { id: number; name: string; name_en: string };
  created_at?: string;
  updated_at?: string;
}

export interface CreateOpeningBalance {
  fiscal_year_id: number;
  notes?: string;
  lines: {
    account_id: number;
    debit: number;
    credit: number;
    partner_id?: number | null;
    cost_center_id?: number | null;
    description?: string;
  }[];
}

export interface UpdateOpeningBalance extends Partial<CreateOpeningBalance> {}
