feat: Phase 1 – Konten, Kategorien, Transaktionen, EZB-Währungsumrechnung
Backend: - Modelle + Migration 0002: accounts, account_identifiers, category_groups, categories, transactions, exchange_rates (alle owner-gescoped). - EZB-Kursdienst (90-Tage/Historie) + Backfill-Skript; Umrechnung EUR<->CHF zum Buchungsdatum mit lokalem Cache und manueller Übersteuerung; EUR-Pivot (amount_eur_cents) eingefroren. - Kontostände + Netto-Vermögen (Umrechnung in Hauptwährung). - Router: accounts (inkl. IBAN-Identifikatoren), categories (Gruppen+Kategorien), transactions (Ausgabe/Einnahme/Transfer, cross-currency), rates. - Gruppierte Standard-Kategorien je Nutzer beim Anlegen. - pytest-Suite: Währung, Salden, Cross-Currency-Transfer, Nutzer-Isolation. Frontend: - Seiten Konten, Kategorien, Buchungen; Icon-Chip, Geldbetrag mit Umrechnung, Icon-/Farbwähler, Modal; erweitertes SVG-Icon-Set (Konto-/Kategorie-Icons). - Währungs-/Datumsformatierung (EUR de-DE, CHF de-CH), i18n DE/EN erweitert. - Live-Umrechnungs-Vorschau im Transfer-Formular. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -124,4 +124,42 @@ export const api = {
|
||||
listSettings: () => request("/settings"),
|
||||
setSetting: (key, value) =>
|
||||
request(`/settings/${key}?value=${encodeURIComponent(value)}`, { method: "PUT" }),
|
||||
|
||||
// Konten
|
||||
listAccounts: () => request("/accounts"),
|
||||
getAccount: (id) => request(`/accounts/${id}`),
|
||||
createAccount: (body) => request("/accounts", { method: "POST", body }),
|
||||
updateAccount: (id, body) => request(`/accounts/${id}`, { method: "PATCH", body }),
|
||||
deleteAccount: (id) => request(`/accounts/${id}`, { method: "DELETE" }),
|
||||
|
||||
// Kategorien (Gruppen + Kategorien)
|
||||
listCategories: () => request("/categories"),
|
||||
createGroup: (body) => request("/categories/groups", { method: "POST", body }),
|
||||
updateGroup: (id, body) => request(`/categories/groups/${id}`, { method: "PATCH", body }),
|
||||
deleteGroup: (id) => request(`/categories/groups/${id}`, { method: "DELETE" }),
|
||||
createCategory: (body) => request("/categories", { method: "POST", body }),
|
||||
updateCategory: (id, body) => request(`/categories/${id}`, { method: "PATCH", body }),
|
||||
deleteCategory: (id) => request(`/categories/${id}`, { method: "DELETE" }),
|
||||
|
||||
// Transaktionen
|
||||
listTransactions: (params = {}) => {
|
||||
const qs = new URLSearchParams();
|
||||
for (const [k, v] of Object.entries(params)) {
|
||||
if (v !== undefined && v !== null && v !== "") qs.set(k, v);
|
||||
}
|
||||
const s = qs.toString();
|
||||
return request(`/transactions${s ? `?${s}` : ""}`);
|
||||
},
|
||||
getTransaction: (id) => request(`/transactions/${id}`),
|
||||
createTransaction: (body) => request("/transactions", { method: "POST", body }),
|
||||
updateTransaction: (id, body) => request(`/transactions/${id}`, { method: "PATCH", body }),
|
||||
deleteTransaction: (id) => request(`/transactions/${id}`, { method: "DELETE" }),
|
||||
|
||||
// Wechselkurse
|
||||
rateStatus: () => request("/rates/status"),
|
||||
convertRate: (amountCents, from, to, on) => {
|
||||
const qs = new URLSearchParams({ amount_cents: amountCents, from_currency: from, to_currency: to });
|
||||
if (on) qs.set("on", on);
|
||||
return request(`/rates/convert?${qs.toString()}`);
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user