Bereits an AG übergeben läuft jetzt so, wie du es beschrieben hast:
Some checks failed
CI / Build (push) Failing after 1m6s
CI / Deploy (push) Has been skipped

Bezahlt setzen zählt in der Budgetanzeige automatisch mit.
Zusätzlich gibt es unter Neue Ausgabe eine eigene Insel für zusätzlich bereits übergebenes Geld, falls das nicht über einzelne Ausgaben läuft.
In den Budgetkarten wird das als gestrichelte Querlinie plus eigenem Chip dargestellt
This commit is contained in:
Jan
2026-04-13 21:22:02 +02:00
parent 051de0eea3
commit 34e5f96db7
13 changed files with 317 additions and 21 deletions

View File

@@ -0,0 +1 @@
ALTER TABLE "budgets" ADD COLUMN "released_amount" DECIMAL(10, 2) NOT NULL DEFAULT 0;

View File

@@ -88,6 +88,7 @@ model Budget {
id String @id @default(cuid())
name String
totalBudget Decimal @db.Decimal(10, 2) @map("total_budget")
releasedAmount Decimal @default(0) @db.Decimal(10, 2) @map("released_amount")
colorCode String @map("color_code")
workingGroupId String @map("working_group_id")
periodId String @map("period_id")

View File

@@ -60,7 +60,8 @@ async function upsertBudget(
periodId: string,
name: string,
totalBudget: number,
colorCode: string
colorCode: string,
releasedAmount = 0
) {
return prisma.budget.upsert({
where: {
@@ -72,11 +73,13 @@ async function upsertBudget(
},
update: {
totalBudget,
releasedAmount,
colorCode
},
create: {
name,
totalBudget,
releasedAmount,
colorCode,
workingGroupId,
periodId
@@ -128,9 +131,9 @@ async function main() {
const awareness = await upsertWorkingGroup("AG Awareness");
const technik = await upsertWorkingGroup("AG Technik");
await upsertBudget(deko.id, currentPeriod.id, "Deko Hauptbudget", 0, "#FFB94A");
await upsertBudget(awareness.id, currentPeriod.id, "Awareness Hauptbudget", 800, "#68A35D");
const technikBudget = await upsertBudget(technik.id, currentPeriod.id, "Technik Infrastruktur", 1500, "#5677F6");
await upsertBudget(deko.id, currentPeriod.id, "Deko Hauptbudget", 0, "#FFB94A", 0);
await upsertBudget(awareness.id, currentPeriod.id, "Awareness Hauptbudget", 800, "#68A35D", 250);
const technikBudget = await upsertBudget(technik.id, currentPeriod.id, "Technik Infrastruktur", 1500, "#5677F6", 500);
await upsertUser({
username: "vorstand-a",