{"openapi":"3.0.3","info":{"title":"AI Assistance System API","description":"Mock/demo spec for the AI Assistance System (PDF ingestion + test-case management). Generated for use with Swagger UI / Prism / Postman mock servers.\n","version":"3.1.0"},"servers":[{"description":"SwaggerHub API Auto Mocking","url":"https://virtserver.swaggerhub.com/siemenstesting/ai-assistance-system-api/3.1.0"},{"url":"http://127.0.0.1:8000","description":"Local dev server"}],"tags":[{"name":"PDF Processing"},{"name":"Test Cases"}],"paths":{"/upload-pdf":{"post":{"tags":["PDF Processing"],"summary":"Upload a PDF (or change document) for background processing","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["project_name","file"],"properties":{"project_name":{"type":"string","example":"My Project"},"file":{"type":"string","format":"binary"}}}}}},"responses":{"202":{"description":"PDF accepted, job queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UploadResponse"},"example":{"job_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","status":"queued","message":"PDF accepted. Processing started."}}}},"400":{"description":"project_name empty OR file is not a PDF","content":{"application/json":{"example":{"detail":"project_name must not be empty"}}}}}}},"/status/{job_id}":{"get":{"tags":["PDF Processing"],"summary":"Poll job status","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"},"example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}],"responses":{"200":{"description":"Current job status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponse"},"examples":{"processing":{"summary":"Still processing","value":{"job_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","status":"processing","message":null}},"done":{"summary":"Done","value":{"job_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","status":"done","message":null}},"failed":{"summary":"Failed","value":{"job_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","status":"failed","message":"PDF could not be parsed: file is encrypted"}}}}}},"404":{"description":"job_id not found","content":{"application/json":{"example":{"detail":"job_id not found"}}}}}}},"/result/{job_id}":{"get":{"tags":["PDF Processing"],"summary":"Fetch final job result","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"},"example":"3fa85f64-5717-4562-b3fc-2c963f66afa6"}],"responses":{"200":{"description":"Job succeeded or failed (see status field)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobResult"},"examples":{"success":{"summary":"Job succeeded","value":{"job_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","status":"done","project_name":"My Project","doc_name":"21-EL15112-00032","panel_ids":["400kV BUSBAR PROTECTION PANEL","ZN02"],"error":null}},"failure":{"summary":"Job failed","value":{"job_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","status":"failed","project_name":"My Project","doc_name":"","panel_ids":[],"error":"PDF could not be parsed: file is encrypted"}}}}}},"202":{"description":"Job still queued/processing — keep polling /status","content":{"application/json":{"example":{"job_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","status":"processing","message":"Job not finished yet, keep polling /status"}}}},"404":{"description":"job_id not found","content":{"application/json":{"example":{"detail":"job_id not found"}}}}}}},"/test-cases/{project_name}/{panel_id}":{"get":{"tags":["Test Cases"],"summary":"Get test cases for a project/panel","parameters":[{"name":"project_name","in":"path","required":true,"schema":{"type":"string"},"example":"My Project"},{"name":"panel_id","in":"path","required":true,"schema":{"type":"string"},"example":"400kV BUSBAR PROTECTION PANEL"},{"name":"from_page","in":"query","required":false,"schema":{"type":"integer"},"example":46},{"name":"to_page","in":"query","required":false,"schema":{"type":"integer"},"example":50},{"name":"test_category","in":"query","required":false,"schema":{"type":"string"},"example":"P1"}],"responses":{"200":{"description":"Array of test cases","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TestCase"}},"example":[{"tc_id":"5496_21-EL15112-00032_P1_0001","phase":"P1","check":"Verify panel name plate label","expected_value":"SB-365801-RP01 66kV GIS BUS BARS PROTECTION PANEL","reference_page_id":"USB01","pdf_page_number":46,"page_description":"Front View","result":"PENDING","actual_value":null,"remarks":null,"steps":null},{"tc_id":"5496_21-EL15112-00032_P1_0002","phase":"P1","check":"Verify presence of earth bus","expected_value":"Earth bus present and bonded","reference_page_id":"USB02","pdf_page_number":47,"page_description":"Rear View","result":"PENDING","actual_value":null,"remarks":null,"steps":null}]}}}}}},"/test-cases/{project_name}/{panel_id}/{tc_id}":{"put":{"tags":["Test Cases"],"summary":"Update a single test case","parameters":[{"name":"project_name","in":"path","required":true,"schema":{"type":"string"},"example":"My Project"},{"name":"panel_id","in":"path","required":true,"schema":{"type":"string"},"example":"400kV BUSBAR PROTECTION PANEL"},{"name":"tc_id","in":"path","required":true,"schema":{"type":"string"},"example":"5496_21-EL15112-00032_P1_0001"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCaseUpdate"},"example":{"result":"PASS","actual_value":"SB-365801-RP01 66kV GIS BUS BARS PROTECTION PANEL","remarks":"Checked and confirmed"}}}},"responses":{"200":{"description":"Updated test case","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCase"},"example":{"tc_id":"5496_21-EL15112-00032_P1_0001","phase":"P1","check":"Verify panel name plate label","expected_value":"SB-365801-RP01 66kV GIS BUS BARS PROTECTION PANEL","reference_page_id":"USB01","pdf_page_number":46,"page_description":"Front View","result":"PASS","actual_value":"SB-365801-RP01 66kV GIS BUS BARS PROTECTION PANEL","remarks":"Checked and confirmed","steps":null}}}},"404":{"description":"tc_id not found","content":{"application/json":{"example":{"detail":"tc_id not found"}}}}}}},"/test-cases/{project_name}/{panel_id}/bulk":{"put":{"tags":["Test Cases"],"summary":"Bulk update test cases","parameters":[{"name":"project_name","in":"path","required":true,"schema":{"type":"string"},"example":"My Project"},{"name":"panel_id","in":"path","required":true,"schema":{"type":"string"},"example":"400kV BUSBAR PROTECTION PANEL"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateRequest"},"example":{"updates":[{"tc_id":"5496_21-EL15112-00032_P1_0001","result":"PASS","remarks":"Checked and confirmed"},{"tc_id":"5496_21-EL15112-00032_P1_0002","result":"FAIL","remarks":"Component missing"}]}}}},"responses":{"200":{"description":"Bulk update summary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUpdateResponse"},"example":{"updated_count":2,"error_count":0,"updated":[{"tc_id":"5496_21-EL15112-00032_P1_0001","phase":"P1","check":"Verify panel name plate label","expected_value":"SB-365801-RP01 66kV GIS BUS BARS PROTECTION PANEL","reference_page_id":"USB01","pdf_page_number":46,"page_description":"Front View","result":"PASS","actual_value":null,"remarks":"Checked and confirmed","steps":null},{"tc_id":"5496_21-EL15112-00032_P1_0002","phase":"P1","check":"Verify presence of earth bus","expected_value":"Earth bus present and bonded","reference_page_id":"USB02","pdf_page_number":47,"page_description":"Rear View","result":"FAIL","actual_value":null,"remarks":"Component missing","steps":null}],"errors":[]}}}},"422":{"description":"Bulk update failed","content":{"application/json":{"example":{"detail":"Bulk update failed"}}}}}}}},"components":{"schemas":{"UploadResponse":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","example":"queued"},"message":{"type":"string"}}},"StatusResponse":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","enum":["queued","processing","done","failed"]},"message":{"type":"string","nullable":true}}},"JobResult":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","enum":["done","failed"]},"project_name":{"type":"string"},"doc_name":{"type":"string"},"panel_ids":{"type":"array","items":{"type":"string"}},"error":{"type":"string","nullable":true}}},"TestCase":{"type":"object","properties":{"tc_id":{"type":"string"},"phase":{"type":"string"},"check":{"type":"string"},"expected_value":{"type":"string"},"reference_page_id":{"type":"string"},"pdf_page_number":{"type":"integer"},"page_description":{"type":"string"},"result":{"type":"string","enum":["PENDING","PASS","FAIL"]},"actual_value":{"nullable":true},"remarks":{"type":"string","nullable":true},"steps":{"nullable":true}}},"TestCaseUpdate":{"type":"object","properties":{"result":{"type":"string","enum":["PASS","FAIL","PENDING"]},"remarks":{"type":"string"},"actual_value":{},"phase":{"type":"string"},"check":{"type":"string"},"expected_value":{"type":"string"},"pdf_page_number":{"type":"integer"},"page_description":{"type":"string"}}},"BulkTestCaseUpdateItem":{"allOf":[{"$ref":"#/components/schemas/TestCaseUpdate"},{"type":"object","required":["tc_id"],"properties":{"tc_id":{"type":"string"}}}]},"BulkUpdateRequest":{"type":"object","properties":{"updates":{"type":"array","items":{"$ref":"#/components/schemas/BulkTestCaseUpdateItem"}}}},"BulkUpdateResponse":{"type":"object","properties":{"updated_count":{"type":"integer"},"error_count":{"type":"integer"},"updated":{"type":"array","items":{"$ref":"#/components/schemas/TestCase"}},"errors":{"type":"array","items":{"type":"object","properties":{"tc_id":{"type":"string"},"reason":{"type":"string"}}}}}}}}}