Skip to content

LEGLINK-697: Create Separate DMRP C# Project & Module Structure - #1776

Merged
smailliwcs merged 20 commits into
devfrom
user/steven.williams/LEGLINK-697
Aug 6, 2026
Merged

LEGLINK-697: Create Separate DMRP C# Project & Module Structure#1776
smailliwcs merged 20 commits into
devfrom
user/steven.williams/LEGLINK-697

Conversation

@smailliwcs

@smailliwcs smailliwcs commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🛠️ Description of Changes

Created/scaffolded the DMRP module.

🧪 Testing Performed

Ran unit/integration tests locally. Confirmed healthy startup in Compose stack.

🧑‍🔬 Unit Testing

  • I have written or updated unit tests to cover my changes
  • Coverage: 16.1%

📓 Documentation Updated

Added setting to app-config.yaml.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Added a complete DMRP .NET 8 service with persistence, CRUD APIs, SDK integration, tests, container configuration, and Azure DevOps deployment pipelines.

Changes

DMRP service

Layer / File(s) Summary
Persistence and service contracts
DotNet/DMRP/Data/..., DotNet/DMRP/Models/..., DotNet/DMRP/Migrations/..., DotNet/DMRP/DMRP.csproj
Added DMRP entities, EF Core mappings, repositories, migrations, project settings, and paginated response models.
Business operations and queries
DotNet/DMRP/Business/...
Added repository-backed CRUD managers and paginated query services for measure mappings and facility reporting plans.
HTTP API and runtime wiring
DotNet/DMRP/Controllers/..., DotNet/DMRP/Program.cs, DotNet/DMRP/Services/..., DotNet/DMRP/appsettings*
Added authorized CRUD controllers and configured authentication, middleware, database access, health checks, logging, telemetry, and environment settings.
SDK and service registration
DotNet/LinkSdk/..., DotNet/Shared/Application/..., app-config.yaml
Added DMRP API models, service URL settings, SDK operations, dependency injection, and global configuration.
Unit and integration validation
DotNet/ServiceTests/...
Added DMRP test infrastructure and coverage for managers, queries, and controller CRUD behavior.
Build and deployment wiring
Azure_Pipelines/..., docker-compose.yml, link-cloud.sln, DotNet/DMRP/Dockerfile
Added solution registration, Docker Compose service configuration, Azure DevOps build and deployment pipelines, deployment tags, and health-check metadata.

Estimated code review effort: 5 (Critical) | ~120 minutes

Suggested reviewers: edward-miller-lcg

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant DMRPController
  participant DMRPManager
  participant DmrpDbContext
  Client->>DMRPController: Submit CRUD request
  DMRPController->>DMRPManager: Invoke operation
  DMRPManager->>DmrpDbContext: Persist or retrieve entity
  DmrpDbContext-->>DMRPManager: Return entity or result
  DMRPManager-->>DMRPController: Return operation result
  DMRPController-->>Client: Return HTTP response
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 13.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description covers the changes, testing, unit tests, coverage, and documentation updates required by the template.
Title check ✅ Passed The title clearly identifies the creation of a separate DMRP C# project and module structure.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch user/steven.williams/LEGLINK-697

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread DotNet/DMRP/Controllers/FacilityReportingPlansController.cs Dismissed
Comment thread DotNet/DMRP/Controllers/MeasureMappingsController.cs Dismissed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 13

🧹 Nitpick comments (1)
DotNet/DMRP/Program.cs (1)

127-136: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove the duplicate FromLogContext enricher.

.Enrich.FromLogContext() is called on line 132 and again on line 135. One call is sufficient.

♻️ Proposed fix
                 .Enrich.WithSpan()
                 .Enrich.With<ActivityEnricher>()
-                .Enrich.FromLogContext()
                 .CreateLogger();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@DotNet/DMRP/Program.cs` around lines 127 - 136, Remove the duplicate
Enrich.FromLogContext() call from the LoggerConfiguration chain, keeping one
invocation while preserving the existing logger enrichers and filters.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@Azure_Pipelines/azure-pipelines.dmrp.cd.yaml`:
- Around line 87-99: Update the Docker@2 task labeled “Build & Push DMRP Docker
Image” to remove the unconditional always() condition and require successful
completion of the preceding validation and tag-generation tasks before building
or pushing either image tag.

In `@DotNet/DMRP/Business/Managers/FacilityReportingPlanManager.cs`:
- Around line 36-40: Preserve cancellation by adding a filtered
OperationCanceledException catch before each general Exception handler in
CreateAsync, UpdateAsync, and DeleteAsync of FacilityReportingPlanManager.cs and
MeasureMappingManager.cs, rethrowing the cancellation unchanged; retain the
existing ApplicationException wrapping for other exceptions at all six sites.
- Line 53: Sanitize caller-provided id values before every affected ILogger call
in FacilityReportingPlanManager.cs at lines 53-53 and 77-77, and
MeasureMappingManager.cs at lines 53-53 and 77-77. Apply the same established
identifier-sanitization approach consistently at all four logging sites before
passing id to LogError.
- Around line 50-60: Update the update flow in FacilityReportingPlanManager.cs
at lines 50-60 by copying the permitted fields from the facilityReportingPlan
request model onto existing before calling Update and SaveChangesAsync. Apply
the same change in MeasureMappingManager.cs at lines 50-60, copying permitted
measureMapping fields onto existing; preserve the existing not-found and save
behavior.

