Files
skr/ts/skr.types.ts
Juergen Kunz 8a9056e767
Some checks failed
Default (tags) / security (push) Successful in 44s
Default (tags) / test (push) Failing after 4m4s
Default (tags) / release (push) Has been skipped
Default (tags) / metadata (push) Has been skipped
feat(core): initial release of SKR03/SKR04 German accounting standards implementation
- Complete implementation of German standard charts of accounts
- SKR03 (Process Structure Principle) for trading/service companies
- SKR04 (Financial Classification Principle) for manufacturing companies
- Double-entry bookkeeping with MongoDB persistence
- Comprehensive reporting suite with DATEV export
- Full TypeScript support and type safety
2025-08-09 12:00:40 +00:00

155 lines
2.9 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;
}
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;
}