openapi: 3.1.0 info: title: Api version: 0.1.0 description: e-SUS PEC Support Management API servers: - url: /api description: Base API path tags: - name: health description: Health operations - name: atendimentos description: Support attendance records - name: dashboard description: Dashboard statistics 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" /atendimentos: get: operationId: listAtendimentos tags: [atendimentos] summary: List atendimentos parameters: - name: municipio in: query schema: type: string - name: prioridade in: query schema: type: string - name: dataInicio in: query schema: type: string - name: dataFim in: query schema: type: string - name: mes in: query schema: type: integer - name: ano in: query schema: type: integer responses: "200": description: List of atendimentos content: application/json: schema: type: array items: $ref: "#/components/schemas/Atendimento" post: operationId: createAtendimento tags: [atendimentos] summary: Create atendimento requestBody: required: true content: application/json: schema: $ref: "#/components/schemas/CreateAtendimentoInput" responses: "201": description: Created atendimento content: application/json: schema: $ref: "#/components/schemas/Atendimento" /atendimentos/{id}: get: operationId: getAtendimento tags: [atendimentos] summary: Get atendimento by id parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Atendimento content: application/json: schema: $ref: "#/components/schemas/Atendimento" "404": description: Not found delete: operationId: deleteAtendimento tags: [atendimentos] summary: Delete atendimento parameters: - name: id in: path required: true schema: type: integer responses: "200": description: Deleted content: application/json: schema: $ref: "#/components/schemas/DeleteResponse" /dashboard/stats: get: operationId: getDashboardStats tags: [dashboard] summary: Get dashboard statistics parameters: - name: mes in: query schema: type: integer - name: ano in: query schema: type: integer responses: "200": description: Dashboard statistics content: application/json: schema: $ref: "#/components/schemas/DashboardStats" /dashboard/daily: get: operationId: getDailyStats tags: [dashboard] summary: Get daily evolution stats parameters: - name: mes in: query schema: type: integer - name: ano in: query schema: type: integer responses: "200": description: Daily stats content: application/json: schema: type: array items: $ref: "#/components/schemas/DailyCount" components: schemas: HealthStatus: type: object properties: status: type: string required: - status Atendimento: type: object properties: id: type: integer municipio: type: string data: type: string descricao: type: string prioridade: type: string enum: [baixa, media, alta] createdAt: type: string required: - id - municipio - data - descricao - prioridade - createdAt CreateAtendimentoInput: type: object properties: municipio: type: string data: type: string descricao: type: string prioridade: type: string enum: [baixa, media, alta] required: - municipio - data - descricao - prioridade DeleteResponse: type: object properties: success: type: boolean required: - success DashboardStats: type: object properties: totalHoje: type: integer totalMes: type: integer totalMesAnterior: type: integer porMunicipio: type: array items: $ref: "#/components/schemas/MunicipioCount" porPrioridade: type: array items: $ref: "#/components/schemas/PrioridadeCount" altaPrioridade: type: array items: $ref: "#/components/schemas/Atendimento" municipioMaiorVolume: type: string required: - totalHoje - totalMes - totalMesAnterior - porMunicipio - porPrioridade - altaPrioridade - municipioMaiorVolume MunicipioCount: type: object properties: municipio: type: string total: type: integer required: - municipio - total PrioridadeCount: type: object properties: prioridade: type: string total: type: integer required: - prioridade - total DailyCount: type: object properties: data: type: string total: type: integer required: - data - total