{"openapi":"3.0.3","info":{"title":"API de Integração CIA Turron","version":"1.0.0","description":"Autenticação OAuth 2.0 (client credentials): obtenha o token em POST /oauth/token e envie `Authorization: Bearer <access_token>` nas rotas /v1. Erros seguem application/problem+json (RFC 9457)."},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"},"oauth2":{"type":"oauth2","flows":{"clientCredentials":{"tokenUrl":"/oauth/token","scopes":{"employees:read":"employees:read","employees:write":"employees:write","orders:read":"orders:read","orders:write":"orders:write"}}}}},"schemas":{}},"paths":{"/health":{"get":{"summary":"Verifica se a API e o banco estão disponíveis","tags":["Sistema"],"responses":{"200":{"description":"Default Response"}}}},"/oauth/token":{"post":{"summary":"Gera um access token (OAuth 2.0 client credentials)","tags":["Autenticação"],"description":"Envie client_id e client_secret via HTTP Basic (recomendado) ou no corpo. Aceita application/x-www-form-urlencoded ou application/json. O token expira em `expires_in` segundos.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"grant_type":{"type":"string","enum":["client_credentials"]},"client_id":{"type":"string","maxLength":64},"client_secret":{"type":"string","maxLength":128},"scope":{"type":"string","maxLength":255,"description":"Escopos separados por espaço (opcional)"}},"required":["grant_type"],"additionalProperties":false}}}},"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"integer"},"scope":{"type":"string"}}}}}}}}},"/v1/employees":{"get":{"summary":"Lista colaboradores (paginado)","tags":["Colaboradores"],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100000,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"in":"query","name":"limit","required":false,"description":"Itens por página (máx. 100)"},{"schema":{"type":"string","maxLength":15},"in":"query","name":"registration","required":false},{"schema":{"type":"string","maxLength":15},"in":"query","name":"badge","required":false},{"schema":{"type":"string","minLength":2,"maxLength":100},"in":"query","name":"name","required":false,"description":"Busca parcial"},{"schema":{"type":"string","enum":["active","inactive"]},"in":"query","name":"status","required":false},{"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"string","format":"date-time"}]},"in":"query","name":"updatedSince","required":false,"description":"Somente alterados a partir desta data"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"registration":{"type":"string"},"badge":{"type":"string","nullable":true},"name":{"type":"string"},"company":{"type":"string","nullable":true},"profitCenter":{"type":"string","nullable":true},"integrationCode":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"pendingSync":{"type":"boolean","description":"true enquanto a alteração não foi sincronizada com os ambientes locais"},"integratedAt":{"type":"string","format":"date-time","nullable":true},"disabledAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}},"meta":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"totalPages":{"type":"integer"}}},"links":{"type":"object","properties":{"self":{"type":"string"},"next":{"type":"string","nullable":true},"prev":{"type":"string","nullable":true}}}}}}}},"400":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"401":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"403":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"404":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"409":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"422":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"429":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}}},"post":{"summary":"Cadastra um colaborador","tags":["Colaboradores"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["registration","badge","name"],"properties":{"registration":{"type":"string","minLength":1,"maxLength":15,"pattern":"^\\S(?:.*\\S)?$","description":"Matrícula do colaborador (chave única)"},"badge":{"type":"string","minLength":1,"maxLength":15,"pattern":"^\\S(?:.*\\S)?$","description":"Crachá"},"name":{"type":"string","minLength":1,"maxLength":250,"pattern":"\\S"},"company":{"type":"string","maxLength":20,"nullable":true},"profitCenter":{"type":"string","maxLength":30,"nullable":true},"integrationCode":{"type":"string","maxLength":20,"nullable":true},"status":{"type":"string","enum":["active","inactive"]}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":8,"maxLength":128},"in":"header","name":"idempotency-key","required":false,"description":"Opcional. Reenvios com a mesma chave não são reprocessados (válido por 24h)."}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"object","properties":{"registration":{"type":"string"},"badge":{"type":"string","nullable":true},"name":{"type":"string"},"company":{"type":"string","nullable":true},"profitCenter":{"type":"string","nullable":true},"integrationCode":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"pendingSync":{"type":"boolean","description":"true enquanto a alteração não foi sincronizada com os ambientes locais"},"integratedAt":{"type":"string","format":"date-time","nullable":true},"disabledAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"401":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"403":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"404":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"409":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"422":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"429":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}}}},"/v1/employees/{registration}":{"get":{"summary":"Consulta um colaborador pela matrícula","tags":["Colaboradores"],"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":15,"pattern":"^\\S(?:.*\\S)?$"},"in":"path","name":"registration","required":true,"description":"Matrícula do colaborador (chave única)"}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"registration":{"type":"string"},"badge":{"type":"string","nullable":true},"name":{"type":"string"},"company":{"type":"string","nullable":true},"profitCenter":{"type":"string","nullable":true},"integrationCode":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"pendingSync":{"type":"boolean","description":"true enquanto a alteração não foi sincronizada com os ambientes locais"},"integratedAt":{"type":"string","format":"date-time","nullable":true},"disabledAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"401":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"403":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"404":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"409":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"422":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"429":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}}},"patch":{"summary":"Atualiza um colaborador (somente os campos enviados)","tags":["Colaboradores"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","minProperties":1,"properties":{"badge":{"type":"string","minLength":1,"maxLength":15,"pattern":"^\\S(?:.*\\S)?$","description":"Crachá"},"name":{"type":"string","minLength":1,"maxLength":250,"pattern":"\\S"},"company":{"type":"string","maxLength":20,"nullable":true},"profitCenter":{"type":"string","maxLength":30,"nullable":true},"integrationCode":{"type":"string","maxLength":20,"nullable":true},"status":{"type":"string","enum":["active","inactive"]}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":1,"maxLength":15,"pattern":"^\\S(?:.*\\S)?$"},"in":"path","name":"registration","required":true,"description":"Matrícula do colaborador (chave única)"},{"schema":{"type":"string","minLength":8,"maxLength":128},"in":"header","name":"idempotency-key","required":false,"description":"Opcional. Reenvios com a mesma chave não são reprocessados (válido por 24h)."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"data":{"type":"object","properties":{"registration":{"type":"string"},"badge":{"type":"string","nullable":true},"name":{"type":"string"},"company":{"type":"string","nullable":true},"profitCenter":{"type":"string","nullable":true},"integrationCode":{"type":"string","nullable":true},"status":{"type":"string","enum":["active","inactive"]},"pendingSync":{"type":"boolean","description":"true enquanto a alteração não foi sincronizada com os ambientes locais"},"integratedAt":{"type":"string","format":"date-time","nullable":true},"disabledAt":{"type":"string","format":"date-time","nullable":true},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}}}}},"400":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"401":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"403":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"404":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"409":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"422":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"429":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}}}},"/v1/employees/bulk":{"post":{"summary":"Cadastra até 1000 colaboradores (tudo ou nada)","tags":["Colaboradores"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","required":["registration","badge","name"],"properties":{"registration":{"type":"string","minLength":1,"maxLength":15,"pattern":"^\\S(?:.*\\S)?$","description":"Matrícula do colaborador (chave única)"},"badge":{"type":"string","minLength":1,"maxLength":15,"pattern":"^\\S(?:.*\\S)?$","description":"Crachá"},"name":{"type":"string","minLength":1,"maxLength":250,"pattern":"\\S"},"company":{"type":"string","maxLength":20,"nullable":true},"profitCenter":{"type":"string","maxLength":30,"nullable":true},"integrationCode":{"type":"string","maxLength":20,"nullable":true},"status":{"type":"string","enum":["active","inactive"]}},"additionalProperties":false}}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":8,"maxLength":128},"in":"header","name":"idempotency-key","required":false,"description":"Opcional. Reenvios com a mesma chave não são reprocessados (válido por 24h)."}],"security":[{"bearerAuth":[]}],"responses":{"201":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"created":{"type":"integer"}}}}}},"400":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"401":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"403":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"404":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"409":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"422":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"429":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}}},"patch":{"summary":"Atualiza até 1000 colaboradores (tudo ou nada)","tags":["Colaboradores"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["items"],"properties":{"items":{"type":"array","minItems":1,"maxItems":1000,"items":{"type":"object","required":["registration"],"minProperties":2,"properties":{"registration":{"type":"string","minLength":1,"maxLength":15,"pattern":"^\\S(?:.*\\S)?$","description":"Matrícula do colaborador (chave única)"},"badge":{"type":"string","minLength":1,"maxLength":15,"pattern":"^\\S(?:.*\\S)?$","description":"Crachá"},"name":{"type":"string","minLength":1,"maxLength":250,"pattern":"\\S"},"company":{"type":"string","maxLength":20,"nullable":true},"profitCenter":{"type":"string","maxLength":30,"nullable":true},"integrationCode":{"type":"string","maxLength":20,"nullable":true},"status":{"type":"string","enum":["active","inactive"]}},"additionalProperties":false}}},"additionalProperties":false}}}},"parameters":[{"schema":{"type":"string","minLength":8,"maxLength":128},"in":"header","name":"idempotency-key","required":false,"description":"Opcional. Reenvios com a mesma chave não são reprocessados (válido por 24h)."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"},"updated":{"type":"integer"},"unchanged":{"type":"integer"}}}}}},"400":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"401":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"403":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"404":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"409":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"422":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"429":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}}}},"/v1/order-items":{"get":{"summary":"Lista itens de pedidos por período (paginado)","tags":["Pedidos"],"description":"Período obrigatório de no máximo 31 dias. Datas YYYY-MM-DD usam o fuso de Brasília e incluem o dia inteiro.","parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100000,"default":1},"in":"query","name":"page","required":false},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"in":"query","name":"limit","required":false,"description":"Itens por página (máx. 100)"},{"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"string","format":"date-time"}]},"in":"query","name":"startDate","required":true},{"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"string","format":"date-time"}]},"in":"query","name":"endDate","required":true},{"schema":{"type":"string","maxLength":15},"in":"query","name":"registration","required":false},{"schema":{"type":"string","maxLength":15},"in":"query","name":"badge","required":false},{"schema":{"type":"integer","minimum":1,"maximum":2147483647},"in":"query","name":"orderId","required":false}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Default Response","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer"},"orderId":{"type":"integer","nullable":true},"orderItemId":{"type":"integer","nullable":true},"issueDate":{"type":"string","format":"date-time","nullable":true},"cashierCode":{"type":"string","nullable":true},"cashierType":{"type":"string","nullable":true},"registration":{"type":"string","description":"Matrícula do colaborador","nullable":true},"badge":{"type":"string","description":"Crachá do colaborador","nullable":true},"employeeName":{"type":"string","nullable":true},"productCode":{"type":"string","nullable":true},"productDescription":{"type":"string","nullable":true},"quantity":{"type":"number","nullable":true},"unitValue":{"type":"number","nullable":true},"totalValue":{"type":"number","nullable":true},"orderTotalValue":{"type":"number","nullable":true}}}},"meta":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"total":{"type":"integer"},"totalPages":{"type":"integer"}}},"links":{"type":"object","properties":{"self":{"type":"string"},"next":{"type":"string","nullable":true},"prev":{"type":"string","nullable":true}}}}}}}},"400":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"401":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"403":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"404":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"409":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"422":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}},"429":{"description":"Erro no formato application/problem+json (RFC 9457)","content":{"application/json":{"schema":{"type":"object","description":"Erro no formato application/problem+json (RFC 9457)","properties":{"type":{"type":"string"},"title":{"type":"string"},"status":{"type":"integer"},"detail":{"type":"string"},"instance":{"type":"string"},"requestId":{"type":"string"},"errors":{"type":"array","items":{"type":"object","additionalProperties":true}}}}}}}}}}},"servers":[{"url":"http://127.0.0.1:6334"}]}