Develop #22

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

View File

@ -50,3 +50,19 @@ func (o Order) CancelDelivery(p model.OrderCancelDelivery) error {
}
return nil
}
// ChangeDeliveryStatus ...
func (o Order) ChangeDeliveryStatus(p model.OrderChangeDeliveryStatus) error {
msg, err := natsio.GetServer().Request(subject.Order.ChangeDeliveryStatus, 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

@ -15,3 +15,8 @@ type DistinctWithField struct {
Conditions interface{} `json:"conditions"`
Filed string `json:"filed"`
}
type ActionBy struct {
ID string `json:"id"`
Name string `json:"name"`
}

View File

@ -13,3 +13,10 @@ type OrderUpdateORStatus struct {
type OrderCancelDelivery struct {
OrderID string `json:"orderId"`
}
// OrderChangeDeliveryStatus ...
type OrderChangeDeliveryStatus struct {
OrderID string `json:"orderId"`
DeliveryStatus string `json:"deliveryStatus"`
ActionBy ActionBy `json:"actionBy"`
}

View File

@ -7,9 +7,11 @@ func getOrderValue(val string) string {
}
var Order = struct {
UpdateORStatus string
CancelDelivery string
UpdateORStatus string
CancelDelivery string
ChangeDeliveryStatus string
}{
UpdateORStatus: getOrderValue("update_outbound_request_status"),
CancelDelivery: getOrderValue("cancel_delivery"),
UpdateORStatus: getOrderValue("update_outbound_request_status"),
CancelDelivery: getOrderValue("cancel_delivery"),
ChangeDeliveryStatus: getOrderValue("change_delivery_status"),
}