Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
a38c454
docs: update roadmap and technical debt for Sprint 12 and init Bookin…
Apr 21, 2026
1d1e1d4
feat(bookings): implement provider schedule and rename enum to EBooki…
Apr 21, 2026
1edd187
chore: update packages.lock.json files after adding Bookings module
Apr 21, 2026
102fb38
feat(web): implement schedule management and booking flow
Apr 21, 2026
b5b16fb
merge: resolve conflicts between master and sprint-12 branch
Apr 21, 2026
ebcdb46
docs: finalize sprint 12 and update roadmap and technical debt
Apr 21, 2026
9f6789a
fix: address CI build errors, coverage and review findings
Apr 21, 2026
1707351
fix(web): use correct button variant and fix package versions
Apr 21, 2026
57b65a9
fix: address final review findings, atomic operations and security
Apr 21, 2026
11e85c5
fix: address all review findings, security and timezone logic
Apr 21, 2026
476e1bc
chore: sync lock files to fix CI restore error
Apr 21, 2026
3b009e3
fix: resolve all review findings, security and timezone tests
Apr 21, 2026
f79704e
chore: total clean and sync of lock files
Apr 21, 2026
77fb0bc
fix(web): resolve button type errors and clean up imports
Apr 21, 2026
2469162
fix: resolve all build errors and review findings across backend and …
Apr 21, 2026
d8d2c13
fix: address final review findings, concurrency and security
Apr 21, 2026
0022feb
fix: resolve all build errors, tests and sync schema
Apr 21, 2026
ade1801
test(bookings): expand test suite and achieve full coverage
Apr 21, 2026
9a89ad3
fix: sync solution and align OpenTelemetry packages to 1.15.2
Apr 21, 2026
7fc5b07
fix: align OpenTelemetry versions with master and enable Bookings tes…
Apr 21, 2026
38c164c
Merge branch 'master' into feature/sprint-12-bookings-messaging
Apr 21, 2026
d8c572f
fix: restore coverage health with new backend and frontend tests
Apr 21, 2026
cc43757
test: achieve coverage goals with new unit and frontend tests
Apr 21, 2026
8c481a8
fix: resolve findings and expand bookings coverage
Apr 21, 2026
8f3c722
fix(frontend): add aria-label to schedule remove button and fix faili…
Apr 21, 2026
198129a
fix: address all findings and achieve stable coverage
Apr 21, 2026
f631dd9
fix: address all remaining findings and stabilize tests
Apr 21, 2026
e7a32b2
fix: resolve integration test authentication and logic issues
Apr 21, 2026
9de0618
fix: resolve build errors and stabilize integration tests
Apr 21, 2026
50335b3
fix: address all final findings and refine tests/logic
Apr 22, 2026
dbbf54c
fix: resolve integration test logic failures and refine API metadata
Apr 22, 2026
725fd2d
fix: stabilize concurrency tests and resolve final findings
Apr 22, 2026
20e6ba8
fix: address all remaining findings and achieve stable coverage
Apr 22, 2026
8274f06
fix: address all final findings and stabilize tests
Apr 22, 2026
43d9038
feat: implement Bookings module with core domain entities, applicatio…
Apr 22, 2026
f58c16b
feat: implement provider scheduling functionality with database migra…
Apr 22, 2026
63463aa
feat: implement complete booking module with scheduling, management e…
Apr 22, 2026
ced4c67
test: add unit tests for GlobalExceptionHandler middleware behavior
Apr 22, 2026
80d5b9e
feat: implement booking schedule E2E flow, handler unit tests, and gl…
Apr 22, 2026
bc57e42
feat: implement booking completion command, query handlers, and repos…
Apr 22, 2026
d788a59
feat: implement global exception handler and bookings module with cor…
Apr 22, 2026
59d1889
feat: implement booking modal component for provider service scheduling
Apr 22, 2026
d67932e
feat: implement booking repository with overlap validation and provid…
Apr 22, 2026
1c7130e
test: add BookingModal unit tests and create E2E utility for API mocking
Apr 22, 2026
9b854e8
feat: implement booking module with backend handlers, infrastructure …
Apr 22, 2026
e8a1198
ci: add backend continuous integration workflow with postgres and azu…
Apr 22, 2026
9a00f4b
feat: implement paginated booking queries, robust overlapping validat…
Apr 22, 2026
a5abe31
feat: implement booking module domain logic, persistence, and public …
Apr 22, 2026
427ece0
feat: implement complete booking module with domain logic, persistenc…
Apr 23, 2026
50fc489
feat: implement provider profile page with integrated booking system …
Apr 23, 2026
795a3c7
feat: implement booking module infrastructure and establish CI/CD doc…
Apr 23, 2026
129d588
feat: implement core booking module with domain entities, application…
Apr 23, 2026
bdd1030
feat: implement booking functionality including scheduling, repositor…
Apr 23, 2026
19a8ad9
feat: implement provider availability query handler tests and booking…
Apr 23, 2026
7e02430
feat: implement messaging infrastructure with Rebus, add booking doma…
Apr 23, 2026
16073a0
feat: implement provider scheduling domain logic, messaging infrastru…
Apr 23, 2026
4197168
test: add unit tests for GlobalExceptionHandler middleware handling v…
Apr 23, 2026
d0d891e
feat: implement BookingRepository with overlap validation and add pub…
Apr 24, 2026
bc53e57
feat: implement provider booking endpoints and cached authorization r…
Apr 24, 2026
506edd6
feat: create MeAjudaAi.Shared project and remove unused Rebus JSON se…
Apr 24, 2026
e2d408a
feat: add provider schedule and booking history endpoints with cached…
Apr 24, 2026
7a4b880
feat: implement booking handlers, endpoints, and backend CI pipeline …
Apr 24, 2026
085b809
chore: add packages.lock.json for Shared project dependencies
Apr 24, 2026
4acb320
fix: Revert Development removal from bypass (keeps tests passing)
Apr 24, 2026
80804fe
fix: Handle empty env vars in IsSecurityBypassEnvironment
Apr 24, 2026
64e8d5e
fix: Apply code review findings
Apr 24, 2026
ffb330a
test: improve code coverage for Bookings API and Shared
Apr 24, 2026
3b9540c
fix: address code review findings for Bookings and Messaging
Apr 24, 2026
b16ac32
test: improve Bookings API and Application coverage
Apr 24, 2026
1ddf743
fix: resolve build errors and stabilize test coverage
Apr 24, 2026
3c6e082
fix: update packages.lock.json files to resolve NU1004 and NU1102 CI …
Apr 24, 2026
3390787
fix: address final code review findings and stabilize messaging
Apr 24, 2026
a1281e1
fix: resolve CS1997 build errors in RabbitMqDeadLetterService
Apr 24, 2026
00c8545
fix: resolve failing E2E test by linking service to provider
Apr 24, 2026
10ea010
fix: finalize coverage improvements and legitimate exclusions
Apr 24, 2026
2f2844a
fix: address final code review findings and stabilize messaging system
Apr 24, 2026
eb91710
fix: recover test coverage and ensure build stability
Apr 24, 2026
f6e450f
fix: resolve Rebus.ServiceProvider version conflict with .NET 10 exte…
Apr 24, 2026
87d0baa
fix: resolve ArgumentNullException in ProvidersModuleApiTests
Apr 24, 2026
9de497f
fix: address final code review findings and stabilize tests
Apr 24, 2026
47635a8
fix: resolve failing tests in Bookings and Outbox
Apr 24, 2026
13b049d
test: major coverage boost for Shared, ApiService and Bookings
Apr 24, 2026
5a49685
test: module refinement and edge cases coverage boost
Apr 25, 2026
d0fe76c
fix: resolve NullReferenceException in OutboxProcessorBase and stabil…
Apr 25, 2026
ba70b65
feat: implement core infrastructure, messaging services, and unit tes…
Apr 25, 2026
0b27f45
feat: implement MessagingExtensions for Rebus and RabbitMQ configurat…
Apr 25, 2026
c8d8d57
feat: implement CreateBookingCommandHandler to handle booking validat…
Apr 25, 2026
94f4c5f
feat: implement BookingRepository with atomic overlap validation and …
Apr 25, 2026
e2fbe38
feat: implement booking creation handler, add infrastructure DI tests…
Apr 25, 2026
ce5a42b
feat: implement ProvidersModuleApi for cross-module communication and…
Apr 25, 2026
42a4780
feat: implement provider authorization resolver with caching and add …
Apr 25, 2026
ee72551
feat: implement booking domain logic with lifecycle state management …
Apr 25, 2026
5dc3ea1
feat: implement BookingRepository with paged queries and atomic overl…
Apr 25, 2026
1e3358d
feat: implement bookings module infrastructure and domain logic, incl…
Apr 25, 2026
72cef9a
feat: implement bookings module workflow and messaging infrastructure…
Apr 25, 2026
0283228
test: add unit tests for booking command handlers and TimeSlot value …
Apr 25, 2026
3cf7949
feat: implement booking lifecycle management handlers and provider sc…
Apr 25, 2026
42c7936
feat: implement booking management lifecycle endpoints and provider s…
Apr 26, 2026
f00fab7
feat: implement booking lifecycle command handlers and provider autho…
Apr 26, 2026
b0143ee
feat: implement booking flow functionality including endpoints, handl…
Apr 27, 2026
e4eedf3
feat: implement ProviderAuthorizationResolver for centralized booking…
Apr 27, 2026
96d9fe5
feat: implement provider schedule management with authorization logic…
Apr 27, 2026
e89aa9e
feat: add set provider schedule endpoint, validation logic, and CI wo…
Apr 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions docs/roadmap-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,30 @@ Este documento contém o registro de todas as sprints concluídas para fins de a

