Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
60de2bd
refactor: apply code review nitpick improvements
Nov 25, 2025
516a2a0
fix: remove ConfigurableTestAuthenticationHandler race condition
Nov 25, 2025
0e48824
docs: remove obsolete documentation files
Nov 25, 2025
e50f728
feat: add IDocumentsModuleApi for cross-module communication
Nov 25, 2025
e046895
wip: add comprehensive IBGE API stubs to WireMock + refactor IbgeApiI…
Nov 25, 2025
efdd1ef
feat: add IServiceCatalogsModuleApi for cross-module service validation
Nov 25, 2025
6302d16
fix: refactor IbgeApiIntegrationTests to use WireMock + fix stubs
Nov 25, 2025
916e4dd
test: remove Skip from 2 ServiceCatalogs integration tests after AUTH…
Nov 25, 2025
4940bc2
fix: enable IBGE fail-open with fallback to simple validation
Nov 25, 2025
97dc7ac
feat(providers): integrate IDocumentsModuleApi in provider activation
Nov 25, 2025
62e46fa
feat(providers): prepare ISearchModuleApi integration for provider in…
Nov 25, 2025
a6ad166
feat(search): implement IndexProviderAsync and RemoveProviderAsync in…
Nov 25, 2025
c63ad65
test: remove duplicate GeographicRestrictionFeatureFlagTests
Nov 25, 2025
65897e9
docs: update Sprint 1 progress and skipped tests analysis
Nov 25, 2025
8ca60ea
docs: comprehensive Module APIs documentation in architecture.md
Nov 25, 2025
234a20f
docs: Sprint 1 final summary and completion report
Nov 25, 2025
b77eb08
feat(providers): implement full provider data sync for search indexing
Nov 25, 2025
2cf5816
feat(providers): add ProviderServices many-to-many table
Nov 25, 2025
b355776
test(providers): add comprehensive unit tests for ProviderServices
Nov 25, 2025
bff2381
refactor: rename infrastructure/database/modules folders and update S…
Nov 25, 2025
3d8b469
fix: make SearchProviders schema migration conditional for TestContai…
Nov 25, 2025
4aa726a
fix: corrigir schema hardcoded 'search' para 'search_providers' em qu…
Nov 25, 2025
938c55d
fix: atualizar schema 'search' para 'search_providers' em SearchProvi…
Nov 25, 2025
b317f38
feat: implement cross-module event handlers and fix SearchProviders s…
Nov 26, 2025
ca4b2f9
test: skip CreateAndUpdateUser_ShouldMaintainConsistency in CI/CD
Nov 26, 2025
17b6e55
refactor: code review fixes - remove duplicates, fix schemas, regener…
Nov 26, 2025
5dad19a
chore: final code review fixes - documentation, security, domain events
Nov 26, 2025
ac601cb
fix: correct schema naming to meajudaai_* pattern across all modules
Nov 26, 2025
b98c132
refactor: code quality improvements from review feedback
Nov 26, 2025
59e6265
refactor: minor code quality improvements
Nov 26, 2025
025aee0
test: improve test quality with explicit assertions and Theory pattern
Nov 26, 2025
ee4d1b2
refactor: use IReadOnlyList in ModuleServiceValidationResultDto
Nov 26, 2025
3d7b31b
fix: resolve race condition in ConfigurableTestAuthenticationHandler
Nov 26, 2025
78e47cb
fix: consolidate schema naming to meajudaai_* convention across all m…
Nov 26, 2025
dfa7f10
perf: reduce WireMock timeout simulation from 30s to 5s
Nov 26, 2025
5221f44
refactor: implement code review feedback - Result Match pattern, repo…
Nov 26, 2025
51f7e0d
refactor: rename Mock* to LocalDevelopment* services and move to dedi…
Nov 26, 2025
512cd66
fix: allowUnauthenticated should return anonymous principal, not admin
Nov 26, 2025
780cae9
fix: address CodeRabbit review feedback
Nov 26, 2025
9bfff7c
refactor: implement CodeRabbit Round 2 feedback - null guards, XML do…
Nov 26, 2025
0be5389
refactor: apply minor CodeRabbit polish - constants and comments
Nov 26, 2025
c69c404
feat: implement remaining CodeRabbit suggestions - UUID v7, migration…
Nov 27, 2025
93592d7
refactor: implement CodeRabbit final round - schema standardization, …
Nov 27, 2025
e0b4db3
refactor: complete CodeRabbit final polish - ProductVersion stable, h…
Nov 27, 2025
63a4a2d
fix: resolve E2E test failures - authentication and category deactiva…
Nov 27, 2025
274b378
refactor: apply CodeRabbit feedback - schema naming, async cleanup, t…
Nov 27, 2025
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
Prev Previous commit
Next Next commit
refactor: code quality improvements from review feedback
Changes:
- Removed redundant unique index on composite primary key in ProviderServiceConfiguration
  (primary key already enforces uniqueness on ProviderId + ServiceId)
- Removed redundant await Task.CompletedTask in DocumentVerifiedIntegrationEventHandler
- Fixed parameter naming convention: SearchProvidersModuleApi -> searchProvidersModuleApi
  (PascalCase to camelCase for consistency)
- Added XML documentation to public API methods:
  - ProvidersModuleApi.GetProviderForIndexingAsync
  - ServiceCatalogsModuleApi.ValidateServicesAsync
- Fixed markdown formatting in documentation:
  - Converted bold emphasis to proper headings in architecture.md
  - Fixed conjunction formatting in skipped-tests-analysis.md

