fix architecture and write new tests
This commit is contained in:
@@ -13,7 +13,7 @@ export async function applyPricingRules(
|
||||
totalDays: number
|
||||
): Promise<{ applied: any[]; total: number }> {
|
||||
const rules = await prisma.pricingRule.findMany({ where: { companyId, isActive: true } })
|
||||
const customer = await prisma.customer.findUniqueOrThrow({ where: { id: customerId } })
|
||||
const customer = await prisma.customer.findFirstOrThrow({ where: { id: customerId, companyId } })
|
||||
const allDrivers: DriverInfo[] = [customer, ...additionalDrivers]
|
||||
const applied: any[] = []
|
||||
const baseAmount = dailyRate * totalDays
|
||||
|
||||
Reference in New Issue
Block a user