fix payment customer and dashboard settings
Build & Deploy / Build & Push Docker Image (push) Successful in 12m39s
Test / Type Check (all packages) (push) Successful in 5m8s
Build & Deploy / Deploy to VPS (push) Successful in 7s
Test / API Unit Tests (push) Failing after 4m24s
Test / Homepage Unit Tests (push) Successful in 3m27s
Test / Storefront Unit Tests (push) Successful in 4m48s
Test / Admin Unit Tests (push) Successful in 3m0s
Test / Dashboard Unit Tests (push) Successful in 4m18s
Test / API Integration Tests (push) Failing after 4m34s

This commit is contained in:
root
2026-06-29 22:15:34 -04:00
parent e1e2f55c93
commit a752a399c2
30 changed files with 4503 additions and 1214 deletions
@@ -1,4 +1,5 @@
import { prisma } from '../lib/prisma'
import { resolveSettingsEntitlements } from '../modules/companies/settingsEntitlements'
interface DriverInfo {
dateOfBirth?: Date | null
@@ -12,6 +13,11 @@ export async function applyPricingRules(
dailyRate: number,
totalDays: number
): Promise<{ applied: any[]; total: number }> {
const entitlements = await resolveSettingsEntitlements(companyId)
if (!entitlements.features['settings.pricing_rules']?.available) {
return { applied: [], total: 0 }
}
const rules = await prisma.pricingRule.findMany({ where: { companyId, isActive: true } })
const customer = await prisma.customer.findFirstOrThrow({ where: { id: customerId, companyId } })
const allDrivers: DriverInfo[] = [customer, ...additionalDrivers]