From 67b99f7774427e7bdfe393c53e2f31ff040ce78a Mon Sep 17 00:00:00 2001 From: Nguyen Minh Date: Wed, 11 Jan 2023 09:27:49 +0700 Subject: [PATCH 1/8] campaign-get-seller-statistic --- client/campaign.go | 22 ++++++++++++++++++++++ model/campaign_request.go | 10 +++++++++- model/campaign_response.go | 29 +++++++++++++++++++++++++++++ subject/campaign.go | 2 ++ 4 files changed, 62 insertions(+), 1 deletion(-) diff --git a/client/campaign.go b/client/campaign.go index 82649d3..16fa6e4 100644 --- a/client/campaign.go +++ b/client/campaign.go @@ -34,3 +34,25 @@ func (c Campaign) GetCampaignTransaction(p model.GetCampaignTransactionsRequest) } return r.Data, nil } + +// GetCampaignSellerStatistic .... +func (c Campaign) GetCampaignSellerStatistic(req model.GetCampaignSellerStatisticBySellerIDs) (*model.ResponseCampaignSellerStatistic, error) { + msg, err := natsio.GetServer().Request(subject.Campaign.GetCampaignSellerStatisticBySellerIDs, toBytes(req)) + if err != nil { + return nil, err + } + + var r struct { + Data *model.ResponseCampaignSellerStatistic `json:"data"` + Error string `json:"error"` + } + + if err = json.Unmarshal(msg.Data, &r); err != nil { + return nil, err + } + + if r.Error != "" { + return nil, errors.New(r.Error) + } + return r.Data, nil +} diff --git a/model/campaign_request.go b/model/campaign_request.go index 71227e4..8033196 100644 --- a/model/campaign_request.go +++ b/model/campaign_request.go @@ -1,6 +1,9 @@ package model -import "time" +import ( + "go.mongodb.org/mongo-driver/bson/primitive" + "time" +) // GetCampaignTransactionsRequest ... type GetCampaignTransactionsRequest struct { @@ -12,3 +15,8 @@ type GetCampaignTransactionsRequest struct { Page int64 `json:"page"` Limit int64 `json:"limit"` } + +// GetCampaignSellerStatisticBySellerIDs ... +type GetCampaignSellerStatisticBySellerIDs struct { + SellerIDs []primitive.ObjectID +} diff --git a/model/campaign_response.go b/model/campaign_response.go index 9619035..65199e9 100644 --- a/model/campaign_response.go +++ b/model/campaign_response.go @@ -57,3 +57,32 @@ type ResponseCampaignTransactionOptions struct { type ResponseCampaignTransactionAdminConfirmData struct { FriendPublicTotal int64 `json:"friendPublicTotal"` } + +// ResponseCampaignSellerStatisticList ... +type ResponseCampaignSellerStatisticList struct { + List []ResponseCampaignSellerStatistic `json:"list"` +} + +// ResponseCampaignSellerStatistic ... +type ResponseCampaignSellerStatistic struct { + SellerID primitive.ObjectID `json:"sellerId"` + Statistic CampaignSellerStatistic `json:"Statistic"` +} + +// CampaignSellerStatistic ... +type CampaignSellerStatistic struct { + TotalNotRejected int64 `bson:"totalNotRejected" json:"totalNotRejected"` + CashTotalNotRejected float64 `bson:"cashTotalNotRejected" json:"cashTotalNotRejected"` + + TotalCompleted int64 `bson:"totalCompleted" json:"totalCompleted"` + CashTotalCompleted float64 `bson:"cashTotalCompleted" json:"cashTotalCompleted"` + + TotalPending int64 `bson:"totalPending" json:"totalPending"` + CashTotalPending float64 `bson:"cashTotalPending" json:"cashTotalPending"` + + TotalApproved int64 `bson:"totalApproved" json:"totalApproved"` + CashTotalApproved float64 `bson:"cashTotalApproved" json:"cashTotalApproved"` + + TotalRejected int64 `bson:"totalRejected" json:"totalRejected"` + CashTotalRejected float64 `bson:"cashTotalRejected" json:"cashTotalRejected"` +} diff --git a/subject/campaign.go b/subject/campaign.go index 8c7ddac..a986f69 100644 --- a/subject/campaign.go +++ b/subject/campaign.go @@ -10,6 +10,8 @@ func getCampaignValue(val string) string { // Campaign ... var Campaign = struct { GetListCampaignTransactionAdminInfoByIDs string + GetCampaignSellerStatisticBySellerIDs string }{ GetListCampaignTransactionAdminInfoByIDs: getCampaignValue("get_list_campaign_transaction_admin_info_by_ids"), + GetCampaignSellerStatisticBySellerIDs: getCampaignValue("get_campaign_seller_statistic_by_seller_ids"), } From 2003cb4e4946341696196f71fc9d6acc3d25a10e Mon Sep 17 00:00:00 2001 From: Nguyen Minh Date: Wed, 11 Jan 2023 10:21:02 +0700 Subject: [PATCH 2/8] update --- client/campaign.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/campaign.go b/client/campaign.go index 16fa6e4..8368230 100644 --- a/client/campaign.go +++ b/client/campaign.go @@ -36,15 +36,15 @@ func (c Campaign) GetCampaignTransaction(p model.GetCampaignTransactionsRequest) } // GetCampaignSellerStatistic .... -func (c Campaign) GetCampaignSellerStatistic(req model.GetCampaignSellerStatisticBySellerIDs) (*model.ResponseCampaignSellerStatistic, error) { +func (c Campaign) GetCampaignSellerStatistic(req model.GetCampaignSellerStatisticBySellerIDs) (*model.ResponseCampaignSellerStatisticList, error) { msg, err := natsio.GetServer().Request(subject.Campaign.GetCampaignSellerStatisticBySellerIDs, toBytes(req)) if err != nil { return nil, err } var r struct { - Data *model.ResponseCampaignSellerStatistic `json:"data"` - Error string `json:"error"` + Data *model.ResponseCampaignSellerStatisticList `json:"data"` + Error string `json:"error"` } if err = json.Unmarshal(msg.Data, &r); err != nil { From f9b2edb03247903d32c2bb21cc876e77406cf982 Mon Sep 17 00:00:00 2001 From: anbuiselly <105765792+anbuiselly@users.noreply.github.com> Date: Tue, 17 Jan 2023 11:20:27 +0700 Subject: [PATCH 3/8] update_pending_active_product_by_warehouse_ids --- client/warehouse.go | 20 ++++++++++ model/warehouse_request.go | 5 +++ subject/warehouse.go | 82 ++++++++++++++++++++------------------ 3 files changed, 68 insertions(+), 39 deletions(-) diff --git a/client/warehouse.go b/client/warehouse.go index fb391ca..52c08db 100644 --- a/client/warehouse.go +++ b/client/warehouse.go @@ -182,3 +182,23 @@ func (w Warehouse) UpdateORDeliveryStatus(p model.WarehouseORUpdateDeliveryStatu } return nil } + +// UpdatePendingActiveProductByWarehouseIDs ... +func (w Warehouse) UpdatePendingActiveProductByWarehouseIDs(p model.UpdatePendingActiveProductRequest) error { + msg, err := natsio.GetServer().Request(subject.Warehouse.UpdatePendingActiveProductByWarehouseIDs, toBytes(p)) + if err != nil { + return err + } + + var r struct { + Error string `json:"error"` + } + + if err = json.Unmarshal(msg.Data, &r); err != nil { + return fmt.Errorf("nats: update_pending_active_product_by_warehouse_ids %v", err) + } + if r.Error != "" { + return errors.New(r.Error) + } + return nil +} diff --git a/model/warehouse_request.go b/model/warehouse_request.go index b6cecb1..3a9fe6c 100644 --- a/model/warehouse_request.go +++ b/model/warehouse_request.go @@ -113,3 +113,8 @@ type WarehouseORUpdateDeliveryStatus struct { OrderID string `json:"orderId"` DeliveryStatus string `json:"deliveryStatus"` } + +// UpdatePendingActiveProductRequest ... +type UpdatePendingActiveProductRequest struct { + WarehouseIDs []string `json:"warehouseIDs"` +} diff --git a/subject/warehouse.go b/subject/warehouse.go index bb184b5..f031594 100644 --- a/subject/warehouse.go +++ b/subject/warehouse.go @@ -1,49 +1,53 @@ package subject -import "fmt" +import ( + "fmt" +) func getWarehouseValue(val string) string { return fmt.Sprintf("%s.%s", prefixes.Warehouse, val) } var Warehouse = struct { - CreateWarehouseIntoServiceSupplier string - UpdateWarehouseIntoServiceSupplier string - CreateOutboundRequest string - UpdateOutboundRequestLogistic string - CancelOutboundRequest string - GetConfiguration string - SyncORStatus string - WebhookTNC string - WebhookGlobalCare string - WebhookOnPoint string - FindOne string - FindByCondition string - Distinct string - Count string - AfterUpdateWarehouse string - AfterCreateWarehouse string - UpdateIsClosedSupplier string - GetWarehouses string - UpdateORDeliveryStatus string + CreateWarehouseIntoServiceSupplier string + UpdateWarehouseIntoServiceSupplier string + CreateOutboundRequest string + UpdateOutboundRequestLogistic string + CancelOutboundRequest string + GetConfiguration string + SyncORStatus string + WebhookTNC string + WebhookGlobalCare string + WebhookOnPoint string + FindOne string + FindByCondition string + Distinct string + Count string + AfterUpdateWarehouse string + AfterCreateWarehouse string + UpdateIsClosedSupplier string + GetWarehouses string + UpdateORDeliveryStatus string + UpdatePendingActiveProductByWarehouseIDs string }{ - CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"), - UpdateWarehouseIntoServiceSupplier: getWarehouseValue("update_warehouse_into_service_supplier"), - AfterCreateWarehouse: getWarehouseValue("after_create_warehouse"), - AfterUpdateWarehouse: getWarehouseValue("after_update_warehouse"), - CreateOutboundRequest: getWarehouseValue("create_outbound_request"), - UpdateOutboundRequestLogistic: getWarehouseValue("update_outbound_request_logistic_info"), - CancelOutboundRequest: getWarehouseValue("cancel_outbound_request"), - GetConfiguration: getWarehouseValue("get_configuration"), - SyncORStatus: getWarehouseValue("sync_or_status"), - WebhookTNC: getWarehouseValue("webhook_tnc"), - WebhookGlobalCare: getWarehouseValue("webhook_global_care"), - WebhookOnPoint: getWarehouseValue("webhook_on_point"), - FindOne: getWarehouseValue("find_one"), - FindByCondition: getWarehouseValue("find_all_by_condition"), - Distinct: getWarehouseValue("distinct"), - Count: getWarehouseValue("count"), - UpdateIsClosedSupplier: getWarehouseValue("update_is_closed_supplier"), - GetWarehouses: getWarehouseValue("get_warehouses"), - UpdateORDeliveryStatus: getWarehouseValue("update_or_delivery_status"), + CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"), + UpdateWarehouseIntoServiceSupplier: getWarehouseValue("update_warehouse_into_service_supplier"), + AfterCreateWarehouse: getWarehouseValue("after_create_warehouse"), + AfterUpdateWarehouse: getWarehouseValue("after_update_warehouse"), + CreateOutboundRequest: getWarehouseValue("create_outbound_request"), + UpdateOutboundRequestLogistic: getWarehouseValue("update_outbound_request_logistic_info"), + CancelOutboundRequest: getWarehouseValue("cancel_outbound_request"), + GetConfiguration: getWarehouseValue("get_configuration"), + SyncORStatus: getWarehouseValue("sync_or_status"), + WebhookTNC: getWarehouseValue("webhook_tnc"), + WebhookGlobalCare: getWarehouseValue("webhook_global_care"), + WebhookOnPoint: getWarehouseValue("webhook_on_point"), + FindOne: getWarehouseValue("find_one"), + FindByCondition: getWarehouseValue("find_all_by_condition"), + Distinct: getWarehouseValue("distinct"), + Count: getWarehouseValue("count"), + UpdateIsClosedSupplier: getWarehouseValue("update_is_closed_supplier"), + GetWarehouses: getWarehouseValue("get_warehouses"), + UpdateORDeliveryStatus: getWarehouseValue("update_or_delivery_status"), + UpdatePendingActiveProductByWarehouseIDs: getWarehouseValue("update_pending_active_product_by_warehouse_ids"), } From 9a30faa3a2cf10347a39f005513ac9fe89e0ac7e Mon Sep 17 00:00:00 2001 From: anbuiselly <105765792+anbuiselly@users.noreply.github.com> Date: Tue, 17 Jan 2023 11:35:38 +0700 Subject: [PATCH 4/8] edit update update_pending_in_active_product_by_warehouse_ids --- client/warehouse.go | 8 ++-- model/warehouse_request.go | 4 +- subject/warehouse.go | 80 +++++++++++++++++++------------------- 3 files changed, 46 insertions(+), 46 deletions(-) diff --git a/client/warehouse.go b/client/warehouse.go index 52c08db..e0abf1c 100644 --- a/client/warehouse.go +++ b/client/warehouse.go @@ -183,9 +183,9 @@ func (w Warehouse) UpdateORDeliveryStatus(p model.WarehouseORUpdateDeliveryStatu return nil } -// UpdatePendingActiveProductByWarehouseIDs ... -func (w Warehouse) UpdatePendingActiveProductByWarehouseIDs(p model.UpdatePendingActiveProductRequest) error { - msg, err := natsio.GetServer().Request(subject.Warehouse.UpdatePendingActiveProductByWarehouseIDs, toBytes(p)) +// UpdatePendingInActiveProductByWarehouseIDs ... +func (w Warehouse) UpdatePendingInActiveProductByWarehouseIDs(p model.UpdatePendingInActiveProductRequest) error { + msg, err := natsio.GetServer().Request(subject.Warehouse.UpdatePendingInActiveProductByWarehouseIDs, toBytes(p)) if err != nil { return err } @@ -195,7 +195,7 @@ func (w Warehouse) UpdatePendingActiveProductByWarehouseIDs(p model.UpdatePendin } if err = json.Unmarshal(msg.Data, &r); err != nil { - return fmt.Errorf("nats: update_pending_active_product_by_warehouse_ids %v", err) + return fmt.Errorf("nats: update_pending_in_active_product_by_warehouse_ids %v", err) } if r.Error != "" { return errors.New(r.Error) diff --git a/model/warehouse_request.go b/model/warehouse_request.go index 3a9fe6c..7388d74 100644 --- a/model/warehouse_request.go +++ b/model/warehouse_request.go @@ -114,7 +114,7 @@ type WarehouseORUpdateDeliveryStatus struct { DeliveryStatus string `json:"deliveryStatus"` } -// UpdatePendingActiveProductRequest ... -type UpdatePendingActiveProductRequest struct { +// UpdatePendingInActiveProductRequest ... +type UpdatePendingInActiveProductRequest struct { WarehouseIDs []string `json:"warehouseIDs"` } diff --git a/subject/warehouse.go b/subject/warehouse.go index f031594..0e6837a 100644 --- a/subject/warehouse.go +++ b/subject/warehouse.go @@ -9,45 +9,45 @@ func getWarehouseValue(val string) string { } var Warehouse = struct { - CreateWarehouseIntoServiceSupplier string - UpdateWarehouseIntoServiceSupplier string - CreateOutboundRequest string - UpdateOutboundRequestLogistic string - CancelOutboundRequest string - GetConfiguration string - SyncORStatus string - WebhookTNC string - WebhookGlobalCare string - WebhookOnPoint string - FindOne string - FindByCondition string - Distinct string - Count string - AfterUpdateWarehouse string - AfterCreateWarehouse string - UpdateIsClosedSupplier string - GetWarehouses string - UpdateORDeliveryStatus string - UpdatePendingActiveProductByWarehouseIDs string + CreateWarehouseIntoServiceSupplier string + UpdateWarehouseIntoServiceSupplier string + CreateOutboundRequest string + UpdateOutboundRequestLogistic string + CancelOutboundRequest string + GetConfiguration string + SyncORStatus string + WebhookTNC string + WebhookGlobalCare string + WebhookOnPoint string + FindOne string + FindByCondition string + Distinct string + Count string + AfterUpdateWarehouse string + AfterCreateWarehouse string + UpdateIsClosedSupplier string + GetWarehouses string + UpdateORDeliveryStatus string + UpdatePendingInActiveProductByWarehouseIDs string }{ - CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"), - UpdateWarehouseIntoServiceSupplier: getWarehouseValue("update_warehouse_into_service_supplier"), - AfterCreateWarehouse: getWarehouseValue("after_create_warehouse"), - AfterUpdateWarehouse: getWarehouseValue("after_update_warehouse"), - CreateOutboundRequest: getWarehouseValue("create_outbound_request"), - UpdateOutboundRequestLogistic: getWarehouseValue("update_outbound_request_logistic_info"), - CancelOutboundRequest: getWarehouseValue("cancel_outbound_request"), - GetConfiguration: getWarehouseValue("get_configuration"), - SyncORStatus: getWarehouseValue("sync_or_status"), - WebhookTNC: getWarehouseValue("webhook_tnc"), - WebhookGlobalCare: getWarehouseValue("webhook_global_care"), - WebhookOnPoint: getWarehouseValue("webhook_on_point"), - FindOne: getWarehouseValue("find_one"), - FindByCondition: getWarehouseValue("find_all_by_condition"), - Distinct: getWarehouseValue("distinct"), - Count: getWarehouseValue("count"), - UpdateIsClosedSupplier: getWarehouseValue("update_is_closed_supplier"), - GetWarehouses: getWarehouseValue("get_warehouses"), - UpdateORDeliveryStatus: getWarehouseValue("update_or_delivery_status"), - UpdatePendingActiveProductByWarehouseIDs: getWarehouseValue("update_pending_active_product_by_warehouse_ids"), + CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"), + UpdateWarehouseIntoServiceSupplier: getWarehouseValue("update_warehouse_into_service_supplier"), + AfterCreateWarehouse: getWarehouseValue("after_create_warehouse"), + AfterUpdateWarehouse: getWarehouseValue("after_update_warehouse"), + CreateOutboundRequest: getWarehouseValue("create_outbound_request"), + UpdateOutboundRequestLogistic: getWarehouseValue("update_outbound_request_logistic_info"), + CancelOutboundRequest: getWarehouseValue("cancel_outbound_request"), + GetConfiguration: getWarehouseValue("get_configuration"), + SyncORStatus: getWarehouseValue("sync_or_status"), + WebhookTNC: getWarehouseValue("webhook_tnc"), + WebhookGlobalCare: getWarehouseValue("webhook_global_care"), + WebhookOnPoint: getWarehouseValue("webhook_on_point"), + FindOne: getWarehouseValue("find_one"), + FindByCondition: getWarehouseValue("find_all_by_condition"), + Distinct: getWarehouseValue("distinct"), + Count: getWarehouseValue("count"), + UpdateIsClosedSupplier: getWarehouseValue("update_is_closed_supplier"), + GetWarehouses: getWarehouseValue("get_warehouses"), + UpdateORDeliveryStatus: getWarehouseValue("update_or_delivery_status"), + UpdatePendingInActiveProductByWarehouseIDs: getWarehouseValue("update_pending_in_active_product_by_warehouse_ids"), } From 292c7733f0a8484d8243c473370009fc0704f66c Mon Sep 17 00:00:00 2001 From: anbuiselly <105765792+anbuiselly@users.noreply.github.com> Date: Tue, 17 Jan 2023 14:15:27 +0700 Subject: [PATCH 5/8] edit struct update_status_warehouse_pending_inactive --- client/warehouse.go | 8 ++-- model/warehouse_request.go | 12 ++++-- subject/warehouse.go | 80 +++++++++++++++++++------------------- 3 files changed, 53 insertions(+), 47 deletions(-) diff --git a/client/warehouse.go b/client/warehouse.go index e0abf1c..61639bb 100644 --- a/client/warehouse.go +++ b/client/warehouse.go @@ -183,9 +183,9 @@ func (w Warehouse) UpdateORDeliveryStatus(p model.WarehouseORUpdateDeliveryStatu return nil } -// UpdatePendingInActiveProductByWarehouseIDs ... -func (w Warehouse) UpdatePendingInActiveProductByWarehouseIDs(p model.UpdatePendingInActiveProductRequest) error { - msg, err := natsio.GetServer().Request(subject.Warehouse.UpdatePendingInActiveProductByWarehouseIDs, toBytes(p)) +// UpdateStatusWarehousePendingInactive ... +func (w Warehouse) UpdateStatusWarehousePendingInactive(p model.UpdateStatusWarehousePendingInactiveRequest) error { + msg, err := natsio.GetServer().Request(subject.Warehouse.UpdateStatusWarehousePendingInactive, toBytes(p)) if err != nil { return err } @@ -195,7 +195,7 @@ func (w Warehouse) UpdatePendingInActiveProductByWarehouseIDs(p model.UpdatePend } if err = json.Unmarshal(msg.Data, &r); err != nil { - return fmt.Errorf("nats: update_pending_in_active_product_by_warehouse_ids %v", err) + return fmt.Errorf("nats: update_status_warehouse_pending_inactive %v", err) } if r.Error != "" { return errors.New(r.Error) diff --git a/model/warehouse_request.go b/model/warehouse_request.go index 7388d74..1ec7f6d 100644 --- a/model/warehouse_request.go +++ b/model/warehouse_request.go @@ -114,7 +114,13 @@ type WarehouseORUpdateDeliveryStatus struct { DeliveryStatus string `json:"deliveryStatus"` } -// UpdatePendingInActiveProductRequest ... -type UpdatePendingInActiveProductRequest struct { - WarehouseIDs []string `json:"warehouseIDs"` +// UpdateStatusWarehousePendingInactiveRequest ... +type UpdateStatusWarehousePendingInactiveRequest struct { + Warehouses []UpdateStatusWarehousePendingInactive `json:"warehouses"` +} + +// UpdateStatusWarehousePendingInactive ... +type UpdateStatusWarehousePendingInactive struct { + WarehouseID string `json:"warehouse"` + Status string `json:"status"` } diff --git a/subject/warehouse.go b/subject/warehouse.go index 0e6837a..4a63cc0 100644 --- a/subject/warehouse.go +++ b/subject/warehouse.go @@ -9,45 +9,45 @@ func getWarehouseValue(val string) string { } var Warehouse = struct { - CreateWarehouseIntoServiceSupplier string - UpdateWarehouseIntoServiceSupplier string - CreateOutboundRequest string - UpdateOutboundRequestLogistic string - CancelOutboundRequest string - GetConfiguration string - SyncORStatus string - WebhookTNC string - WebhookGlobalCare string - WebhookOnPoint string - FindOne string - FindByCondition string - Distinct string - Count string - AfterUpdateWarehouse string - AfterCreateWarehouse string - UpdateIsClosedSupplier string - GetWarehouses string - UpdateORDeliveryStatus string - UpdatePendingInActiveProductByWarehouseIDs string + CreateWarehouseIntoServiceSupplier string + UpdateWarehouseIntoServiceSupplier string + CreateOutboundRequest string + UpdateOutboundRequestLogistic string + CancelOutboundRequest string + GetConfiguration string + SyncORStatus string + WebhookTNC string + WebhookGlobalCare string + WebhookOnPoint string + FindOne string + FindByCondition string + Distinct string + Count string + AfterUpdateWarehouse string + AfterCreateWarehouse string + UpdateIsClosedSupplier string + GetWarehouses string + UpdateORDeliveryStatus string + UpdateStatusWarehousePendingInactive string }{ - CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"), - UpdateWarehouseIntoServiceSupplier: getWarehouseValue("update_warehouse_into_service_supplier"), - AfterCreateWarehouse: getWarehouseValue("after_create_warehouse"), - AfterUpdateWarehouse: getWarehouseValue("after_update_warehouse"), - CreateOutboundRequest: getWarehouseValue("create_outbound_request"), - UpdateOutboundRequestLogistic: getWarehouseValue("update_outbound_request_logistic_info"), - CancelOutboundRequest: getWarehouseValue("cancel_outbound_request"), - GetConfiguration: getWarehouseValue("get_configuration"), - SyncORStatus: getWarehouseValue("sync_or_status"), - WebhookTNC: getWarehouseValue("webhook_tnc"), - WebhookGlobalCare: getWarehouseValue("webhook_global_care"), - WebhookOnPoint: getWarehouseValue("webhook_on_point"), - FindOne: getWarehouseValue("find_one"), - FindByCondition: getWarehouseValue("find_all_by_condition"), - Distinct: getWarehouseValue("distinct"), - Count: getWarehouseValue("count"), - UpdateIsClosedSupplier: getWarehouseValue("update_is_closed_supplier"), - GetWarehouses: getWarehouseValue("get_warehouses"), - UpdateORDeliveryStatus: getWarehouseValue("update_or_delivery_status"), - UpdatePendingInActiveProductByWarehouseIDs: getWarehouseValue("update_pending_in_active_product_by_warehouse_ids"), + CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"), + UpdateWarehouseIntoServiceSupplier: getWarehouseValue("update_warehouse_into_service_supplier"), + AfterCreateWarehouse: getWarehouseValue("after_create_warehouse"), + AfterUpdateWarehouse: getWarehouseValue("after_update_warehouse"), + CreateOutboundRequest: getWarehouseValue("create_outbound_request"), + UpdateOutboundRequestLogistic: getWarehouseValue("update_outbound_request_logistic_info"), + CancelOutboundRequest: getWarehouseValue("cancel_outbound_request"), + GetConfiguration: getWarehouseValue("get_configuration"), + SyncORStatus: getWarehouseValue("sync_or_status"), + WebhookTNC: getWarehouseValue("webhook_tnc"), + WebhookGlobalCare: getWarehouseValue("webhook_global_care"), + WebhookOnPoint: getWarehouseValue("webhook_on_point"), + FindOne: getWarehouseValue("find_one"), + FindByCondition: getWarehouseValue("find_all_by_condition"), + Distinct: getWarehouseValue("distinct"), + Count: getWarehouseValue("count"), + UpdateIsClosedSupplier: getWarehouseValue("update_is_closed_supplier"), + GetWarehouses: getWarehouseValue("get_warehouses"), + UpdateORDeliveryStatus: getWarehouseValue("update_or_delivery_status"), + UpdateStatusWarehousePendingInactive: getWarehouseValue("update_status_warehouse_pending_inactive"), } From 49156e576d0ad99942adb7f7cbc93b60e94b0981 Mon Sep 17 00:00:00 2001 From: anbuiselly <105765792+anbuiselly@users.noreply.github.com> Date: Tue, 17 Jan 2023 14:23:24 +0700 Subject: [PATCH 6/8] fix --- model/warehouse_request.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/warehouse_request.go b/model/warehouse_request.go index 1ec7f6d..e813d99 100644 --- a/model/warehouse_request.go +++ b/model/warehouse_request.go @@ -121,6 +121,6 @@ type UpdateStatusWarehousePendingInactiveRequest struct { // UpdateStatusWarehousePendingInactive ... type UpdateStatusWarehousePendingInactive struct { - WarehouseID string `json:"warehouse"` - Status string `json:"status"` + WarehouseID string `json:"warehouse"` + PendingInactive bool `json:"pendingInactive"` } From f32844916a6416e1805929ed64987b7f709ac893 Mon Sep 17 00:00:00 2001 From: quang Date: Tue, 17 Jan 2023 16:29:47 +0700 Subject: [PATCH 7/8] location --- client/location.go | 228 +++++++++++++++++++++++++++++++++++-- model/common_request.go | 23 ++++ model/location_request.go | 77 ++++++++++--- model/location_response.go | 114 +++++++++++++------ subject/location.go | 44 +++++-- 5 files changed, 416 insertions(+), 70 deletions(-) diff --git a/client/location.go b/client/location.go index 18be423..ff50195 100644 --- a/client/location.go +++ b/client/location.go @@ -19,7 +19,7 @@ func GetLocation() Location { // GetLocationByCode ... func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*model.ResponseLocationAddress, error) { - msg, err := natsio.GetServer().Request(subject.Location.GetLocationByCode, toBytes(payload)) + msg, err := natsio.GetServer().Request(subject.Location.GetLocationByCodeNew, toBytes(payload)) if err != nil { return nil, err } @@ -28,7 +28,7 @@ func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*mode Data *model.ResponseLocationAddress `json:"data"` Error string `json:"error"` } - if err := json.Unmarshal(msg.Data, &r); err != nil { + if err = json.Unmarshal(msg.Data, &r); err != nil { return nil, err } @@ -38,19 +38,19 @@ func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*mode return r.Data, nil } -// GetProvincesByCodes ... ... +// GetProvincesByCodes ... func (l Location) GetProvincesByCodes(p model.ProvinceRequestPayload) (*model.LocationProvinceResponse, error) { - msg, err := natsio.GetServer().Request(subject.Location.GetProvincesByCodes, toBytes(p)) + msg, err := natsio.GetServer().Request(subject.Location.GetProvincesByCodesNew, toBytes(p)) if err != nil { return nil, err } var r struct { - Data *model.LocationProvinceResponse `json:"data"'` + Data *model.LocationProvinceResponse `json:"data"` Error string `json:"error"` } - if err := json.Unmarshal(msg.Data, &r); err != nil { + if err = json.Unmarshal(msg.Data, &r); err != nil { return nil, err } @@ -62,7 +62,7 @@ func (l Location) GetProvincesByCodes(p model.ProvinceRequestPayload) (*model.Lo // GetDistrictsByCodes ... func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.LocationDistrictResponse, error) { - msg, err := natsio.GetServer().Request(subject.Location.GetDistrictsByCodes, toBytes(p)) + msg, err := natsio.GetServer().Request(subject.Location.GetDistrictsByCodesNew, toBytes(p)) if err != nil { return nil, err } @@ -71,7 +71,7 @@ func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.Lo Error string `json:"error"` } - if err := json.Unmarshal(msg.Data, &r); err != nil { + if err = json.Unmarshal(msg.Data, &r); err != nil { return nil, err } @@ -84,7 +84,7 @@ func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.Lo // GetWardsByCodes ... func (l Location) GetWardsByCodes(p model.WardRequestPayload) (*model.LocationWardResponse, error) { - msg, err := natsio.GetServer().Request(subject.Location.GetWardsByCodes, toBytes(p)) + msg, err := natsio.GetServer().Request(subject.Location.GetWardsByCodesNew, toBytes(p)) if err != nil { return nil, err } @@ -94,7 +94,7 @@ func (l Location) GetWardsByCodes(p model.WardRequestPayload) (*model.LocationWa Error string `json:"error"` } - if err := json.Unmarshal(msg.Data, &r); err != nil { + if err = json.Unmarshal(msg.Data, &r); err != nil { return nil, err } @@ -104,3 +104,211 @@ func (l Location) GetWardsByCodes(p model.WardRequestPayload) (*model.LocationWa return r.Data, nil } + +// GetProvinceByCondition ... +func (l Location) GetProvinceByCondition(p model.RequestCondition) (*model.LocationProvinceDetailResponse, error) { + msg, err := natsio.GetServer().Request(subject.Location.GetProvinceByCondition, toBytes(p)) + if err != nil { + return nil, err + } + + var r struct { + Data *model.LocationProvinceDetailResponse `json:"data"` + Error string `json:"error"` + } + + if err = json.Unmarshal(msg.Data, &r); err != nil { + return nil, err + } + + if r.Error != "" { + return nil, errors.New(r.Error) + } + return r.Data, nil +} + +// GetProvincesByCondition ... +func (l Location) GetProvincesByCondition(p model.RequestCondition) ([]*model.LocationProvinceDetailResponse, error) { + msg, err := natsio.GetServer().Request(subject.Location.GetProvincesByCondition, toBytes(p)) + if err != nil { + return nil, err + } + + var r struct { + Data []*model.LocationProvinceDetailResponse `json:"data"` + Error string `json:"error"` + } + + if err = json.Unmarshal(msg.Data, &r); err != nil { + return nil, err + } + + if r.Error != "" { + return nil, errors.New(r.Error) + } + return r.Data, nil +} + +// GetDistrictByCondition ... +func (l Location) GetDistrictByCondition(p model.RequestCondition) (*model.LocationDistrictDetailResponse, error) { + msg, err := natsio.GetServer().Request(subject.Location.GetDistrictByCondition, toBytes(p)) + if err != nil { + return nil, err + } + + var r struct { + Data *model.LocationDistrictDetailResponse `json:"data"` + Error string `json:"error"` + } + + if err = json.Unmarshal(msg.Data, &r); err != nil { + return nil, err + } + + if r.Error != "" { + return nil, errors.New(r.Error) + } + return r.Data, nil +} + +// GetDistrictsByCondition ... +func (l Location) GetDistrictsByCondition(p model.RequestCondition) ([]*model.LocationDistrictDetailResponse, error) { + msg, err := natsio.GetServer().Request(subject.Location.GetDistrictsByCondition, toBytes(p)) + if err != nil { + return nil, err + } + + var r struct { + Data []*model.LocationDistrictDetailResponse `json:"data"` + Error string `json:"error"` + } + + if err = json.Unmarshal(msg.Data, &r); err != nil { + return nil, err + } + + if r.Error != "" { + return nil, errors.New(r.Error) + } + return r.Data, nil +} + +// GetWardByCondition ... +func (l Location) GetWardByCondition(p model.RequestCondition) (*model.LocationWardDetailResponse, error) { + msg, err := natsio.GetServer().Request(subject.Location.GetWardByCondition, toBytes(p)) + if err != nil { + return nil, err + } + + var r struct { + Data *model.LocationWardDetailResponse `json:"data"` + Error string `json:"error"` + } + + if err = json.Unmarshal(msg.Data, &r); err != nil { + return nil, err + } + + if r.Error != "" { + return nil, errors.New(r.Error) + } + return r.Data, nil +} + +// GetWardsByCondition ... +func (l Location) GetWardsByCondition(p model.RequestCondition) ([]*model.LocationWardDetailResponse, error) { + msg, err := natsio.GetServer().Request(subject.Location.GetWardsByCondition, toBytes(p)) + if err != nil { + return nil, err + } + + var r struct { + Data []*model.LocationWardDetailResponse `json:"data"` + Error string `json:"error"` + } + + if err = json.Unmarshal(msg.Data, &r); err != nil { + return nil, err + } + + if r.Error != "" { + return nil, errors.New(r.Error) + } + return r.Data, nil +} + +// CountProvinceByCondition ... +func (l Location) CountProvinceByCondition(p model.RequestCondition) (int64, error) { + msg, err := natsio.GetServer().Request(subject.Location.CountProvinceByCondition, toBytes(p)) + if err != nil { + return 0, err + } + var r struct { + Data int64 `json:"data"` + Error string `json:"error"` + } + if err = json.Unmarshal(msg.Data, &r); err != nil { + return 0, err + } + if r.Error != "" { + return 0, errors.New(r.Error) + } + return r.Data, nil +} + +// CountDistrictByCondition ... +func (l Location) CountDistrictByCondition(p model.RequestCondition) (int64, error) { + msg, err := natsio.GetServer().Request(subject.Location.CountDistrictByCondition, toBytes(p)) + if err != nil { + return 0, err + } + var r struct { + Data int64 `json:"data"` + Error string `json:"error"` + } + if err = json.Unmarshal(msg.Data, &r); err != nil { + return 0, err + } + if r.Error != "" { + return 0, errors.New(r.Error) + } + return r.Data, nil +} + +// CountWardByCondition ... +func (l Location) CountWardByCondition(p model.RequestCondition) (int64, error) { + msg, err := natsio.GetServer().Request(subject.Location.CountWardByCondition, toBytes(p)) + if err != nil { + return 0, err + } + var r struct { + Data int64 `json:"data"` + Error string `json:"error"` + } + if err = json.Unmarshal(msg.Data, &r); err != nil { + return 0, err + } + if r.Error != "" { + return 0, errors.New(r.Error) + } + return r.Data, nil +} + +// DistinctWithField ... +func (l Location) DistinctWithField(p model.ProvinceDistinctWithField) ([]interface{}, error) { + msg, err := natsio.GetServer().Request(subject.Location.ProvinceDistinctWithField, toBytes(p)) + if err != nil { + return nil, err + } + var r struct { + Data []interface{} `json:"data"` + Error string `json:"error"` + } + if err = json.Unmarshal(msg.Data, &r); err != nil { + return nil, err + } + if r.Error != "" { + return nil, errors.New(r.Error) + } + return r.Data, nil +} diff --git a/model/common_request.go b/model/common_request.go index 0ce5163..447ae57 100644 --- a/model/common_request.go +++ b/model/common_request.go @@ -20,3 +20,26 @@ type ActionBy struct { ID string `json:"id"` Name string `json:"name"` } + +// RequestCondition ... +type RequestCondition struct { + Code int `json:"code"` + Codes []int `json:"codes"` + DistrictCode int `json:"districtCode"` + ProvinceCode int `json:"provinceCode"` + + Slug string `json:"slug"` + OldSlug string `json:"oldSlug"` + + Slugs []string `json:"slugs"` + OldSlugs []string `json:"oldSlugs"` + + DistrictSlug string `json:"districtSlug"` + ProvinceSlug string `json:"provinceSlug"` + + Keyword string `json:"keyword"` + Region string `json:"region"` + + Page int64 `json:"page"` + Limit int64 `json:"limit"` +} diff --git a/model/location_request.go b/model/location_request.go index 4533db7..47ddd01 100644 --- a/model/location_request.go +++ b/model/location_request.go @@ -1,23 +1,66 @@ package model // LocationRequestPayload ... -type LocationRequestPayload struct { - Province int `json:"province"` - District int `json:"district"` - Ward int `json:"ward"` -} +type ( + // LocationRequestPayload ... + LocationRequestPayload struct { + Province int `json:"province"` + District int `json:"district"` + Ward int `json:"ward"` + } -// ProvinceRequestPayload ... -type ProvinceRequestPayload struct { - Codes []int `json:"codes"` -} + // ProvinceRequestPayload ... + ProvinceRequestPayload struct { + Codes []int `json:"codes"` + } -// DistrictRequestPayload ... -type DistrictRequestPayload struct { - Codes []int `json:"codes"` -} + // ProvinceRequestCondition ... + ProvinceRequestCondition struct { + Code int `json:"code"` + Codes []int `json:"codes"` + Slug string `json:"slug"` + Slugs []string `json:"slugs"` + Keyword string `json:"keyword"` + Region string `json:"region"` + } -// WardRequestPayload ... -type WardRequestPayload struct { - Codes []int `json:"codes"` -} + // DistrictRequestPayload ... + DistrictRequestPayload struct { + Codes []int `json:"codes"` + } + + // DistrictRequestCondition ... + DistrictRequestCondition struct { + Code int `json:"code"` + Codes []int `json:"codes"` + ProvinceCode int `json:"provinceCode"` + Slug string `json:"slug"` + ProvinceSlug string `json:"provinceSlug"` + Keyword string `json:"keyword"` + } + + // WardRequestPayload ... + WardRequestPayload struct { + Codes []int `json:"codes"` + } + + // WardRequestCondition ... + WardRequestCondition struct { + Code int `json:"code"` + Codes []int `json:"codes"` + DistrictCode int `json:"districtCode"` + ProvinceCode int `json:"provinceCode"` + Slug string `json:"slug"` + DistrictSlug string `json:"districtSlug"` + ProvinceSlug string `json:"provinceSlug"` + Keyword string `json:"keyword"` + } + + // ProvinceDistinctWithField ... + ProvinceDistinctWithField struct { + Conditions struct { + Region string `json:"region"` + } `json:"conditions"` + Field string `json:"filed"` + } +) diff --git a/model/location_response.go b/model/location_response.go index 484d89e..e48bdce 100644 --- a/model/location_response.go +++ b/model/location_response.go @@ -1,43 +1,87 @@ package model -type ResponseLocationAddress struct { - Province LocationProvince `json:"province"` - District LocationDistrict `json:"district"` - Ward LocationWard `json:"ward"` -} +type ( + // ResponseLocationAddress ... + ResponseLocationAddress struct { + Province LocationProvince `json:"province"` + District LocationDistrict `json:"district"` + Ward LocationWard `json:"ward"` + } -// LocationProvince ... -type LocationProvince struct { - ID string `json:"id"` - Name string `json:"name"` - Code int `json:"code"` -} + // LocationProvince ... + LocationProvince struct { + ID string `json:"id"` + Name string `json:"name"` + Code int `json:"code"` + Slug string `json:"slug"` + RegionCode string `json:"regionCode"` + MainRegionCode string `json:"mainRegionCode"` + } -// LocationDistrict ... -type LocationDistrict struct { - ID string `json:"id"` - Name string `json:"name"` - Code int `json:"code"` -} + // LocationDistrict ... + LocationDistrict struct { + ID string `json:"id"` + Name string `json:"name"` + Code int `json:"code"` + Slug string `json:"slug"` + } -// LocationWard ... -type LocationWard struct { - ID string `json:"id"` - Name string `json:"name"` - Code int `json:"code"` -} + // LocationWard ... + LocationWard struct { + ID string `json:"id"` + Name string `json:"name"` + Code int `json:"code"` + Slug string `json:"slug"` + } -// LocationProvinceResponse ... -type LocationProvinceResponse struct { - Provinces []LocationProvince `json:"provinces"` -} + // LocationProvinceResponse ... + LocationProvinceResponse struct { + Provinces []LocationProvince `json:"provinces"` + } -// LocationDistrictResponse ... -type LocationDistrictResponse struct { - Districts []LocationDistrict `json:"districts"` -} + // LocationDistrictResponse ... + LocationDistrictResponse struct { + Districts []LocationDistrict `json:"districts"` + } -// LocationWardResponse ... -type LocationWardResponse struct { - Wards []LocationWard `json:"wards"` -} + // LocationWardResponse ... + LocationWardResponse struct { + Wards []LocationWard `json:"wards"` + } + + // LocationProvinceDetailResponse ... + LocationProvinceDetailResponse struct { + ID string `json:"_id"` + Name string `json:"name"` + Slug string `json:"slug"` + Code int `json:"code"` + CountryCode string `json:"countryCode"` + RegionCode string `json:"regionCode"` + MainRegionCode string `json:"mainRegionCode"` + TotalDistricts int `json:"totalDistricts"` + TotalWards int `json:"totalWards"` + } + + // LocationDistrictDetailResponse ... + LocationDistrictDetailResponse struct { + ID string `json:"_id"` + Name string `json:"name"` + OldSlugs []string `json:"oldSlugs"` + Slug string `json:"slug"` + Code int `json:"code"` + ProvinceCode int `json:"provinceCode"` + Area int `json:"area"` + TotalWards int `json:"totalWards"` + } + + // LocationWardDetailResponse ... + LocationWardDetailResponse struct { + ID string `json:"_id"` + Name string `json:"name"` + OldSlugs []string `json:"oldSlugs"` + Slug string `json:"slug"` + Code int `json:"code"` + DistrictCode int `json:"districtCode"` + ProvinceCode int `json:"provinceCode"` + } +) diff --git a/subject/location.go b/subject/location.go index b19a59b..3ee9baf 100644 --- a/subject/location.go +++ b/subject/location.go @@ -7,13 +7,41 @@ func getLocationValue(val string) string { } var Location = struct { - GetLocationByCode string - GetProvincesByCodes string - GetDistrictsByCodes string - GetWardsByCodes string + GetLocationByCode string + GetLocationByCodeNew string + GetProvincesByCodes string + GetProvincesByCodesNew string + GetDistrictsByCodes string + GetDistrictsByCodesNew string + GetWardsByCodes string + GetWardsByCodesNew string + GetProvinceByCondition string + GetProvincesByCondition string + GetDistrictByCondition string + GetDistrictsByCondition string + GetWardByCondition string + GetWardsByCondition string + CountProvinceByCondition string + CountDistrictByCondition string + CountWardByCondition string + ProvinceDistinctWithField string }{ - GetLocationByCode: getLocationValue("get_location_warehouse"), - GetProvincesByCodes: getLocationValue("get_provinces_by_codes"), - GetDistrictsByCodes: getLocationValue("get_districts_by_codes"), - GetWardsByCodes: getLocationValue("get_wards_by_codes"), + GetLocationByCode: getLocationValue("get_location_warehouse"), + GetLocationByCodeNew: getLocationValue("get_location_warehouse_new"), + GetProvincesByCodes: getLocationValue("get_provinces_by_codes"), + GetProvincesByCodesNew: getLocationValue("get_provinces_by_codes_new"), + GetDistrictsByCodes: getLocationValue("get_districts_by_codes"), + GetDistrictsByCodesNew: getLocationValue("get_districts_by_codes_new"), + GetWardsByCodes: getLocationValue("get_wards_by_codes"), + GetWardsByCodesNew: getLocationValue("get_wards_by_codes_new"), + GetProvinceByCondition: getLocationValue("get_province_by_condition"), + GetProvincesByCondition: getLocationValue("get_provinces_by_condition"), + GetDistrictByCondition: getLocationValue("get_district_by_condition"), + GetDistrictsByCondition: getLocationValue("get_districts_byCondition"), + GetWardByCondition: getLocationValue("get_ward_by_condition"), + GetWardsByCondition: getLocationValue("get_wards_by_condition"), + CountProvinceByCondition: getLocationValue("count_province_by_condition"), + CountDistrictByCondition: getLocationValue("count_district_by_condition"), + CountWardByCondition: getLocationValue("count_ward_by_condition"), + ProvinceDistinctWithField: getLocationValue("province_distinct_with_field"), } From 5a47acc373f05110cbe538858923d158f1c9f7bc Mon Sep 17 00:00:00 2001 From: trunglt251292 Date: Tue, 17 Jan 2023 17:22:28 +0700 Subject: [PATCH 8/8] change name --- client/location.go | 8 ++--- subject/location.go | 72 ++++++++++++++++++++++----------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/client/location.go b/client/location.go index ff50195..bd7333d 100644 --- a/client/location.go +++ b/client/location.go @@ -19,7 +19,7 @@ func GetLocation() Location { // GetLocationByCode ... func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*model.ResponseLocationAddress, error) { - msg, err := natsio.GetServer().Request(subject.Location.GetLocationByCodeNew, toBytes(payload)) + msg, err := natsio.GetServer().Request(subject.Location.GetLocationByCodeFromLocationService, toBytes(payload)) if err != nil { return nil, err } @@ -40,7 +40,7 @@ func (l Location) GetLocationByCode(payload model.LocationRequestPayload) (*mode // GetProvincesByCodes ... func (l Location) GetProvincesByCodes(p model.ProvinceRequestPayload) (*model.LocationProvinceResponse, error) { - msg, err := natsio.GetServer().Request(subject.Location.GetProvincesByCodesNew, toBytes(p)) + msg, err := natsio.GetServer().Request(subject.Location.GetProvincesByCodesFromLocationService, toBytes(p)) if err != nil { return nil, err } @@ -62,7 +62,7 @@ func (l Location) GetProvincesByCodes(p model.ProvinceRequestPayload) (*model.Lo // GetDistrictsByCodes ... func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.LocationDistrictResponse, error) { - msg, err := natsio.GetServer().Request(subject.Location.GetDistrictsByCodesNew, toBytes(p)) + msg, err := natsio.GetServer().Request(subject.Location.GetDistrictsByCodesFromLocationService, toBytes(p)) if err != nil { return nil, err } @@ -84,7 +84,7 @@ func (l Location) GetDistrictsByCodes(p model.DistrictRequestPayload) (*model.Lo // GetWardsByCodes ... func (l Location) GetWardsByCodes(p model.WardRequestPayload) (*model.LocationWardResponse, error) { - msg, err := natsio.GetServer().Request(subject.Location.GetWardsByCodesNew, toBytes(p)) + msg, err := natsio.GetServer().Request(subject.Location.GetWardsByCodesFromLocationService, toBytes(p)) if err != nil { return nil, err } diff --git a/subject/location.go b/subject/location.go index 3ee9baf..df2117c 100644 --- a/subject/location.go +++ b/subject/location.go @@ -7,41 +7,41 @@ func getLocationValue(val string) string { } var Location = struct { - GetLocationByCode string - GetLocationByCodeNew string - GetProvincesByCodes string - GetProvincesByCodesNew string - GetDistrictsByCodes string - GetDistrictsByCodesNew string - GetWardsByCodes string - GetWardsByCodesNew string - GetProvinceByCondition string - GetProvincesByCondition string - GetDistrictByCondition string - GetDistrictsByCondition string - GetWardByCondition string - GetWardsByCondition string - CountProvinceByCondition string - CountDistrictByCondition string - CountWardByCondition string - ProvinceDistinctWithField string + GetLocationByCode string + GetLocationByCodeFromLocationService string + GetProvincesByCodes string + GetProvincesByCodesFromLocationService string + GetDistrictsByCodes string + GetDistrictsByCodesFromLocationService string + GetWardsByCodes string + GetWardsByCodesFromLocationService string + GetProvinceByCondition string + GetProvincesByCondition string + GetDistrictByCondition string + GetDistrictsByCondition string + GetWardByCondition string + GetWardsByCondition string + CountProvinceByCondition string + CountDistrictByCondition string + CountWardByCondition string + ProvinceDistinctWithField string }{ - GetLocationByCode: getLocationValue("get_location_warehouse"), - GetLocationByCodeNew: getLocationValue("get_location_warehouse_new"), - GetProvincesByCodes: getLocationValue("get_provinces_by_codes"), - GetProvincesByCodesNew: getLocationValue("get_provinces_by_codes_new"), - GetDistrictsByCodes: getLocationValue("get_districts_by_codes"), - GetDistrictsByCodesNew: getLocationValue("get_districts_by_codes_new"), - GetWardsByCodes: getLocationValue("get_wards_by_codes"), - GetWardsByCodesNew: getLocationValue("get_wards_by_codes_new"), - GetProvinceByCondition: getLocationValue("get_province_by_condition"), - GetProvincesByCondition: getLocationValue("get_provinces_by_condition"), - GetDistrictByCondition: getLocationValue("get_district_by_condition"), - GetDistrictsByCondition: getLocationValue("get_districts_byCondition"), - GetWardByCondition: getLocationValue("get_ward_by_condition"), - GetWardsByCondition: getLocationValue("get_wards_by_condition"), - CountProvinceByCondition: getLocationValue("count_province_by_condition"), - CountDistrictByCondition: getLocationValue("count_district_by_condition"), - CountWardByCondition: getLocationValue("count_ward_by_condition"), - ProvinceDistinctWithField: getLocationValue("province_distinct_with_field"), + GetLocationByCode: getLocationValue("get_location_warehouse"), + GetLocationByCodeFromLocationService: getLocationValue("get_location_warehouse_from_location_service"), + GetProvincesByCodes: getLocationValue("get_provinces_by_codes"), + GetProvincesByCodesFromLocationService: getLocationValue("get_provinces_by_codes_from_location_service"), + GetDistrictsByCodes: getLocationValue("get_districts_by_codes"), + GetDistrictsByCodesFromLocationService: getLocationValue("get_districts_by_codes_from_location_service"), + GetWardsByCodes: getLocationValue("get_wards_by_codes"), + GetWardsByCodesFromLocationService: getLocationValue("get_wards_by_codes_from_location_service"), + GetProvinceByCondition: getLocationValue("get_province_by_condition"), + GetProvincesByCondition: getLocationValue("get_provinces_by_condition"), + GetDistrictByCondition: getLocationValue("get_district_by_condition"), + GetDistrictsByCondition: getLocationValue("get_districts_byCondition"), + GetWardByCondition: getLocationValue("get_ward_by_condition"), + GetWardsByCondition: getLocationValue("get_wards_by_condition"), + CountProvinceByCondition: getLocationValue("count_province_by_condition"), + CountDistrictByCondition: getLocationValue("count_district_by_condition"), + CountWardByCondition: getLocationValue("count_ward_by_condition"), + ProvinceDistinctWithField: getLocationValue("province_distinct_with_field"), }