From 3fcd06806b0788c5635d571db9fdc11d483fd108 Mon Sep 17 00:00:00 2001 From: Sahar Mokarrami Date: Sun, 5 Apr 2026 13:06:42 +0330 Subject: [PATCH] refactor(order): improve handler --- purchaseapp/delivery/http/order/handler.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/purchaseapp/delivery/http/order/handler.go b/purchaseapp/delivery/http/order/handler.go index b88f7133..9ae96087 100644 --- a/purchaseapp/delivery/http/order/handler.go +++ b/purchaseapp/delivery/http/order/handler.go @@ -4,7 +4,6 @@ import ( richerror "git.gocasts.ir/ebhomengo/niki/pkg/rich_error" "git.gocasts.ir/ebhomengo/niki/purchaseapp/entity" "git.gocasts.ir/ebhomengo/niki/purchaseapp/service/order" - "git.gocasts.ir/ebhomengo/niki/types" "github.com/labstack/echo/v4" "net/http" "time" @@ -28,10 +27,10 @@ func (h *Handler) CreateOrderHandler(c echo.Context) error { orderItems := req.OrderItems order := entity.Order{ ID: 0, - UserID: types.ID(req.UserID), - TotalAmount: types.Price(req.TotalAmount), - TotalDiscount: types.Price(req.TotalDiscount), - ShippingID: types.ID(req.ShippingID), + UserID: req.UserID, + TotalAmount: req.TotalAmount, + TotalDiscount: req.TotalDiscount, + ShippingID: req.ShippingID, PaymentMethod: req.PaymentMethod, ProcessStatus: entity.WaitingToPay, PaymentStatus: entity.UnPaid,