fix notification and add billing page and contract
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user