add bank branch info

This commit is contained in:
Tue 2022-09-15 11:20:34 +07:00
parent fffcc281cc
commit 4546d0e89b
2 changed files with 2 additions and 22 deletions

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"),
} }