All changes improve code quality, maintainability, and consistency.

Refs: Code review feedback on code quality and documentation
  • Loading branch information
Filipe Frigini committed Nov 26, 2025
commit b98c132c07da4a4436dfef53bcdf24e9c4fb40c4
9 changes: 6 additions & 3 deletions docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,8 @@ public interface IDocumentsModuleApi : IModuleApi
}
```

**2. Implementar em Module/Application/ModuleApi**
##### 2. Implementar em Module/Application/ModuleApi

```csharp
[ModuleApi("Documents", "1.0")]
public sealed class DocumentsModuleApi(IQueryDispatcher queryDispatcher) : IDocumentsModuleApi
Expand All @@ -1260,12 +1261,14 @@ public sealed class DocumentsModuleApi(IQueryDispatcher queryDispatcher) : IDocu
}
```

**3. Registrar em DI (Module/Application/Extensions.cs)**
##### 3. Registrar em DI (Module/Application/Extensions.cs)

```csharp
services.AddScoped<IDocumentsModuleApi, DocumentsModuleApi>();
```

**4. Injetar e Usar em Outro Módulo**
##### 4. Injetar e Usar em Outro Módulo

```csharp
public sealed class ActivateProviderCommandHandler(
IDocumentsModuleApi documentsApi) // ✅ Cross-module dependency
Expand Down
2 changes: 1 addition & 1 deletion docs/skipped-tests-analysis.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ mas conceitualmente deveria ser internal.
**Impacto**: Violação de Onion Architecture (Infrastructure vazando para fora do módulo).

**Mitigação Atual**:
- DbContext está `public` mas **não** exposto via DI para outros módulos
- DbContext está `public`, mas não é exposto via DI para outros módulos
- Documentação clara que DbContext **não** deve ser usado externamente
- Migrations controladas via CLI tools, não via código

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ public async Task<Result<IReadOnlyList<ModuleProviderBasicDto>>> GetProvidersByV
);
}

/// <summary>
/// Gets provider data prepared for search indexing, including coordinates obtained via geocoding.
/// </summary>
/// <param name="providerId">The unique identifier of the provider to index.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Provider indexing DTO with geocoded location, or null if provider not found, or failure if geocoding fails.</returns>
public async Task<Result<ModuleProviderIndexingDto?>> GetProviderForIndexingAsync(
Guid providerId,
CancellationToken cancellationToken = default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ public async Task HandleAsync(DocumentVerifiedIntegrationEvent integrationEvent,
integrationEvent.DocumentType,
integrationEvent.ProviderId,
provider.Status);

// Não precisa salvar mudanças pois não estamos modificando o provider aqui
await Task.CompletedTask;
}
catch (Exception ex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace MeAjudaAi.Modules.Providers.Infrastructure.Events.Handlers;
public sealed class ProviderVerificationStatusUpdatedDomainEventHandler(
IMessageBus messageBus,
ProvidersDbContext context,
ISearchProvidersModuleApi SearchProvidersModuleApi,
ISearchProvidersModuleApi searchProvidersModuleApi,
ILogger<ProviderVerificationStatusUpdatedDomainEventHandler> logger) : IEventHandler<ProviderVerificationStatusUpdatedDomainEvent>
{
/// <summary>
Expand All @@ -45,7 +45,7 @@ public async Task HandleAsync(ProviderVerificationStatusUpdatedDomainEvent domai
{
logger.LogInformation("Provider {ProviderId} verified, indexing in SearchProviders module", domainEvent.AggregateId);

var indexResult = await SearchProvidersModuleApi.IndexProviderAsync(provider.Id.Value, cancellationToken);
var indexResult = await searchProvidersModuleApi.IndexProviderAsync(provider.Id.Value, cancellationToken);
if (indexResult.IsFailure)
{
logger.LogError("Failed to index provider {ProviderId} in search: {Error}",
Expand All @@ -62,7 +62,7 @@ public async Task HandleAsync(ProviderVerificationStatusUpdatedDomainEvent domai
logger.LogInformation("Provider {ProviderId} status changed to {Status}, removing from search index",
domainEvent.AggregateId, domainEvent.NewStatus);

var removeResult = await SearchProvidersModuleApi.RemoveProviderAsync(provider.Id.Value, cancellationToken);
var removeResult = await searchProvidersModuleApi.RemoveProviderAsync(provider.Id.Value, cancellationToken);
if (removeResult.IsFailure)
{
logger.LogError("Failed to remove provider {ProviderId} from search: {Error}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,5 @@ public void Configure(EntityTypeBuilder<ProviderService> builder)
// Índice para busca eficiente por ServiceId
builder.HasIndex(ps => ps.ServiceId)
.HasDatabaseName("ix_provider_services_service_id");

// Índice composto para queries comuns
builder.HasIndex(ps => new { ps.ProviderId, ps.ServiceId })
.IsUnique()
.HasDatabaseName("ix_provider_services_provider_service");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,12 @@ public async Task<Result<bool>> IsServiceActiveAsync(
}
}

/// <summary>
/// Validates that the specified service IDs exist in the catalog.
/// </summary>
/// <param name="serviceIds">Collection of service IDs to validate.</param>
/// <param name="cancellationToken">Cancellation token.</param>
/// <returns>Validation result indicating which services are valid.</returns>
public async Task<Result<ModuleServiceValidationResultDto>> ValidateServicesAsync(
IReadOnlyCollection<Guid> serviceIds,
CancellationToken cancellationToken = default)
Expand Down