This commit is contained in:
root
2025-12-31 08:19:59 +00:00
parent 0d8c2ea3a3
commit d138dae2ca
8 changed files with 785 additions and 8 deletions

View File

@@ -44,6 +44,12 @@ export async function GET(request: NextRequest) {
const pointsPerChf = parseFloat(
settings.find(s => s.setting_key === 'points_per_chf')?.setting_value || '10'
)
const pointsToCryptoChf = parseFloat(
settings.find(s => s.setting_key === 'points_to_crypto_chf')?.setting_value || '100'
)
const minRedemptionPoints = parseFloat(
settings.find(s => s.setting_key === 'min_redemption_points')?.setting_value || '1000'
)
// Calculate maximum discount available
const maxDiscountChf = referralPoints / pointsToChf
@@ -52,6 +58,8 @@ export async function GET(request: NextRequest) {
referral_points: referralPoints,
points_to_chf: pointsToChf,
points_per_chf: pointsPerChf,
points_to_crypto_chf: pointsToCryptoChf,
min_redemption_points: minRedemptionPoints,
max_discount_chf: maxDiscountChf,
})
} catch (error) {