In `@DotNet/DMRP/Business/Queries/FacilityReportingPlanQueries.cs`:
- Around line 38-63: Bound pageSize before pagination in both PagedSearchAsync
implementations: DotNet/DMRP/Business/Queries/FacilityReportingPlanQueries.cs
lines 38-63 and DotNet/DMRP/Business/Queries/MeasureMappingQueries.cs lines
38-63. Reject invalid values or normalize pageSize consistently before using it
in Skip, Take, and PaginationMetadata.TotalPages, while preserving the existing
pageNumber normalization behavior.

In `@DotNet/DMRP/Controllers/FacilityReportingPlansController.cs`:
- Around line 40-53: Clamp pageSize to the supported range before invoking
PagedSearchAsync in GetFacilityReportingPlans within
DotNet/DMRP/Controllers/FacilityReportingPlansController.cs#L40-L53. Apply the
same pageSize bounds in the corresponding handler in
DotNet/DMRP/Controllers/MeasureMappingsController.cs#L40-L53, preserving the
existing pageNumber normalization and query flow.
- Around line 91-117: Map validated request fields onto the entities before
manager calls: in DotNet/DMRP/Controllers/FacilityReportingPlansController.cs
lines 91-117 and DotNet/DMRP/Controllers/MeasureMappingsController.cs lines
91-117, update CreateFacilityReportingPlan and the corresponding MeasureMappings
POST handler to create from the mapped request and return the created
representation; in DotNet/DMRP/Controllers/FacilityReportingPlansController.cs
lines 127-153 and DotNet/DMRP/Controllers/MeasureMappingsController.cs lines
127-153, reject null requests with 400 and pass mapped entities with the
requested ID to UpdateAsync instead of new ID-only entities.

In `@DotNet/DMRP/Dockerfile`:
- Line 3: Update the Dockerfile’s base image reference to an explicit version
tag or digest for reproducible builds, and in the final stage after `FROM base
AS final`, add `USER 1001` unless the pinned runtime image already declares a
non-root user.

In `@DotNet/DMRP/packages.lock.json`:
- Around line 947-950: Update the centralized package versions in
Directory.Packages.props for SQLitePCLRaw.lib.e_sqlite3, AutoMapper, and
Microsoft.EntityFrameworkCore.Sqlite to patched releases, then regenerate or
update every affected packages.lock.json so no vulnerable versions remain.

In `@DotNet/DMRP/Program.cs`:
- Line 92: Update the client-facing ProblemDetails.Detail message in the
error-handling flow to correct “occured” to “occurred” and “assistence” to
“assistance,” preserving the rest of the message unchanged.

In `@DotNet/LinkSdk/Clients/DmrpServiceClient.cs`:
- Around line 11-21: The DmrpServiceClient currently creates its own HTTP client
instead of using the SDK’s configured factory. Update DmrpServiceClient and its
LinkApiClientBase integration to accept and use the compatible request-header
abstraction, then update ServiceCollectionExtensions registration to use
AddHttpClient<IDmrpServiceClient, DmrpServiceClient>() and configure the
required request headers through the typed client.

In `@DotNet/LinkSdk/Clients/Interfaces/IDmrpServiceClient.cs`:
- Around line 12-18: The DMRP search methods currently discard their typed paged
payloads. Update SearchMeasureMappingsAsync and
SearchFacilityReportingPlansAsync in
DotNet/LinkSdk/Clients/Interfaces/IDmrpServiceClient.cs (lines 12-18) and the
corresponding implementations in DotNet/LinkSdk/Clients/DmrpServiceClient.cs
(lines 50-57 and 84-91) to return LinkApiResponse<PagedMeasureMappingDto> and
LinkApiResponse<PagedFacilityReportingPlanDto>, respectively, using reusable
paged SDK response types while preserving the existing request and pagination
behavior.

In `@DotNet/Shared/Application/Models/Configs/ServiceRegistry.cs`:
- Around line 106-115: Add focused XUnit tests in ServiceRegistryTests for both
DmrpServiceApiUrl and PublicDmrpServiceApiUrl, covering null or empty service
URLs, URLs without a trailing slash, and URLs with trailing slashes. Assert
missing values produce the expected null result, non-trailing URLs append
“/api”, and trailing slashes are normalized before appending “/api”.

---

Nitpick comments:
In `@DotNet/DMRP/Program.cs`:
- Around line 127-136: Remove the duplicate Enrich.FromLogContext() call from
the LoggerConfiguration chain, keeping one invocation while preserving the
existing logger enrichers and filters.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9eb71ce8-c60d-4e18-8d95-44a1a5d3c268

📥 Commits

Reviewing files that changed from the base of the PR and between 1f59229 and d5b0c3e.

