Enhance printer schema by adding optional code field and default ID generation
All checks were successful
farmcontrol/farmcontrol-ws/pipeline/head This commit looks good

- Introduced a new optional field `code` in the printer schema for additional identification.
- Updated the `_id` field to use a default value generated by `generateId()` for improved uniqueness.
- Ensured schema maintains required fields and defaults for better data integrity.
This commit is contained in:
Tom Butcher 2026-07-26 21:11:49 +01:00
parent 0a1f75d050
commit 652d62c758

View File

@ -19,7 +19,8 @@ const alertSchema = new Schema(
type: { type: String, required: true }, // error, info, message
message: { type: String, required: false },
actions: [{ type: String, required: false, default: [] }],
_id: { type: String, required: true },
_id: { type: String, required: true, default: () => generateId()() },
code: { type: String, required: false },
canDismiss: { type: Boolean, required: true, default: true },
},
{ timestamps: true, _id: false }