---

## ✅ Sprint 12 - Bookings & Messaging Excellence (Concluída em 21 Abr 2026)
Comment thread
frigini marked this conversation as resolved.
Outdated

**Objetivo**: Implementar o sistema de agendamentos e consolidar a infraestrutura de mensageria com Rebus.

### Entregas:
- ✅ **Bookings Module**: Implementação completa (Backend/Frontend) de agendamentos com gestão de disponibilidade do prestador e fluxo de reserva do cliente.
- ✅ **Messaging Excellence**: Migração final para Rebus v3 e implementação de atributos `[DedicatedTopic]`, `[HighVolumeEvent]` e `[CriticalEvent]` para roteamento avançado.
- ✅ **Qualidade**: Cobertura total de testes unitários, integração e arquitetura para o novo módulo.
Comment thread
frigini marked this conversation as resolved.
Outdated
- ✅ **API & Contratos**: Padronização de enums (`EBookingStatus`) e exposição via Minimal APIs com autorização.

---
Comment thread
frigini marked this conversation as resolved.
Outdated

## ✅ Sprint 11 - Monetização & Polimento (Concluída em 15 Abr 2026)

**Objetivo**: Habilitar o faturamento da plataforma e finalizar a experiência do usuário.

### Entregas:
- ✅ **Payments Module**: Implementação de assinaturas (Stripe), webhooks, billing portal e renovações automáticas com padrão ACL.
- ✅ **Localização Frontend**: Suporte completo a i18n (PT-BR/EN-US) no Customer App, incluindo formulários e erros.
- ✅ **UX Polish**: Implementação de skeleton loaders animados para melhor percepção de desempenho.
- ✅ **Qualidade**: Cobertura de testes unitários e de integração para todos os fluxos críticos de pagamento e localização.

