update
This commit is contained in:
parent
6c29945831
commit
57739506ac
@ -32,7 +32,7 @@ func (s *OrderService) Log(format string, val ...any) {
|
|||||||
s.log.Log(format, val...)
|
s.log.Log(format, val...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: REFACTOR !!
|
// Refactor
|
||||||
func (s *OrderService) CreateOrder(ctx context.Context, basketID string) (*model.OrderModel, error) {
|
func (s *OrderService) CreateOrder(ctx context.Context, basketID string) (*model.OrderModel, error) {
|
||||||
basketAPI := api.NewBasketAPI(SERVICE_USER_AGENT, s.redis)
|
basketAPI := api.NewBasketAPI(SERVICE_USER_AGENT, s.redis)
|
||||||
basket, err := basketAPI.GetBasket(basketID)
|
basket, err := basketAPI.GetBasket(basketID)
|
||||||
@ -67,7 +67,6 @@ func (s *OrderService) UpdateOrderStatus(reqID, orderID, status string) (string,
|
|||||||
|
|
||||||
msg := &event.StatusUpdateEvent{Event: event.NewEvent(reqID), OrderID: orderID, Status: status}
|
msg := &event.StatusUpdateEvent{Event: event.NewEvent(reqID), OrderID: orderID, Status: status}
|
||||||
amqp.Publish(s.ebCh, "api-events", "order.email.statusUpdate", msg)
|
amqp.Publish(s.ebCh, "api-events", "order.email.statusUpdate", msg)
|
||||||
// amqp.Publish(s.ebCh, "api-events", "order.warehouse.orderFinalized", msg) // test event...
|
|
||||||
|
|
||||||
return orderID, nil
|
return orderID, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user