mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-03 06:27:11 +01:00
further work on billing
This commit is contained in:
committed by
Thomas Ruoff
parent
f8434233d9
commit
c396cdcbf9
@@ -1,6 +1,7 @@
|
||||
import * as mongoose from 'mongoose'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { dateFormatBackend, getDays } from '../helpers/date'
|
||||
import { BillDocument } from './bill'
|
||||
import { BookerDocument } from './booker'
|
||||
import { BOOKING_STATUS } from './enums'
|
||||
|
||||
@@ -9,6 +10,7 @@ export interface BookingDocument
|
||||
mongoose.SchemaTimestampsConfig {
|
||||
uuid: string
|
||||
booker: BookerDocument
|
||||
bill: BillDocument
|
||||
startDate: Date
|
||||
endDate: Date
|
||||
status: BOOKING_STATUS
|
||||
@@ -35,6 +37,11 @@ const BookingSchema = new mongoose.Schema<BookingDocument>(
|
||||
ref: 'Booker',
|
||||
required: true,
|
||||
},
|
||||
bill: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: 'Bill',
|
||||
required: false,
|
||||
},
|
||||
startDate: {
|
||||
type: Date,
|
||||
required: true,
|
||||
@@ -56,11 +63,6 @@ const BookingSchema = new mongoose.Schema<BookingDocument>(
|
||||
purpose: { type: String, required: false },
|
||||
org: { type: String, required: false },
|
||||
destination: { type: String, required: false },
|
||||
bill: {
|
||||
type: mongoose.Schema.Types.ObjectId,
|
||||
ref: 'bill',
|
||||
required: false,
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
|
||||
Reference in New Issue
Block a user