Compare commits
No commits in common. "ac018fa08e0782b257240c725a5449c6b56d9510" and "4dd7e3a49f27fc3cdf38daa8fc7167c3e6ddad56" have entirely different histories.
ac018fa08e
...
4dd7e3a49f
|
@ -146,25 +146,6 @@ func (w Warehouse) GetConfigByWarehouseID(warehouseID string) (*model.WarehouseC
|
||||||
return r.Data, nil
|
return r.Data, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetListConfig ...
|
|
||||||
func (w Warehouse) GetListConfig(req model.GetListWarehouseConfigReq) ([]*model.WarehouseConfiguration, error) {
|
|
||||||
msg, err := natsio.GetServer().Request(subject.Warehouse.GetListWarehouseConfig, toBytes(req))
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
var r struct {
|
|
||||||
Data []*model.WarehouseConfiguration `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
|
|
||||||
}
|
|
||||||
|
|
||||||
// GetWarehouses ...
|
// GetWarehouses ...
|
||||||
func (w Warehouse) GetWarehouses(p model.GetWarehousesRequest) (*model.GetWarehousesResponse, error) {
|
func (w Warehouse) GetWarehouses(p model.GetWarehousesRequest) (*model.GetWarehousesResponse, error) {
|
||||||
msg, err := natsio.GetServer().Request(subject.Warehouse.GetWarehouses, toBytes(p))
|
msg, err := natsio.GetServer().Request(subject.Warehouse.GetWarehouses, toBytes(p))
|
||||||
|
|
|
@ -131,7 +131,3 @@ type UpdateStatusWarehousePendingInactive struct {
|
||||||
WarehouseID string `json:"warehouse"`
|
WarehouseID string `json:"warehouse"`
|
||||||
PendingInactive bool `json:"pendingInactive"`
|
PendingInactive bool `json:"pendingInactive"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetListWarehouseConfigReq struct {
|
|
||||||
ConfigPartnerCode string `json:"configPartnerCode"`
|
|
||||||
}
|
|
||||||
|
|
|
@ -182,9 +182,3 @@ type GetWarehousesResponse struct {
|
||||||
Limit int64 `json:"limit"`
|
Limit int64 `json:"limit"`
|
||||||
List []WarehouseInfo `json:"list"`
|
List []WarehouseInfo `json:"list"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetListWarehouseConfigRes struct {
|
|
||||||
Total int64 `json:"total"`
|
|
||||||
Limit int64 `json:"limit"`
|
|
||||||
List []WarehouseConfiguration `json:"list"`
|
|
||||||
}
|
|
||||||
|
|
|
@ -8,17 +8,15 @@ func getProductValue(val string) string {
|
||||||
}
|
}
|
||||||
|
|
||||||
var Product = struct {
|
var Product = struct {
|
||||||
ApplyRequest string
|
ApplyRequest string
|
||||||
CreateRequestStep string
|
CreateRequestStep string
|
||||||
ProcessApplyRequest string
|
ProcessApplyRequest string
|
||||||
RequestChangeStatus string
|
RequestChangeStatus string
|
||||||
WebhookStockUpdate string // WebhookStockUpdate Kiotviet queue
|
WebhookStockUpdate string
|
||||||
OPWebhookStockUpdate string // OPWebhookStockUpdate Onpoint queue
|
|
||||||
}{
|
}{
|
||||||
ApplyRequest: getProductValue("apply_request"),
|
ApplyRequest: getProductValue("apply_request"),
|
||||||
CreateRequestStep: getProductValue("create_request_step"),
|
CreateRequestStep: getProductValue("create_request_step"),
|
||||||
ProcessApplyRequest: getProductValue("process_apply_request"),
|
ProcessApplyRequest: getProductValue("process_apply_request"),
|
||||||
RequestChangeStatus: getProductValue("request_change_status"),
|
RequestChangeStatus: getProductValue("request_change_status"),
|
||||||
WebhookStockUpdate: getProductValue("webhook_stock_update"),
|
WebhookStockUpdate: getProductValue("webhook_stock_update"),
|
||||||
OPWebhookStockUpdate: getProductValue("op_webhook_stock_update"),
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,6 @@ var Warehouse = struct {
|
||||||
UpdateIsSellyMall string
|
UpdateIsSellyMall string
|
||||||
UpdateWarehouseConfig string
|
UpdateWarehouseConfig string
|
||||||
BulkWriteWarehouseConfig string
|
BulkWriteWarehouseConfig string
|
||||||
GetListWarehouseConfig string
|
|
||||||
}{
|
}{
|
||||||
SyncWarehouseIntoServiceSupplier: getWarehouseValue("sync_warehouse_into_service_supplier"),
|
SyncWarehouseIntoServiceSupplier: getWarehouseValue("sync_warehouse_into_service_supplier"),
|
||||||
CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"),
|
CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"),
|
||||||
|
@ -61,5 +60,4 @@ var Warehouse = struct {
|
||||||
UpdateIsSellyMall: getWarehouseValue("update_is_selly_mall"),
|
UpdateIsSellyMall: getWarehouseValue("update_is_selly_mall"),
|
||||||
UpdateWarehouseConfig: getWarehouseValue("update_warehouse_config"),
|
UpdateWarehouseConfig: getWarehouseValue("update_warehouse_config"),
|
||||||
BulkWriteWarehouseConfig: getWarehouseValue("bulk_write_warehouse_config"),
|
BulkWriteWarehouseConfig: getWarehouseValue("bulk_write_warehouse_config"),
|
||||||
GetListWarehouseConfig: getWarehouseValue("get_list_warehouse_config"),
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue