add review and booking policies
This commit is contained in:
@@ -172,8 +172,13 @@ enum EmployeeRole {
|
||||
|
||||
enum VehicleStatus {
|
||||
AVAILABLE
|
||||
RESERVED
|
||||
READY
|
||||
RENTED
|
||||
RETURNED
|
||||
NEEDS_CLEANING
|
||||
MAINTENANCE
|
||||
DAMAGE_REVIEW
|
||||
OUT_OF_SERVICE
|
||||
}
|
||||
|
||||
@@ -223,6 +228,11 @@ enum BookingSource {
|
||||
API
|
||||
}
|
||||
|
||||
enum ReservationPhotoType {
|
||||
PICKUP
|
||||
DROPOFF
|
||||
}
|
||||
|
||||
enum CancelledBy {
|
||||
COMPANY
|
||||
RENTER
|
||||
@@ -398,6 +408,36 @@ enum NotificationType {
|
||||
REVIEW_REQUEST
|
||||
}
|
||||
|
||||
enum FeedbackCategory {
|
||||
BOOKING
|
||||
PICKUP
|
||||
VEHICLE_CLEANLINESS
|
||||
VEHICLE_CONDITION
|
||||
STAFF_SERVICE
|
||||
PRICING
|
||||
DEPOSIT
|
||||
INSURANCE
|
||||
DAMAGE_CLAIM
|
||||
RETURN_PROCESS
|
||||
COMMUNICATION
|
||||
ROADSIDE_ASSISTANCE
|
||||
BILLING
|
||||
OTHER
|
||||
}
|
||||
|
||||
enum ComplaintSeverity {
|
||||
LEVEL_1
|
||||
LEVEL_2
|
||||
LEVEL_3
|
||||
}
|
||||
|
||||
enum ComplaintStatus {
|
||||
OPEN
|
||||
INVESTIGATING
|
||||
RESOLVED
|
||||
CLOSED
|
||||
}
|
||||
|
||||
enum NotificationChannel {
|
||||
EMAIL
|
||||
SMS
|
||||
@@ -450,6 +490,7 @@ model Company {
|
||||
insurancePolicies InsurancePolicy[]
|
||||
pricingRules PricingRule[]
|
||||
notifications Notification[] @relation("CompanyNotifications")
|
||||
complaints Complaint[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -1083,7 +1124,9 @@ model Customer {
|
||||
licenseApprovedAt DateTime?
|
||||
licenseApprovalNote String?
|
||||
|
||||
reservations Reservation[]
|
||||
reservations Reservation[]
|
||||
complaints Complaint[]
|
||||
reviewOptOut Boolean @default(false)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
@@ -1134,6 +1177,11 @@ model Reservation {
|
||||
checkInFuelLevel String?
|
||||
checkOutFuelLevel String?
|
||||
|
||||
reviewRequestSentAt DateTime?
|
||||
reviewReminderSentAt DateTime?
|
||||
reviewFinalReminderSentAt DateTime?
|
||||
reviewPaused Boolean @default(false)
|
||||
|
||||
insurances ReservationInsurance[]
|
||||
insuranceTotal Int @default(0)
|
||||
additionalDrivers AdditionalDriver[]
|
||||
@@ -1143,7 +1191,9 @@ model Reservation {
|
||||
damageReports DamageReport[]
|
||||
rentalPayments RentalPayment[]
|
||||
inspections DamageInspection[]
|
||||
photos ReservationPhoto[]
|
||||
review Review?
|
||||
complaints Complaint[]
|
||||
damageChargeAmount Int?
|
||||
damageChargeNote String?
|
||||
extras Json?
|
||||
@@ -1183,19 +1233,21 @@ model RentalPayment {
|
||||
}
|
||||
|
||||
model Review {
|
||||
id String @id @default(cuid())
|
||||
reservationId String @unique
|
||||
reservation Reservation @relation(fields: [reservationId], references: [id])
|
||||
id String @id @default(cuid())
|
||||
reservationId String @unique
|
||||
reservation Reservation @relation(fields: [reservationId], references: [id])
|
||||
renterId String?
|
||||
renter Renter? @relation(fields: [renterId], references: [id])
|
||||
renter Renter? @relation(fields: [renterId], references: [id])
|
||||
companyId String
|
||||
overallRating Int
|
||||
vehicleRating Int?
|
||||
serviceRating Int?
|
||||
comment String?
|
||||
isPublished Boolean @default(true)
|
||||
isPublished Boolean @default(true)
|
||||
companyReply String?
|
||||
companyRepliedAt DateTime?
|
||||
category FeedbackCategory?
|
||||
complaints Complaint[]
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@ -1203,6 +1255,36 @@ model Review {
|
||||
@@map("reviews")
|
||||
}
|
||||
|
||||
model Complaint {
|
||||
id String @id @default(cuid())
|
||||
companyId String
|
||||
company Company @relation(fields: [companyId], references: [id], onDelete: Cascade)
|
||||
reservationId String?
|
||||
reservation Reservation? @relation(fields: [reservationId], references: [id])
|
||||
reviewId String?
|
||||
review Review? @relation(fields: [reviewId], references: [id])
|
||||
customerId String?
|
||||
customer Customer? @relation(fields: [customerId], references: [id])
|
||||
|
||||
severity ComplaintSeverity @default(LEVEL_1)
|
||||
status ComplaintStatus @default(OPEN)
|
||||
category FeedbackCategory
|
||||
subject String
|
||||
description String?
|
||||
resolution String?
|
||||
notes String?
|
||||
assignedTo String?
|
||||
resolvedAt DateTime?
|
||||
resolvedBy String?
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
@@index([companyId])
|
||||
@@index([reservationId])
|
||||
@@map("complaints")
|
||||
}
|
||||
|
||||
// ═══════════════════════════════════════════════════════════════
|
||||
// NOTIFICATIONS
|
||||
// ═══════════════════════════════════════════════════════════════
|
||||
@@ -1645,3 +1727,15 @@ model PricingPromotion {
|
||||
@@index([isActive])
|
||||
@@map("pricing_promotions")
|
||||
}
|
||||
|
||||
model ReservationPhoto {
|
||||
id String @id @default(cuid())
|
||||
reservationId String
|
||||
reservation Reservation @relation(fields: [reservationId], references: [id], onDelete: Cascade)
|
||||
type ReservationPhotoType
|
||||
url String
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([reservationId])
|
||||
@@map("reservation_photos")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user