---

## ✅ Sprint 10 - Qualidade & Onboarding (Concluída em 14 Abr 2026)

**Objetivo**: Estabelecer confiança na plataforma através de avaliações e simplificar o acesso de novos prestadores.
Expand Down
57 changes: 14 additions & 43 deletions docs/roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,40 @@ Este é o planejamento estratégico unificado da plataforma MeAjudaAi.

## 📊 Status Atual (Abril 2026)

**Sprint Atual**: 11 (Monetização & Polimento)
**Status**: ✅ Concluído
**Meta MVP**: 12 - 16 de Maio de 2026
**Sprint Atual**: 13 (Escala & Provedores Reais)

**Stack Principal**: .NET 10 LTS + Aspire 13 + PostgreSQL + NX Monorepo + React 19 + Next.js 15 + Tailwind v4

---

## ✅ Sprint 11 - Monetização & Polimento (13-27 Abr 2026) — Concluída em 15 Abr 2026
**Status**: 🚀 Em Início

**Objetivo**: Habilitar o faturamento da plataforma e finalizar a experiência do usuário.
**Meta MVP**: 12 a 16 de maio de 2026

### 🔴 MUST-HAVE:

#### 1. 💳 Payments Module (Módulo de Pagamentos)
* **Arquitetura**: Padrão de **Anti-Corruption Layer (ACL)**. A lógica de negócio não conhece tipos do Stripe. Abstração via `IPaymentGateway`. ✅
* **Funcionalidades**:
* ✅ **Assinaturas de Prestadores**: Planos Free, Standard e Gold — implementado com `CreateSubscriptionCommandHandler` com padrão gateway-first e compensação em caso de falha.
* ✅ **Stripe Checkout & Webhooks**: Redirecionamento seguro via `CreateSubscriptionEndpoint` e processamento assíncrono via padrão Inbox (`ProcessInboxJob`).
* ✅ **Qualidade & Testes**: Suíte completa de testes unitários e de integração validando fluxos críticos e tratamento de erros.
* ✅ **Handler `invoice.paid`**: Processamento de renovações mensais e registro de `PaymentTransaction` para auditoria.
* ✅ **Billing Portal**: Endpoint para gestão de assinaturas via Stripe Customer Portal.
* **Localização & i18n**:
* ✅ **Frontend (Customer App)**: Localização completa (PT-BR/EN-US) com suporte a pluralização e datas/moedas.
* ✅ **Backend (FluentValidation)**: Integração de mensagens de validação com arquivos de recurso `.resx` (concluído na Sprint 9 e validado nesta).
* **Schema DB**: `payments` | **ModuleName**: `Payments`.

