Skip to content

Feature-805 - Add Financial List (ChD/KB) daily cause list - #929

Merged
alao-daniel merged 7 commits into
masterfrom
Feature-805-financial-List-(ChD/KB)-daily-cause-list
Aug 18, 2026
Merged

Feature-805 - Add Financial List (ChD/KB) daily cause list#929
alao-daniel merged 7 commits into
masterfrom
Feature-805-financial-List-(ChD/KB)-daily-cause-list

Conversation

@alao-daniel

@alao-daniel alao-daniel commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Jira link

#805

Change description

implement Financial List (ChD/KB) daily cause list style guide + PDF
closes #805

Checklist

  • commit messages are meaningful and follow good commit message guidelines
  • README and other documentation has been updated / added (if needed)
  • tests have been updated / new tests has been added (if needed)
  • Does this PR introduce a breaking change

Summary by CodeRabbit

  • New Features

    • Added the Financial List (Chancery Division/King’s Bench) daily cause list.
    • Published daily cause lists in English and Welsh, with hearing details, search controls, guidance and empty-list messaging.
    • Added downloadable PDF versions and support for Excel-uploaded list data.
    • Added email summaries for newly published lists.
  • Bug Fixes

    • Added validation and clear error handling for invalid or unsupported list data.
  • Documentation

    • Added implementation plans, acceptance criteria, task tracking and review documentation.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review available on request

  • 🔍 Trigger review

Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment @coderabbitai review to review the latest changes. For a full review, comment @coderabbitai full review.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 249e9b2e-68be-46bc-94c3-a6b224b14d6a

📝 Walkthrough

Walkthrough

Adds the Financial List CHD/KB daily cause-list module. It supports Excel conversion, validation, bilingual web rendering, PDF generation, notifications, publication processing, and application registration.

Changes

Financial List CHD/KB daily cause list

