Add giftcard management

This commit is contained in:
2026-06-06 14:26:33 +01:00
parent 44c9d423ec
commit 310e6aaa80
10 changed files with 1281 additions and 523 deletions
+9
View File
@@ -95,3 +95,12 @@ export function calculateAge(dateOfBirth: string | undefined | null): number | n
}
return age;
}
/**
* Format a 12-character gift card code into display format (XXXX-XXXX-XXXX).
* Example: "a3f1c9d2b4e8" → "A3F1-C9D2-B4E8"
*/
export function formatCardCode(id: string): string {
if (id.length !== 12) return id;
return `${id.slice(0, 4)}-${id.slice(4, 8)}-${id.slice(8, 12)}`.toUpperCase();
}