📒 Files selected for processing (49)
  • Azure_Pipelines/_deploy_all_services.yml
  • Azure_Pipelines/azure-pipelines.dmrp.cd.yaml
  • Azure_Pipelines/deploy_tags_all.yml
  • DotNet/DMRP/Business/Managers/FacilityReportingPlanManager.cs
  • DotNet/DMRP/Business/Managers/MeasureMappingManager.cs
  • DotNet/DMRP/Business/Queries/FacilityReportingPlanQueries.cs
  • DotNet/DMRP/Business/Queries/MeasureMappingQueries.cs
  • DotNet/DMRP/Config/DmrpConstants.cs
  • DotNet/DMRP/Controllers/FacilityReportingPlansController.cs
  • DotNet/DMRP/Controllers/MeasureMappingsController.cs
  • DotNet/DMRP/DMRP.csproj
  • DotNet/DMRP/Data/Entities/FacilityReportingPlan.cs
  • DotNet/DMRP/Data/Entities/MeasureMapping.cs
  • DotNet/DMRP/Data/Repository/DmrpDbContext.cs
  • DotNet/DMRP/Data/Repository/FacilityReportingPlanRepository.cs
  • DotNet/DMRP/Data/Repository/Mappings/FacilityReportingPlanConfigMap.cs
  • DotNet/DMRP/Data/Repository/Mappings/MeasureMappingConfigMap.cs
  • DotNet/DMRP/Data/Repository/MeasureMappingRepository.cs
  • DotNet/DMRP/Dockerfile
  • DotNet/DMRP/Migrations/20260803165942_InitialCreate.Designer.cs
  • DotNet/DMRP/Migrations/20260803165942_InitialCreate.cs
  • DotNet/DMRP/Migrations/DmrpDbContextModelSnapshot.cs
  • DotNet/DMRP/Models/PagedFacilityReportingPlanDto.cs
  • DotNet/DMRP/Models/PagedMeasureMappingDto.cs
  • DotNet/DMRP/Program.cs
  • DotNet/DMRP/Properties/launchSettings.json
  • DotNet/DMRP/Services/DatabaseHealthCheck.cs
  • DotNet/DMRP/appsettings.Development.json
  • DotNet/DMRP/appsettings.Docker.json
  • DotNet/DMRP/appsettings.json
  • DotNet/DMRP/packages.lock.json
  • DotNet/LinkSdk/Clients/DmrpServiceClient.cs
  • DotNet/LinkSdk/Clients/Interfaces/IDmrpServiceClient.cs
  • DotNet/LinkSdk/DependencyInjection/ServiceCollectionExtensions.cs
  • DotNet/ServiceTests/IntegrationTests/DMRP/DmrpIntegrationTestFixture.cs
  • DotNet/ServiceTests/IntegrationTests/DMRP/FacilityReportingPlansControllerTests.cs
  • DotNet/ServiceTests/IntegrationTests/DMRP/MeasureMappingsControllerTests.cs
  • DotNet/ServiceTests/IntegrationTests/IntegrationTestCollection.cs
  • DotNet/ServiceTests/ServiceTests.csproj
  • DotNet/ServiceTests/UnitTests/DMRP/FacilityReportingPlanManagerTests.cs
  • DotNet/ServiceTests/UnitTests/DMRP/FacilityReportingPlanQueriesTests.cs
  • DotNet/ServiceTests/UnitTests/DMRP/MeasureMappingManagerTests.cs
  • DotNet/ServiceTests/UnitTests/DMRP/MeasureMappingQueriesTests.cs
  • DotNet/ServiceTests/packages.lock.json
  • DotNet/Shared/Application/Models/Configs/ServiceRegistry.cs
  • DotNet/Shared/Application/Models/Integration/DMRP/DMRPApiModels.cs
  • app-config.yaml
  • docker-compose.yml
  • link-cloud.sln

Comment thread Azure_Pipelines/azure-pipelines.dmrp.cd.yaml Outdated
Comment thread DotNet/DMRP/Business/Managers/FacilityReportingPlanManager.cs
Comment thread DotNet/DMRP/Business/Managers/FacilityReportingPlanManager.cs
Comment thread DotNet/DMRP/Business/Managers/FacilityReportingPlanManager.cs Outdated
Comment thread DotNet/DMRP/Business/Queries/FacilityReportingPlanQueries.cs
Comment thread DotNet/DMRP/packages.lock.json
Comment thread DotNet/DMRP/Program.cs Outdated
Comment thread DotNet/LinkSdk/Clients/DmrpServiceClient.cs
Comment thread DotNet/LinkSdk/Clients/Interfaces/IDmrpServiceClient.cs Outdated
Comment thread DotNet/Shared/Application/Models/Configs/ServiceRegistry.cs Outdated
@smailliwcs
smailliwcs requested a review from johnbritton August 5, 2026 13:18
DMRP functionality will be integrated into Tenant rather than existing
as a separate standalone service.
Such requests would have already been rejected during model binding.
This replaces the manual registration of repositories, managers, and
queries, which could eventually drift from `AddDmrpModule`'s
implementation.
@smailliwcs
smailliwcs merged commit 7995790 into dev Aug 6, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants