mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 14:37:13 +01:00
add missing fields to model
This commit is contained in:
11
db/schema.js
11
db/schema.js
@@ -5,7 +5,10 @@ import { getDays, dateFormat } from '../lib/dateHelper'
|
||||
export const BookerSchema = new Schema(
|
||||
{
|
||||
name: { type: String, required: true },
|
||||
email: { type: String, required: true, unique: true },
|
||||
email: { type: String, required: true, unique: true, minlength: 5 },
|
||||
street: { type: String, required: true },
|
||||
zip: { type: String, required: true },
|
||||
city: { type: String, required: true },
|
||||
},
|
||||
{ timestamps: true }
|
||||
)
|
||||
@@ -17,14 +20,18 @@ export const BookingSchema = new Schema(
|
||||
type: Date,
|
||||
required: true,
|
||||
get: dateFormat,
|
||||
min: new Date(),
|
||||
},
|
||||
endDate: { type: Date, required: false, get: dateFormat },
|
||||
endDate: { type: Date, required: false, get: dateFormat, min: new Date() },
|
||||
status: {
|
||||
type: String,
|
||||
enum: ['requested', 'confirmed', 'rejected'],
|
||||
required: true,
|
||||
default: 'requested',
|
||||
},
|
||||
purpose: { type: String, required: false },
|
||||
org: { type: String, required: false },
|
||||
destination: { type: String, required: false },
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
|
||||
Reference in New Issue
Block a user