mergeDev/campaign #73
|
@ -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))
|
||||||
|
|
|
@ -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"),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue