feat(billing): env-based dev discount code forces 1 TL (NEXT_PUBLIC_DEV_DISCOUNT_CODE)
This commit is contained in:
@@ -15,6 +15,10 @@ export const DISCOUNT_CODES: Record<string, number> = {
|
||||
|
||||
export function validateDiscountCode(code: string): number | null {
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user