// 손익계산서 API 응답 타입 (snake_case)
export interface IncomeStatementItemApi {
  code: string;
  name: string;
  current: number;
  previous: number;
}

export interface IncomeStatementSectionApi {
  code: string;
  name: string;
  current_amount: number;
  previous_amount: number;
  items: IncomeStatementItemApi[];
  is_calculated: boolean;
}

export interface IncomeStatementPeriodApi {
  start: string;
  end: string;
  label: string;
}

export interface IncomeStatementResponseApi {
  period: {
    current: IncomeStatementPeriodApi;
    previous: IncomeStatementPeriodApi;
  };
  unit: string;
  sections: IncomeStatementSectionApi[];
}

export interface IncomeStatementMonthApi {
  month: string;
  label: string;
  sections: IncomeStatementSectionApi[];
}

export interface IncomeStatementMonthlyResponseApi {
  year: number;
  fiscal_year: number;
  fiscal_label: string;
  unit: string;
  months: IncomeStatementMonthApi[];
}

// 프론트엔드 타입 (camelCase)
export interface IncomeStatementItem {
  code: string;
  name: string;
  current: number;
  previous: number;
}

export interface IncomeStatementSection {
  code: string;
  name: string;
  currentAmount: number;
  previousAmount: number;
  items: IncomeStatementItem[];
  isCalculated: boolean;
}

export interface IncomeStatementPeriod {
  start: string;
  end: string;
  label: string;
}

export interface IncomeStatementData {
  period: {
    current: IncomeStatementPeriod;
    previous: IncomeStatementPeriod;
  };
  unit: string;
  sections: IncomeStatementSection[];
}

export interface IncomeStatementMonth {
  month: string;
  label: string;
  sections: IncomeStatementSection[];
}

export interface IncomeStatementMonthlyData {
  year: number;
  fiscalYear: number;
  fiscalLabel: string;
  unit: string;
  months: IncomeStatementMonth[];
}

export type UnitType = 'won' | 'thousand' | 'million';
export type ViewMode = 'period' | 'monthly';

// 강조 표시 대상 코드 (매출총이익, 영업이익, 당기순이익)
export const HIGHLIGHT_CODES = ['III', 'V', 'X'];
