28 lines
675 B
Python
28 lines
675 B
Python
from flask import current_app
|
|
|
|
|
|
def get_vehicles():
|
|
return current_app.config.get("TOML", {}).get("vehicles", {})
|
|
|
|
|
|
def get_journeys():
|
|
return current_app.config.get("TOML", {}).get("journeys", {})
|
|
|
|
|
|
def get_bareme(year: int, cv: int) -> list[dict]:
|
|
bareme = current_app.config.get("TOML", {}).get("bareme_kilometrique", {})
|
|
year_data = bareme.get(str(year), {})
|
|
if cv <= 5:
|
|
key = "cv_5"
|
|
elif cv <= 7:
|
|
key = "cv_6_7"
|
|
elif cv <= 9:
|
|
key = "cv_8_9"
|
|
else:
|
|
key = "cv_10_11"
|
|
return year_data.get(key, {}).get("tranches", [])
|
|
|
|
|
|
def day_types_without_journey():
|
|
return {"TT", "MALADE", "CONGE", "RTT", "FERIE"}
|