Feature/get bank info #23

Open
nguyenphamquangtue wants to merge 15 commits from feature/get-bank-info into master
2 changed files with 2 additions and 22 deletions
Showing only changes of commit 4546d0e89b - Show all commits

View File

@ -80,27 +80,6 @@ func (s Supplier) FindAll(supplierID model.SupplierRequestPayload) (*model.Suppl
return r.Data, nil return r.Data, nil
} }
func (s Supplier) GetBankInfoByID(supplierID model.SupplierRequestPayload) (*model.SupplierAll, error) {
msg, err := natsio.GetServer().Request(subject.Supplier.FindAll, toBytes(supplierID))
if err != nil {
return nil, err
}
var r struct {
Data *model.SupplierAll `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
}
// CreateWarehouseIntoServiceSupplier ... // CreateWarehouseIntoServiceSupplier ...
func (s Supplier) CreateWarehouseIntoServiceSupplier(p model.CreateSupplierWarehousePayload) error { func (s Supplier) CreateWarehouseIntoServiceSupplier(p model.CreateSupplierWarehousePayload) error {
msg, err := natsio.GetServer().Request(subject.Warehouse.CreateWarehouseIntoServiceSupplier, toBytes(p)) msg, err := natsio.GetServer().Request(subject.Warehouse.CreateWarehouseIntoServiceSupplier, toBytes(p))

View File

@ -10,5 +10,6 @@ var Bank = struct {
GetBankById string GetBankById string
GetBankBranchById string GetBankBranchById string
}{ }{
GetBankBranchById: getBankValue("get_bank_by_id"), GetBankById: getBankValue("get_bank_by_id"),
GetBankBranchById: getBankValue("get_bank_branch_by_id"),
} }