From 528130dc46460eb72d4ef0c1e444280af387049f Mon Sep 17 00:00:00 2001 From: ludvij Date: Sat, 2 Apr 2022 15:53:56 +0200 Subject: [PATCH] fixed order --- restapi/interfaces/OrderInterface.ts | 2 +- restapi/schemas/OrderSchema.ts | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/restapi/interfaces/OrderInterface.ts b/restapi/interfaces/OrderInterface.ts index 8b95162..2095099 100644 --- a/restapi/interfaces/OrderInterface.ts +++ b/restapi/interfaces/OrderInterface.ts @@ -4,7 +4,7 @@ import IProduct from "./ProductInterface"; export default interface IOrder extends Document { webId: string addres: string - shipping: number + shippingPrice: number totalPrice: number products: Map } \ No newline at end of file diff --git a/restapi/schemas/OrderSchema.ts b/restapi/schemas/OrderSchema.ts index 6a43880..9a916e3 100644 --- a/restapi/schemas/OrderSchema.ts +++ b/restapi/schemas/OrderSchema.ts @@ -7,12 +7,13 @@ const Map = Schema.Types.Map; const orderSchema = new Schema ( { webId: {type: String, required: true}, - address: String, - shipping: Number, - totalPrice: Number, - products: {type: Map, of: Number} - - } + address: {type: String, required: true}, + shippingPrice: {type: Number, required: true}, + totalPrice: {type: Number, required: true}, + products: {type: Map, of: Number, required: true} + }, { + timestamps: true + } );