feat: add Buchhaltung module with fiscal years, budget accounts, transactions, and approval workflow
This commit is contained in:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user