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 { getDays, dateFormatBackend } from '../helpers/date'
|
||||||
|
|
||||||
|
import { BOOKING_STATUS } from './bookingStatus'
|
||||||
|
|
||||||
const BookingSchema = new mongoose.Schema(
|
const BookingSchema = new mongoose.Schema(
|
||||||
{
|
{
|
||||||
// need a seperate uuid to be able to target a booking anonimously
|
// need a seperate uuid to be able to target a booking anonimously
|
||||||
@@ -30,7 +32,7 @@ const BookingSchema = new mongoose.Schema(
|
|||||||
},
|
},
|
||||||
status: {
|
status: {
|
||||||
type: String,
|
type: String,
|
||||||
enum: ['requested', 'confirmed', 'rejected'],
|
enum: Object.values(BOOKING_STATUS),
|
||||||
required: true,
|
required: true,
|
||||||
default: 'requested',
|
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