Beispiel #1
0
def create_petrol_station():
    # Extract incoming params from request
    params = request.get_json()

    petrol_stations = [PetrolStation(param) for param in params]
    accounting_service.create_petrol_stations(petrol_stations)

    return json_response()
Beispiel #2
0
def create_materials():
    # Extract incoming params from request
    params = request.get_json()

    materials = [Material(param) for param in params]
    accounting_service.create_materials(materials)

    return json_response()
Beispiel #3
0
def add_material_to_petrol_station(petrol_station_id, material_id, number):
    accounting_service.add_material_to_petrol_station(petrol_station_id, material_id, number)
    return json_response()
Beispiel #4
0
def get_material_on_petrol_station(petrol_station_id, material_id):
    material = accounting_service.get_material_on_petrol_station(petrol_station_id, material_id)
    return json_response(str(material))
Beispiel #5
0
def get_petrol_stations():
    petrol_stations = accounting_service.get_petrol_stations()
    return json_response(str(petrol_stations))
Beispiel #6
0
def get_petrol_station(id):
    petrol_station = accounting_service.get_petrol_station(id)
    return json_response(str(petrol_station))
Beispiel #7
0
def remove_petrol_station(id):
    accounting_service.remove_petrol_station(id)
    return json_response()
Beispiel #8
0
def remove_material(id):
    accounting_service.remove_material(id)
    return json_response()
Beispiel #9
0
def get_materials():
    materials = accounting_service.get_materials()
    return json_response(str(materials))
Beispiel #10
0
def get_material(id):
    material = accounting_service.get_material(id)
    return json_response(str(material))
Beispiel #11
0
def take_material_from_petrol_station(petrol_station_id, material_id, number):
    accounting_service.take_material_from_petrol_station(petrol_station_id, material_id, number)
    return json_response()