feat:drinkkaart
This commit is contained in:
18
apps/web/src/lib/drinkkaart.ts
Normal file
18
apps/web/src/lib/drinkkaart.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
// Frontend constants and utilities for the Drinkkaart feature.
|
||||
|
||||
export const TOPUP_PRESETS_CENTS = [500, 1000, 2000, 5000] as const;
|
||||
// = €5, €10, €20, €50
|
||||
|
||||
export const DEDUCTION_PRESETS_CENTS = [150, 200, 300, 500] as const;
|
||||
// = €1,50 / €2,00 / €3,00 / €5,00 — typical drink prices
|
||||
|
||||
export const TOPUP_MIN_CENTS = 100; // €1
|
||||
export const TOPUP_MAX_CENTS = 50000; // €500
|
||||
|
||||
/** Format a cents integer as a Belgian euro string, e.g. 1250 → "€ 12,50". */
|
||||
export function formatCents(cents: number): string {
|
||||
return new Intl.NumberFormat("nl-BE", {
|
||||
style: "currency",
|
||||
currency: "EUR",
|
||||
}).format(cents / 100);
|
||||
}
|
||||
Reference in New Issue
Block a user