M21: add optional organisation identity

This commit is contained in:
NuklearRabbit
2026-08-10 15:35:25 +02:00
parent 509cb95110
commit c3f1cfc699
38 changed files with 563 additions and 110 deletions
+7 -5
View File
@@ -100,22 +100,24 @@ def get_dashboard(
if b.starts_at.date() == today and b.status in ("reserved", "active"):
today_items.append(
TodayItem(
kind="departure", booking_ref=b.public_ref, vehicle_ref=vehicle_ref,
kind="departure",
booking_ref=b.public_ref,
vehicle_ref=vehicle_ref,
scheduled_at=b.starts_at,
)
)
if b.ends_at.date() == today and b.status in ("active", "returned"):
today_items.append(
TodayItem(
kind="return", booking_ref=b.public_ref, vehicle_ref=vehicle_ref,
kind="return",
booking_ref=b.public_ref,
vehicle_ref=vehicle_ref,
scheduled_at=b.ends_at,
)
)
today_items.sort(key=lambda item: item.scheduled_at)
recent = db.scalars(
select(OutboxEvent).order_by(OutboxEvent.occurred_at.desc()).limit(5)
).all()
recent = db.scalars(select(OutboxEvent).order_by(OutboxEvent.occurred_at.desc()).limit(5)).all()
recent_automation = [
AutomationRunOut(
event_id=str(r.event_id),