#### 2. 🌍 Localização Frontend (i18n)
* **Arquitetura**: `i18next` + `react-i18next`. PT-BR como padrão, EN-US como alternativa.
* **Escopo Sprint 11**: App **Customer** (`MeAjudaAi.Web.Customer`) — navegação, formulários, erros Zod localizados, seletor de idioma no header. ✅
* **Qualidade**: Testes unitários com mock de i18n passando. ✅

#### 3. 🎨 UX Polish
* ✅ **Skeletons de Carregamento**: Placeholders visuais animados (pulse) integrados nas listas de busca e perfil do prestador. Testes de unidade criados. ✅
**Stack Principal**: .NET 10 LTS + Aspire 13 + PostgreSQL + NX Monorepo + React 19 + Next.js 15 + Tailwind v4

---

## 🔮 Roadmaps Futuros (Pós-MVP)
## 🔮 Roadmaps Futuros (MVP Launch & Além)

### Fase 3: Escala e Provedores Reais
### Fase 3: Escala e Provedores Reais (Próximas Atividades)
* **Provedores de Comunicação**: Substituir Stubs por SendGrid (E-mail), Twilio (SMS) e Firebase (Push).
* **Verificação Automatizada**: OCR via Azure AI Vision e integração com APIs de antecedentes criminais.
* **i18n Apps Provider/Admin**: Localização frontend para os apps de Prestador e Administrador.
* **Documentação Final**: Manuais de Usuário e Guias de Implantação (revisão global).

### Fase 4: Experiência e Engajamento
* **Módulo de Agendamentos (Bookings)**: Calendário de disponibilidade.
* **Sistema de Disputas**: Mediação administrativa para conflitos.
* **Melhorias em Bookings**: Sincronização com Google Calendar/Outlook e lembretes automáticos.

