FK: userId
user
activityHistory userId (PK)
activityId (PK) username role
trip userId (FK) FK: userId password (hashed) FK: roleId roleId (PK)
tripId (PK) activityType email roleName
userId (FK) timestamp createdAt description
driverId (FK) details FK: userId updatedAt
vehicleId (FK) deletedAt (Soft Delete)
startLocation FK: driverId
driver
file endLocation FK: vehicleId driverId (PK)
fileId (PK) startTime userId (FK)
entityId endTime vehicle
vehicleId (PK) FK: driverId licenseNumber
entityType statusId (FK) statusId (FK)
FK: tripId driverId (FK) FK: statusId
filePath createdAt
fileSize licensePlate (Unique)
insurance model updatedAt
fileExtension FK: vehicleId
uploadedAt insuranceId (PK) capacity
statusId (FK) FK: statusId
vehicleId (FK)
providerName createdAt status
payment policyNumber statusId (PK)
paymentId (PK) startDate FK: statusId statusName
tripId (FK) endDate description
amount
currency FK: statusId
paymentMethod
paymentDate
statusId (FK)