From 00d2d0f89537056538194509bfa2e7db30a888c6 Mon Sep 17 00:00:00 2001 From: Sinh Date: Fri, 14 Oct 2022 14:39:57 +0700 Subject: [PATCH] update onpoint webhook payload --- partnerapi/onpoint/const.go | 8 ++++++-- partnerapi/onpoint/model_request.go | 23 +++++++++++------------ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/partnerapi/onpoint/const.go b/partnerapi/onpoint/const.go index cb073b0..dffc4d9 100644 --- a/partnerapi/onpoint/const.go +++ b/partnerapi/onpoint/const.go @@ -1,5 +1,11 @@ package onpoint +const ( + CodeSuccess = "SUCCESS" + + TimeLayout = "2006-01-02T15:04:05Z" +) + const ( baseURLStaging = "https://dev-selly-api.onpoint.vn" baseURLProd = "https://selly-api.onpoint.vn" @@ -15,8 +21,6 @@ const ( webhookEventUpdateOrderStatus = "update_order_status" webhookEventUpdateInventory = "update_inventory" - - CodeSuccess = "SUCCESS" ) var ( diff --git a/partnerapi/onpoint/model_request.go b/partnerapi/onpoint/model_request.go index 2da4a7d..a79b3a3 100644 --- a/partnerapi/onpoint/model_request.go +++ b/partnerapi/onpoint/model_request.go @@ -53,22 +53,21 @@ type CancelOrderRequest struct { // WebhookDataUpdateInventory ... type WebhookDataUpdateInventory struct { - Sku string `json:"sku"` - PartnerSku string `json:"partner_sku"` - WarehouseCode string `json:"warehouse_code"` - AvailableQuantity int `json:"available_quantity"` - CommittedQuantity int `json:"committed_quantity"` - TotalQuantity int `json:"total_quantity"` - UpdatedAt time.Time `json:"updated_at"` + Sku string `json:"sku"` + PartnerSku string `json:"partner_sku"` + WarehouseCode string `json:"warehouse_code"` + AvailableQuantity int `json:"available_quantity"` + CommittedQuantity int `json:"committed_quantity"` + TotalQuantity int `json:"total_quantity"` + UpdatedAt string `json:"updated_at"` } // WebhookDataUpdateOrderStatus ... type WebhookDataUpdateOrderStatus struct { - PartnerOrderCode string `json:"partner_order_code"` - OrderNo string `json:"order_no"` - Status string `json:"status"` - DeliveryStatus string `json:"delivery_status"` - UpdatedAt time.Time `json:"updated_at"` + OrderCode string `json:"order_code"` + OnpointOrderCode string `json:"onpoint_order_code"` + Status string `json:"status"` + UpdatedAt string `json:"updated_at"` } // WebhookPayload ...