### 🚀 Arquitetura Evolutiva e Mensageria (Desejável)
* **Evolução do Service Bus**: Implementar lógica de infraestrutura no `Shared.Messaging` para interpretar atributos de mensageria:
* `[DedicatedTopic]`: Uso de `ITopicNameConvention` no Rebus para desviar eventos críticos/frequentes para filas dedicadas, evitando o "vizinho barulhento".
* `[HighVolumeEvent]`: Otimização de I/O no RabbitMQ (mensagens transientes ou Lazy Queues) e paralelismo massivo via `SetNumberOfWorkers`.
* `[CriticalEvent]`: Garantia de persistência via Quorum Queues e priorização de processamento (`x-max-priority`).
### 🚀 Arquitetura Evolutiva e Mensageria (Objetivos)
* **Performance do Service Bus (Planejado)**: Implementar ajuste fino de paralelismo baseado no atributo `[HighVolumeEvent]` e otimizações no `RabbitMqInfrastructureManager`.
* **Resiliência Crítica (Planejado)**: Garantir persistência via Quorum Queues para eventos marcados com `[CriticalEvent]`.
* **Roteamento por Atributo (Em Andamento)**: Evolução do `AttributeTopicNameConvention` para suporte total a tópicos dedicados.

---

## ✅ Concluído Recentemente

