mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
add separate booking state
This commit is contained in:
@@ -3,6 +3,8 @@ import * as mongoose from 'mongoose'
|
||||
|
||||
import { getDays, dateFormatBackend } from '../helpers/date'
|
||||
|
||||
import { BOOKING_STATUS } from './bookingStatus'
|
||||
|
||||
const BookingSchema = new mongoose.Schema(
|
||||
{
|
||||
// need a seperate uuid to be able to target a booking anonimously
|
||||
@@ -30,7 +32,7 @@ const BookingSchema = new mongoose.Schema(
|
||||
},
|
||||
status: {
|
||||
type: String,
|
||||
enum: ['requested', 'confirmed', 'rejected'],
|
||||
enum: Object.values(BOOKING_STATUS),
|
||||
required: true,
|
||||
default: 'requested',
|
||||
},
|
||||
|
||||
6
db/bookingStatus.js
Normal file
6
db/bookingStatus.js
Normal file
@@ -0,0 +1,6 @@
|
||||
export const BOOKING_STATUS = {
|
||||
REQUESTED: 'requested',
|
||||
CONFIRMED: 'confirmed',
|
||||
REJECTED: 'rejected',
|
||||
CANCELED: 'canceled',
|
||||
}
|
||||
Reference in New Issue
Block a user