bank info

This commit is contained in:
Tue 2022-09-14 17:33:18 +07:00
parent ee32f2d8bb
commit 42a6d04413
2 changed files with 18 additions and 18 deletions

View File

@ -100,3 +100,21 @@ func (s Supplier) GetBankInfoByID(supplierID model.SupplierRequestPayload) (*mod
return r.Data, nil
}
// CreateWarehouseIntoServiceSupplier ...
func (s Supplier) CreateWarehouseIntoServiceSupplier(p model.CreateSupplierWarehouseResponse) error {
msg, err := natsio.GetServer().Request(subject.Warehouse.CreateWarehouseIntoServiceSupplier, toBytes(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
}

View File

@ -126,21 +126,3 @@ func (w Warehouse) GetConfigByWarehouseID(warehouseID string) (*model.WarehouseC
}
return r.Data, nil
}
// CreateWarehouseIntoServiceSupplier ...
func (w Warehouse) CreateWarehouseIntoServiceSupplier(p model.CreateSupplierWarehouseResponse) error {
msg, err := natsio.GetServer().Request(subject.Warehouse.CreateWarehouseIntoServiceSupplier, toBytes(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
}