mirror of
https://github.com/tomru/pfadi-bussle.git
synced 2026-03-04 15:07:13 +01:00
small change on bill schema
This commit is contained in:
committed by
Thomas Ruoff
parent
4712167af9
commit
df6ec51af9
18
db/bill.ts
18
db/bill.ts
@@ -15,6 +15,7 @@ export interface BillDocument
|
|||||||
milageEnd: number
|
milageEnd: number
|
||||||
milage?: number
|
milage?: number
|
||||||
rate: MILAGE_RATES
|
rate: MILAGE_RATES
|
||||||
|
total: number
|
||||||
status: BILL_STATUS
|
status: BILL_STATUS
|
||||||
additionalCosts: AdditionalCosts[]
|
additionalCosts: AdditionalCosts[]
|
||||||
}
|
}
|
||||||
@@ -54,23 +55,26 @@ const BillSchema = new mongoose.Schema<BillDocument>(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
rate: {
|
rate: {
|
||||||
type: Number,
|
type: String,
|
||||||
enum: Object.values(MILAGE_RATES),
|
enum: Object.values(MILAGE_RATES),
|
||||||
default: MILAGE_RATES.EXTERN_UP_TO_200,
|
default: MILAGE_RATES.EXTERN_UP_TO_200,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
status: {
|
|
||||||
type: String,
|
|
||||||
enum: Object.values(BILL_STATUS),
|
|
||||||
default: BILL_STATUS.UNINVOICED,
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
additionalCosts: [
|
additionalCosts: [
|
||||||
{
|
{
|
||||||
name: { type: String, required: true },
|
name: { type: String, required: true },
|
||||||
value: { type: Number, 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 } }
|
{ timestamps: true, collation: { locale: 'de', strength: 1 } }
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user