def extend(): json = request.get_json() return jsonify(Warranty.extend(**json).to_json())
def create(): json = request.get_json() return jsonify(Warranty.create(**json).to_json())
def invalidate(): json = request.get_json() return jsonify(Warranty.invalidate(**json).to_json())
def transfer(): json = request.get_json() return jsonify(Warranty.transfer(**json).to_json())
def add_remark(): json = request.get_json() return jsonify(Warranty.add_remark(**json).to_json())
def change_nick(): json = request.get_json() return jsonify(Warranty.change_nick(**json).to_json())
def list(): json = request.get_json() items = Warranty.list(**json) items = sorted(items, key=lambda x: -x.date_of_purchase) return jsonify([_.to_json() for _ in items])