add id to overview overhaul

main
Cizz22 1 year ago
parent d8350530f9
commit 77149e10a4

@ -101,7 +101,6 @@ async def get_overview_overhaul(*, db_session: DbSession):
).where(
OverhaulScope.start_date <= current_date,
OverhaulScope.end_date >= current_date,
OverhaulScope.status != 'Completed'
).group_by(
OverhaulScope.id
)
@ -116,6 +115,7 @@ async def get_overview_overhaul(*, db_session: DbSession):
return {
"status": "Ongoing",
"overhaul": {
"id": ongoing_overhaul.id,
"type": ongoing_overhaul.type,
"start_date": ongoing_overhaul.start_date,
"end_date": ongoing_overhaul.end_date,
@ -134,7 +134,6 @@ async def get_overview_overhaul(*, db_session: DbSession):
OverhaulScope.activity_equipments
).where(
OverhaulScope.start_date > current_date,
OverhaulScope.status == 'Upcoming'
).group_by(
OverhaulScope.id
).order_by(
@ -151,6 +150,7 @@ async def get_overview_overhaul(*, db_session: DbSession):
return {
"status": "Upcoming",
"overhaul": {
"id": upcoming_overhaul.id,
"type": upcoming_overhaul.type,
"start_date": upcoming_overhaul.start_date,
"end_date": upcoming_overhaul.end_date,

Loading…
Cancel
Save