feat: use mongoose-sequence to increment order number

This commit is contained in:
RustamRu
2025-02-02 14:51:55 +03:00
parent b3d4aa3c86
commit 759aad2d80
5 changed files with 55 additions and 21 deletions
@@ -0,0 +1,14 @@
const { Schema, model } = require('mongoose')
const schema = new Schema({
_id: {
type: String,
required: true,
},
sequenceValue: {
type: Number,
default: 0
}
})
exports.OrderNumberModel = model('dry-wash-order-number', schema)