EdwinVW/cloud-native-net
45.4
Weak · 21 September 2026
3.5k
lines of production code
C#
primary language
4
measurements over time
What this system is
This system is a contract management service built on an event-sourced architecture, handling the registration, modification, and cancellation of contracts. It enforces business rules and consistency checks through a refactored domain model that utilizes event replay for state rehydration. The codebase is organized into distinct interface and application layers, with a simplified aggregate service interface and standardized persistence mechanisms.
Features
Added class and sequence diagrams for the event-sourced synchronous API
New PlantUML diagrams have been added to the documentation to illustrate the architecture of the event-sourced service. The changes introduce a compact and a detailed class diagram that define the relationships between Entity, AggregateRoot, and Contract classes, along with their interfaces. Additionally, a sequence diagram is provided to visualize the synchronous command flow through the WebAPI, CommandHandler, AggregateService, and related infrastructure components.
src/!docs · high confidence
Behavioural changes
Consolidated contract feature handlers into the Contract aggregate
The separate feature files for contract maintenance (changing amount and term) and contract registration have been removed. This refactoring consolidates the handling of these domain events and commands directly within the Contract aggregate, simplifying the domain structure by reducing the number of folders and files.
src/ContractManagement/Domain/Aggregates/Contract/Features/ContractMaintenance, src/ContractManagement/Domain/Aggregates/Contract/Features/ContractRegistration · medium confidence
Contract cancellation logic removed from the domain aggregate
The implementation for cancelling a contract, including the business rule that prevents cancellation within three years of the contract's end date, has been removed from the Contract aggregate. This change eliminates the ability to cancel contracts through this specific code path, altering the existing cancellation behavior for users.
src/ContractManagement/Domain/Aggregates/Contract/Features/ContractCancellation · medium confidence
Refactor contract aggregate namespace and simplify aggregate service interface
The contract aggregate has been renamed from 'ContractAggregate' to 'Contract' in the domain layer, with corresponding updates to the 'ContractManagement.Domain.Aggregates.Contract' namespace across multiple files. This includes updating the 'DomainEvents' type alias in 'ChangeContractAmountFeature' and 'ChangeContractTermFeature' to reflect the new namespace. Additionally, the 'IAggregateService' interface has been simplified by removing the generic 'EventSourcedEntityId' type parameter, changing from 'IAggregateService\<EventSourcedEntityId, Contract\>' to 'IAggregateService\<Contract\>'. In the output management service, the 'PaymentPeriod' enum has been moved to the new 'Contract' namespace, and integration events 'ContractCancelled' and 'ContractRegistered' have been updated to reflect the namespace change. The 'ContractCancelled' event has also had its 'reason' field removed. These changes affect how contract data is accessed and processed within the application features and output management components.
src/ContractManagement/Application/Features/ContractMaintenance, src/OutputManagement · medium confidence
Refactored AggregateRoot to use event replay and explicit consistency checks
The AggregateRoot base class has been refactored to support event replay for state rehydration, replacing the previous constructor-based initialization. The class now implements a ReplayEvents method to apply domain events and update the version number. Additionally, the IsValid property now checks for business rule violations, and a new EnsureConsistency method allows derived classes to validate aggregate state after applying events.
Common · high confidence
Refactored ContractManagement domain structure and contract handling
The ContractManagement domain has been restructured: command and domain event classes have been moved from feature-specific folders (e.g., ContractRegistration, ContractMaintenance) into a unified Commands and DomainEvents directory under the respective aggregates. The Contract aggregate now uses a standard AggregateRoot base class instead of EventSourcedAggregateRoot, with explicit command handling methods (RegisterContractV2, ChangeContractAmount, ChangeContractTerm, CancelContract) that validate business rules before applying domain events. The domain event handling was refactored from a switch statement with return values to a switch statement with break statements, and an alternative dynamic casting approach was added as a comment. Additionally, a static Undefined property was added to the ContractNumber value object.
ContractManagement · medium confidence
Reorganize contract command namespaces
The namespace for contract-related commands (CancelContract, ChangeContractAmount, ChangeContractTerm, and RegisterContractV2) has been moved from ContractManagement.Domain.Aggregates.ContractAggregate to ContractManagement.Domain.Aggregates.Contract. This change also updates the associated enum namespace from ContractManagement.Domain.Aggregates.ContractAggregate.Enums to ContractManagement.Domain.Aggregates.Contract.Enums. This is a structural reorganization of the codebase.
!Support · medium confidence
Restructure codebase into Interface and Application layers
The project's directory structure has been reorganized to separate concerns: the WebAPI and MessageReceiver services have been moved into a new 'Interface' folder, while application logic and domain models have been consolidated into an 'Application' folder. This refactoring also introduces a new 'Portfolio' aggregate with associated handlers, migrations, and a 'Document' entity, alongside the removal of obsolete controller files and the renaming of exception filters to better reflect their purpose.
src/ContractManagement · high confidence
Simplified generic type parameters for aggregate services and repositories
The aggregate service and repository interfaces and implementations have been refactored to remove the separate generic type parameter for the aggregate ID, simplifying the API. The aggregate ID is now passed as a string rather than a generic type parameter. Additionally, the exception handling for business rule violations has been updated: the \ConsistencyException\ has been renamed to \BusinessRuleViolationException\, and its details are now accessed via a \Violations\ property instead of \Details\. The dependency injection extension methods now accept an \assemblyNamePrefix\ parameter to control which assemblies are scanned for services, replacing the previous hardcoded \CORP\_NAME\ string.
src/Common/Application.Common · high confidence
Simplifies aggregate persistence by removing generic type parameters and custom value types
The aggregate persistence infrastructure is refactored to use simpler, non-generic base classes and interfaces. The \Entity\ and \IAggregateRoot\ interfaces no longer use generic type parameters for IDs, instead standardizing on \string\ for \Id\ and \uint\ for \Version\. Custom value types like \AggregateVersion\ and \EventSourcedEntityId\ are removed in favor of primitive types. The \EFEventSourcedAggregateRepository\ is updated to work with the simplified \AggregateRoot\ and \IEntity\ interfaces, and the \EventEntity\ is updated to use \string\ and \uint\ directly. This change streamlines the domain model and persistence layer by removing unnecessary abstraction layers.
src/Common/Domain.Common · high confidence
Update aggregate service interface and domain event references
The contract cancellation feature now uses a simplified IAggregateService\<Contract\> interface instead of the previous IAggregateService\<EventSourcedEntityId, Contract\>, and the ContractCancelledHandler references the updated domain event namespace. These changes streamline the cancellation workflow by removing unnecessary type parameters and aligning event handling with the new aggregate structure.
src/ContractManagement/Application/Features/ContractCancellation · high confidence
Updated Visual Studio solution file and SDK version
The Visual Studio solution file (CloudNativeNet.sln) has been updated to target Visual Studio 17.3, and the .NET SDK version in global.json has been adjusted from 6.0.300 to 6.0.0. These changes update the development environment configuration for the project.
src · high confidence
Dependencies
Updated project references and upgraded NuGet packages
The MessageReceiver and WebAPI projects have been moved into the Interface folder, with their project references updated to reflect the new directory structure. Additionally, several NuGet packages were upgraded to newer versions: FluentAssertions, FluentValidation.AspNetCore, Microsoft.EntityFrameworkCore (and related packages) to 6.0.10, MassTransit to 8.0.7, Microsoft.NET.Test.Sdk, Moq, MSTest packages, Scrutor, Serilog.AspNetCore, and Swashbuckle.AspNetCore.
(dependencies) · medium confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 45 → 45 (+0.6)
- Rubric changed (rubric-2026.08.18 → rubric-2026.09.15) — scores are not directly comparable.
Lenses
- Code Health 73 → 72 (-1.3)
- Architecture 79 → 79 (+0.0)
- Maturity 57 → 57 (+0.0)
- Readiness 36 → 36 (+0.2)
- Security 37 → 37 (+0.5)
- Domain Modelling 65 → 70 (+5.0)
- Event-Driven 100 → 100 (+0.0)
- Performance 83 → 83 (+0.0)
Resolved (8)
- Ambiguous naming: 'Contract' is used for both a Domain Aggregate (Contract) and a Read Model (Contract). While technically different namespaces, the identical short name can cause confusion regarding which 'Contract' is being referenced in code.
- Bounded contexts not declared
- Coverage not measured — analyzer environment
- Inconsistent method name due to typo: 'CeateFrom' is used in one place while 'CreateFrom' is used in another for the same pattern.
- No exposed public API
- XML-doc coverage: MessageReceiver (src/ContractManagement/Interface/MessageReceiver/MessageReceiver.csproj)
- redundant comment (src/Common/Infrastructure.Common/Persistence/EFCore/WriteModel/EventSourced/EFEventSourcedAggregateRepository.cs)
- single-maintainer — knowledge-concentration (bus factor) risk
New (8)
- Documentation: no installation or build instructions (README.md)
- End-of-life runtime: .NET net6.0
- Medium: security finding (details withheld)
- Typo in method name: CeateFrom is a misspelling of CreateFrom. This is inconsistent with other similar methods like CreateFrom in ContractRegisteredV2 and PortfolioCreated.
- WriteOnlyPrivateField (src/Common/Application.Common/Services/AggregateService.cs)
- WriteOnlyPrivateField (src/Common/Application.Common/Services/AggregateService.cs)
- WriteOnlyPrivateField (src/ContractManagement/Interface/WebAPI/Controllers/QueryController.cs)
- redundant comment (src/Common/Infrastructure.Common/Persistence/EFCore/WriteModel/Relational/EFAggregateRepository.cs)
API surface
- Unchanged — 8 HTTP endpoints
Architecture
- Unchanged — 6 containers · 3 contexts · 1 edges
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
EdwinVW/cloud-native-net was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 21 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit a2e2c01e23ad666bd7b3e704283db798da8da6df — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-28e75b8e3254.