Skip to content

Add civil-daily-cause-list and family-daily-cause-list modules (#594) - #663

Merged
junaidiqbalmoj merged 28 commits into
masterfrom
feature/594-civil-family-daily-cause-list
Jun 12, 2026
Merged

Add civil-daily-cause-list and family-daily-cause-list modules (#594)#663
junaidiqbalmoj merged 28 commits into
masterfrom
feature/594-civil-family-daily-cause-list

Conversation

@junaidiqbalmoj

@junaidiqbalmoj junaidiqbalmoj commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds @hmcts/civil-daily-cause-list module under libs/list-types/civil-daily-cause-list/ with page controller, renderer, PDF generator, JSON schema validator, and English/Welsh translations
  • Adds @hmcts/family-daily-cause-list module under libs/list-types/family-daily-cause-list/ with the same structure
  • Registers both modules in apps/web/src/app.ts and apps/web/package.json, and adds path aliases to the root tsconfig.json
  • Fixes a bug in both renderers where calculateDuration called formatTime after an early return, causing sittings without an end time to never have their time property set

Test plan

  • Run unit tests: yarn workspace @hmcts/civil-daily-cause-list test — 28 tests pass
  • Run unit tests: yarn workspace @hmcts/family-daily-cause-list test — 28 tests pass
  • Run linter: yarn lint — no errors
  • Verify civil daily cause list renders at /civil-daily-cause-list?artefactId=<id>
  • Verify family daily cause list renders at /family-daily-cause-list?artefactId=<id>
  • Toggle Welsh language (?lng=cy) and confirm all text is translated
  • Verify PDF download works for both list types

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Civil and Family Daily Cause List: new public pages, PDF generation, English and Welsh content, and registration in the web app.
  • Tests

    • Extensive unit tests covering validators, renderers, PDF generation and page handlers (success and error paths), plus additional renderer and PDF scenarios.
  • Documentation

    • Implementation checklist and detailed review notes added for Issue 594.

Implements two new list-type modules for civil and family daily cause
lists, each with a page controller, renderer, PDF generator, JSON schema
validator, and full unit test coverage (56 tests).

Also fixes a bug in both renderers where calculateDuration called
formatTime after an early return, preventing sittings without an end
time from having their time property set.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds two list-type libraries (@hmcts/civil-daily-cause-list, @hmcts/family-daily-cause-list) with manifests, runtime configs, TypeScript models, JSON schemas/validators, renderers, Nunjucks pages and PDF templates, PDF generators, unit tests, docs, and registers them in apps/web, Vite, tsconfig and publication registry.

Changes

Civil and Family Daily Cause List

Layer / File(s) Summary
App registration and build wiring
apps/web/package.json, apps/web/src/app.ts, apps/web/vite.build.ts, tsconfig.json, apps/web/src/app.test.ts
Adds the two workspace dependencies, imports module roots/pageRoutes in the web app, extends configureGovuk modulePaths, adds Vite resolve aliases, TS path mappings, and updates a unit test count.
Ticket 594 review and tasks
docs/tickets/594/review.md, docs/tickets/594/tasks.md
Adds a review document enumerating critical/high issues and a tasks checklist for implementation and follow-ups.
Civil package scaffold and contracts
libs/list-types/civil-daily-cause-list/package.json, .../config.ts, .../index.ts, .../models/types.ts, .../tsconfig.json
Introduces the civil list package manifest, runtime config exports, public barrel, TypeScript domain models, and per-package tsconfig.
Civil schema and validator
libs/list-types/civil-daily-cause-list/src/schemas/civil-daily-cause-list.json, .../validation/json-validator.ts, .../validation/json-validator.test.ts
Adds JSON Schema for civil payload and a validator with tests.
Civil rendering, pages, and PDF
.../rendering/renderer.ts, .../rendering/renderer.test.ts, .../pages/*.njk, .../pages/en.ts, .../pages/cy.ts, .../pages/index.ts, .../pages/index.test.ts, .../pdf/*
Adds renderer that enriches JSON for templates, Nunjucks page and PDF templates, Express GET handler, PDF generator and unit tests for renderer/controller/pdf-generator.
Family package scaffold and contracts
libs/list-types/family-daily-cause-list/package.json, .../config.ts, .../index.ts, .../models/types.ts, .../tsconfig.json
Introduces the family list package manifest, runtime config exports, public barrel, TypeScript domain models, and per-package tsconfig.
Family schema and validator
libs/list-types/family-daily-cause-list/src/schemas/family-daily-cause-list.json, .../validation/json-validator.ts, .../validation/json-validator.test.ts
Adds JSON Schema for family payload and a validator with tests.
Family rendering, pages, and PDF
.../rendering/renderer.ts, .../rendering/renderer.test.ts, .../pages/*.njk, .../pages/en.ts, .../pages/cy.ts, .../pages/index.ts, .../pages/index.test.ts, .../pdf/*
Adds renderer that enriches JSON for templates, Nunjucks page and PDF templates, Express GET handler, PDF generator and unit tests for renderer/controller/pdf-generator.
Publication integration
libs/publication/src/processing/service.ts
Registers a CIVIL_DAILY_CAUSE_LIST PDF generator mapping to the new civil PDF generator.

Sequence Diagram(s)

sequenceDiagram
  participant Client as Browser
  participant WebApp as Web App
  participant Prisma as Postgres (Prisma)
  participant Renderer as renderCauseListData
  participant PDFGen as generate{Civil|Family}Pdf
  participant Storage as PDF Storage

  Client->>WebApp: GET /.../daily-cause-list?artefactId=...
  WebApp->>Prisma: fetch artefact & listType
  WebApp->>WebApp: read artefact JSON from temp upload dir
  WebApp->>Renderer: renderCauseListData(jsonData, {locationId, contentDate, locale})
  Renderer-->>WebApp: header, openJustice, listData
  WebApp->>PDFGen: generate*Pdf(options)
  PDFGen->>Storage: savePdfToStorage(artefactId, buffer, sizeBytes)
  Storage-->>PDFGen: confirmation
  WebApp-->>Client: render page or return PDF
Loading

Possibly related issues

  • Style Guide: Implement Civil and Family Daily Cause Lists #594 — Directly implements the civil and family daily cause list modules and registration described in the issue.
  • hmcts/cath-service#601 — Similar module registration changes to apps/web/src/app.ts and related wiring.
  • hmcts/cath-service#600 — Reference implementation pattern for list-type libraries and registrations used here.

Possibly related pull requests

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changeset: it adds two new list-type modules (civil-daily-cause-list and family-daily-cause-list) and references the issue number. Clear, specific, and directly related to the primary changes.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/594-civil-family-daily-cause-list

@github-actions

github-actions Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

🎭 Playwright E2E Test Results

84 tests   52 ✅  4m 7s ⏱️
33 suites  32 💤
 1 files     0 ❌

Results for commit 7970d28.

♻️ This comment has been updated with latest results.

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

🧹 Nitpick comments (2)
libs/list-types/family-daily-cause-list/src/pdf/pdf-generator.ts (1)

55-63: ⚡ Quick win

sizeBytes! guarded by the current generatePdfFromHtml contract (optional hardening)

generatePdfFromHtml sets sizeBytes: pdfBuffer.length whenever it returns success: true and pdfBuffer, so the existing check (!pdfResult.success || !pdfResult.pdfBuffer) already implies sizeBytes is a number at runtime. The type still marks sizeBytes as optional (sizeBytes?: number), so adding an explicit sizeBytes guard is only future-proofing, not a correctness fix.

libs/list-types/civil-daily-cause-list/src/rendering/renderer.test.ts (1)

192-209: ⚡ Quick win

Add a Welsh lastUpdated assertion in the locale test.

This test currently only checks contentDate. Adding one assertion on header.lastUpdated will lock in full Welsh formatting behaviour and catch mixed-language regressions.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cdeddd0b-ebd7-4a04-8efe-cf40bc988bea

📥 Commits

Reviewing files that changed from the base of the PR and between 447a418 and 047ac67.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (41)
  • apps/web/package.json
  • apps/web/src/app.ts
  • docs/tickets/594/review.md
  • docs/tickets/594/tasks.md
  • libs/list-types/civil-daily-cause-list/package.json
  • libs/list-types/civil-daily-cause-list/src/config.ts
  • libs/list-types/civil-daily-cause-list/src/index.ts
  • libs/list-types/civil-daily-cause-list/src/models/types.ts
  • libs/list-types/civil-daily-cause-list/src/pages/civil-daily-cause-list.njk
  • libs/list-types/civil-daily-cause-list/src/pages/cy.ts
  • libs/list-types/civil-daily-cause-list/src/pages/en.ts
  • libs/list-types/civil-daily-cause-list/src/pages/index.test.ts
  • libs/list-types/civil-daily-cause-list/src/pages/index.ts
  • libs/list-types/civil-daily-cause-list/src/pdf/pdf-generator.test.ts
  • libs/list-types/civil-daily-cause-list/src/pdf/pdf-generator.ts
  • libs/list-types/civil-daily-cause-list/src/pdf/pdf-template.njk
  • libs/list-types/civil-daily-cause-list/src/rendering/renderer.test.ts
  • libs/list-types/civil-daily-cause-list/src/rendering/renderer.ts
  • libs/list-types/civil-daily-cause-list/src/schemas/civil-daily-cause-list.json
  • libs/list-types/civil-daily-cause-list/src/validation/json-validator.test.ts
  • libs/list-types/civil-daily-cause-list/src/validation/json-validator.ts
  • libs/list-types/civil-daily-cause-list/tsconfig.json
  • libs/list-types/family-daily-cause-list/package.json
  • libs/list-types/family-daily-cause-list/src/config.ts
  • libs/list-types/family-daily-cause-list/src/index.ts
  • libs/list-types/family-daily-cause-list/src/models/types.ts
  • libs/list-types/family-daily-cause-list/src/pages/cy.ts
  • libs/list-types/family-daily-cause-list/src/pages/en.ts
  • libs/list-types/family-daily-cause-list/src/pages/family-daily-cause-list.njk
  • libs/list-types/family-daily-cause-list/src/pages/index.test.ts
  • libs/list-types/family-daily-cause-list/src/pages/index.ts
  • libs/list-types/family-daily-cause-list/src/pdf/pdf-generator.test.ts
  • libs/list-types/family-daily-cause-list/src/pdf/pdf-generator.ts
  • libs/list-types/family-daily-cause-list/src/pdf/pdf-template.njk
  • libs/list-types/family-daily-cause-list/src/rendering/renderer.test.ts
  • libs/list-types/family-daily-cause-list/src/rendering/renderer.ts
  • libs/list-types/family-daily-cause-list/src/schemas/family-daily-cause-list.json
  • libs/list-types/family-daily-cause-list/src/validation/json-validator.test.ts
  • libs/list-types/family-daily-cause-list/src/validation/json-validator.ts
  • libs/list-types/family-daily-cause-list/tsconfig.json
  • tsconfig.json


Two new list-type modules have been added: `@hmcts/civil-daily-cause-list` and `@hmcts/family-daily-cause-list`. Both are correctly structured under `libs/list-types/` and follow the existing module patterns from comparable modules such as `@hmcts/civil-and-family-daily-cause-list`. Both modules are registered in `apps/web/src/app.ts`, the root `tsconfig.json`, and `apps/web/package.json`. All 28 unit tests pass in each module and the linter reports no issues.

The implementation is broadly solid and consistent with the established codebase conventions. There are no security vulnerabilities or accessibility blockers. However, there are several issues that need attention before deployment: pervasive use of `as any` type casts in the renderer, an unvalidated query parameter used directly in a file-system path, inline `<style>` blocks in templates, and near-total code duplication between the two new modules (and against the existing `civil-and-family` module). There is also a missing `publishedAt` display in both templates despite the translation key being defined, and duration labels are hardcoded English strings in templates that should come from the `t` object.

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Resolve the contradictory security statement.

Line 7 says there are no security vulnerabilities, but the same section and later critical issue #1 describe a path traversal risk. Please align this wording so the risk posture is unambiguous.

Comment thread docs/tickets/594/tasks.md
Comment on lines +40 to +43
- [ ] Add path aliases to root `tsconfig.json`
- [ ] Register modules in `apps/web/src/app.ts`
- [ ] Add packages as dependencies in `apps/web/package.json`

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Update checklist status for completed registration tasks.

These items are implemented in this PR but still marked unchecked. Please mark them as completed to keep ticket tracking accurate.

Comment on lines +114 to +131
{% set durationText = '' %}
{% if sitting.durationAsHours > 0 %}
{% if sitting.durationAsHours > 1 %}
{% set durationText = sitting.durationAsHours ~ ' hours' %}
{% else %}
{% set durationText = sitting.durationAsHours ~ ' hour' %}
{% endif %}
{% endif %}
{% if sitting.durationAsMinutes > 0 %}
{% if durationText | length %}
{% set durationText = durationText ~ ' ' %}
{% endif %}
{% if sitting.durationAsMinutes > 1 %}
{% set durationText = durationText ~ sitting.durationAsMinutes ~ ' mins' %}
{% else %}
{% set durationText = durationText ~ sitting.durationAsMinutes ~ ' min' %}
{% endif %}
{% endif %}

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Localise duration units instead of hard-coding English text.

Lines 117-129 use "hour/hours/min/mins" directly, so Welsh pages still show English duration units.

Suggested direction
- {% set durationText = sitting.durationAsHours ~ ' hours' %}
+ {% set durationText = sitting.durationAsHours ~ ' ' ~ t.hoursPlural %}
...
- {% set durationText = durationText ~ sitting.durationAsMinutes ~ ' min' %}
+ {% set durationText = durationText ~ sitting.durationAsMinutes ~ ' ' ~ t.minutesSingular %}

Add matching keys in en.ts and cy.ts (hoursSingular, hoursPlural, minutesSingular, minutesPlural).

Comment on lines +22 to +24
const artefactId = req.query.artefactId as string;

if (!artefactId) {

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Validate artefactId runtime type before using it.

Line 22 force-casts the query value to string, but Express query values can be arrays/objects. Add a typeof artefactId === "string" guard (and trim/format check) before DB and file operations.

Suggested fix
-  const artefactId = req.query.artefactId as string;
-
-  if (!artefactId) {
+  const artefactIdParam = req.query.artefactId;
+  if (typeof artefactIdParam !== "string" || artefactIdParam.trim().length === 0) {
     return res.status(400).render("errors/common", {
       en,
       cy,
       errorTitle: t.errorTitle,
       errorMessage: t.errorMessage
     });
   }
+  const artefactId = artefactIdParam.trim();
📝 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
const artefactId = req.query.artefactId as string;
if (!artefactId) {
const artefactIdParam = req.query.artefactId;
if (typeof artefactIdParam !== "string" || artefactIdParam.trim().length === 0) {
return res.status(400).render("errors/common", {
en,
cy,
errorTitle: t.errorTitle,
errorMessage: t.errorMessage
});
}
const artefactId = artefactIdParam.trim();

@@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="en">

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Lang attribute should be dynamic based on locale.

The lang attribute is hardcoded to "en", but the template must support Welsh locale. For Welsh PDFs, this should be "cy".

🌍 Suggested fix

Pass the locale parameter to the template (in pdf-generator.ts) and use it:

-<html lang="en">
+<html lang="{{ locale }}">

Comment on lines +71 to +88
{% set durationText = '' %}
{% if sitting.durationAsHours > 0 %}
{% if sitting.durationAsHours > 1 %}
{% set durationText = sitting.durationAsHours ~ ' hours' %}
{% else %}
{% set durationText = sitting.durationAsHours ~ ' hour' %}
{% endif %}
{% endif %}
{% if sitting.durationAsMinutes > 0 %}
{% if durationText | length %}
{% set durationText = durationText ~ ' ' %}
{% endif %}
{% if sitting.durationAsMinutes > 1 %}
{% set durationText = durationText ~ sitting.durationAsMinutes ~ ' mins' %}
{% else %}
{% set durationText = durationText ~ sitting.durationAsMinutes ~ ' min' %}
{% endif %}
{% endif %}

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Duration units are hardcoded in English.

The duration calculation uses hardcoded English strings ("hours", "hour", "mins", "min") instead of the translation object t. Welsh PDFs will incorrectly display English units.

🌍 Suggested fix

Add translation keys for duration units to en.ts and cy.ts, then use them:

  {% if sitting.durationAsHours > 1 %}
-   {% set durationText = sitting.durationAsHours ~ ' hours' %}
+   {% set durationText = sitting.durationAsHours ~ ' ' ~ t.hours %}
  {% else %}
-   {% set durationText = sitting.durationAsHours ~ ' hour' %}
+   {% set durationText = sitting.durationAsHours ~ ' ' ~ t.hour %}
  {% endif %}

Apply the same pattern for t.mins and t.min.

Comment on lines +24 to +38
function formatPublicationDateTime(isoDateTime: string, locale: string): string {
const dt = DateTime.fromISO(isoDateTime).setZone("Europe/London").setLocale(locale);

const dateStr = dt.toFormat("d MMMM yyyy");

const hours = dt.hour;
const minutes = dt.minute;
const period = hours >= 12 ? "pm" : "am";
const hour12 = hours % 12 || 12;

const minuteStr = minutes > 0 ? `:${minutes.toString().padStart(2, "0")}` : "";
const timeStr = `${hour12}${minuteStr}${period}`;

return `${dateStr} at ${timeStr}`;
}

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

lastUpdated is not fully localised for Welsh.

The formatted value always inserts "at", so Welsh output mixes languages.

Suggested fix
 function formatPublicationDateTime(isoDateTime: string, locale: string): string {
   const dt = DateTime.fromISO(isoDateTime).setZone("Europe/London").setLocale(locale);
@@
-  return `${dateStr} at ${timeStr}`;
+  const connector = locale === "cy" ? "am" : "at";
+  return `${dateStr} ${connector} ${timeStr}`;
 }

Comment thread libs/list-types/family-daily-cause-list/src/rendering/renderer.ts Outdated
Comment on lines +79 to +85
"isPresiding": {
"description": "A flag to indicate whether a judiciary is presiding",
"title": "Is Presiding",
"type": "boolean",
"examples": [true],
"default": ""
}

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix invalid default value for boolean field.

The isPresiding boolean field has a default value of "" (empty string). Boolean fields must have boolean default values (true or false) or omit the default entirely.

🛠️ Proposed fix
         "isPresiding": {
           "description": "A flag to indicate whether a judiciary is presiding",
           "title": "Is Presiding",
           "type": "boolean",
           "examples": [true],
-          "default": ""
+          "default": false
         }
📝 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
"isPresiding": {
"description": "A flag to indicate whether a judiciary is presiding",
"title": "Is Presiding",
"type": "boolean",
"examples": [true],
"default": ""
}
"isPresiding": {
"description": "A flag to indicate whether a judiciary is presiding",
"title": "Is Presiding",
"type": "boolean",
"examples": [true],
"default": false
}

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

♻️ Duplicate comments (1)
libs/list-types/civil-daily-cause-list/src/pages/civil-daily-cause-list.njk (1)

123-135: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Localise duration units via translation keys, not hard-coded English literals.

'hours'/'hour'/'mins'/'min' are still embedded in the template, so Welsh pages will render mixed language output for durations.

As per coding guidelines and learnings, pages must support both English and Welsh content passed from controllers.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d1a47396-30a5-4769-a07f-4d236c415441

📥 Commits

Reviewing files that changed from the base of the PR and between ce147cf and f1a52b6.

📒 Files selected for processing (14)
  • apps/web/src/app.test.ts
  • libs/list-types/civil-daily-cause-list/src/pages/civil-daily-cause-list.njk
  • libs/list-types/civil-daily-cause-list/src/pages/cy.ts
  • libs/list-types/civil-daily-cause-list/src/pages/en.ts
  • libs/list-types/civil-daily-cause-list/src/pages/index.test.ts
  • libs/list-types/civil-daily-cause-list/src/pdf/pdf-template.njk
  • libs/list-types/civil-daily-cause-list/src/rendering/renderer.test.ts
  • libs/list-types/family-daily-cause-list/src/pages/cy.ts
  • libs/list-types/family-daily-cause-list/src/pages/en.ts
  • libs/list-types/family-daily-cause-list/src/pages/family-daily-cause-list.njk
  • libs/list-types/family-daily-cause-list/src/pages/index.test.ts
  • libs/list-types/family-daily-cause-list/src/pdf/pdf-template.njk
  • libs/list-types/family-daily-cause-list/src/rendering/renderer.test.ts
  • libs/publication/src/processing/service.ts
💤 Files with no reviewable changes (2)
  • libs/list-types/civil-daily-cause-list/src/pages/en.ts
  • libs/list-types/civil-daily-cause-list/src/pages/cy.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • libs/list-types/civil-daily-cause-list/src/pdf/pdf-template.njk
  • libs/publication/src/processing/service.ts
  • libs/list-types/family-daily-cause-list/src/pages/index.test.ts
  • libs/list-types/family-daily-cause-list/src/pages/en.ts
  • libs/list-types/family-daily-cause-list/src/pages/family-daily-cause-list.njk
  • libs/list-types/family-daily-cause-list/src/pdf/pdf-template.njk
  • libs/list-types/civil-daily-cause-list/src/pages/index.test.ts

Comment thread libs/list-types/civil-daily-cause-list/src/rendering/renderer.test.ts Outdated
Comment thread libs/list-types/family-daily-cause-list/src/rendering/renderer.test.ts Outdated
junaidiqbalmoj and others added 2 commits June 4, 2026 10:05
…ation dependencies

The publication service imports from @hmcts/civil-daily-cause-list and
@hmcts/family-daily-cause-list but these were missing from package.json,
causing the API to crash on startup with ERR_MODULE_NOT_FOUND.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ause-list dependencies

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 4, 2026

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.

junaidiqbalmoj and others added 2 commits June 4, 2026 13:57
…ause list

- Replace duplicate renderer.ts in civil-daily-cause-list and family-daily-cause-list
  with re-exports from the shared civil-and-family-daily-cause-list module, eliminating
  the 17.7% code duplication that was blocking the quality gate
- Replace duplicate models/types.ts in both modules with re-exports from the shared module
- Fix calculateDuration in shared renderer to set sitting time before early return,
  restoring correct behaviour when sittingEnd is absent
- Replace unnecessary non-null assertions (sizeBytes!) with nullish coalescing
- Add @hmcts/civil-and-family-daily-cause-list as explicit dependency in both packages

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jun 4, 2026

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.

@@ -0,0 +1 @@
export { renderCauseListData } from "@hmcts/civil-and-family-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.

It is a bit odd to call the method in an independent lib this way. If Civil, Family and Mixed List share the same renderer. Is that not better to add all of them to the same lib?

Can we ask AI and see what he can do?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Move render functionality into one libs and all three lists are now calling common render class.

@github-actions

github-actions Bot commented Jun 5, 2026

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.

@junaidiqbalmoj
junaidiqbalmoj requested a review from KianKwa June 5, 2026 11:26
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@junaidiqbalmoj
junaidiqbalmoj merged commit 13e8969 into master Jun 12, 2026
24 of 25 checks passed
@junaidiqbalmoj
junaidiqbalmoj deleted the feature/594-civil-family-daily-cause-list branch June 12, 2026 18:33
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.

2 participants