add func bulk write warehouse config
This commit is contained in:
parent
28178e0c31
commit
e84157281b
|
@ -102,3 +102,21 @@ func (w Warehouse) UpdateWarehouseConfig(p model.UpdatePayload) error {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// BulkWriteWarehouseConfig ...
|
||||||
|
func (w Warehouse) BulkWriteWarehouseConfig(p model.UpdatePayload) error {
|
||||||
|
msg, err := natsio.GetServer().Request(subject.Warehouse.BulkWriteWarehouseConfig, bsonToBytes(p))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
var r struct {
|
||||||
|
Error string `json:"error"`
|
||||||
|
}
|
||||||
|
if err = json.Unmarshal(msg.Data, &r); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if r.Error != "" {
|
||||||
|
return errors.New(r.Error)
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
|
@ -31,6 +31,7 @@ var Warehouse = struct {
|
||||||
UpdateStatusWarehousePendingInactive string
|
UpdateStatusWarehousePendingInactive string
|
||||||
UpdateIsSellyMall string
|
UpdateIsSellyMall string
|
||||||
UpdateWarehouseConfig string
|
UpdateWarehouseConfig string
|
||||||
|
BulkWriteWarehouseConfig string
|
||||||
}{
|
}{
|
||||||
CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"),
|
CreateWarehouseIntoServiceSupplier: getWarehouseValue("create_warehouse_into_service_supplier"),
|
||||||
UpdateWarehouseIntoServiceSupplier: getWarehouseValue("update_warehouse_into_service_supplier"),
|
UpdateWarehouseIntoServiceSupplier: getWarehouseValue("update_warehouse_into_service_supplier"),
|
||||||
|
@ -54,4 +55,5 @@ var Warehouse = struct {
|
||||||
UpdateStatusWarehousePendingInactive: getWarehouseValue("update_status_warehouse_pending_inactive"),
|
UpdateStatusWarehousePendingInactive: getWarehouseValue("update_status_warehouse_pending_inactive"),
|
||||||
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"),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue