Feature/get bank info #23

Closed
nguyenphamquangtue wants to merge 57 commits from feature/get-bank-info into master
2 changed files with 18 additions and 18 deletions
Showing only changes of commit 42a6d04413 - Show all commits

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
}