Develop #22

Merged
luuvansinh merged 56 commits from develop into master 2022-09-13 02:28:19 +00:00
3 changed files with 31 additions and 6 deletions
Showing only changes of commit 367dc7edd9 - Show all commits

View File

@ -66,3 +66,19 @@ func (o Order) ChangeDeliveryStatus(p model.OrderChangeDeliveryStatus) error {
} }
return nil return nil
} }
// UpdateLogisticInfoFailed ...
func (o Order) UpdateLogisticInfoFailed(p model.OrderUpdateLogisticInfoFailed) error {
msg, err := natsio.GetServer().Request(subject.Order.UpdateLogisticInfoFailed, toBytes(p))
if err != nil {
return err
}
var r model.CommonResponseData
if err = json.Unmarshal(msg.Data, &r); err != nil {
return err
}
if r.Error != "" {
return errors.New(r.Error)
}
return nil
}

View File

@ -26,3 +26,10 @@ type OrderChangeDeliveryStatus struct {
type OrderORData struct { type OrderORData struct {
Link string `json:"link"` Link string `json:"link"`
} }
// OrderUpdateLogisticInfoFailed ...
type OrderUpdateLogisticInfoFailed struct {
OrderID string `json:"orderId"`
ORCode string `json:"orCode"`
Reason string `json:"reason"`
}

View File

@ -10,8 +10,10 @@ var Order = struct {
UpdateORStatus string UpdateORStatus string
CancelDelivery string CancelDelivery string
ChangeDeliveryStatus string ChangeDeliveryStatus string
UpdateLogisticInfoFailed string
}{ }{
UpdateORStatus: getOrderValue("update_outbound_request_status"), UpdateORStatus: getOrderValue("update_outbound_request_status"),
CancelDelivery: getOrderValue("cancel_delivery"), CancelDelivery: getOrderValue("cancel_delivery"),
ChangeDeliveryStatus: getOrderValue("change_delivery_status"), ChangeDeliveryStatus: getOrderValue("change_delivery_status"),
UpdateLogisticInfoFailed: getOrderValue("update_logistic_info_failed"),
} }