{"openapi":"3.0.3","info":{"title":"RiQS Report Renderer API","version":"1.0.0","description":"Standalone Next.js Report Renderer service for RiQS Business. Provides server-side report HTML compilation and interactive paginated preview microfrontend."},"servers":[{"url":"/","description":"Current environment"}],"tags":[{"name":"Report Rendering","description":"Endpoints for generating report HTML fragments and previews"},{"name":"System","description":"Health and service metadata"}],"paths":{"/":{"get":{"tags":["System"],"summary":"Service Health Check","description":"Returns service status for load balancers and deployment verification.","responses":{"200":{"description":"Service is healthy and ready."}}}},"/report/{reportId}":{"get":{"tags":["Report Rendering"],"summary":"Interactive Report Preview (Microfrontend)","description":"Renders a paginated document preview using Paged.js within an iframe. Communicates with the host app via postMessage (protocol v2: RR_READY / RR_INIT, then RR_DATA / RR_FOCUS in live mode; RR_RENDERED / RR_ERROR back).","parameters":[{"name":"reportId","in":"path","required":true,"description":"Unique identifier of the report","schema":{"type":"string","example":"a8106b8c-8758-4055-a062-75d002b0f8ea"}}],"responses":{"200":{"description":"Interactive report preview HTML page."}}}},"/api/report-html/{reportId}":{"post":{"tags":["Report Rendering"],"summary":"Generate Report HTML Fragments","description":"Fetches report data and template definitions from upstream Praxis services, resolves asset URLs, and generates self-contained inline CSS HTML fragments (header, body, footer) for PDF export or preview rendering.","parameters":[{"name":"reportId","in":"path","required":true,"description":"Unique identifier of the report to render","schema":{"type":"string","example":"a8106b8c-8758-4055-a062-75d002b0f8ea"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["backendUrl","token"],"properties":{"backendUrl":{"type":"string","format":"uri","description":"Upstream Praxis backend web service URL","example":"https://praxismonitor.seliselocal.com/api/business-praxismonitor/PraxisMonitorWebService"},"storageUrl":{"type":"string","format":"uri","description":"Upstream Storage service URL to resolve file IDs (images, logos, attachments)","example":"https://praxismonitor.seliselocal.com/api/storageService/v22/StorageService"},"token":{"type":"string","description":"Bearer authentication token for upstream services","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."},"timeZone":{"type":"string","description":"IANA time zone for rendered date-times. Defaults to the renderer server's zone.","example":"Europe/Zurich"},"labels":{"type":"object","additionalProperties":{"type":"string"},"description":"Translated copy as one flat object: report chrome keys (confirmation, confirmedOn, approvalOverview, …) and survey card keys (numberOfResponses, benchmark, …). Any key left out renders in English.","example":{"confirmation":"Bestätigung","confirmedOn":"Bestätigt am","numberOfResponses":"Anzahl Antworten"}},"leadingReportId":{"description":"Preparation report merged ahead of this report as one document (one cover, the main report's header and footer, continuous page numbers). Leave it out: a main report's attached preparation report is merged automatically. A string names one explicitly; false turns the merge off.","oneOf":[{"type":"string"},{"type":"boolean","enum":[false]}]},"inlineImages":{"type":"boolean","description":"Defaults to true: every image is returned as a base64 data URI (PDF export needs nothing more). Send false to keep body images as signed storage URLs, as the preview page does. The logo is always inlined.","default":true}}}}}},"responses":{"200":{"description":"Successfully compiled HTML fragments","content":{"application/json":{"schema":{"type":"object","properties":{"headerHtml":{"type":"string","description":"Self-contained HTML fragment with inline CSS for the report header"},"bodyHtml":{"type":"string","description":"Self-contained HTML fragment with inline CSS for the report body"},"footerHtml":{"type":"string","description":"Self-contained HTML fragment with inline CSS for the report footer"}}}}}},"400":{"description":"Invalid request payload (missing backendUrl or token)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"backendUrl and token are required in the request body"}}}}}},"405":{"description":"Method not allowed (only POST is supported)"},"500":{"description":"Internal server error"},"502":{"description":"Upstream Praxis API error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string","example":"Praxis API error: 404 Not Found"}}}}}}}}}}}