Add +-1000 spinner buttons to amount fields, floor (not round) to nearest 1000 in all allocation calculations
Deploy App / deploy (push) Successful in 45s
Deploy App / deploy (push) Successful in 45s
This commit is contained in:
@@ -2,6 +2,7 @@ import { NextRequest, NextResponse } from "next/server";
|
||||
import { z } from "zod";
|
||||
import { prisma } from "@/lib/db";
|
||||
import { computeSecurityYearlyValues } from "@/lib/calculations";
|
||||
import { floorToThousand } from "@/lib/format";
|
||||
|
||||
const transitionItemSchema = z.object({
|
||||
positionType: z.enum(["SECURITY", "REAL_ESTATE"]),
|
||||
@@ -132,6 +133,11 @@ export async function PUT(
|
||||
}
|
||||
}
|
||||
|
||||
// Auf ein Vielfaches von 1'000 abrunden, damit der Betrag ueber Wertschriften
|
||||
// (die nur in 1'000er-Schritten Sparbeitraege/Startwerte annehmen) vollstaendig
|
||||
// verteilbar bleibt.
|
||||
incomingCapital = floorToThousand(incomingCapital);
|
||||
|
||||
const transition = await prisma.$transaction(async (tx) => {
|
||||
await tx.phaseTransition.deleteMany({ where: { fromPhaseId: phaseId } });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user