Skip to content
CAI
Software that uses CAICheck a score

valentinajemuovic/banking-kata-dotnet

79.0

Strong · 21 September 2026

1.1k

lines of production code

C#

primary language

4

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

This system is a .NET-based banking application that manages bank accounts through a clean architecture. It exposes RESTful endpoints to open accounts, view account details, and process deposits and withdrawals. The core logic enforces strict domain validation and uses MediatR to handle use cases, while infrastructure components manage data persistence via Entity Framework Core and generate unique account identifiers.

Features

Add MediatR-based ViewAccount use case

The ViewAccount feature is now implemented as a MediatR request handler. Users can now view account details by providing an account number, which returns the account holder's full name and balance. If the account does not exist, a validation exception is thrown.

src/Optivem.Kata.Banking.Core/UseCases/ViewAccount · high confidence

Added BankAccount and WeatherForecast controllers

Introduced the BankAccountController to expose REST API endpoints for opening and viewing bank accounts, utilizing MediatR for command handling. Additionally, added a default WeatherForecastController to provide a basic weather forecast endpoint.

src/Optivem.Kata.Banking.Web/Controllers · high confidence

Added fake infrastructure components for testing

Introduced a suite of fake implementations to support testing, including a FakeBankAccountRepository that enforces constraints such as preventing duplicate account numbers and disallowing updates to non-existent accounts, alongside dedicated generators for account IDs and numbers, a fake date-time service, and supporting exception classes.

src/Optivem.Kata.Banking.Infrastructure.Fake · high confidence

Implemented WithdrawFunds use case with MediatR integration

Added the WithdrawFunds use case, introducing a new request object (WithdrawFundsRequest) and its corresponding handler (WithdrawFundsUseCase) that implements the MediatR IRequestHandler interface. The handler processes withdrawal requests by validating the account number and amount, interacting with the bank account repository to perform the withdrawal, and returning a VoidResponse.

src/Optivem.Kata.Banking.Core/UseCases/WithdrawFunds · high confidence

Initial ASP.NET Core web application scaffolding

The web project has been initialized with the standard ASP.NET Core template, providing a functional HTTP pipeline. This includes the main entry point (Program.cs) that configures controllers, Swagger/OpenAPI documentation, and HTTPS redirection, alongside default configuration files (appsettings.json) and a sample WeatherForecast model.

src/Optivem.Kata.Banking.Web · high confidence

Initial project structure and documentation for Banking Kata

The repository was initialized with a .NET solution file (Optivem.Kata.Banking.sln) that defines the core, infrastructure, web, and test projects, alongside a CONTRIBUTING.md guide for new contributors. The README was expanded to include setup instructions, build and test commands, and details on using Entity Framework migrations and Stryker mutation testing. Additionally, a test.runsettings file was added to configure environment variables, such as the SQL Server connection string, for the test runner.

(repo-wide) · high confidence

Introduce MediatR-based OpenAccount use case

The OpenAccount feature is now implemented as a MediatR request handler (OpenAccountUseCase) that accepts an OpenAccountRequest containing the account holder's first and last name and initial balance, and returns an OpenAccountResponse with the generated account number. This change shifts the entry point for opening a new account to a clean-architecture use-case layer, decoupling the command from the infrastructure and domain layers.

src/Optivem.Kata.Banking.Core/UseCases/OpenAccount · high confidence

Introduce infrastructure implementations for account ID generation, account number generation, data persistence, and time services

Added new infrastructure components: AccountIdGenerator using the IdGen library to produce unique account identifiers; AccountNumberGenerator using the NUlid library to generate ULID-based account numbers; BankAccountRepository implementing Entity Framework Core for persisting bank account data to a database; and DateTimeService providing the current system time. These changes implement the underlying data access and utility services required by the banking domain.

src/Optivem.Kata.Banking.Infrastructure · medium confidence

Introduces domain models and validation for bank accounts

The domain layer now includes value objects for Money, Balance, TransactionAmount, AccountHolderName, and AccountNumber, each with strict validation (e.g., non-negative balance, positive transaction amounts, non-empty strings). The BankAccount entity enforces constructor validation via Guard extensions, and a Builder pattern is provided for test-friendly construction. Repository and generator interfaces (IBankAccountRepository, IAccountIdGenerator, IAccountNumberGenerator) and a DateTime service interface are added to support account lifecycle and ID generation.

src/Optivem.Kata.Banking.Core/Domain · high confidence

Behavioural changes

Added exception classes and message constants for validation and repository constraints

New exception types (RepositoryException, ValidationException) and corresponding message constants (RepositoryMessages, ValidationMessages) were added to the core library. This introduces structured error handling for validation failures (e.g., empty names, negative balances, non-existent accounts) and repository constraint violations, enabling the application to throw specific exceptions for these business rules.

src/Optivem.Kata.Banking.Core/Exceptions · high confidence

Centralized dependency injection configuration for the banking application

