From df6ec51af9f9360f593ed3f9dc1c9052dfc8d7da Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Mon, 5 Oct 2020 00:08:20 +0200 Subject: [PATCH] small change on bill schema --- db/bill.ts | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/db/bill.ts b/db/bill.ts index 91717c6..99c0b39 100644 --- a/db/bill.ts +++ b/db/bill.ts @@ -15,6 +15,7 @@ export interface BillDocument milageEnd: number milage?: number rate: MILAGE_RATES + total: number status: BILL_STATUS additionalCosts: AdditionalCosts[] } @@ -54,23 +55,26 @@ const BillSchema = new mongoose.Schema( }, }, rate: { - type: Number, + type: String, enum: Object.values(MILAGE_RATES), default: MILAGE_RATES.EXTERN_UP_TO_200, required: true, }, - status: { - type: String, - enum: Object.values(BILL_STATUS), - default: BILL_STATUS.UNINVOICED, - required: true, - }, additionalCosts: [ { name: { type: String, required: true }, value: { type: Number, required: true }, }, ], + total: { + type: Number, + required: true, + }, + status: { + type: String, + enum: Object.values(BILL_STATUS), + default: BILL_STATUS.UNINVOICED, + }, }, { timestamps: true, collation: { locale: 'de', strength: 1 } } )