Update invoice schema to support dynamic references for 'from' and 'to' fields by introducing 'fromType' and 'toType' fields, enhancing flexibility in vendor and client associations.
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good
This commit is contained in:
parent
6d4ed27996
commit
cf979a6db0
@ -33,8 +33,10 @@ const invoiceSchema = new Schema(
|
|||||||
shippingAmountWithTax: { type: Number, required: true, default: 0 },
|
shippingAmountWithTax: { type: Number, required: true, default: 0 },
|
||||||
grandTotalAmount: { type: Number, required: true, default: 0 },
|
grandTotalAmount: { type: Number, required: true, default: 0 },
|
||||||
totalTaxAmount: { type: Number, required: true, default: 0 },
|
totalTaxAmount: { type: Number, required: true, default: 0 },
|
||||||
from: { type: Schema.Types.ObjectId, ref: 'vendor', required: false },
|
from: { type: Schema.Types.ObjectId, refPath: 'fromType', required: false },
|
||||||
to: { type: Schema.Types.ObjectId, ref: 'client', required: false },
|
fromType: { type: String, required: false },
|
||||||
|
to: { type: Schema.Types.ObjectId, refPath: 'toType', required: false },
|
||||||
|
toType: { type: String, required: false },
|
||||||
state: {
|
state: {
|
||||||
type: { type: String, required: true, default: 'draft' },
|
type: { type: String, required: true, default: 'draft' },
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user