Conversation
|
Warning Rate limit exceeded@frigini has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 10 minutes and 36 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughAdds provider lifecycle states and workflows: new EProviderStatus, status/reason fields, domain transitions (complete, require-correction, activate, reactivate, suspend, reject), CQRS commands/handlers/validators, domain→integration event handlers/mappers, DTO and mapper updates, EF mappings + migrations, an admin endpoint, tests, and documentation. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant Admin
participant Endpoint as API Endpoint
participant CmdDisp as Command Dispatcher
participant CmdHandler as Command Handler
participant Repo as ProviderRepository
participant Domain as ProviderAggregate
participant DB as Persistence
participant MessageBus
participant EventHandler
Admin->>Endpoint: POST /{id}/require-basic-info-correction (reason, requestedBy)
Endpoint->>CmdDisp: Dispatch RequireBasicInfoCorrectionCommand
CmdDisp->>CmdHandler: Handle(command)
CmdHandler->>Repo: GetById(providerId)
Repo-->>CmdHandler: provider
CmdHandler->>Domain: RequireBasicInfoCorrection(reason, requestedBy)
activate Domain
Domain->>Domain: ValidateStatusTransition()
Domain->>Domain: Status = PendingBasicInfo
Domain->>Domain: Emit ProviderBasicInfoCorrectionRequiredDomainEvent
deactivate Domain
CmdHandler->>Repo: UpdateAsync(provider)
Repo-->>CmdHandler: saved
CmdHandler-->>Endpoint: Result.Success
Note over Repo,MessageBus: Domain events are published
Repo->>MessageBus: PublishAsync(domainEvent)
MessageBus->>EventHandler: HandleAsync(domainEvent)
EventHandler->>MessageBus: PublishAsync(IntegrationEvent)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Areas to focus on:
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 6
♻️ Duplicate comments (1)
src/Modules/Providers/Application/Handlers/Commands/ActivateProviderCommandHandler.cs (1)
50-54: Avoid exposing exception details in Result.Failure.Same issue as in
CompleteBasicInfoCommandHandler.cs: returningex.Messagecan leak sensitive implementation details to API consumers.Apply the same fix:
catch (Exception ex) { logger.LogError(ex, "Error activating provider {ProviderId}", command.ProviderId); - return Result.Failure(ex.Message); + return Result.Failure("An error occurred while activating provider"); }
🧹 Nitpick comments (4)
PLAN.md (1)
299-307: Optional: Consider varying task introductions.The roadmap section uses repetitive "Task:" prefixes which slightly reduces readability. This is a minor stylistic point.
Example variation:
### Phase 1: Foundational Provider & Search (MVP Core) -1. **Task**: Enhance `Providers` module for multi-step registration. -2. **Task**: Build `Media, Storage & Documents` module for basic document upload. -3. **Task**: Build `Location Management` module for CEP lookup. -4. **Task**: Build `Search & Discovery` module with basic radius search (PostGIS initially, can migrate to Elasticsearch later). -5. **Task**: Build `Service Catalog` module. +1. **Enhance** `Providers` module for multi-step registration. +2. **Build** `Media, Storage & Documents` module for basic document upload. +3. **Implement** `Location Management` module for CEP lookup. +4. **Create** `Search & Discovery` module with basic radius search (PostGIS initially, can migrate to Elasticsearch later). +5. **Develop** `Service Catalog` module.Based on static analysis hints.
src/Modules/Providers/Application/Handlers/Commands/RejectProviderCommandHandler.cs (1)
51-55: Consider sanitizing exception messages.Returning
ex.Messagedirectly could expose internal implementation details, database schema information, or sensitive system information to clients.Consider returning a generic error message to clients:
catch (Exception ex) { logger.LogError(ex, "Error rejecting provider {ProviderId}", command.ProviderId); - return Result.Failure(ex.Message); + return Result.Failure("An error occurred while rejecting the provider"); }Note: This pattern is consistent with other command handlers in the codebase. If you decide to apply this change, consider updating all command handlers uniformly.
src/Modules/Providers/Infrastructure/Events/Mappers/ProviderEventMappers.cs (1)
77-105: Consider injecting time provider for testability.The mappers use
DateTime.UtcNowdirectly for timestamp fields (lines 88, 103), which makes unit testing non-deterministic. While this is consistent with existing mappers in the file (lines 25, 40), consider injecting a time provider (e.g.,TimeProviderin .NET 8+) to improve testability.This would allow deterministic testing:
public static class ProviderEventMappers { // Add time provider parameter or use a static factory private static TimeProvider TimeProvider { get; set; } = TimeProvider.System; public static ProviderAwaitingVerificationIntegrationEvent ToIntegrationEvent( this ProviderAwaitingVerificationDomainEvent domainEvent) { return new ProviderAwaitingVerificationIntegrationEvent( Source: ModuleName, ProviderId: domainEvent.AggregateId, UserId: domainEvent.UserId, Name: domainEvent.Name, UpdatedBy: domainEvent.UpdatedBy, TransitionedAt: TimeProvider.GetUtcNow().DateTime ); } }Note: This would require updating all existing mappers for consistency.
WARP.md (1)
1-548: Excellent documentation addition!This comprehensive guide will significantly help developers understand the project architecture, development workflows, and best practices. The structure is well-organized and covers all essential aspects.
If desired, you can address the minor linting issues flagged by static analysis tools (unordered list indentation, terminology consistency), but these are cosmetic and don't affect the documentation's value.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (28)
PLAN.md(1 hunks)WARP.md(1 hunks)src/Modules/Providers/Application/Commands/ActivateProviderCommand.cs(1 hunks)src/Modules/Providers/Application/Commands/CompleteBasicInfoCommand.cs(1 hunks)src/Modules/Providers/Application/Commands/RejectProviderCommand.cs(1 hunks)src/Modules/Providers/Application/Commands/SuspendProviderCommand.cs(1 hunks)src/Modules/Providers/Application/DTOs/ProviderDto.cs(1 hunks)src/Modules/Providers/Application/Handlers/Commands/ActivateProviderCommandHandler.cs(1 hunks)src/Modules/Providers/Application/Handlers/Commands/CompleteBasicInfoCommandHandler.cs(1 hunks)src/Modules/Providers/Application/Handlers/Commands/RejectProviderCommandHandler.cs(1 hunks)src/Modules/Providers/Application/Handlers/Commands/SuspendProviderCommandHandler.cs(1 hunks)src/Modules/Providers/Application/Mappers/ProviderMapper.cs(1 hunks)src/Modules/Providers/Domain/Entities/Provider.cs(4 hunks)src/Modules/Providers/Domain/Enums/EProviderStatus.cs(1 hunks)src/Modules/Providers/Domain/Events/ProviderActivatedDomainEvent.cs(1 hunks)src/Modules/Providers/Domain/Events/ProviderAwaitingVerificationDomainEvent.cs(1 hunks)src/Modules/Providers/Infrastructure/Events/Handlers/ProviderActivatedDomainEventHandler.cs(1 hunks)src/Modules/Providers/Infrastructure/Events/Handlers/ProviderAwaitingVerificationDomainEventHandler.cs(1 hunks)src/Modules/Providers/Infrastructure/Events/Mappers/ProviderEventMappers.cs(1 hunks)src/Modules/Providers/Infrastructure/Persistence/Configurations/ProviderConfiguration.cs(2 hunks)src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112144744_AddProviderStatusColumn.Designer.cs(1 hunks)src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112144744_AddProviderStatusColumn.cs(1 hunks)src/Modules/Providers/Infrastructure/Persistence/Migrations/ProvidersDbContextModelSnapshot.cs(2 hunks)src/Modules/Providers/Infrastructure/appsettings.json(1 hunks)src/Modules/Providers/Tests/Unit/Application/Services/ProvidersModuleApiTests.cs(1 hunks)src/Modules/Providers/Tests/Unit/Domain/Entities/ProviderTests.cs(1 hunks)src/Shared/Messaging/Messages/Providers/ProviderActivatedIntegrationEvent.cs(1 hunks)src/Shared/Messaging/Messages/Providers/ProviderAwaitingVerificationIntegrationEvent.cs(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (16)
src/Modules/Providers/Infrastructure/Events/Mappers/ProviderEventMappers.cs (1)
src/Modules/Providers/Tests/Infrastructure/TestInfrastructureExtensions.cs (1)
DateTime(76-76)
src/Modules/Providers/Domain/Enums/EProviderStatus.cs (1)
src/Shared/Constants/ApiEndpoints.cs (1)
Providers(35-51)
src/Modules/Providers/Application/Commands/RejectProviderCommand.cs (1)
src/Shared/Constants/ApiEndpoints.cs (1)
Providers(35-51)
src/Modules/Providers/Application/Handlers/Commands/RejectProviderCommandHandler.cs (4)
src/Modules/Providers/Application/Handlers/Commands/ActivateProviderCommandHandler.cs (1)
Task(30-55)src/Modules/Providers/Application/Handlers/Commands/CompleteBasicInfoCommandHandler.cs (1)
Task(30-55)src/Modules/Providers/Application/Handlers/Commands/SuspendProviderCommandHandler.cs (1)
Task(30-56)src/Modules/Providers/Domain/Entities/Provider.cs (1)
Reject(455-465)
src/Modules/Providers/Application/Handlers/Commands/ActivateProviderCommandHandler.cs (4)
src/Modules/Providers/Application/Handlers/Commands/CompleteBasicInfoCommandHandler.cs (1)
Task(30-55)src/Modules/Providers/Application/Handlers/Commands/RejectProviderCommandHandler.cs (1)
Task(30-56)src/Modules/Providers/Application/Handlers/Commands/SuspendProviderCommandHandler.cs (1)
Task(30-56)src/Modules/Providers/Domain/Entities/Provider.cs (1)
Activate(426-433)
src/Modules/Providers/Application/Handlers/Commands/SuspendProviderCommandHandler.cs (4)
src/Modules/Providers/Application/Handlers/Commands/ActivateProviderCommandHandler.cs (1)
Task(30-55)src/Modules/Providers/Application/Handlers/Commands/CompleteBasicInfoCommandHandler.cs (1)
Task(30-55)src/Modules/Providers/Application/Handlers/Commands/RejectProviderCommandHandler.cs (1)
Task(30-56)src/Modules/Providers/Domain/Entities/Provider.cs (1)
Suspend(439-449)
src/Modules/Providers/Application/Handlers/Commands/CompleteBasicInfoCommandHandler.cs (4)
src/Modules/Providers/Application/Handlers/Commands/ActivateProviderCommandHandler.cs (1)
Task(30-55)src/Modules/Providers/Application/Handlers/Commands/RejectProviderCommandHandler.cs (1)
Task(30-56)src/Modules/Providers/Application/Handlers/Commands/SuspendProviderCommandHandler.cs (1)
Task(30-56)src/Modules/Providers/Domain/Entities/Provider.cs (1)
CompleteBasicInfo(414-420)
src/Modules/Providers/Infrastructure/Events/Handlers/ProviderActivatedDomainEventHandler.cs (1)
src/Modules/Providers/Infrastructure/Events/Handlers/ProviderAwaitingVerificationDomainEventHandler.cs (1)
Task(27-45)
src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112144744_AddProviderStatusColumn.cs (1)
src/Shared/Constants/ApiEndpoints.cs (1)
Providers(35-51)
src/Shared/Messaging/Messages/Providers/ProviderActivatedIntegrationEvent.cs (1)
src/Modules/Providers/Infrastructure/Events/Mappers/ProviderEventMappers.cs (1)
ProviderActivatedIntegrationEvent(95-105)
src/Shared/Messaging/Messages/Providers/ProviderAwaitingVerificationIntegrationEvent.cs (2)
src/Modules/Providers/Infrastructure/Events/Mappers/ProviderEventMappers.cs (1)
ProviderAwaitingVerificationIntegrationEvent(80-90)src/Shared/Messaging/Messages/Providers/ProviderVerificationStatusUpdatedIntegrationEvent.cs (1)
ProviderVerificationStatusUpdatedIntegrationEvent(16-25)
src/Modules/Providers/Domain/Entities/Provider.cs (2)
src/Modules/Providers/Domain/Exceptions/ProviderDomainException.cs (3)
ProviderDomainException(12-30)ProviderDomainException(18-20)ProviderDomainException(27-29)src/Shared/Domain/BaseEntity.cs (2)
MarkAsUpdated(17-17)AddDomainEvent(15-15)
src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112144744_AddProviderStatusColumn.Designer.cs (2)
src/Modules/Providers/Infrastructure/Persistence/Migrations/ProvidersDbContextModelSnapshot.cs (1)
DbContext(13-327)src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112144744_AddProviderStatusColumn.cs (1)
AddProviderStatusColumn(8-42)
src/Modules/Providers/Application/Commands/SuspendProviderCommand.cs (1)
src/Shared/Constants/ApiEndpoints.cs (1)
Providers(35-51)
src/Modules/Providers/Infrastructure/Events/Handlers/ProviderAwaitingVerificationDomainEventHandler.cs (1)
src/Modules/Providers/Infrastructure/Events/Handlers/ProviderActivatedDomainEventHandler.cs (1)
Task(27-45)
src/Modules/Providers/Tests/Unit/Domain/Entities/ProviderTests.cs (1)
src/Modules/Providers/Domain/Entities/Provider.cs (6)
CompleteBasicInfo(414-420)Activate(426-433)Suspend(439-449)Reject(455-465)UpdateStatus(377-408)Delete(502-516)
🪛 LanguageTool
WARP.md
[uncategorized] ~237-~237: The official name of this software platform is spelled with a capital “H”.
Context: ...; 3. **Update CI/CD workflow** (`.github/workflows/pr-validation.yml`): ya...
(GITHUB)
[style] ~248-~248: This phrase is redundant (‘I’ stands for ‘interface’). Use simply “API”.
Context: ...ure/database/schemas/ 5. **Add Module API interface** inShared/Contracts/Modules/{ModuleN...
(ACRONYM_TAUTOLOGY)
PLAN.md
[style] ~299-~299: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...anagementmodule for CEP lookup. 4. **Task**: BuildSearch & Discovery` module wi...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~300-~300: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... migrate to Elasticsearch later). 5. Task: Build Service Catalog module. ###...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~306-~306: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...module with Stripe integration. 4. **Task**: Integrate subscription tier intoSe...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~307-~307: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...nto Search & Discovery ranking. 5. Task: Implement document verification logi...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~313-~313: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...` module for email notifications. 4. Task: (Future) Consider an internal chat f...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
[style] ~344-~344: This is not the usual sequence for adjectives that have no special emphasis.
Context: ...hese reports. - Implementation: A new small module or an extension of the Reviews...
(EN_ADJ_ORDER)
[style] ~368-~368: Consider replacing ‘giving’ with a different word to let your writing stand out.
Context: ...by enabling platform administration and giving users a space to manage their information, la...
(GIVE_TIME_STYLE)
🪛 markdownlint-cli2 (0.18.1)
WARP.md
80-80: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
324-324: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
325-325: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
326-326: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
327-327: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
333-333: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
334-334: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
335-335: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
341-341: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
342-342: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
343-343: Unordered list indentation
Expected: 2; Actual: 4
(MD007, ul-indent)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Code Quality Checks
- GitHub Check: Security Scan
🔇 Additional comments (15)
src/Modules/Providers/Tests/Unit/Application/Services/ProvidersModuleApiTests.cs (1)
233-233: LGTM! Test data updated correctly.The test helper now includes the
Statusproperty initialized toPendingBasicInfo, which correctly aligns with the new provider lifecycle state machine introduced in this PR.src/Modules/Providers/Infrastructure/Persistence/Migrations/ProvidersDbContextModelSnapshot.cs (1)
50-54: LGTM! Good addition of status column with appropriate indexing.The migration correctly adds the
Statusproperty as a required string with a maximum length of 30 characters, which is appropriate for storing enum values. The inclusion of an index on the status column is a good practice that will optimize queries filtering by provider status.Also applies to: 84-85
src/Modules/Providers/Application/Mappers/ProviderMapper.cs (1)
23-23: LGTM! Status mapping correctly integrated.The
provider.Statusmapping is correctly positioned in the DTO construction, maintaining consistency with the updatedProviderDtosignature. The absence of reverse mapping (ToDomain) for Status is appropriate, as provider status should be managed through domain methods rather than reconstructed from DTOs.src/Modules/Providers/Application/DTOs/ProviderDto.cs (1)
14-14: Status property is correctly integrated in ProviderMapper.The
Statusproperty has been properly included in theProviderMapper.ToDto()method at line 21, positioned correctly in the constructor call. All production code paths that createProviderDtoinstances use this mapper, so the new property is consistently available across all consumers. No additional updates are needed.src/Modules/Providers/Application/Commands/RejectProviderCommand.cs (1)
12-16: The original review comment is incorrect and should be disregarded.The optional
Reasonparameter inRejectProviderCommandis intentional and consistent with the codebase architecture. TheSuspendProviderCommanduses the identical pattern, with optionalReasonthat is logged but not enforced. Domain entities accept only the actor identifier (RejectedBy/SuspendedBy), not the reason. No validators enforce the reason as mandatory, and other administrative commands follow the same optional audit field pattern (e.g.,UpdatedBy,DeletedBy). The reason is captured for logging/audit purposes, not strict enforcement, which is the established design in this codebase.Likely an incorrect or invalid review comment.
src/Modules/Providers/Domain/Events/ProviderActivatedDomainEvent.cs (1)
1-25: LGTM!The domain event is well-structured with comprehensive XML documentation. The properties appropriately capture the provider activation context, and the record inherits correctly from
DomainEvent.src/Modules/Providers/Application/Commands/CompleteBasicInfoCommand.cs (1)
1-15: LGTM!The command structure is clean, well-documented, and consistent with other commands in the module like
ActivateProviderCommandandSuspendProviderCommand.src/Modules/Providers/Infrastructure/Persistence/Configurations/ProviderConfiguration.cs (1)
37-43: LGTM!The
Statusproperty configuration follows the established pattern for enum mappings (consistent withTypeandVerificationStatus). The index naming follows the convention used for other indexes in the configuration.Also applies to: 218-219
src/Modules/Providers/Application/Commands/ActivateProviderCommand.cs (1)
1-14: LGTM!The command is well-documented and follows the same pattern as other lifecycle commands in the module.
src/Modules/Providers/Tests/Unit/Domain/Entities/ProviderTests.cs (1)
401-610: LGTM! Excellent test coverage.The status transition tests are comprehensive and well-structured:
- Initialization: Validates default
PendingBasicInfostatus- Valid transitions: Covers all happy path transitions with domain event verification
- Invalid transitions: Ensures exceptions are thrown for disallowed transitions
- Edge cases: Tests idempotency (already suspended) and constraints (deleted provider)
- Data-driven tests: Theory test at lines 554-608 systematically validates multiple transition rules
The tests follow the AAA pattern consistently and have descriptive names. This provides strong protection against regressions in the status lifecycle.
src/Modules/Providers/Domain/Enums/EProviderStatus.cs (1)
1-47: Verify whether Status filtering endpoints are needed based on your business requirements.The enum is well-structured with clear documentation. However, the suggestion to consider a
GetByStatusendpoint is valid: the Status field is now indexed in the database and represents a distinct workflow from VerificationStatus, yet no corresponding query method exists in the repository.Check whether any clients or internal services need to query providers by their registration status (PendingBasicInfo, PendingDocumentVerification, Active, Suspended, or Rejected). If filtering by Status is a required feature, you'll need to add:
- A
GetByStatusAsyncmethod toIProviderRepository- A corresponding query handler and API endpoint
- Update
ApiEndpoints.csto include the new endpointsrc/Shared/Messaging/Messages/Providers/ProviderActivatedIntegrationEvent.cs (1)
17-24: LGTM!The integration event is well-structured and follows the established pattern. The documentation clearly explains its purpose and the optional parameters are appropriate for this use case.
src/Shared/Messaging/Messages/Providers/ProviderAwaitingVerificationIntegrationEvent.cs (1)
17-24: LGTM!The integration event follows the established pattern and is well-documented. The structure is consistent with
ProviderActivatedIntegrationEventand other integration events in the codebase.src/Modules/Providers/Domain/Events/ProviderAwaitingVerificationDomainEvent.cs (1)
19-25: LGTM!The domain event is properly structured with appropriate documentation. It follows DDD best practices and carries the necessary context for the state transition.
src/Modules/Providers/Infrastructure/Events/Handlers/ProviderActivatedDomainEventHandler.cs (1)
27-45: LGTM!The event handler is well-implemented with proper error handling. The catch-and-rethrow pattern is appropriate here as it logs the error before propagating it to the domain event dispatcher. The use of the mapper extension method keeps the code clean and maintainable.
src/Modules/Providers/Application/Handlers/Commands/CompleteBasicInfoCommandHandler.cs
Show resolved
Hide resolved
src/Modules/Providers/Application/Handlers/Commands/RejectProviderCommandHandler.cs
Show resolved
Hide resolved
...es/Providers/Infrastructure/Persistence/Migrations/20251112144744_AddProviderStatusColumn.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (20)
src/Modules/Providers/Application/Commands/RejectProviderCommand.cs(1 hunks)src/Modules/Providers/Application/Commands/SuspendProviderCommand.cs(1 hunks)src/Modules/Providers/Application/DTOs/ProviderDto.cs(1 hunks)src/Modules/Providers/Application/Handlers/Commands/ActivateProviderCommandHandler.cs(1 hunks)src/Modules/Providers/Application/Handlers/Commands/CompleteBasicInfoCommandHandler.cs(1 hunks)src/Modules/Providers/Application/Handlers/Commands/RejectProviderCommandHandler.cs(1 hunks)src/Modules/Providers/Application/Handlers/Commands/SuspendProviderCommandHandler.cs(1 hunks)src/Modules/Providers/Application/Mappers/ProviderMapper.cs(1 hunks)src/Modules/Providers/Application/Validators/RejectProviderCommandValidator.cs(1 hunks)src/Modules/Providers/Application/Validators/SuspendProviderCommandValidator.cs(1 hunks)src/Modules/Providers/Domain/Entities/Provider.cs(5 hunks)src/Modules/Providers/Infrastructure/CONFIGURATION.md(1 hunks)src/Modules/Providers/Infrastructure/Persistence/Configurations/ProviderConfiguration.cs(3 hunks)src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112144744_AddProviderStatusColumn.cs(1 hunks)src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112181927_AddSuspensionAndRejectionReasonColumns.Designer.cs(1 hunks)src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112181927_AddSuspensionAndRejectionReasonColumns.cs(1 hunks)src/Modules/Providers/Infrastructure/Persistence/Migrations/ProvidersDbContextModelSnapshot.cs(2 hunks)src/Modules/Providers/Infrastructure/appsettings.json(1 hunks)src/Modules/Providers/Tests/Unit/Application/Services/ProvidersModuleApiTests.cs(2 hunks)src/Modules/Providers/Tests/Unit/Domain/Entities/ProviderTests.cs(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- src/Modules/Providers/Infrastructure/CONFIGURATION.md
🚧 Files skipped from review as they are similar to previous changes (6)
- src/Modules/Providers/Infrastructure/Persistence/Configurations/ProviderConfiguration.cs
- src/Modules/Providers/Tests/Unit/Domain/Entities/ProviderTests.cs
- src/Modules/Providers/Application/Handlers/Commands/ActivateProviderCommandHandler.cs
- src/Modules/Providers/Infrastructure/appsettings.json
- src/Modules/Providers/Application/DTOs/ProviderDto.cs
- src/Modules/Providers/Infrastructure/Persistence/Migrations/ProvidersDbContextModelSnapshot.cs
🧰 Additional context used
🧬 Code graph analysis (10)
src/Modules/Providers/Application/Handlers/Commands/RejectProviderCommandHandler.cs (3)
src/Modules/Providers/Application/Handlers/Commands/ActivateProviderCommandHandler.cs (1)
Task(30-55)src/Modules/Providers/Application/Handlers/Commands/SuspendProviderCommandHandler.cs (1)
Task(30-68)src/Modules/Providers/Domain/Entities/Provider.cs (1)
Reject(471-485)
src/Modules/Providers/Application/Validators/RejectProviderCommandValidator.cs (1)
src/Shared/Constants/ApiEndpoints.cs (1)
Providers(35-51)
src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112181927_AddSuspensionAndRejectionReasonColumns.cs (1)
src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112144744_AddProviderStatusColumn.cs (2)
Up(11-40)Down(43-54)
src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112144744_AddProviderStatusColumn.cs (1)
src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112181927_AddSuspensionAndRejectionReasonColumns.cs (2)
Up(11-28)Down(31-42)
src/Modules/Providers/Application/Handlers/Commands/CompleteBasicInfoCommandHandler.cs (2)
src/Modules/Providers/Application/Handlers/Commands/ActivateProviderCommandHandler.cs (1)
Task(30-55)src/Modules/Providers/Domain/Entities/Provider.cs (1)
CompleteBasicInfo(424-430)
src/Modules/Providers/Application/Commands/SuspendProviderCommand.cs (1)
src/Shared/Constants/ApiEndpoints.cs (1)
Providers(35-51)
src/Modules/Providers/Domain/Entities/Provider.cs (2)
src/Modules/Providers/Domain/Exceptions/ProviderDomainException.cs (3)
ProviderDomainException(12-30)ProviderDomainException(18-20)ProviderDomainException(27-29)src/Shared/Domain/BaseEntity.cs (2)
MarkAsUpdated(17-17)AddDomainEvent(15-15)
src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112181927_AddSuspensionAndRejectionReasonColumns.Designer.cs (3)
src/Modules/Providers/Infrastructure/Persistence/Migrations/ProvidersDbContextModelSnapshot.cs (1)
DbContext(13-337)src/Modules/Providers/Infrastructure/Persistence/Migrations/20251112181927_AddSuspensionAndRejectionReasonColumns.cs (1)
AddSuspensionAndRejectionReasonColumns(8-43)src/Modules/Providers/Infrastructure/Persistence/Migrations/20251031190904_InitialCreate.Designer.cs (1)
MeAjudaAi(12-307)
src/Modules/Providers/Application/Commands/RejectProviderCommand.cs (1)
src/Shared/Constants/ApiEndpoints.cs (1)
Providers(35-51)
src/Modules/Providers/Application/Handlers/Commands/SuspendProviderCommandHandler.cs (2)
src/Modules/Providers/Application/Handlers/Commands/RejectProviderCommandHandler.cs (1)
Task(30-68)src/Modules/Providers/Domain/Entities/Provider.cs (1)
Suspend(450-464)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Code Quality Checks
- GitHub Check: Security Scan
🔇 Additional comments (1)
src/Modules/Providers/Application/Handlers/Commands/RejectProviderCommandHandler.cs (1)
56-57: Reason now reaches the aggregateGood to see
command.Reasonflowing intoprovider.Reject, ensuring the audit detail lands on the entity and persists.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/Modules/Providers/Domain/Entities/Provider.cs (2)
433-444: LGTM: Activate correctly transitions and updates verification status.The method properly guards the precondition, transitions to
Active, and synchronizesVerificationStatus. The logic is sound.Minor note: Both
UpdateStatusandUpdateVerificationStatuscallMarkAsUpdated(), settingUpdatedAttwice. Not a functional issue, but a small inefficiency. The same pattern appears inSuspend(line 463-464) andReject(line 484-485).
514-537: LGTM: Status transition validation is well-structured.The state machine is clearly defined and validates allowed transitions. The logic correctly handles same-status "transitions" and throws for invalid transitions.
Minor observation: The transition from
PendingDocumentVerificationback toPendingBasicInfo(line 526) is defined but no method in this entity uses it. If this is for future use, consider adding a TODO comment; otherwise, consider removing it to keep the transition table minimal.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Modules/Providers/Domain/Entities/Provider.cs(6 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/Modules/Providers/Domain/Entities/Provider.cs (2)
src/Modules/Providers/Domain/Exceptions/ProviderDomainException.cs (3)
ProviderDomainException(12-30)ProviderDomainException(18-20)ProviderDomainException(27-29)src/Shared/Domain/BaseEntity.cs (2)
MarkAsUpdated(17-17)AddDomainEvent(15-15)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Code Quality Checks
- GitHub Check: Security Scan
🔇 Additional comments (6)
src/Modules/Providers/Domain/Entities/Provider.cs (6)
50-56: LGTM: Status property properly encapsulated.The Status property follows proper domain entity encapsulation with a private setter and clear documentation.
85-93: LGTM: Reason fields properly defined.The nullable reason fields with clear documentation align with the domain requirements. The Suspend/Reject methods enforce the required constraints at runtime.
120-120: LGTM: Consistent Status initialization.Both constructors correctly initialize new providers to
PendingBasicInfostatus, establishing the proper starting state for the multi-step registration workflow.Also applies to: 153-153
421-431: LGTM: CompleteBasicInfo correctly guards and transitions.The method properly validates preconditions and delegates to
UpdateStatusfor the state transition. The guard ensures it can only advance fromPendingBasicInfo.
446-465: LGTM: Suspend correctly manages reason and state transitions.The method properly validates the required reason, sets
SuspensionReasonbefore callingUpdateStatus, and synchronizesVerificationStatus. The order ensuresClearReasonFieldsIfNeededwon't clear the reason since the new status ISSuspended.
539-556: LGTM: Reason fields correctly cleared on state transitions.This method properly implements the invariant that
SuspensionReasonandRejectionReasonare only valid while in their respective states. The logic correctly clears each reason when leaving that state and preserves them when in that state.This addresses the previous review concern about resetting suspension/rejection reasons when transitioning away from those states. The implementation is called at the correct point in
UpdateStatus(line 398): after the status change andMarkAsUpdated(), but before emitting domain events.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/Modules/Providers/Domain/Entities/Provider.cs (1)
520-544: Address TODO: Implement public method for document correction flow.The transition matrix (line 533) already allows
PendingDocumentVerification→PendingBasicInfo, but the TODO comment indicates a public method is needed to encapsulate this business operation.Would you like me to implement the missing method? Example:
+/// <summary> +/// Retorna o prestador para correção de informações básicas. +/// </summary> +/// <param name="reason">Motivo da correção necessária</param> +/// <param name="updatedBy">Quem está solicitando a correção</param> +public void RequireBasicInfoCorrection(string reason, string? updatedBy = null) +{ + if (Status != EProviderStatus.PendingDocumentVerification) + throw new ProviderDomainException("Can only require corrections during document verification"); + + if (string.IsNullOrWhiteSpace(reason)) + throw new ProviderDomainException("Correction reason is required"); + + UpdateStatus(EProviderStatus.PendingBasicInfo, updatedBy); + + // Optionally emit a domain event for this transition + AddDomainEvent(new ProviderBasicInfoCorrectionRequiredDomainEvent( + Id.Value, 1, UserId, Name, reason, updatedBy)); +}Should I open a new issue to track this task?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/Modules/Providers/Domain/Entities/Provider.cs(7 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/Modules/Providers/Domain/Entities/Provider.cs (2)
src/Modules/Providers/Domain/Exceptions/ProviderDomainException.cs (3)
ProviderDomainException(12-30)ProviderDomainException(18-20)ProviderDomainException(27-29)src/Shared/Domain/BaseEntity.cs (2)
MarkAsUpdated(17-17)AddDomainEvent(15-15)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Code Quality Checks
- GitHub Check: Security Scan
🔇 Additional comments (10)
src/Modules/Providers/Domain/Entities/Provider.cs (10)
50-56: LGTM!The
Statusproperty is well-documented and correctly encapsulates the multi-step registration state with appropriate access control.
85-93: LGTM!The reason properties are appropriately nullable and well-documented, clearly indicating their conditional nature based on provider status.
120-120: LGTM!Correct initialization of
StatustoPendingBasicInfofor new provider instances.
361-379: LGTM!The
skipMarkAsUpdatedparameter is a sensible optimization to prevent redundant timestamp updates when this method is called alongsideUpdateStatus.
427-437: LGTM!Well-encapsulated business method with appropriate precondition validation.
452-471: Verify idempotent behavior for suspension reason updates.The early return at lines 462-463 prevents updating the suspension reason if the provider is already suspended. While this implements idempotency, it means:
- Calling
Suspend("Reason A")followed bySuspend("Reason B")leaves the reason as "Reason A"- The suspension reason cannot be updated without first reactivating the provider
Is this the intended behavior, or should there be a way to update the suspension reason while remaining suspended?
473-492: Verify idempotent behavior for rejection reason updates.Similar to
Suspend, the early return at lines 483-484 prevents updating the rejection reason if already rejected. This means the rejection reason cannot be modified without reopening and re-rejecting the registration.Is this the intended behavior?
546-563: LGTM!This method correctly implements the invariant that reason fields only exist while in their corresponding states, addressing the previous review concern. The logic properly clears stale reasons when transitioning away from
SuspendedorRejectedstates.
565-580: LGTM!This method correctly enforces the invariant that
SuspensionReasonandRejectionReasonmust be set before transitioning to their respective states, addressing the previous review concern. The validation integrates properly with theSuspendandRejectmethods which set reasons before callingUpdateStatus.
381-425: Clarify event coverage for provider status transitions.The implementation correctly covers the registration flow (PendingBasicInfo → DocumentVerification → Active) with specific domain events. However, there are legitimate gaps:
Verified gap: Transitions OUT of Suspended/Rejected states lack events entirely:
Suspended→Active(reactivation): No event emittedRejected→PendingBasicInfo(reopening): No event emittedNoted: Transitions INTO Suspended/Rejected ARE covered via
ProviderVerificationStatusUpdatedDomainEventin theUpdateVerificationStatus()method (line 373), so audit trail exists for suspension/rejection actions.Should reactivation and reopening transitions emit explicit status-change events for cross-module coordination (e.g., notification services, audit logs)?
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/Modules/Providers/Application/Handlers/Commands/RequireBasicInfoCorrectionCommandHandler.cs (1)
68-72: Preserve domain validation messageCatching every exception and replying with “Failed to require basic info correction” hides actionable domain feedback. When
Provider.RequireBasicInfoCorrectionrejects the transition (e.g., status ≠ PendingDocumentVerification) the admin gets no clue. Catch the domain/functional exception separately and return its message, reserving the generic text for unexpected failures.src/Modules/Providers/Tests/Unit/Application/Commands/RequireBasicInfoCorrectionCommandHandlerTests.cs (1)
296-299: Prefer type-safe event assertion over string comparison.The domain event check uses
GetType().Namestring comparison, which is fragile. If the event type is renamed or moved, the test will pass incorrectly.Apply this diff to use type-safe assertion:
- provider.DomainEvents.Should().Contain(e => - e.GetType().Name == "ProviderBasicInfoCorrectionRequiredDomainEvent"); + var correctionEvent = provider.DomainEvents + .OfType<ProviderBasicInfoCorrectionRequiredDomainEvent>() + .Should().ContainSingle().Subject; + correctionEvent.Reason.Should().Be("Contact information needs verification");Add the using statement at the top:
+using MeAjudaAi.Modules.Providers.Domain.Events;
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (10)
src/Modules/Providers/API/Endpoints/ProviderAdmin/RequireBasicInfoCorrectionEndpoint.cs(1 hunks)src/Modules/Providers/API/Endpoints/ProvidersModuleEndpoints.cs(1 hunks)src/Modules/Providers/API/Mappers/RequestMapperExtensions.cs(1 hunks)src/Modules/Providers/Application/Commands/RequireBasicInfoCorrectionCommand.cs(1 hunks)src/Modules/Providers/Application/DTOs/Requests/RequireBasicInfoCorrectionRequest.cs(1 hunks)src/Modules/Providers/Application/Handlers/Commands/RequireBasicInfoCorrectionCommandHandler.cs(1 hunks)src/Modules/Providers/Domain/Entities/Provider.cs(7 hunks)src/Modules/Providers/Domain/Events/ProviderBasicInfoCorrectionRequiredDomainEvent.cs(1 hunks)src/Modules/Providers/Tests/Unit/Application/Commands/RequireBasicInfoCorrectionCommandHandlerTests.cs(1 hunks)src/Modules/Providers/Tests/Unit/Domain/Entities/ProviderTests.cs(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (7)
src/Modules/Providers/API/Endpoints/ProvidersModuleEndpoints.cs (1)
src/Modules/Providers/API/Endpoints/ProviderAdmin/RequireBasicInfoCorrectionEndpoint.cs (1)
RequireBasicInfoCorrectionEndpoint(22-115)
src/Modules/Providers/API/Endpoints/ProviderAdmin/RequireBasicInfoCorrectionEndpoint.cs (3)
src/Shared/Endpoints/BaseEndpoint.cs (1)
BaseEndpoint(10-130)src/Modules/Providers/Application/Handlers/Commands/RequireBasicInfoCorrectionCommandHandler.cs (1)
Task(31-73)src/Modules/Providers/API/Mappers/RequestMapperExtensions.cs (1)
RequireBasicInfoCorrectionCommand(83-90)
src/Modules/Providers/Application/Handlers/Commands/RequireBasicInfoCorrectionCommandHandler.cs (3)
src/Modules/Providers/API/Mappers/RequestMapperExtensions.cs (1)
RequireBasicInfoCorrectionCommand(83-90)src/Modules/Providers/API/Endpoints/ProviderAdmin/RequireBasicInfoCorrectionEndpoint.cs (1)
Task(100-114)src/Modules/Providers/Domain/Entities/Provider.cs (1)
RequireBasicInfoCorrection(444-461)
src/Modules/Providers/Application/Commands/RequireBasicInfoCorrectionCommand.cs (1)
src/Modules/Providers/API/Mappers/RequestMapperExtensions.cs (1)
RequireBasicInfoCorrectionCommand(83-90)
src/Modules/Providers/Tests/Unit/Application/Commands/RequireBasicInfoCorrectionCommandHandlerTests.cs (4)
src/Modules/Providers/Application/Handlers/Commands/RequireBasicInfoCorrectionCommandHandler.cs (2)
RequireBasicInfoCorrectionCommandHandler(20-74)Task(31-73)src/Modules/Providers/Tests/Unit/Domain/Entities/ProviderTests.cs (6)
Provider(391-399)Theory(94-111)Theory(586-660)Theory(679-712)Theory(730-765)Theory(767-783)src/Modules/Providers/Domain/Entities/Provider.cs (8)
CompleteBasicInfo(431-437)Provider(19-635)Provider(98-98)Provider(103-124)Provider(137-163)Activate(467-474)Suspend(494-508)Reject(515-529)src/Modules/Providers/API/Mappers/RequestMapperExtensions.cs (1)
RequireBasicInfoCorrectionCommand(83-90)
src/Modules/Providers/Tests/Unit/Domain/Entities/ProviderTests.cs (2)
src/Modules/Providers/Domain/Entities/Provider.cs (8)
CompleteBasicInfo(431-437)Activate(467-474)Suspend(494-508)Reject(515-529)UpdateStatus(390-425)Delete(541-555)Reactivate(480-487)RequireBasicInfoCorrection(444-461)src/Modules/Providers/Tests/Infrastructure/TestInfrastructureExtensions.cs (1)
DateTime(76-76)
src/Modules/Providers/Domain/Entities/Provider.cs (2)
src/Modules/Providers/Domain/Exceptions/ProviderDomainException.cs (3)
ProviderDomainException(12-30)ProviderDomainException(18-20)ProviderDomainException(27-29)src/Shared/Domain/BaseEntity.cs (2)
MarkAsUpdated(17-17)AddDomainEvent(15-15)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Code Quality Checks
- GitHub Check: Security Scan
🔇 Additional comments (6)
src/Modules/Providers/API/Endpoints/ProvidersModuleEndpoints.cs (1)
49-62: RequireBasicInfoCorrection endpoint registration LGTMRegistration fits the existing fluent chain and keeps the module wiring consistent.
src/Modules/Providers/Application/Commands/RequireBasicInfoCorrectionCommand.cs (1)
13-17: Command contract reads cleanDefinition mirrors the workflow and stays aligned with the command pattern in this module.
src/Modules/Providers/Domain/Events/ProviderBasicInfoCorrectionRequiredDomainEvent.cs (1)
21-28: Domain event payload looks comprehensiveIncludes the identifiers and rationale needed for auditing when the workflow reverts to PendingBasicInfo.
src/Modules/Providers/Tests/Unit/Domain/Entities/ProviderTests.cs (1)
401-785: LGTM! Comprehensive status transition test coverage.The new status transition tests provide excellent coverage of the multi-step provider registration workflow, including:
- All valid state transitions with proper event emission
- Guard conditions preventing invalid transitions
- Required field validation (reasons for suspension/rejection)
- Edge cases like idempotent operations
The test organization using the Theory pattern for parameterized testing is particularly effective.
src/Modules/Providers/API/Endpoints/ProviderAdmin/RequireBasicInfoCorrectionEndpoint.cs (1)
14-77: LGTM! Outstanding API documentation and proper authorization.The OpenAPI documentation is exceptionally comprehensive, providing:
- Clear use cases for when to use the endpoint
- Step-by-step workflow after correction
- Field-level validation rules
- Security restrictions with AdminOnly authorization
The implementation correctly validates the request body and follows the established CQRS pattern.
src/Modules/Providers/Domain/Entities/Provider.cs (1)
381-616: LGTM! Solid state machine implementation with proper invariant enforcement.The status management implementation addresses all past review concerns:
✅ Reason field clearing (lines 590-599):
ClearReasonFieldsIfNeededproperly clearsSuspensionReasonandRejectionReasonwhen transitioning away from those states.✅ Invariant validation (lines 609-616):
ValidateRequiredReasonsenforces that reason fields must be set before transitioning toSuspendedorRejectedstates.✅ Reactivation support (lines 476-487):
Reactivatemethod handles theSuspended→Activetransition with proper verification status update.The state machine is well-designed with:
- Comprehensive transition validation using an allowed transitions dictionary
- Proper encapsulation with private setters on status and reason fields
- Domain events for key lifecycle transitions
- Coordinated updates between
StatusandVerificationStatus
src/Modules/Providers/Application/DTOs/Requests/RequireBasicInfoCorrectionRequest.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/Modules/Providers/Tests/Unit/Application/Commands/RequireBasicInfoCorrectionCommandHandlerTests.cs (1)
119-151: Tighten assertions around persistence.When validation fails we should assert that
IProviderRepository.UpdateAsyncwas never invoked, just like we already ensureGetByIdAsyncisn’t called. That keeps future regressions from sneaking in a persistence call on invalid payloads._providerRepositoryMock.Verify( r => r.GetByIdAsync(It.IsAny<ProviderId>(), It.IsAny<CancellationToken>()), Times.Never); + + _providerRepositoryMock.Verify( + r => r.UpdateAsync(It.IsAny<Provider>(), It.IsAny<CancellationToken>()), + Times.Never);Mirror the same assertion in the
invalidRequestedBytest as well.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
src/Modules/Providers/API/Endpoints/ProviderAdmin/RequireBasicInfoCorrectionEndpoint.cs(1 hunks)src/Modules/Providers/API/Mappers/RequestMapperExtensions.cs(1 hunks)src/Modules/Providers/Application/DTOs/Requests/RequireBasicInfoCorrectionRequest.cs(1 hunks)src/Modules/Providers/Application/Handlers/Commands/RequireBasicInfoCorrectionCommandHandler.cs(1 hunks)src/Modules/Providers/Tests/Unit/Application/Commands/RequireBasicInfoCorrectionCommandHandlerTests.cs(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/Modules/Providers/Application/DTOs/Requests/RequireBasicInfoCorrectionRequest.cs
- src/Modules/Providers/API/Mappers/RequestMapperExtensions.cs
🧰 Additional context used
🧬 Code graph analysis (3)
src/Modules/Providers/API/Endpoints/ProviderAdmin/RequireBasicInfoCorrectionEndpoint.cs (3)
src/Shared/Endpoints/BaseEndpoint.cs (1)
BaseEndpoint(10-130)src/Modules/Providers/Application/Handlers/Commands/RequireBasicInfoCorrectionCommandHandler.cs (1)
Task(32-83)src/Modules/Providers/API/Mappers/RequestMapperExtensions.cs (1)
RequireBasicInfoCorrectionCommand(84-91)
src/Modules/Providers/Tests/Unit/Application/Commands/RequireBasicInfoCorrectionCommandHandlerTests.cs (5)
src/Modules/Providers/Application/Handlers/Commands/RequireBasicInfoCorrectionCommandHandler.cs (2)
RequireBasicInfoCorrectionCommandHandler(21-84)Task(32-83)src/Modules/Providers/Tests/Unit/Domain/Entities/ProviderTests.cs (6)
Provider(391-399)Theory(94-111)Theory(586-660)Theory(679-712)Theory(730-765)Theory(767-783)src/Modules/Providers/API/Endpoints/ProviderAdmin/RequireBasicInfoCorrectionEndpoint.cs (1)
Task(103-124)src/Modules/Providers/Domain/Entities/Provider.cs (8)
CompleteBasicInfo(431-437)Provider(19-635)Provider(98-98)Provider(103-124)Provider(137-163)Activate(467-474)Suspend(494-508)Reject(515-529)src/Modules/Providers/API/Mappers/RequestMapperExtensions.cs (1)
RequireBasicInfoCorrectionCommand(84-91)
src/Modules/Providers/Application/Handlers/Commands/RequireBasicInfoCorrectionCommandHandler.cs (3)
src/Modules/Providers/API/Mappers/RequestMapperExtensions.cs (1)
RequireBasicInfoCorrectionCommand(84-91)src/Modules/Providers/API/Endpoints/ProviderAdmin/RequireBasicInfoCorrectionEndpoint.cs (1)
Task(103-124)src/Modules/Providers/Domain/Entities/Provider.cs (1)
RequireBasicInfoCorrection(444-461)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Code Quality Checks
- GitHub Check: Security Scan
🔇 Additional comments (1)
src/Modules/Providers/Application/Handlers/Commands/RequireBasicInfoCorrectionCommandHandler.cs (1)
40-50: Good early validation on command payload.These guard clauses stop us from touching the repository when the client payload is incomplete, keeping the failure cheap and predictable. Nicely done.
src/Modules/Providers/API/Endpoints/ProviderAdmin/RequireBasicInfoCorrectionEndpoint.cs
Outdated
Show resolved
Hide resolved
New test failing due to SetAllowUnauthenticated(true): - ApiVersioning_ShouldWork_ForDifferentModules - Expected: OK/401/400 - Actual: 403 Forbidden Same root cause as PermissionAuthorizationE2ETests. All authentication-dependent tests require handler refactor in Sprint 1. Updated: 96/103 passing, 7 skipped (93.2% success rate)
- Move Infrastructure/Migrations para Infrastructure/Persistence/Migrations - Atualiza namespaces em todas as migrations e snapshots - Melhora organização: migrations agora próximas ao DbContext - Mantém histórico git com git mv Item #7 concluído
Summary by CodeRabbit
New Features
Documentation
Chores
Tests