first
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { Schema, model } from "mongoose";
|
||||
|
||||
import { ICancelOrderItem } from "./Abstraction/ICancelItem";
|
||||
import { OrderItemsStatus } from "../../../common/enums/order.enum";
|
||||
//TODO:add a refund model to refund user after complete return
|
||||
const CancelOrderItemSchema = new Schema<ICancelOrderItem>(
|
||||
{
|
||||
cancelOrderId: { type: Schema.Types.ObjectId, ref: "CancelOrder", required: true },
|
||||
orderItem: { type: Schema.Types.ObjectId, ref: "OrderItem", required: true },
|
||||
shipmentItem: { type: Schema.Types.ObjectId, required: true },
|
||||
quantity: { type: Number, required: true },
|
||||
comment: { type: String, required: true },
|
||||
reason: { type: Schema.Types.ObjectId, ref: "CancelReason", required: true },
|
||||
status: { type: String, enum: OrderItemsStatus, default: OrderItemsStatus.cancelled_system },
|
||||
},
|
||||
{ timestamps: true, toJSON: { versionKey: false, virtuals: true }, id: false },
|
||||
);
|
||||
|
||||
const CancelOrderItemModel = model<ICancelOrderItem>("CancelOrderItem", CancelOrderItemSchema);
|
||||
export { CancelOrderItemModel };
|
||||
Reference in New Issue
Block a user