fix notification and add billing page and contract

This commit is contained in:
root
2026-05-13 00:09:39 -04:00
committed by Administrator
parent 1a39aa8433
commit 89621a163b
52 changed files with 5631 additions and 1110 deletions
+19
View File
@@ -99,6 +99,25 @@ const chargeSchema = z.object({
failureUrl: z.string().url(),
})
router.get('/company', async (req, res, next) => {
try {
const payments = await prisma.rentalPayment.findMany({
where: { companyId: req.companyId },
include: {
reservation: {
include: {
customer: true,
vehicle: true,
},
},
},
orderBy: { createdAt: 'desc' },
take: 100,
})
res.json({ data: payments })
} catch (err) { next(err) }
})
router.get('/reservations/:id', async (req, res, next) => {
try {
const payments = await prisma.rentalPayment.findMany({