A new extension method, Register, has been added to the CompositionRoot layer to consolidate service registrations. This includes registering domain services such as AccountIdGenerator, AccountNumberGenerator, and DateTimeService, as well as infrastructure components like the BankAccountRepository and the SQL Server DatabaseContext. The configuration now explicitly retrieves the SQL Server connection string from the environment variable SQL\_SERVER\_CONNECTION\_STRING and registers MediatR for the CoreModule.

src/Optivem.Kata.Banking.CompositionRoot · medium confidence

Initial database schema for bank accounts

The application now supports persisting bank account data to a SQL Server database using Entity Framework Core. This change introduces the \BankAccountRecord\ entity, its corresponding EF Core configuration, and the initial migration that creates the \BankAccounts\ table with fields for account number, first name, last name, opening date, and balance.

src/Optivem.Kata.Banking.Infrastructure/Persistence · high confidence

Introduce MediatR-based DepositFunds use case

The DepositFunds feature is now implemented as a MediatR command handler. The \DepositFundsUseCase\ processes a \DepositFundsRequest\ (containing an account number and amount) by validating the account's existence and then calling the domain model's \Deposit\ method. This change shifts the implementation to use the MediatR framework for request handling.

src/Optivem.Kata.Banking.Core/UseCases/DepositFunds · medium confidence

Introduce MediatR-based request/response structure for banking use cases

The application now uses MediatR for handling use cases, starting with the introduction of a core module and a VoidResponse class to support request/response patterns in the banking domain.

src/Optivem.Kata.Banking.Core, src/Optivem.Kata.Banking.Core/UseCases · medium confidence

Introduction of a dedicated AccountId type

The domain model now includes a specific AccountId struct to represent bank account identifiers. This change replaces the previous approach of using raw long values for account identification, providing a more explicit and type-safe way to handle account IDs within the banking core logic.

Optivem.Kata.Banking.Core · high confidence

Test coverage

Added comprehensive test coverage for core domain, use cases, and infrastructure

Added unit and integration tests for the banking domain, including validation for the BankAccount constructor, and end-to-end tests for the OpenAccount, DepositFunds, ViewAccount, and WithdrawFunds use cases. The change also introduces tests for infrastructure components such as the Fake and real implementations of the BankAccountRepository, AccountIdGenerator, AccountNumberGenerator, and DateTimeService. Additionally, architectural and linguistic anti-pattern rules are enforced using ArchUnitNET, and a Stryker mutation testing configuration is included.

test · high confidence

Dependencies

Updated .NET 6.0 project files with new and upgraded dependencies

The project files for the solution's source and test projects have been updated to target .NET 6.0 and include specific package references. The core and composition root projects now reference MediatR (v10.0.1) and Microsoft.EntityFrameworkCore.SqlServer (v6.0.6). The infrastructure project adds IdGen (v3.0.1), Microsoft.EntityFrameworkCore.Design (v6.0.6), and NUlid (v1.7.0). The web project includes Swashbuckle.AspNetCore (v6.3.1). Test projects incorporate xUnit (v2.4.1), FluentAssertions (v6.7.0), Microsoft.NET.Test.Sdk (v17.1.0 or v17.2.0), coverlet.collector (v3.1.2), and ArchUnitNET (v0.10.1).

(dependencies) · high 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 77 → 79 (+1.8)
  • Rubric changed (rubric-2026.08.19 → rubric-2026.09.15) — scores are not directly comparable.

Lenses

  • Code Health 87 → 86 (-1.0)
  • Architecture 77 → 77 (+0.0)
  • Maturity 85 → 85 (+0.0)
  • Readiness 82 → 82 (+0.0)
  • Security 73 → 78 (+4.0)

Resolved (11)

  • Bounded contexts not declared
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • No exposed public API
  • no production source files with tracked history to analyse
  • no production source files with tracked history to analyse
  • redundant comment (src/Optivem.Kata.Banking.CompositionRoot/Extensions/IServiceCollectionExtensions.cs)
  • redundant comment (src/Optivem.Kata.Banking.Infrastructure.Fake/BankAccounts/FakeAccountIdGenerator.cs)
  • redundant comment (src/Optivem.Kata.Banking.Web/Program.cs)
  • redundant comment (src/Optivem.Kata.Banking.Web/Program.cs)

New (14)

  • Documentation: no architecture or design documentation (README.md)
  • Documentation: no usage examples (README.md)
  • End-of-life runtime: .NET net6.0
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • High: security finding (details withheld)
  • Medium: security finding (details withheld)
  • Medium: security finding (details withheld)
  • Medium: security finding (details withheld)
  • No dependency advisory monitoring
  • Workflow token permissions not restricted
  • WriteOnlyPrivateField (src/Optivem.Kata.Banking.Web/Controllers/WeatherForecastController.cs)
  • redundant comment (src/Optivem.Kata.Banking.Web/Program.cs)

API surface

  • Unchanged — 3 HTTP endpoints

Architecture

  • Unchanged — 2 containers · 1 contexts · 0 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

valentinajemuovic/banking-kata-dotnet 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 0ae272cd99547a66e7852a58015c2c9a48534d90 — 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.