feat: add Buchhaltung module with fiscal years, budget accounts, transactions, and approval workflow

This commit is contained in:
Matthias Hochmeister
2026-03-28 19:48:32 +01:00
parent 4349de9bc9
commit 18b1300de8
14 changed files with 2791 additions and 1 deletions

View File

@@ -132,4 +132,42 @@ const issueOptions: any = {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const uploadIssue: any = multer(issueOptions);
export { UPLOAD_DIR, THUMBNAIL_DIR, WARTUNG_DIR, ISSUE_DIR };
// ── Buchhaltung uploads (accounting receipts / Belege) ───────────────────────
const BUCHHALTUNG_DIR = path.join(APP_ROOT, 'uploads', 'buchhaltung');
try {
if (!fs.existsSync(BUCHHALTUNG_DIR)) {
fs.mkdirSync(BUCHHALTUNG_DIR, { recursive: true });
}
} catch (err) {
logger.warn(`Could not create buchhaltung upload directory`, { err });
}
const buchhaltungStorage = multer.diskStorage({
destination(_req: any, _file: any, cb: any) {
cb(null, BUCHHALTUNG_DIR);
},
filename(_req: any, file: any, cb: any) {
const uniqueSuffix = `${Date.now()}-${Math.round(Math.random() * 1e9)}`;
const ext = path.extname(file.originalname);
cb(null, `${uniqueSuffix}${ext}`);
},
});
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const buchhaltungOptions: any = {
storage: buchhaltungStorage,
fileFilter(_req: any, file: any, cb: any) {
if (ALLOWED_TYPES.includes(file.mimetype)) {
cb(null, true);
} else {
cb(new Error(`Dateityp ${file.mimetype} ist nicht erlaubt.`));
}
},
limits: { fileSize: 20 * 1024 * 1024 },
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const uploadBuchhaltung: any = multer(buchhaltungOptions);
export { UPLOAD_DIR, THUMBNAIL_DIR, WARTUNG_DIR, ISSUE_DIR, BUCHHALTUNG_DIR };