Update document and email message schemas to allow optional object references
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
- Modified the `object` field in both `documentJob` and `emailMessage` schemas to be non-required. - Introduced a new `objects` array field in both schemas to accommodate multiple optional object references, enhancing flexibility in data management.
This commit is contained in:
parent
940c05078e
commit
ea80bfb217
@ -14,8 +14,15 @@ const documentJobSchema = new Schema(
|
|||||||
object: {
|
object: {
|
||||||
type: Schema.Types.ObjectId,
|
type: Schema.Types.ObjectId,
|
||||||
refPath: 'objectType',
|
refPath: 'objectType',
|
||||||
required: true,
|
required: false,
|
||||||
},
|
},
|
||||||
|
objects: [
|
||||||
|
{
|
||||||
|
type: Schema.Types.ObjectId,
|
||||||
|
refPath: 'objectType',
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
],
|
||||||
state: {
|
state: {
|
||||||
type: { type: String, required: true, default: 'queued' },
|
type: { type: String, required: true, default: 'queued' },
|
||||||
progress: { type: Number, required: false },
|
progress: { type: Number, required: false },
|
||||||
|
|||||||
@ -13,7 +13,8 @@ const emailMessageSchema = new Schema(
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
objectType: { type: String, required: true },
|
objectType: { type: String, required: true },
|
||||||
object: { type: Schema.Types.ObjectId, refPath: 'objectType', required: true },
|
object: { type: Schema.Types.ObjectId, refPath: 'objectType', required: false },
|
||||||
|
objects: [{ type: Schema.Types.ObjectId, refPath: 'objectType', required: false }],
|
||||||
emailAccount: {
|
emailAccount: {
|
||||||
type: Schema.Types.ObjectId,
|
type: Schema.Types.ObjectId,
|
||||||
ref: 'emailAccount',
|
ref: 'emailAccount',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user