def GetSuplliers(): req = GetItemsByPageReq(request.json) result = SupplierSvc.GetSupplierByPage(req) res = GetItemsByPageRsp(has_next=result['has_next'], has_prev=result['has_prev'], items=result['suppliers']).serialize() return jsonify(res)
def DeleteSupplier(): req = DeleteSupplierReq(request.json) result = SupplierSvc.DeleteSupplier(req) return jsonify(result)
def UpdateSupplier(): req = UpdateSupplierReq(request.json) result = SupplierSvc.UpdateSupplier(req) return jsonify(result)
def CreateSupplier(): req = CreateSupplierReq(request.json) result = SupplierSvc.CreateSupplier(req) return jsonify(result)
def SearchSuppliers(): req = SearchSuppliersReq(request.json) result = SupplierSvc.SearchSuppliers(req) res = SearchSuppliersRsp(result).serialize() return jsonify(res['suppliers'])