import { Calendar } from './Calendar.interface'; import { PeriodicityType, RepartitionType } from './CreditInsights.enum'; import { TransactionType } from './Transaction.enum'; import { Transaction, TransactionCategoryType } from './Transaction.interface'; export interface CreditInsights { version: string; cashFlows: CashFlowV2[]; incomes: IncomesV2; expenses: Expenses; loans: Loans; risks: Risks; } export interface CashFlowV2 { id?: string; type: TransactionType; category: TransactionCategoryType; labelRoot: string; label: string; totalAmount: number; totalRejectedAmount?: number; calendar: Calendar[]; transactions: Transaction[]; regularity?: CashFlowRegularity; } export interface CashFlowRegularity { dueDays?: number[]; interval?: CashFlowRegularityInterval; meanNumberOfDaysInInterval?: number; accuracy?: number; periodicity?: PeriodicityType; repartition?: RepartitionType; } export interface CashFlowRegularityInterval { min?: number; max?: number; } export interface IncomesV2 { totalAmount: number; monthlyAmount: number; indicators: Indicators; categories: CategoryGroup[]; } export interface Indicators { allowancesRatio: number; } export interface Expenses { totalAmount: number; monthlyAmount: number; categories: CategoryGroup[]; frequentTransactions: FrequentTransactions[]; } export interface FrequentTransactions { label: string; transactions: Transaction[]; } export interface CategoryGroup { name: TransactionCategoryType; totalAmount: number; monthlyAmount: number; calendar: Calendar[]; transactions: Transaction[]; } export interface Loans { repayments: LoansDetails; drawdowns: LoansDetails; } export interface LoansDetails { count?: number; totalAmount: number; monthlyAmount?: number; details: CashFlowV2[]; } export interface Risks { gambling: TransactionGroupDetail; incidents: Incidents; overdraft: Overdraft; heavyFailures: HeavyFailures; wageAdvance: TransactionGroupDetail; } export interface HeavyFailures { directRecoveryOfDebt: TransactionGroupDetail; bankAccountSeizure: TransactionGroupDetail; } export interface Incidents { paymentRejections: Rejections; checkRejections: Rejections; interventionFees: TransactionGroupDetail; } export interface Rejections { totalAmount: number; totalFeesAmount: number; transactions: Transaction[]; feesTransactions: Transaction[]; } export interface Overdraft { minimumBalanceReached: number; duration: number; fees: TransactionGroupDetail; } export interface TransactionGroupDetail { totalAmount: number; transactions: Transaction[]; }