job-ledger-export
Nightly console job that performs the full ledger export from backoffice (Accounts) to the ledger API for all companies or a specified company, with a separate import-only variant.
Health score
0 to 100 across seven weighted factors; nothing is hidden. Green is 75 and above, amber 50 to 74, red below 50. How scoring works.
Facts
| Languages | csharp |
| Frameworks | Microsoft.Extensions.Hosting 10, McMaster.Extensions.CommandLineUtils 4 |
| Runtimes | .NET 8 |
| Tests / CI | none / CI in place |
| Last commit | 2026-02-16 |
| Owner | Owner unknown (mapping to be curated) |
| Domain | Payments and finance (system generated; curate in repo-owners.json to override) |
| Product area | Phenix |
| Hosted | On-prem Deployed to our own machines
|
| Releases | 1 release pipeline(s): \finance\jobs\job-ledger-export CI |
| Integration | rest |
| Source | Open in Azure DevOps |
Dependencies in context
Entanglement
loose No binding mechanisms apply: this system needs no untangling work.
Depends on / used by
Migration playbooks
Generated from this repo's assessment data: what is feasible, what blocks it, and the steps in order. Ratings: green means actionable now, amber means sequence other work first, red means blocked, grey means not applicable.
ZDD adoption
Needs workFeasible through the Workflow Engine's rolling drain, but real preparation is needed: dual-version discipline, better tests, or schema care before at-will release is sensible. No automated tests yet.
- Adopt the four-stage discipline from the ZDD engineering standard: pre-deployment compatibility, deployment, feature activation behind a flag, post-release cleanup.
- Raise automated test coverage first: ZDD trades the end-of-sprint manual gate for continuous automated confidence, so the tests are the entry ticket.
- Make every change dual-version safe: backwards-compatible APIs (new major version for breaking wire changes), expand and contract for any schema change, and consumers tolerant of unknown fields.
- Wrap behaviour changes in feature flags so code deploys dark and release becomes a business decision, not a deployment event.
- Route deployments through the Workflow Engine's automated drain, deploy, health-check, return cycle (the path proven by the first automated production run in mid-2026).
- Verify with area-scoped regression rather than the whole-platform cycle, and watch error rates after rollout with automated rollback on alert.
SQL Server exit
Not applicableNo SQL Server dependency is recorded for this repo. Nothing to migrate.
Containerisation
Ready to containeriseModern runtime, no hosted legacy transport: this service can follow the estate's proven container path (Dockerfile, shared pipeline template, ECS via Terraform).
- Add a Dockerfile and make the app read all configuration from environment variables and the secrets manager, never from machine-local files.
- Log to stdout and expose a health check endpoint so ECS can supervise it.
- Adopt the shared ci.yml pipeline template with the container parameters (awsRegion, containerAfterBuild, ecsTerraformRepo), which is exactly how the estate's existing AWS services deploy.
- Define the service in the Terraform repo, deploy to a non-production environment, then shift traffic and disarm the deployment-group release pipeline.
Recommended actions
No specific actions for this repo. It either needs only normal maintenance, or its work is covered by an estate-level action. See the full programme.
Assessment notes
job-ledger-export
Purpose
Command-line job intended to run nightly that exports the ledger from backoffice (Accounts) into the ledger API. It supports --environment (datafixqa/qa/liveproviderqa/preproduction/live) and --company (UK/NL/BE/IE/AU/ZA/AE) arguments. The solution builds two executables: LedgerExportJob (export then import) and LedgerImportOnlyJob (re-runs the import step for an existing ledger export id).
Tech stack
- C# on .NET 8 across three projects:
LedgerExportJob,LedgerImportOnlyJob, and sharedLedgerExportJob.Common. - Generic host (
Microsoft.Extensions.Hosting10) with aConsoleHostedService, McMaster CommandLineUtils for argument parsing, and per-environmentappsettings.*.jsonfiles. - Internal clients:
TC.Ledger.Api.Client5.2 (NSwag-generated,BackOfficeIntegration_CreateLedgerExport*operations),TC.Commission.Service.Api7.3, andTC.ConnectionBroker1.20 for environment resolution.
Deployment
Prod application with 1 release. Build pipelines job-ledger-export and job-ledger-export CI (YAML build.yml using shared InternalOSS/azure-pipelines-templates, .NET SDK 8.x, publishing both apps) feeding release pipeline \finance\jobs\job-ledger-export CI.
Dependencies
- Internal: calls the ledger API (
backoffice-ledger-service) and the commission service (backoffice-commissions-service) via their published client packages; also usesTC.ConnectionBroker.*andTC.Exceptions.WebApiClient. - Third-party: McMaster.Extensions.CommandLineUtils only; no external SaaS integrations.
Data stores
None accessed directly; ledger and commission data are read/written through the internal REST APIs.
Integration points
- REST/HTTP calls to the ledger API and commission service using typed HttpClient accessors registered through
Microsoft.Extensions.Httpand ConnectionBroker.
Code health
- No test projects in the repo; logic is mostly orchestration around generated API clients.
- Modern, clean codebase (nullable enabled, primary constructors) with template-based YAML CI. Last commit 2026-02-16.
Modernisation risks
- Lack of automated tests is the main gap; a regression in export/import orchestration would only surface at runtime.
- Otherwise low risk: current runtime, template CI, thin REST-client logic. Risk is concentrated in the downstream ledger and commission APIs rather than this job.