openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: API specification servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: trades description: BSE trade ingestion and monitoring operations paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check description: Returns server health status responses: "200": description: Healthy content: application/json: schema: $ref: "#/components/schemas/HealthStatus" /trades: get: operationId: listTrades tags: [trades] summary: List stored trades description: Returns all currently stored BSE trades and the timestamp of the latest available data. responses: "200": description: Stored trades content: application/json: schema: $ref: "#/components/schemas/TradesResponse" "500": description: Failed to load trades content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /pullTrades: post: operationId: startTradePull tags: [trades] summary: Start an asynchronous trade pull description: Starts a long-running trade pull and returns immediately without waiting for completion. responses: "202": description: Trade pull accepted content: application/json: schema: $ref: "#/components/schemas/PullStatusResponse" "409": description: A trade pull is already in progress content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" "500": description: Failed to start trade pull content: application/json: schema: $ref: "#/components/schemas/ErrorResponse" /events: get: operationId: tradeEvents tags: [trades] summary: Subscribe to trade ingestion events description: Opens a Server-Sent Events stream for pull lifecycle notifications. responses: "200": description: Server-Sent Events stream content: text/event-stream: schema: type: string components: schemas: HealthStatus: type: object properties: status: type: string required: - status Trade: type: object properties: tradeId: type: string client: type: string symbol: type: string quantity: type: number price: type: number timestamp: type: string format: date-time required: - tradeId - client - symbol - quantity - price - timestamp TradesResponse: type: object properties: trades: type: array items: $ref: "#/components/schemas/Trade" lastUpdated: type: string format: date-time required: - trades - lastUpdated PullStatusResponse: type: object properties: message: type: string status: type: string enum: [IN_PROGRESS, COMPLETED, FAILED] required: - message - status ErrorResponse: type: object properties: error: type: string required: - error