mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 15:07:13 +01:00
fix type errors hopefully *fingerscrossed*
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import * as mongoose from 'mongoose'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { dateFormatBackend, getDays, nowInTz } from '../helpers/date'
|
||||
|
||||
import { Bill } from './bill'
|
||||
import { Booker } from './booker'
|
||||
import { BOOKING_STATUS } from './enums'
|
||||
@@ -49,13 +50,23 @@ const BookingSchema = new mongoose.Schema<BookingDocument>(
|
||||
type: Date,
|
||||
required: true,
|
||||
get: dateFormatBackend,
|
||||
min: nowInTz(),
|
||||
validate: {
|
||||
validator: function (v: Date) {
|
||||
return v >= nowInTz()
|
||||
},
|
||||
message: (props: { value: Date }) => `${props.value} is in the past`,
|
||||
},
|
||||
},
|
||||
endDate: {
|
||||
type: Date,
|
||||
required: false,
|
||||
get: dateFormatBackend,
|
||||
min: nowInTz(),
|
||||
validate: {
|
||||
validator: function (v: Date) {
|
||||
return v >= nowInTz()
|
||||
},
|
||||
message: (props: { value: Date }) => `${props.value} is in the past`,
|
||||
},
|
||||
},
|
||||
days: {
|
||||
type: [String],
|
||||
|
||||
Reference in New Issue
Block a user