Layer / File(s) Summary
Ticket and implementation record
docs/tickets/805/*
Adds the ticket specification, technical plan, implementation checklist, and review record.
Module contract and Excel conversion
libs/list-types/common/src/list-type-data.ts, libs/list-types/financial-list-chd-kb-daily-cause-list/*, tsconfig.json
Defines the list type, package exports, shared CHD/KB conversion configuration, validation constraints, and public module exports.
Localised rendering and web view
libs/list-types/financial-list-chd-kb-daily-cause-list/src/locales/*, libs/list-types/financial-list-chd-kb-daily-cause-list/src/rendering/*, apps/web/src/pages/(list-types)/financial-list-chd-kb-daily-cause-list/*
Adds English and Welsh content, rendering logic, the Nunjucks page, and coverage for hearing data, empty states, metadata, and translations.
Web handler and application integration
apps/web/package.json, apps/web/src/app.ts, apps/web/src/pages/(admin)/*, apps/web/src/pages/(list-types)/financial-list-chd-kb-daily-cause-list/index.*
Adds the GET handler, module paths, upload converter registration, dependency wiring, validation, locale selection, error handling, and provenance resolution.
PDF, notification, and publication outputs
libs/list-types/financial-list-chd-kb-daily-cause-list/src/pdf/*, libs/publication/*, libs/notifications/*
Adds PDF rendering and storage, then registers PDF generation and email summary handling for the new list type.

Sequence Diagram(s)

sequenceDiagram
  participant Admin
  participant Converter
  participant Database
  participant GETHandler
  participant Renderer
  participant Page
  Admin->>Converter: Upload Excel cause list
  Converter->>Database: Store validated JSON artefact
  GETHandler->>Database: Load hearing-list artefact
  GETHandler->>Renderer: Provide hearings, locale, dates, and provenance
  Renderer->>Page: Render localised cause list
Loading

Possibly related issues

  • hmcts/cath-service issue 601: Covers the same Financial List CHD/KB module registration, rendering, PDF, localisation, and testing work.
  • hmcts/cath-service issue 600: Covers a closely related Chancery Division daily cause-list implementation pattern.
  • hmcts/cath-service issue 613: Covers similar hearing-list module wiring across validation, rendering, PDF generation, and web routes.

Possibly related PRs

  • hmcts/cath-service#913: Implements parallel CHD/KB daily cause-list wiring, conversion, rendering, PDF, notification, and publication registration.
  • hmcts/cath-service#761: Establishes similar registration patterns for a new Financial List module.
  • hmcts/cath-service#856: Adds a similar Nunjucks daily cause-list template test approach.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Linked Issues check ❓ Inconclusive The changes cover schema, upload conversion, rendering, localisation and PDF output, but the evidence does not verify Excel downloads or all court registrations. Confirm the Business and Property Courts, Civil jurisdiction and Royal Courts of Justice Group registrations, and verify the Excel download implementation.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the addition of the Financial List (ChD/KB) daily cause list.
Out of Scope Changes check ✅ Passed The code and documentation changes relate to implementing and registering the Financial List (ChD/KB) daily cause list.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Feature-805-financial-List-(ChD/KB)-daily-cause-list

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.

@alao-daniel
alao-daniel changed the base branch from feature/803-companies-winding-up-chd-list to master August 10, 2026 13:23
…al-List-(ChD/KB)-daily-cause-list

# Conflicts:
#	apps/web/package.json
#	libs/list-types/common/src/list-type-data.ts
#	libs/publication/src/processing/service.ts
#	yarn.lock

@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: 9


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 5f89f03a-6479-46ea-af9b-997ea552c7f5

📥 Commits

Reviewing files that changed from the base of the PR and between df61527 and 80041b0.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (31)
  • apps/web/package.json
  • apps/web/src/app.ts
  • apps/web/src/pages/(admin)/non-strategic-upload-summary/index.ts
  • apps/web/src/pages/(admin)/non-strategic-upload/index.ts
  • apps/web/src/pages/(list-types)/financial-list-chd-kb-daily-cause-list/financial-list-chd-kb-daily-cause-list.njk
  • apps/web/src/pages/(list-types)/financial-list-chd-kb-daily-cause-list/financial-list-chd-kb-daily-cause-list.njk.test.ts
  • apps/web/src/pages/(list-types)/financial-list-chd-kb-daily-cause-list/index.test.ts
  • apps/web/src/pages/(list-types)/financial-list-chd-kb-daily-cause-list/index.ts
  • docs/tickets/805/plan.md
  • docs/tickets/805/review.md
  • docs/tickets/805/tasks.md
  • docs/tickets/805/ticket.md
  • libs/list-types/common/src/list-type-data.ts
  • libs/list-types/financial-list-chd-kb-daily-cause-list/package.json
  • libs/list-types/financial-list-chd-kb-daily-cause-list/src/config.ts
  • libs/list-types/financial-list-chd-kb-daily-cause-list/src/conversion/financial-list-chd-kb-daily-cause-list-config.test.ts
  • libs/list-types/financial-list-chd-kb-daily-cause-list/src/conversion/financial-list-chd-kb-daily-cause-list-config.ts
  • libs/list-types/financial-list-chd-kb-daily-cause-list/src/index.ts
  • libs/list-types/financial-list-chd-kb-daily-cause-list/src/locales/cy.ts
  • libs/list-types/financial-list-chd-kb-daily-cause-list/src/locales/en.ts
  • libs/list-types/financial-list-chd-kb-daily-cause-list/src/pdf/pdf-generator.test.ts
  • libs/list-types/financial-list-chd-kb-daily-cause-list/src/pdf/pdf-generator.ts
  • libs/list-types/financial-list-chd-kb-daily-cause-list/src/pdf/pdf-template.njk
  • libs/list-types/financial-list-chd-kb-daily-cause-list/src/rendering/renderer.test.ts
  • libs/list-types/financial-list-chd-kb-daily-cause-list/src/rendering/renderer.ts
  • libs/list-types/financial-list-chd-kb-daily-cause-list/tsconfig.json
  • libs/notifications/package.json
  • libs/notifications/src/notification/notification-service.ts
  • libs/publication/package.json
  • libs/publication/src/processing/service.ts
  • tsconfig.json

Comment thread apps/web/package.json
"@hmcts/et-daily-list": "workspace:*",
"@hmcts/et-fortnightly-list": "workspace:*",
"@hmcts/family-daily-cause-list": "workspace:*",
"@hmcts/financial-list-chd-kb-daily-cause-list": "workspace:*",

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Pin the workspace dependency.

"workspace:*" does not identify a dependency version. Set this dependency to the declared package version by using the repository-approved workspace version format.

As per coding guidelines, “pin dependency versions”.

Source: Coding guidelines

Comment on lines +287 to +312
describe("Welsh rendering", () => {
it("should render Welsh headings, table headers and labels", () => {
const { $ } = renderPage({ hearings: [buildHearing({ judge: "Barnwr A", venue: "Lleoliad A" })] }, cy);

expect($("h1#top").text()).toContain(cy.pageTitle);
expect($(".govuk-grid-column-full").text()).toContain(cy.venueName);
expect($("h2.govuk-heading-s").text()).toContain(cy.searchCasesTitle);

// The Welsh pageTitle placeholder contains double quotes, so query the table by class
// rather than by its aria-label (which would break the CSS attribute selector).
const headers = $(".hearings-table thead th")
.map((_, el) => $(el).text().trim())
.get();
expect(headers).toContain(cy.tableHeaders.judge);
expect(headers).toContain(cy.tableHeaders.time);
expect(headers).toContain(cy.tableHeaders.venue);
expect(headers).toContain(cy.tableHeaders.caseNumber);

const firstRowCells = $(".hearings-table tbody tr")
.eq(0)
.find("td")
.map((_, el) => $(el).text().trim())
.get();
expect(firstRowCells[COLUMN.judge]).toBe("Barnwr A");
expect($(".back-to-top a").text()).toContain(cy.backToTop);
});

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Test Welsh content through the locale query.

This test injects cy into the template. It does not test the i18n middleware or the ?lng=cy route contract. Add a route-level test that requests ?lng=cy and asserts Welsh page content.

As per coding guidelines, “Test Welsh page content using the ?lng=cy query parameter.”

Source: Coding guidelines

Comment on lines +103 to +106
vi.mocked(getArtefactById).mockResolvedValue(mockArtefact as any);
vi.mocked(getPublicationJson).mockResolvedValue(mockJsonData);
mockValidate.mockReturnValue({ isValid: true, errors: [] });
vi.mocked(renderFinancialListChdKbDailyCauseList).mockReturnValue(mockRenderedData as any);

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Remove the unjustified any casts.

These casts prevent TypeScript from checking the artefact and rendered-data contracts. Define complete typed fixtures or type-safe test doubles instead.

As per coding guidelines, “Do not use any without justification; TypeScript strict mode is required.”

Also applies to: 187-187, 214-214, 244-244, 306-309, 347-350, 387-390, 425-428

Source: Coding guidelines

Comment on lines +51 to +60
Statement coverage per changed workspace (`vitest run --coverage`):

| Workspace | Statements | Status |
|-----------|-----------|--------|
| `libs/list-types/financial-list-chd-kb-daily-cause-list` | 90.9% | ✅ |
| `libs/notifications` | 90.53% | ✅ |
| `libs/publication` | 96.5% | ✅ |
| `apps/web` (new controller) | 31 tests pass; filtered run shows 44% only because it reports the shared `list-type-handler.ts`, not the new controller | ✅ (advisory) |

Note on `apps/web`: the filtered coverage number reflects the shared `list-type-handler.ts` helper (partially exercised by a single filtered run), not the new page controller, whose 31 tests all pass. The new controller itself is thin and fully exercised by `index.test.ts`. Not flagged as below-threshold since the new code is well covered.

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.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Correct the overall coverage statement.

The coverage table reports apps/web at 44% for the filtered run, but line 93 states that all workspace coverage is above 80%. The note explains the scope limitation, but it does not make the aggregate statement accurate. Replace the claim with a scoped statement that distinguishes the new controller tests from workspace coverage.

Also applies to: 89-93

🧰 Tools
🪛 LanguageTool

[uncategorized] ~60-~60: Possible missing comma found.
Context: ...y index.test.ts. Not flagged as below-threshold since the new code is well covered. ##...

(AI_HYDRA_LEO_MISSING_COMMA)

Comment on lines +77 to +82
Reference style guide (staging):
`https://pip-frontend.staging.platform.hmcts.net/financial-list-chd-kb-daily-cause-list?artefactId=bb5307f2-e0fd-4d72-8ae8-b72457413eb8`

This list follows the same flat single-table pattern used by the RCJ standard daily cause lists (`libs/list-types/rcj-standard-daily-cause-list`), but with a distinct field set. It **cannot** reuse `RCJ_EXCEL_CONFIG` because the columns differ (`type` not `hearingType`, `caseName` not `caseDetails`, and both `caseNumber` and `caseName` are present). It therefore requires its own module, schema, model, Excel config, renderer, and PDF generator.

**Reference implementation to mirror:** `libs/list-types/rcj-standard-daily-cause-list/` and its page controller at `apps/web/src/pages/(list-types)/rcj-standard-daily-cause-list/`.

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Align the ticket with the shared ChD/KB module design.

This section requires a bespoke schema, model, Excel configuration, and validation module. The current plan and review record define a thin wrapper over @hmcts/chd-kb-common with no local schemas/, validation/, or models/ directories. Keeping both designs can cause duplicate validation contracts and schema drift. Update the ticket to describe the shared-module approach.

Also applies to: 209-238

Comment thread docs/tickets/805/ticket.md
Comment on lines +295 to +309
**A. Excel-to-JSON conversion config** — a new `ExcelConverterConfig` (do **not** reuse `RCJ_EXCEL_CONFIG`), with columns in the required order and `validateNoHtmlTags` on text fields plus `validateTimeFormat` on `Time`:

| Header | fieldName | required | validators |
|--------|-----------|----------|------------|
| Judge | `judge` | true | `validateNoHtmlTags` |
| Time | `time` | true | `validateTimeFormat` |
| Venue | `venue` | true | `validateNoHtmlTags` |
| Type | `type` | true | `validateNoHtmlTags` |
| Case Number | `caseNumber` | true | `validateNoHtmlTags` |
| Case Name | `caseName` | true | `validateNoHtmlTags` |
| Additional Information | `additionalInformation` | false | `validateNoHtmlTags` |

`minRows: 1`. Register with `registerConverterByName("FINANCIAL_LIST_CHD_KB_DAILY_CAUSE_LIST", converter)`.

**B. JSON Schema** (`schemas/financial-list-chd-kb-daily-cause-list.json`), draft-07, root `type: array`, required `judge`, `time`, `venue`, `type`, `caseNumber`, `caseName`, `additionalInformation`.

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Document additionalInformation as required.

Line 305 marks additionalInformation as optional, but libs/list-types/chd-kb-common/src/conversion/chd-kb-excel-config.test.ts:30-34 expects an empty value to be rejected. Line 309 also lists the field as required in the JSON schema. Set the Excel configuration entry to true.

Proposed documentation fix
-| Additional Information | `additionalInformation` | false | `validateNoHtmlTags` |
+| Additional Information | `additionalInformation` | true  | `validateNoHtmlTags` |
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**A. Excel-to-JSON conversion config** — a new `ExcelConverterConfig` (do **not** reuse `RCJ_EXCEL_CONFIG`), with columns in the required order and `validateNoHtmlTags` on text fields plus `validateTimeFormat` on `Time`:
| Header | fieldName | required | validators |
|--------|-----------|----------|------------|
| Judge | `judge` | true | `validateNoHtmlTags` |
| Time | `time` | true | `validateTimeFormat` |
| Venue | `venue` | true | `validateNoHtmlTags` |
| Type | `type` | true | `validateNoHtmlTags` |
| Case Number | `caseNumber` | true | `validateNoHtmlTags` |
| Case Name | `caseName` | true | `validateNoHtmlTags` |
| Additional Information | `additionalInformation` | false | `validateNoHtmlTags` |
`minRows: 1`. Register with `registerConverterByName("FINANCIAL_LIST_CHD_KB_DAILY_CAUSE_LIST", converter)`.
**B. JSON Schema** (`schemas/financial-list-chd-kb-daily-cause-list.json`), draft-07, root `type: array`, required `judge`, `time`, `venue`, `type`, `caseNumber`, `caseName`, `additionalInformation`.
**A. Excel-to-JSON conversion config** — a new `ExcelConverterConfig` (do **not** reuse `RCJ_EXCEL_CONFIG`), with columns in the required order and `validateNoHtmlTags` on text fields plus `validateTimeFormat` on `Time`:
| Header | fieldName | required | validators |
|--------|-----------|----------|------------|
| Judge | `judge` | true | `validateNoHtmlTags` |
| Time | `time` | true | `validateTimeFormat` |
| Venue | `venue` | true | `validateNoHtmlTags` |
| Type | `type` | true | `validateNoHtmlTags` |
| Case Number | `caseNumber` | true | `validateNoHtmlTags` |
| Case Name | `caseName` | true | `validateNoHtmlTags` |
| Additional Information | `additionalInformation` | true | `validateNoHtmlTags` |
`minRows: 1`. Register with `registerConverterByName("FINANCIAL_LIST_CHD_KB_DAILY_CAUSE_LIST", converter)`.
**B. JSON Schema** (`schemas/financial-list-chd-kb-daily-cause-list.json`), draft-07, root `type: array`, required `judge`, `time`, `venue`, `type`, `caseNumber`, `caseName`, `additionalInformation`.

Comment on lines +26 to +29
"@hmcts/chd-kb-common": "workspace:*",
"@hmcts/list-types-common": "workspace:*",
"@hmcts/pdf-generation": "workspace:*",
"@hmcts/postgres-prisma": "workspace:*",

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.

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

for file in \
  libs/list-types/financial-list-chd-kb-daily-cause-list/package.json \
  libs/publication/package.json \
  libs/notifications/package.json
do
  echo "== $file =="
  jq -r '
    (.dependencies // {} | to_entries[] | select(.value == "workspace:*") | "\(.key)=\(.value)"),
    (.peerDependencies // {} | to_entries[] | select(.value | test("[*^~]")) | "\(.key)=\(.value)")
  ' "$file"
done

Repository: hmcts/cath-service

Length of output: 4702


Pin dependency declarations in these package manifests.

These package.json files still use unbounded dependency versions. Replace workspace:* entries with exact package versions, and keep Express entries as exact Express 5.x versions.

  • libs/list-types/financial-list-chd-kb-daily-cause-list/package.json: pin its workspace dependencies and express peer dependency (currently ^5.1.0).
  • libs/publication/package.json: pin the @hmcts/financial-list-chd-kb-daily-cause-list dependency.
  • libs/notifications/package.json: pin the @hmcts/financial-list-chd-kb-daily-cause-list dependency.
📍 Affects 3 files
  • libs/list-types/financial-list-chd-kb-daily-cause-list/package.json#L26-L29 (this comment)
  • libs/list-types/financial-list-chd-kb-daily-cause-list/package.json#L40-L41
  • libs/publication/package.json#L40-L40
  • libs/notifications/package.json#L37-L37

Source: Coding guidelines

() => import("../locales/cy.js")
);

const provenanceLabel = options.provenance ? PROVENANCE_LABELS[options.provenance as keyof typeof PROVENANCE_LABELS] || options.provenance : "";

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use the locale-specific provenance label.

This lookup does not use options.locale. A Welsh PDF can therefore show the English data-source label. Resolve the label from the selected locale’s provenanceLabels, then fall back to the raw provenance value. Add Welsh provenance coverage to the PDF test.

@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

@github-actions

github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

🎭 Playwright E2E Test Results

82 tests   52 ✅  6m 22s ⏱️
31 suites  30 💤
 1 files     0 ❌

Results for commit 99068ac.

♻️ This comment has been updated with latest results.

@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment Successful 🚀

Your preview environment is ready:

The environment will be automatically cleaned up when this PR is closed.

@alao-daniel
alao-daniel merged commit 63b139c into master Aug 18, 2026
25 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.

Financial List (ChD/KB) daily cause list

2 participants