feat: add Buchhaltung dashboard widget, CSV export, Bestellungen linking, recurring bookings, and approval workflow
This commit is contained in:
@@ -7,6 +7,8 @@ import type {
|
||||
Transaktion, TransaktionFormData, TransaktionFilters,
|
||||
Beleg,
|
||||
BuchhaltungStats,
|
||||
WiederkehrendBuchung, WiederkehrendFormData,
|
||||
Freigabe,
|
||||
} from '../types/buchhaltung.types';
|
||||
|
||||
export const buchhaltungApi = {
|
||||
@@ -126,4 +128,41 @@ export const buchhaltungApi = {
|
||||
deleteBeleg: async (id: number): Promise<void> => {
|
||||
await api.delete(`/api/buchhaltung/belege/${id}`);
|
||||
},
|
||||
|
||||
// ── Wiederkehrend ─────────────────────────────────────────────────────────────
|
||||
getWiederkehrend: async (): Promise<WiederkehrendBuchung[]> => {
|
||||
const r = await api.get('/api/buchhaltung/wiederkehrend');
|
||||
return r.data.data;
|
||||
},
|
||||
createWiederkehrend: async (data: WiederkehrendFormData): Promise<WiederkehrendBuchung> => {
|
||||
const r = await api.post('/api/buchhaltung/wiederkehrend', data);
|
||||
return r.data.data;
|
||||
},
|
||||
updateWiederkehrend: async (id: number, data: Partial<WiederkehrendFormData>): Promise<WiederkehrendBuchung> => {
|
||||
const r = await api.patch(`/api/buchhaltung/wiederkehrend/${id}`, data);
|
||||
return r.data.data;
|
||||
},
|
||||
deleteWiederkehrend: async (id: number): Promise<void> => {
|
||||
await api.delete(`/api/buchhaltung/wiederkehrend/${id}`);
|
||||
},
|
||||
|
||||
// ── CSV Export ────────────────────────────────────────────────────────────────
|
||||
exportCsv: async (haushaltsjahrId: number): Promise<Blob> => {
|
||||
const r = await api.get(`/api/buchhaltung/export/csv?haushaltsjahr_id=${haushaltsjahrId}`, { responseType: 'blob' });
|
||||
return r.data;
|
||||
},
|
||||
|
||||
// ── Freigaben ─────────────────────────────────────────────────────────────────
|
||||
requestFreigabe: async (transaktionId: number): Promise<Freigabe> => {
|
||||
const r = await api.post(`/api/buchhaltung/${transaktionId}/freigabe`);
|
||||
return r.data.data;
|
||||
},
|
||||
approveFreigabe: async (id: number, kommentar?: string): Promise<Freigabe> => {
|
||||
const r = await api.patch(`/api/buchhaltung/freigaben/${id}/genehmigen`, { kommentar });
|
||||
return r.data.data;
|
||||
},
|
||||
rejectFreigabe: async (id: number, kommentar?: string): Promise<Freigabe> => {
|
||||
const r = await api.patch(`/api/buchhaltung/freigaben/${id}/ablehnen`, { kommentar });
|
||||
return r.data.data;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user