|
|
|
|
@ -387,8 +387,13 @@ async def calculate_contribution(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@router.get("/result/critical/{simulation_id}]", response_model=StandardResponse[List[SimulationCalc]])
|
|
|
|
|
async def get_critical_equipment(db_session:DbSession, simulation_id:UUID):
|
|
|
|
|
async def get_critical_equipment(db_session:DbSession, simulation_id: str):
|
|
|
|
|
# Step 1: Get all failure events for this simulation
|
|
|
|
|
if simulation_id == 'default':
|
|
|
|
|
simulation = await get_default_simulation(db_session=db_session)
|
|
|
|
|
simulation_id = simulation.id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
failure_query = text("""
|
|
|
|
|
SELECT DISTINCT
|
|
|
|
|
(elem ->> 'currentEvent') AS jenis,
|
|
|
|
|
|