0.37.1: Bezahlt-am-Datum setzt die Rate automatisch auf bezahlt
Some checks failed
Prüfung / tests (push) Has been cancelled
Prüfung / container (push) Has been cancelled

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
Claude
2026-10-26 06:44:38 +00:00
parent ba57e97de9
commit 3bc50cdfec
6 changed files with 33 additions and 2 deletions

View File

@@ -306,6 +306,10 @@ describe.skipIf(!url)("Übernahme aus V70 über die API", () => {
await app.inject({ method: "PATCH", url: `/api/zahlungen/${r1.id}`, payload: { status: "gestellt" } });
await app.inject({ method: "PATCH", url: `/api/vorgaenge/${richten.id}`, payload: { start: "2026-11-16" } });
expect((await app.inject(`/api/zahlungen/${r1.id}`)).json().termin).toBe("2026-11-10");
// „Bezahlt am“ eingetragen: Status geht von selbst auf bezahlt; zurück auf gestellt nimmt das Datum weg (Henning, 26.10.2026)
expect((await app.inject({ method: "PATCH", url: `/api/zahlungen/${r1.id}`, payload: { bezahlt_am: "2026-11-20" } })).json().status).toBe("bezahlt");
const zurueck = (await app.inject({ method: "PATCH", url: `/api/zahlungen/${r1.id}`, payload: { status: "gestellt" } })).json();
expect([zurueck.status, zurueck.bezahlt_am]).toEqual(["gestellt", null]);
expect((await app.inject("/api/terminplan")).json().zahlungen.filter((z: { projekt_id: string }) => z.projekt_id === p.id)).toHaveLength(4);
// alle gelöscht: es kommt kein neuer automatisch
for (const z of await raten(p.id)) await app.inject({ method: "DELETE", url: `/api/zahlungen/${z.id}` });