Refactor RegistrationsManager to use DTOs and integrate new contracts - #5
Conversation
Ladozhsky
commented
Jul 30, 2026
- Updated InlineTicketPricing to accept RegistrationMeetingContextDto and ticket type directly.
- Refactored Program.cs to utilize new contracts and improve registration handling.
- Added new project references for DataAccessor, IntegrationEvents, and RegistrationsManager contracts.
- Introduced new mappings for DataAccessor and RegistrationsManager to convert between entities and DTOs.
- Created new contracts for AiChatEngine, DataAccessor, MeetingsManager, NotificationsAccessor, and SchedulingEngine.
- Implemented feedback and registration request DTOs to enhance API validation and structure.
- Enhanced Gateway mappings to convert between internal and public DTOs for meetings and registrations.
- Updated InlineTicketPricing to accept RegistrationMeetingContextDto and ticket type directly. - Refactored Program.cs to utilize new contracts and improve registration handling. - Added new project references for DataAccessor, IntegrationEvents, and RegistrationsManager contracts. - Introduced new mappings for DataAccessor and RegistrationsManager to convert between entities and DTOs. - Created new contracts for AiChatEngine, DataAccessor, MeetingsManager, NotificationsAccessor, and SchedulingEngine. - Implemented feedback and registration request DTOs to enhance API validation and structure. - Enhanced Gateway mappings to convert between internal and public DTOs for meetings and registrations.
There was a problem hiding this comment.
🟡 Not ready to approve
Gateway’s new DownstreamResult<T> error-body parsing can throw on empty/chunked/non-JSON responses, risking unintended 500s instead of cleanly relaying downstream status codes.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR refactors the MeetingFlow microservices solution toward explicit, service-owned transport contracts by introducing dedicated Contracts projects, mapping layers, and narrower request/response models so EF entities and internal fields no longer cross service boundaries (HTTP or messaging).
Changes:
- Added service-owned
*.Contractsprojects (HTTP DTOs) plusMeetingFlow.IntegrationEvents(versioned RabbitMQ events) and wired them into the solution/services. - Updated Gateway, Managers, Engines, and Accessors to use the new contracts and mapping layers, adding request validation and reducing over-fetched payloads.
- Switched registration notification flow to an async
registration.created.v1event consumed byNotificationsAccessor(removing the direct synchronous call path).
File summaries
| File | Description |
|---|---|
| README.md | Updates repo-level architecture description to reflect multiple variants and the microservices “contracted” reference. |
| MeetingFlow.slnx | Adds the new Contracts and IntegrationEvents projects to the solution. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/RegistrationsManager.csproj | Adds references to Contracts/IntegrationEvents used by RegistrationsManager. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Program.cs | Refactors endpoints to accept DTOs, validate inputs, use narrower DataAccessor/SchedulingEngine contracts, and publish registration.created.v1. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Pricing/InlineTicketPricing.cs | Updates pricing API to take RegistrationMeetingContextDto, normalized ticket type, and injected time. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Models/Registration.cs | Removes local entity redeclaration in favor of contracts. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Models/Meeting.cs | Removes local entity redeclaration in favor of contracts. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Models/Feedback.cs | Removes local entity redeclaration in favor of contracts. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Models/Attendee.cs | Removes local entity redeclaration in favor of contracts. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Messaging/RegistrationCreatedEvent.cs | Removes old, unversioned event record. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Messaging/EventPublisher.cs | Introduces IEventPublisher and keeps RabbitMQ publishing via a typed abstraction. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Mappings/ContractMappings.cs | Adds mappings from DataAccessor DTOs to RegistrationsManager DTOs. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Dockerfile | Copies src/Contracts into the Docker build context for restore/build. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Clients/SchedulingEngineClient.cs | Refactors capacity call to use SchedulingEngine.Contracts request/response. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Clients/NotificationsAccessorClient.cs | Removes direct NotificationsAccessor HTTP client. |
| MeetingFlow.Microservices/src/Managers/RegistrationsManager/Clients/DataAccessorClient.cs | Refactors accessor calls to use DataAccessor.Contracts and narrower endpoints. |
| MeetingFlow.Microservices/src/Managers/MeetingsManager/Program.cs | Refactors endpoints to use contracts/mappings and adds validation for updates/conflict checks. |
| MeetingFlow.Microservices/src/Managers/MeetingsManager/Models/Venue.cs | Removes local entity redeclaration in favor of contracts. |
| MeetingFlow.Microservices/src/Managers/MeetingsManager/Models/Speaker.cs | Removes local entity redeclaration in favor of contracts. |
| MeetingFlow.Microservices/src/Managers/MeetingsManager/Models/Session.cs | Removes local entity redeclaration in favor of contracts. |
| MeetingFlow.Microservices/src/Managers/MeetingsManager/Models/Registration.cs | Removes local entity redeclaration in favor of contracts. |
| MeetingFlow.Microservices/src/Managers/MeetingsManager/Models/Meeting.cs | Removes local entity redeclaration in favor of contracts. |
| MeetingFlow.Microservices/src/Managers/MeetingsManager/MeetingsManager.csproj | Adds references to DataAccessor/MeetingsManager/SchedulingEngine contract projects. |
| MeetingFlow.Microservices/src/Managers/MeetingsManager/Mappings/ContractMappings.cs | Adds mappings from accessor DTOs to MeetingsManager use-case DTOs. |
| MeetingFlow.Microservices/src/Managers/MeetingsManager/Dockerfile | Copies src/Contracts into the Docker build context for restore/build. |
| MeetingFlow.Microservices/src/Managers/MeetingsManager/Clients/SchedulingEngineClient.cs | Refactors conflict call to use SchedulingEngine.Contracts request/response. |
| MeetingFlow.Microservices/src/Managers/MeetingsManager/Clients/DataAccessorClient.cs | Refactors accessor calls to return accessor contract DTOs and adds admin list method. |
| MeetingFlow.Microservices/src/Gateway/Program.cs | Refactors Gateway routes to bind public contracts, map downstream DTOs to public DTOs, and standardize downstream error handling. |
| MeetingFlow.Microservices/src/Gateway/Models/Registration.cs | Removes Gateway-local entity redeclaration in favor of public contracts. |
| MeetingFlow.Microservices/src/Gateway/Models/Meeting.cs | Removes Gateway-local entity redeclaration in favor of public contracts. |
| MeetingFlow.Microservices/src/Gateway/Mappings/PublicMappings.cs | Adds downstream-to-public DTO mapping layer for Gateway responses. |
| MeetingFlow.Microservices/src/Gateway/Gateway.csproj | Adds references to downstream contract projects. |
| MeetingFlow.Microservices/src/Gateway/Dockerfile | Copies src/Contracts into the Docker build context for restore/build. |
| MeetingFlow.Microservices/src/Gateway/Contracts/RegistrationsContracts.cs | Introduces public (edge) registration/feedback request/response models. |
| MeetingFlow.Microservices/src/Gateway/Contracts/MeetingsContracts.cs | Introduces public (edge) meeting/speaker/session request/response models. |
| MeetingFlow.Microservices/src/Gateway/Contracts/ChatContracts.cs | Introduces public (edge) chat request/response models. |
| MeetingFlow.Microservices/src/Gateway/Clients/RegistrationsManagerClient.cs | Refactors to typed JSON calls returning DownstreamResult<T> for write endpoints. |
| MeetingFlow.Microservices/src/Gateway/Clients/MeetingsManagerClient.cs | Refactors to typed JSON calls and DownstreamResult<T> for updates. |
| MeetingFlow.Microservices/src/Gateway/Clients/DownstreamResult.cs | Adds a helper wrapper for propagating status codes and parsing error bodies from downstream services. |
| MeetingFlow.Microservices/src/Gateway/Clients/AiChatEngineClient.cs | Refactors chat client to send typed contract request and return DownstreamResult<ChatResult>. |
| MeetingFlow.Microservices/src/Engines/SchedulingEngine/SchedulingEngine.csproj | Adds reference to SchedulingEngine.Contracts. |
| MeetingFlow.Microservices/src/Engines/SchedulingEngine/Program.cs | Refactors scheduling endpoints to accept narrow contract DTOs and adds validation. |
| MeetingFlow.Microservices/src/Engines/SchedulingEngine/Models/Session.cs | Removes local model redeclaration in favor of contract DTOs. |
| MeetingFlow.Microservices/src/Engines/SchedulingEngine/Models/Meeting.cs | Removes local model redeclaration in favor of contract DTOs. |
| MeetingFlow.Microservices/src/Engines/SchedulingEngine/Dockerfile | Copies src/Contracts into the Docker build context for restore/build. |
| MeetingFlow.Microservices/src/Engines/AiChatEngine/Program.cs | Refactors chat endpoint to use contract models, validates inputs, and returns a typed ChatResult. |
| MeetingFlow.Microservices/src/Engines/AiChatEngine/Dockerfile | Copies src/Contracts into the Docker build context for restore/build. |
| MeetingFlow.Microservices/src/Engines/AiChatEngine/Clients/DataAccessorClient.cs | Refactors DataAccessor calls to use DataAccessor.Contracts task/meeting DTOs and narrower update shapes. |
| MeetingFlow.Microservices/src/Engines/AiChatEngine/AiChatEngine.csproj | Adds references to AiChatEngine/DataAccessor contract projects. |
| MeetingFlow.Microservices/src/Contracts/SchedulingEngine.Contracts/SchedulingEngine.Contracts.csproj | Adds new packable contract project for SchedulingEngine HTTP API. |
| MeetingFlow.Microservices/src/Contracts/SchedulingEngine.Contracts/SchedulingContracts.cs | Defines conflict/capacity request/response DTOs. |
| MeetingFlow.Microservices/src/Contracts/RegistrationsManager.Contracts/RegistrationsManager.Contracts.csproj | Adds new packable contract project for RegistrationsManager HTTP API. |
| MeetingFlow.Microservices/src/Contracts/RegistrationsManager.Contracts/RegistrationContracts.cs | Defines registrations/feedback DTOs for RegistrationsManager boundary. |
| MeetingFlow.Microservices/src/Contracts/NotificationsAccessor.Contracts/NotificationsAccessor.Contracts.csproj | Adds new packable contract project for NotificationsAccessor HTTP API. |
| MeetingFlow.Microservices/src/Contracts/NotificationsAccessor.Contracts/NotificationContracts.cs | Defines notification send request and notification DTO. |
| MeetingFlow.Microservices/src/Contracts/MeetingsManager.Contracts/MeetingsManager.Contracts.csproj | Adds new packable contract project for MeetingsManager HTTP API. |
| MeetingFlow.Microservices/src/Contracts/MeetingsManager.Contracts/MeetingContracts.cs | Defines meeting/speaker/session/admin DTOs and conflict-check models. |
| MeetingFlow.Microservices/src/Contracts/MeetingFlow.IntegrationEvents/RegistrationCreatedV1.cs | Introduces versioned registration.created.v1 integration event payload. |
| MeetingFlow.Microservices/src/Contracts/MeetingFlow.IntegrationEvents/MeetingFlow.IntegrationEvents.csproj | Adds new packable integration-events project. |
| MeetingFlow.Microservices/src/Contracts/DataAccessor.Contracts/TasksContracts.cs | Defines task DTOs and create/update request shapes for DataAccessor boundary. |
| MeetingFlow.Microservices/src/Contracts/DataAccessor.Contracts/RegistrationsContracts.cs | Defines registration/feedback/attendee DTOs and persist request shapes for DataAccessor boundary. |
| MeetingFlow.Microservices/src/Contracts/DataAccessor.Contracts/MeetingsContracts.cs | Defines meeting/session/speaker DTOs including RegistrationMeetingContextDto. |
| MeetingFlow.Microservices/src/Contracts/DataAccessor.Contracts/DataAccessor.Contracts.csproj | Adds new packable contract project for DataAccessor HTTP API. |
| MeetingFlow.Microservices/src/Contracts/AiChatEngine.Contracts/ChatContracts.cs | Defines chat DTOs for AiChatEngine boundary. |
| MeetingFlow.Microservices/src/Contracts/AiChatEngine.Contracts/AiChatEngine.Contracts.csproj | Adds new packable contract project for AiChatEngine HTTP API. |
| MeetingFlow.Microservices/src/Accessors/NotificationsAccessor/Program.cs | Refactors send endpoint to accept SendNotificationRequest, validates inputs, and returns DTOs. |
| MeetingFlow.Microservices/src/Accessors/NotificationsAccessor/NotificationsAccessor.csproj | Adds references to NotificationsAccessor.Contracts and IntegrationEvents. |
| MeetingFlow.Microservices/src/Accessors/NotificationsAccessor/Models/Meeting.cs | Removes local model redeclaration (no longer needed for send contract). |
| MeetingFlow.Microservices/src/Accessors/NotificationsAccessor/Models/Attendee.cs | Removes local model redeclaration (no longer needed for send contract). |
| MeetingFlow.Microservices/src/Accessors/NotificationsAccessor/Messaging/RegistrationEventConsumer.cs | Updates consumer to bind registration.created.v1, deserialize RegistrationCreatedV1, and send via FakeSmtpGateway. |
| MeetingFlow.Microservices/src/Accessors/NotificationsAccessor/Dockerfile | Copies src/Contracts into the Docker build context for restore/build. |
| MeetingFlow.Microservices/src/Accessors/DataAccessor/Repositories/MeetingsRepository.cs | Adds GetRegistrationContextAsync and replaces upsert with explicit update logic. |
| MeetingFlow.Microservices/src/Accessors/DataAccessor/Program.cs | Refactors all endpoints to return/access DTOs only; adds admin list, registration-context, and task update endpoints. |
| MeetingFlow.Microservices/src/Accessors/DataAccessor/Mappings/ContractMappings.cs | Adds entity→contract mapping helpers for meetings/sessions/speakers/registrations/feedback/tasks. |
| MeetingFlow.Microservices/src/Accessors/DataAccessor/Dockerfile | Copies src/Contracts into the Docker build context for restore/build. |
| MeetingFlow.Microservices/src/Accessors/DataAccessor/DataAccessor.csproj | Adds reference to DataAccessor.Contracts. |
| MeetingFlow.Microservices/README.md | Updates microservices docs to describe contract boundaries and the new event-driven notification flow. |
| MeetingFlow.Microservices/MeetingFlow_MICROSERVICES_TEAM_EXERCISE.md | Removes the older “intentionally wrong” exercise doc that no longer matches the refactored microservices state. |
| MeetingFlow.Microservices/docker-compose.yml | Removes NotificationsAccessor direct dependency/env var from RegistrationsManager and relies on RabbitMQ integration. |
Review details
- Files reviewed: 79/79 changed files
- Comments generated: 2
- Review effort level: Low
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
| JsonElement? error = null; | ||
| if (response.Content.Headers.ContentLength is not 0) | ||
| { | ||
| error = await response.Content.ReadFromJsonAsync<JsonElement>(); | ||
| } |
| notification.Body, | ||
| notification.RawPayloadJson); | ||
|
|
||
| _logger.LogInformation("Processed registration.created event for {RegistrationId}", evt.RegistrationId); |