Cài đặt tính năng hiển thị chi phí

This commit is contained in:
2026-06-15 20:20:34 +07:00
parent 879f20985c
commit f52580717f
8 changed files with 319 additions and 42 deletions
+4 -1
View File
@@ -159,12 +159,15 @@ let TourController = class TourController {
this.prisma = prisma;
}
async createTour(body, req) {
const { title, startDate, endDate } = body;
const { title, startDate, endDate, adultCount, childCount, childDiscount } = body;
return this.prisma.tour.create({
data: {
title,
startDate: startDate ? new Date(startDate) : null,
endDate: endDate ? new Date(endDate) : null,
adultCount: adultCount || 1,
childCount: childCount || 0,
childDiscount: childDiscount || 0,
createdById: req.user.id,
participants: {
create: {