feat(billing): env-based dev discount code forces 1 TL (NEXT_PUBLIC_DEV_DISCOUNT_CODE)

This commit is contained in:
egecankomur
2026-05-14 23:22:38 +03:00
parent 12397d409d
commit 2d67d49255
+4
View File
@@ -15,6 +15,10 @@ export const DISCOUNT_CODES: Record<string, number> = {
export function validateDiscountCode(code: string): number | null { export function validateDiscountCode(code: string): number | null {
const normalized = code.trim().toUpperCase(); const normalized = code.trim().toUpperCase();
// NEXT_PUBLIC_DEV_DISCOUNT_CODE: forces price to 1 TL for testing
// Set in Coolify env vars — remove when done testing
const devCode = process.env.NEXT_PUBLIC_DEV_DISCOUNT_CODE?.trim().toUpperCase();
if (devCode && normalized === devCode) return 1;
return DISCOUNT_CODES[normalized] ?? null; return DISCOUNT_CODES[normalized] ?? null;
} }