This commit is contained in:
root
2025-12-20 22:05:21 +01:00
parent e1a0966dee
commit f2c3b04a88
10 changed files with 1134 additions and 28 deletions

View File

@@ -71,11 +71,13 @@ export async function POST(request: NextRequest) {
}
// Calculate price
// ppu is stored as integer where 1000 = $1.00, so divide by 1000 to get actual price
const pricePerUnit = drop.ppu / 1000
let priceAmount = 0
if (drop.unit === 'kg') {
priceAmount = (size / 1000) * drop.ppu
priceAmount = (size / 1000) * pricePerUnit
} else {
priceAmount = size * drop.ppu
priceAmount = size * pricePerUnit
}
// Round to 2 decimal places