export type FinancialStatus = "OPEN" | "PAID" | "OVERDUE" | "CANCELED";
export type CashMovementType = "INCOME" | "EXPENSE";

export interface AccountReceivable {
  id: string;
  companyId: string;
  customerId: string;
  rentalId?: string | null;
  description: string;
  amount: number;
  dueDate: string;
  paidAt?: string | null;
  status: FinancialStatus;
  createdAt: string;
  updatedAt: string;
  customer?: {
    id: string;
    name: string;
    document: string;
  };
}

export interface AccountPayable {
  id: string;
  companyId: string;
  supplierId?: string | null;
  description: string;
  amount: number;
  dueDate: string;
  paidAt?: string | null;
  status: FinancialStatus;
  createdAt: string;
  updatedAt: string;
  supplier?: {
    id: string;
    name: string;
  };
}

export interface CashMovement {
  id: string;
  companyId: string;
  type: CashMovementType;
  description: string;
  amount: number;
  occurredAt: string;
  category?: string | null;
  createdAt: string;
}

export interface CreateFinancialEntryDTO {
  entryType: "RECEIVABLE" | "PAYABLE";
  entityId: string; // customerId or supplierId
  description: string;
  amount: number;
  dueDate: string;
  notes?: string;
}

export interface FinanceStats {
  totalReceivable: number;
  totalPayable: number;
  netProjected: number;
  overdueAmount: number;
}

export interface FinanceFilterParams {
  search?: string;
  status?: FinancialStatus | "ALL";
  page?: number;
  limit?: number;
}
