forked from ebhomengo/niki
refactor(order): improve handler
This commit is contained in:
parent
c5b96ee64e
commit
3fcd06806b
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue