Sprint 2: Consolida as 3 semanas de sprint#41
Merged
Conversation
- Adds a GitHub Actions workflow to automate the deployment of the staging environment whenever changes are pushed to the develop branch. - Updates the Makefile to include commands for deploying to staging. - Creates a new Docker Compose file for the staging environment and modifies the existing one to accommodate the new setup.
infra(docker-compose): fixes access to logs directory
…ponses - add chatbot domain README with architecture, FSM flow, routes, schemas, metrics, and known issues - introduce Attendance document model and register it in Beanie initialization - add chatbot dependency wiring (repository/service providers) - add centralized swagger metadata for chatbot endpoints - refactor router to use injected service deps and response factory envelopes - change service `process_message` return type from wrapped DTO to `TriageData` - update chatbot schemas to reuse shared models and add search/evaluation/attendance response DTOs - adjust integration tests to validate the new service response contract
attendance contracts: establishes and consolidates api contracts for chatbot domain
…itial schema migration - add Alembic migration for companies, products and company_products tables - link users to companies via nullable users.company_id foreign key - register new models in Alembic/seed/test metadata bootstrap - add company and product routers to API router - create initial domain scaffolding for companies/products: entities, models, schemas, repositories, services, dependencies and swagger docs - add module READMEs and shared PaginatedItems generic schema
…ions - Scaffold user management endpoints (add, remove, list) on the company - router, register all company and product permissions in the seed, and - assign read access to agent and client roles.
Feat/company products - defines domain contracts
…in communication Implement EventDispatcher core module to decouple domain emitters from consumers, avoiding circular dependencies and growing coupling between domains (chatbot, ticket, live_chat). - EventDispatcher class with subscribe/publish using asyncio fire-and-forget tasks - @event_handler decorator with payload type validation and structured error logging - Typed Pydantic schemas for domain events - EVENT_PAYLOAD_MAP for compile-time wiring validation at startup - Custom exceptions: EventSchemaError, InvalidHandlerError - Singleton access via get_event_dispatcher (lru_cache) - Integration in app lifespan (main.py) with listener registration hook - Unit tests for dispatcher logic and decorator behavior - Module README and architectural docs (docs/event_dispatcher.md)
feat(event-dispatcher): add async in-process event bus
…nd FastAPI DI support - Injects logger into EventDispatcher for subscribe/publish - Adds Prometheus counters and histogram via @event_handler decorator - Exposes EventDispatcherDep for FastAPI route injection - Updates documentation.
feat(event-dispatcher): add structured logging, Prometheus metrics, and FastAPI DI support
…e suporte ao realtime chat
…tionListener Automate conversation management in response to ticket events (created, assignee updated, escalated, status updated, closed). Conversations are chained via parent_id/children_ids and indexed with sequential_index. - Add ConversationListener with handlers for all ticket lifecycle events - Add append_conversation_to_ticket, end_conversation, and lookup methods - Add client_id to TicketAssigneeUpdated and TicketEscalated event schemas - Add Prometheus metrics for listener-created/closed conversations - Add integration tests for listener and new repository methods
feat(live-chat): add event-driven conversation lifecycle via ConversationListener
…cleanup Refactor/chatbot typing and cleanup
Make company_id and company_name optional. Rename pagination field from limit to page_size across the ticket domain to match the documented README contract and the existing public tests.
feat(ticket): define ticket API contracts
…s created by the method create_ticket
Adds text search through tickets
…coping Adds case-insensitive substring search over message content, deduplicated by ticket and ranked by match count. Scope is enforced by role: clients see only their own conversations, agents see only assigned ones, admins see all.
feat(live_chat): implement conversation text search
feat(users): Add endpoint to deactivate user
sec(auth): hide sensitive user data from response payloads
fix(chat): improve triage ticket and websocket flow
Style/atualiza templates email
feat(db):db migration and seed
style: atualiza layout dos templates de e-mail
style: atualiza layout dos templates de e-mail
style: atualiza layout dos templates de e-mail
fix: ticket text search
…e testes - Substitui `entity.__dict__` por `jsonable_encoder` nos endpoints de CRUD de companies e products para evitar `TypeError` ao serializar UUID e datetime via `JSONResponse` - Adiciona `selectinload(User.roles)` em `get_company_users_paginated` para evitar `MissingGreenlet` no lazy load do relacionamento em sessão async - Captura `IntegrityError` em `add_products` e `add_companies` e levanta `ValueError`, que os routers já traduzem em 404 (em vez de retornar 500 quando o id referenciado não existe) - Ajusta `products_id_seq` no seed depois de inserir produtos com `id` fixo, evitando 409 na primeira chamada de POST /products - Remove a migration vazia `ebe6c4a057ea` — as tabelas já são criadas pela migration `337ea87962d5` - Adiciona testes de integração para `CompanyRepository` e `ProductRepository` cobrindo CRUD, soft delete, paginação, validações de DTO e relacionamentos M2M - Adiciona testes e2e para `/api/companies` e `/api/products` cobrindo CRUD, conflitos, autenticação e os relacionamentos com users e companies
feat(auth): include company_id in JWT token payload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumo
Release consolidando ~3 semanas de evolução da
develop. Principais eixos:Novidades por domínio
Companies & Products
company_idincluso no payload do JWT (feat(auth): include company_id in JWT token payload #40)Tickets
escalonamento, transferência e fechamento
ticket.created,ticket.assigneeeticket.closedvia EventDispatcher, com listeners dedicados
fechamento, busca, take)
Live Chat / Chatbot
ConversationListenerTriageState,padronização do router e remoção de código morto
Event Dispatcher
@event_handlercom testes unitáriosNotifications
Auth & Users
Infra & Observabilidade
Testes