Exemplo n.º 1
0
def addParkingSellPeriod():
    app.logger.debug("adding new sell for user")
    
    parking_id = None
    start_date = None
    end_date   = None
    price_per_hour = None
    
    try:
        parking_id = request.form['pid']
        start_date = request.form['start']
        end_date   = request.form['end']
        price_per_hour = request.form['pph']
    except:
        return jsonify(success=False, error="missing parameter")
    
    parkingSvc = ParkingService()
    
    insert_response = parkingSvc.addParkingSellPeriod(parking_id, start_date, end_date, price_per_hour)
    
    if insert_response is not None:
        return jsonify(success=True)
    else:
        return jsonify(success=False, error='there was problem in adding this sell')