feat(buchhaltung): add categories, recurring tx scheduling, sub-pot budget validation, and UX polish
This commit is contained in:
@@ -9,6 +9,7 @@ import type {
|
||||
BuchhaltungStats,
|
||||
WiederkehrendBuchung, WiederkehrendFormData,
|
||||
Freigabe,
|
||||
Kategorie,
|
||||
} from '../types/buchhaltung.types';
|
||||
|
||||
export const buchhaltungApi = {
|
||||
@@ -165,6 +166,23 @@ export const buchhaltungApi = {
|
||||
return r.data;
|
||||
},
|
||||
|
||||
// ── Kategorien ──────────────────────────────────────────────────────────────
|
||||
getKategorien: async (haushaltsjahrId: number): Promise<Kategorie[]> => {
|
||||
const r = await api.get(`/api/buchhaltung/kategorien?haushaltsjahr_id=${haushaltsjahrId}`);
|
||||
return r.data.data;
|
||||
},
|
||||
createKategorie: async (data: { haushaltsjahr_id: number; bezeichnung: string; sortierung?: number }): Promise<Kategorie> => {
|
||||
const r = await api.post('/api/buchhaltung/kategorien', data);
|
||||
return r.data.data;
|
||||
},
|
||||
updateKategorie: async (id: number, data: Partial<{ bezeichnung: string; sortierung: number }>): Promise<Kategorie> => {
|
||||
const r = await api.patch(`/api/buchhaltung/kategorien/${id}`, data);
|
||||
return r.data.data;
|
||||
},
|
||||
deleteKategorie: async (id: number): Promise<void> => {
|
||||
await api.delete(`/api/buchhaltung/kategorien/${id}`);
|
||||
},
|
||||
|
||||
// ── Freigaben ─────────────────────────────────────────────────────────────────
|
||||
requestFreigabe: async (transaktionId: number): Promise<Freigabe> => {
|
||||
const r = await api.post(`/api/buchhaltung/${transaktionId}/freigabe`);
|
||||
|
||||
Reference in New Issue
Block a user