Skip to content

Commit

Permalink
🗃️ Update Order Model
Browse files Browse the repository at this point in the history
  • Loading branch information
nmdra committed Oct 11, 2024
1 parent 69a1432 commit 60cd956
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion backend/models/DLOModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ const dorderSchema = new mongoose.Schema(
{
/* generate and store the oID:{type: String,}, */

oID: { type: String },
oID: {
type: String,
required: [true, 'Order ID required'], // Ensure each order has a unique ID
unique: [true, 'Order already exists']
},

orderID: {
type: String, // You can change this to any type or ObjectId if needed
Expand Down
1 change: 1 addition & 0 deletions backend/models/OrderModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const orderSchema = new mongoose.Schema(
totalPrice: { type: Number, required: true },
orderStatus: {
type: String,
enum: ['Pending','Rejected', 'Ready',' .Ready. ', 'Picked Up', 'On The Way', 'Delivered'],
default: 'Pending',
},
deliveryDate: {
Expand Down

0 comments on commit 60cd956

Please sign in to comment.