mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
remover booker, that's overdosed
It also brings the problem of consolidating bookers over multiple bookings. The amount of data is not justifying having it in an own entity
This commit is contained in:
@@ -3,13 +3,17 @@ import { v4 as uuidv4 } from 'uuid'
|
||||
import { dateFormatBackend, getDays, nowInTz } from '../helpers/date'
|
||||
|
||||
import { Bill } from './bill'
|
||||
import { Booker } from './booker'
|
||||
import { BOOKING_STATUS, VALIDATION_ERRORS } from './enums'
|
||||
import { getBookedDays } from './index'
|
||||
|
||||
export type Booking = {
|
||||
uuid: string
|
||||
booker?: Booker
|
||||
name: string
|
||||
email: string
|
||||
phone: string
|
||||
street: string
|
||||
zip: string
|
||||
city: string
|
||||
bill?: Bill
|
||||
startDate: string
|
||||
endDate: string
|
||||
@@ -36,11 +40,12 @@ const BookingSchema = new mongoose.Schema<BookingDocument>(
|
||||
default: uuidv4,
|
||||
index: true,
|
||||
},
|
||||
booker: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: 'Booker',
|
||||
required: true,
|
||||
},
|
||||
name: { type: String, required: true },
|
||||
email: { type: String, required: true, minlength: 5 },
|
||||
phone: { type: String, required: false },
|
||||
street: { type: String, required: true },
|
||||
zip: { type: String, required: true },
|
||||
city: { type: String, required: true },
|
||||
bill: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: 'Bill',
|
||||
|
||||
Reference in New Issue
Block a user