Poter inserire un Ordine anche per un altra persona... (Modalità Cassa)
This commit is contained in:
@@ -17,6 +17,7 @@ const CartSchema = new Schema({
|
||||
userId: { type: Schema.Types.ObjectId, ref: 'User' },
|
||||
totalQty: { type: Number, default: 0 },
|
||||
totalPrice: { type: Number, default: 0 },
|
||||
totalPriceCalc: { type: Number, default: 0 },
|
||||
department: {
|
||||
type: String, ref: 'Department',
|
||||
},
|
||||
@@ -88,6 +89,7 @@ module.exports.updateCartByUserId = function (userId, newCart, callback) {
|
||||
items: newCart.items,
|
||||
totalQty: newCart.totalQty,
|
||||
totalPrice: newCart.totalPrice,
|
||||
totalPriceCalc: newCart.totalPriceCalc,
|
||||
userId: userId,
|
||||
},
|
||||
},
|
||||
@@ -106,6 +108,7 @@ module.exports.updateCartByCartId = async function (cartId, newCart) {
|
||||
const items = newCart.items;
|
||||
const totalQty = newCart.totalQty;
|
||||
const totalPrice = newCart.totalPrice;
|
||||
const totalPriceCalc = newCart.totalPriceCalc;
|
||||
const note = newCart.note;
|
||||
|
||||
const modify_at = new Date();
|
||||
@@ -114,6 +117,7 @@ module.exports.updateCartByCartId = async function (cartId, newCart) {
|
||||
$set: {
|
||||
items,
|
||||
totalPrice,
|
||||
totalPriceCalc,
|
||||
totalQty,
|
||||
note,
|
||||
modify_at: new Date(),
|
||||
|
||||
Reference in New Issue
Block a user