Files
skr/ts/skr.types.ts
Juergen Kunz 73b46f7857
Some checks failed
Default (tags) / security (push) Successful in 48s
Default (tags) / test (push) Failing after 4m3s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
feat(invoice): add e-invoice support with XRechnung/ZUGFeRD and advanced export features
2025-08-12 12:37:01 +00:00

156 lines
3.0 KiB
TypeScript

export type TAccountType =
| 'asset'
| 'liability'
| 'equity'
| 'revenue'
| 'expense';
export type TSKRType = 'SKR03' | 'SKR04';
export type TTransactionStatus = 'pending' | 'posted' | 'reversed';
export type TReportType =
| 'trial_balance'
| 'income_statement'
| 'balance_sheet'
| 'general_ledger'
| 'cash_flow';
export interface IAccountData {
accountNumber: string;
accountName: string;
accountClass: number;
accountType: TAccountType;
skrType: TSKRType;
description?: string;
vatRate?: number;
isActive?: boolean;
}
export interface ITransactionData {
date: Date;
debitAccount: string;
creditAccount: string;
amount: number;
description: string;
reference?: string;
skrType: TSKRType;
vatAmount?: number;
costCenter?: string;
}
export interface IJournalEntry {
date: Date;
description: string;
reference?: string;
lines: IJournalEntryLine[];
skrType: TSKRType;
}
export interface IJournalEntryLine {
accountNumber: string;
debit?: number;
credit?: number;
description?: string;
costCenter?: string;
}
export interface ITrialBalanceEntry {
accountNumber: string;
accountName: string;
debitBalance: number;
creditBalance: number;
netBalance: number;
}
export interface ITrialBalanceReport {
date: Date;
skrType: TSKRType;
entries: ITrialBalanceEntry[];
totalDebits: number;
totalCredits: number;
isBalanced: boolean;
}
export interface IIncomeStatementEntry {
accountNumber: string;
accountName: string;
amount: number;
percentage?: number;
}
export interface IIncomeStatement {
date: Date;
skrType: TSKRType;
revenue: IIncomeStatementEntry[];
expenses: IIncomeStatementEntry[];
totalRevenue: number;
totalExpenses: number;
netIncome: number;
}
export interface IBalanceSheetEntry {
accountNumber: string;
accountName: string;
amount: number;
}
export interface IBalanceSheet {
date: Date;
skrType: TSKRType;
assets: {
current: IBalanceSheetEntry[];
fixed: IBalanceSheetEntry[];
totalAssets: number;
};
liabilities: {
current: IBalanceSheetEntry[];
longTerm: IBalanceSheetEntry[];
totalLiabilities: number;
};
equity: {
entries: IBalanceSheetEntry[];
totalEquity: number;
};
isBalanced: boolean;
}
export interface IAccountFilter {
skrType?: TSKRType;
accountClass?: number;
accountType?: TAccountType;
isActive?: boolean;
searchTerm?: string;
}
export interface ITransactionFilter {
skrType?: TSKRType;
dateFrom?: Date;
dateTo?: Date;
accountNumber?: string;
minAmount?: number;
maxAmount?: number;
searchTerm?: string;
}
export interface IDatabaseConfig {
mongoDbUrl: string;
dbName?: string;
invoiceExportPath?: string; // Optional path for invoice storage
}
export interface IReportParams {
dateFrom?: Date;
dateTo?: Date;
skrType: TSKRType;
format?: 'json' | 'csv' | 'datev';
}
export interface IAccountBalance {
accountNumber: string;
debitTotal: number;
creditTotal: number;
balance: number;
lastUpdated: Date;
}