From 00ec7e1f2fff853406632fe56f8f78392422addf Mon Sep 17 00:00:00 2001 From: Sinh Date: Fri, 21 Jun 2024 15:37:59 +0700 Subject: [PATCH] update VTP FFM model --- partnerapi/viettelffm/model.go | 1 + partnerapi/viettelffm/viettel_ffm.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/partnerapi/viettelffm/model.go b/partnerapi/viettelffm/model.go index 8fc904c..d6aabab 100644 --- a/partnerapi/viettelffm/model.go +++ b/partnerapi/viettelffm/model.go @@ -14,6 +14,7 @@ type AuthRes struct { type UpdateLogisticInfoPayload struct { PrintLabelLink string `json:"print_label_link"` TrackingCode string `json:"tracking_code"` + OrID int `json:"or_id,omitempty"` } type CancelORPayload struct { diff --git a/partnerapi/viettelffm/viettel_ffm.go b/partnerapi/viettelffm/viettel_ffm.go index 4b6b65d..bd65820 100644 --- a/partnerapi/viettelffm/viettel_ffm.go +++ b/partnerapi/viettelffm/viettel_ffm.go @@ -25,7 +25,7 @@ const ( baseURLAuthProd = "" pathAuth = "/realms/wms/protocol/openid-connect/token" - pathUpdateORLogisticInfo = "/wms-core/api/v1/obms/outbound-request/outbound-request-partner/%s/bill" + pathUpdateORLogisticInfo = "/wms-core/api/v1/obms/outbound-request/outbound-request-partner/%d/bill" pathCreateOR = "/wms-core/api/v1/obms/outbound-request/outbound-request-partner/hab" pathCancelOR = "/wms-core/api/v1/obms/outbound-request/cancel" @@ -98,7 +98,7 @@ func (c *Client) CreateOR(p ORPayload) (*ORResult, error) { } func (c *Client) UpdateORLogisticInfo(p UpdateLogisticInfoPayload) error { - apiURL := c.getBaseURL() + pathUpdateORLogisticInfo + apiURL := c.getBaseURL() + fmt.Sprintf(pathUpdateORLogisticInfo, p.OrID) token, err := c.getToken() if err != nil { return err