* **Sprint 11**: Monetização completa (Checkout, Webhooks, Billing Portal, Renovação Automática), Localização i18n Frontend, Skeleton Loaders e cobertura de testes abrangente.
* **Sprint 10**: Módulo de Ratings, Moderação de Conteúdo, Login Social Instagram (#141), Alinhamento de Realms Keycloak, Infra CI/CD (OpenAPI gating) e Documentação (coleções Bruno).
* **Sprint 9**: Estabilização global, Módulo de Comunicações (Infra), Resiliência (`CancellationToken`) e Localização Backend (.resx).
* **Sprint 8D/8E**: Migração completa do Admin Portal para React e Testes E2E com Playwright.
* **Sprint 12**: Módulo de Bookings completo (Backend/Frontend), Migração final Rebus v3, Atributos de roteamento avançado e testes de arquitetura. (Abril 2026)
* **Sprint 11**: Monetização completa (Checkout, Webhooks, Billing Portal, Renovação Automática), Localização i18n Frontend, Skeleton Loaders e cobertura de testes abrangente. (Abril 2026)
* **Sprint 10**: Módulo de Ratings, Moderação de Conteúdo, Login Social Instagram (#141), Alinhamento de Realms Keycloak, Infra CI/CD (OpenAPI gating) e Documentação (coleções Bruno). (Abril 2026)

---

Expand Down
12 changes: 5 additions & 7 deletions docs/technical-debt.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ Este documento rastreia **débitos técnicos e seu histórico de otimização**.

- [ ] Perfilagem de memória em produção

### 🚀 Infraestrutura & Messaging

**Severidade**: MÉDIA
**Sprint**: Backlog

- [ ] Avaliar migração para Rebus v3 ou alternativa de Enterprise Service Bus (ESB) assim que a compatibilidade com .NET 10 e `Rebus.ServiceProvider` (v10+) for estabilizada. Atualmente, o sistema utiliza `RabbitMQ.Client` diretamente com middleware de retry customizado.

### 🎨 Melhorias de UI/UX

**Severidade**: BAIXA
Expand All @@ -35,6 +28,11 @@ Este documento rastreia **débitos técnicos e seu histórico de otimização**.

## 📋 Histórico

### 🚀 Infraestrutura & Messaging (Migração Rebus v3)

**Resolvido em**: Abr 2026 (Sprint 12) | **Severidade original**: MÉDIA
Migração para Rebus v3 concluída. Implementação do `RebusMessageBus` como abstração principal (`IMessageBus`) e remoção do uso direto de `RabbitMQ.Client` nos módulos. Introdução de atributos de roteamento avançado (`[DedicatedTopic]`, `[HighVolumeEvent]`, `[CriticalEvent]`) e convenções customizadas.
Comment thread
frigini marked this conversation as resolved.
Outdated

### ⚠️ Hangfire + Npgsql 10.x Compatibility Risk

**Resolvido em**: Abr 2026 (Sprint 11) | **Severidade original**: CRÍTICA
Expand Down
34 changes: 34 additions & 0 deletions src/Aspire/MeAjudaAi.AppHost/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -1153,6 +1153,30 @@
"Npgsql": "10.0.2"
}
},
"OpenTelemetry": {
"type": "Transitive",
"resolved": "1.15.3",
"contentHash": "N0i6WjPoHPbZyms1ugbDIFAJFuGlpeExJMU/+XSL0lQRUkg/D0utFkDoLXf8Z1km5B+xVZ2GyMXXiX8qdeNmPg==",
"dependencies": {
"Microsoft.Extensions.Diagnostics.Abstractions": "10.0.0",
"Microsoft.Extensions.Logging.Configuration": "10.0.0",
"OpenTelemetry.Api.ProviderBuilderExtensions": "1.15.3"
}
},
"OpenTelemetry.Api": {
"type": "Transitive",
"resolved": "1.15.3",
"contentHash": "fX+fkCysfPut+qCcT3bKqyX4QN9Saf4CgX8HLOHywEVD+Xr7sULtfuypITpoDysjx8R59dn/3mWhgimMH8cm/g=="
},
"OpenTelemetry.Api.ProviderBuilderExtensions": {
"type": "Transitive",
"resolved": "1.15.3",
"contentHash": "SYn0lqYDwLMWhv/zlNGsQcl2yX++yTumanX46bmOZE/ZDOd1WjPBO2kZaZgKLEZTZk48pavIFGJ6vOvxXgWVFQ==",
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "10.0.0",
"OpenTelemetry.Api": "1.15.3"
}
},
"Pipelines.Sockets.Unofficial": {
"type": "Transitive",
"resolved": "2.2.8",
Expand Down Expand Up @@ -1446,6 +1470,7 @@
"Microsoft.Extensions.Caching.StackExchangeRedis": "[10.0.6, )",
"Microsoft.FeatureManagement.AspNetCore": "[4.4.0, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "[10.0.1, )",
"OpenTelemetry.Exporter.Console": "[1.15.3, )",
"RabbitMQ.Client": "[7.2.1, )",
"Rebus": "[8.9.2, )",
"Rebus.RabbitMq": "[10.1.1, )",
Expand Down Expand Up @@ -1883,6 +1908,15 @@
"Npgsql.NetTopologySuite": "10.0.2"
}
},
"OpenTelemetry.Exporter.Console": {
"type": "CentralTransitive",
"requested": "[1.15.3, )",
"resolved": "1.15.3",
"contentHash": "QBGOoPwLHDXX+hXeUpspOjsqEn4vMkLw672QN+MzVWFBzjf625DdxLxhzowS1J/dRtW93U34rRbJec+4808fkg==",
"dependencies": {
"OpenTelemetry": "1.15.3"
}
},
"RabbitMQ.Client": {
"type": "CentralTransitive",
"requested": "[7.2.1, )",
Expand Down
1 change: 1 addition & 0 deletions src/Aspire/MeAjudaAi.ServiceDefaults/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@
"Microsoft.Extensions.Caching.StackExchangeRedis": "[10.0.6, )",
"Microsoft.FeatureManagement.AspNetCore": "[4.4.0, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "[10.0.1, )",
"OpenTelemetry.Exporter.Console": "[1.15.3, )",
"RabbitMQ.Client": "[7.2.1, )",
"Rebus": "[8.9.2, )",
"Rebus.RabbitMq": "[10.1.1, )",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
<ProjectReference Include="..\..\Modules\Documents\API\MeAjudaAi.Modules.Documents.API.csproj" />
<ProjectReference Include="..\..\Modules\Locations\API\MeAjudaAi.Modules.Locations.API.csproj" />
<ProjectReference Include="..\..\Modules\Payments\API\MeAjudaAi.Modules.Payments.API.csproj" />
<ProjectReference Include="..\..\Modules\Bookings\API\MeAjudaAi.Modules.Bookings.API.csproj" />
<ProjectReference Include="..\..\Modules\Providers\API\MeAjudaAi.Modules.Providers.API.csproj" />
<ProjectReference Include="..\..\Modules\Ratings\API\MeAjudaAi.Modules.Ratings.API.csproj" />
<ProjectReference Include="..\..\Modules\SearchProviders\API\MeAjudaAi.Modules.SearchProviders.API.csproj" />
Expand Down
5 changes: 4 additions & 1 deletion src/Bootstrapper/MeAjudaAi.ApiService/MigrationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ public static async Task ApplyModuleMigrationsAsync(this IHost app, Cancellation
{ "Documents", 4 },
{ "Providers", 5 },
{ "Communications", 6 },
{ "SearchProviders", 7 }
{ "Ratings", 7 },
{ "Payments", 8 },
{ "Bookings", 9 },
{ "SearchProviders", 10 }
};

dbContextTypes = dbContextTypes.OrderBy(t =>
Expand Down
4 changes: 4 additions & 0 deletions src/Bootstrapper/MeAjudaAi.ApiService/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using MeAjudaAi.Modules.Providers.API;
using MeAjudaAi.Modules.Ratings.API;
using MeAjudaAi.Modules.Payments.API;
using MeAjudaAi.Modules.Bookings.API;
using MeAjudaAi.Modules.SearchProviders.API;
using MeAjudaAi.Modules.ServiceCatalogs.API;
using MeAjudaAi.Modules.Users.API;
Expand Down Expand Up @@ -53,6 +54,7 @@ public static async Task Main(string[] args)
builder.Services.AddCommunicationsModule(builder.Configuration);
builder.Services.AddRatingsModule(builder.Configuration, builder.Environment);
builder.Services.AddPaymentsModule(builder.Configuration, builder.Environment);
builder.Services.AddBookingsModule(builder.Configuration, builder.Environment);

// Shared services por último (GlobalExceptionHandler atua como fallback)
builder.Services.AddSharedServices(builder.Configuration);
Expand Down Expand Up @@ -139,8 +141,10 @@ private static async Task ConfigureMiddlewareAsync(WebApplication app)
app.UseCommunicationsModule();
app.UseRatingsModule();
app.UsePaymentsModule();
app.UseBookingsModule();

// Endpoints de orquestração cross-módulo (ficam no ApiService)
app.MapBookingsEndpoints();
app.MapProviderRegistrationEndpoints();
app.MapCommunicationsEndpoints();
Comment thread
frigini marked this conversation as resolved.
}
Expand Down
28 changes: 28 additions & 0 deletions src/Bootstrapper/MeAjudaAi.ApiService/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,33 @@
"FluentValidation": "[12.1.1, )"
}
},
"meajudaai.modules.bookings.api": {
"type": "Project",
"dependencies": {
"MeAjudaAi.Modules.Bookings.Infrastructure": "[1.0.0, )"
}
},
"meajudaai.modules.bookings.application": {
"type": "Project",
"dependencies": {
"MeAjudaAi.Modules.Bookings.Domain": "[1.0.0, )"
}
},
"meajudaai.modules.bookings.domain": {
"type": "Project",
"dependencies": {
"MeAjudaAi.Shared": "[1.0.0, )"
}
},
"meajudaai.modules.bookings.infrastructure": {
"type": "Project",
"dependencies": {
"MeAjudaAi.Modules.Bookings.Application": "[1.0.0, )",
"MeAjudaAi.Shared": "[1.0.0, )",
"Microsoft.EntityFrameworkCore": "[10.0.6, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "[10.0.1, )"
}
},
"meajudaai.modules.communications.api": {
"type": "Project",
"dependencies": {
Expand Down Expand Up @@ -909,6 +936,7 @@
"Microsoft.Extensions.Caching.StackExchangeRedis": "[10.0.6, )",
"Microsoft.FeatureManagement.AspNetCore": "[4.4.0, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "[10.0.1, )",
"OpenTelemetry.Exporter.Console": "[1.15.3, )",
"RabbitMQ.Client": "[7.2.1, )",
"Rebus": "[8.9.2, )",
"Rebus.RabbitMq": "[10.1.1, )",
Expand Down
10 changes: 10 additions & 0 deletions src/Contracts/Bookings/Enums/EBookingStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace MeAjudaAi.Contracts.Bookings.Enums;

public enum EBookingStatus
{
Pending = 0,
Confirmed = 1,
Cancelled = 2,
Completed = 3,
Rejected = 4
}
24 changes: 24 additions & 0 deletions src/Modules/Bookings/API/Endpoints/BookingsEndpoints.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using MeAjudaAi.Modules.Bookings.API.Endpoints.Public;
using MeAjudaAi.Shared.Endpoints;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing;

namespace MeAjudaAi.Modules.Bookings.API.Endpoints;

public static class BookingsEndpoints
{
public const string Route = "bookings";
public const string Tag = "Bookings";

public static void Map(IEndpointRouteBuilder app)
{
var group = BaseEndpoint.CreateVersionedGroup(app, Route, Tag);

group.MapEndpoint<CreateBookingEndpoint>()
.MapEndpoint<ConfirmBookingEndpoint>()
.MapEndpoint<CancelBookingEndpoint>()
.MapEndpoint<GetProviderAvailabilityEndpoint>()
.MapEndpoint<SetProviderScheduleEndpoint>();
}
}
52 changes: 52 additions & 0 deletions src/Modules/Bookings/API/Endpoints/Public/CancelBookingEndpoint.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using MeAjudaAi.Contracts.Functional;
using MeAjudaAi.Modules.Bookings.Application.Bookings.Commands;
using MeAjudaAi.Shared.Commands;
using MeAjudaAi.Shared.Endpoints;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;

namespace MeAjudaAi.Modules.Bookings.API.Endpoints.Public;

public class CancelBookingEndpoint : IEndpoint
{
public static void Map(IEndpointRouteBuilder app)
{
app.MapPut("/{id}/cancel", async (
Guid id,
CancelBookingRequest request,
[FromServices] ICommandDispatcher dispatcher,
CancellationToken cancellationToken) =>
{
if (string.IsNullOrWhiteSpace(request.Reason))
{
return Results.BadRequest(new { error = "O motivo do cancelamento é obrigatório." });
}
Comment thread
frigini marked this conversation as resolved.

if (request.Reason.Length > 500)
{
return Results.BadRequest(new { error = "O motivo do cancelamento não pode exceder 500 caracteres." });
Comment thread
frigini marked this conversation as resolved.
Outdated
}

var command = new CancelBookingCommand(id, request.Reason, Guid.NewGuid());
var result = await dispatcher.SendAsync<CancelBookingCommand, Result>(command, cancellationToken);
Comment thread
frigini marked this conversation as resolved.

return result.Match(
onSuccess: () => Results.NoContent(),
onFailure: error => Results.Problem(error.Message, statusCode: error.StatusCode)
);
})
.RequireAuthorization()
.Produces(StatusCodes.Status204NoContent)
.ProducesProblem(StatusCodes.Status400BadRequest)
.ProducesProblem(StatusCodes.Status401Unauthorized)
.ProducesProblem(StatusCodes.Status403Forbidden)
.ProducesProblem(StatusCodes.Status404NotFound)
.WithTags(BookingsEndpoints.Tag)
Comment thread
frigini marked this conversation as resolved.
.WithName("CancelBooking")
.WithSummary("Cancela um agendamento.");
}
}

public record CancelBookingRequest(string Reason);
Loading
Loading