Skip to content

Feature/645 Add PHT Weekly hearing List style guide and PDF - #851

Merged
junaidiqbalmoj merged 11 commits into
masterfrom
feature/645-PHT-Weekly-Hearing-List
Jul 17, 2026
Merged

Feature/645 Add PHT Weekly hearing List style guide and PDF#851
junaidiqbalmoj merged 11 commits into
masterfrom
feature/645-PHT-Weekly-Hearing-List

Conversation

@KianKwa

@KianKwa KianKwa commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Jira link

#645

Change description

Add PHT Weekly hearing List style guide and PDF

Testing done

Security Vulnerability Assessment

CVE Suppression: Are there any CVEs present in the codebase (either newly introduced or pre-existing) that are being intentionally suppressed or ignored by this commit?

  • Yes
  • No

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 Primary Health Tribunal weekly hearing list, including a new searchable web page with English/Welsh content, plus PDF generation and Excel-to-list conversion.
    • Extended notifications and publication PDF generation to support the new list type, including email summaries.
  • Bug Fixes
    • Improved non-strategic upload sensitivity defaults to use each list type’s configured default.
  • Tests
    • Added automated test coverage for the controller, rendering, JSON validation, email summary builder, and PDF generator.
  • Documentation
    • Added technical planning and task checklists for the new list type.

@coderabbitai

coderabbitai Bot commented Jul 13, 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d5928459-d1f8-479e-a5ea-6ca531a6590c

📥 Commits

Reviewing files that changed from the base of the PR and between 33f139e and f9945f7.

📒 Files selected for processing (3)
  • apps/web/package.json
  • libs/list-types/pht-weekly-hearing-list/src/index.ts
  • libs/list-types/pht-weekly-hearing-list/src/rendering/renderer.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • apps/web/package.json
  • libs/list-types/pht-weekly-hearing-list/src/index.ts
  • libs/list-types/pht-weekly-hearing-list/src/rendering/renderer.test.ts

📝 Walkthrough

Walkthrough

Adds the PHT Weekly Hearing List module with validation, localisation, Excel conversion, web rendering, PDF generation, email summaries, metadata registration, and service integration.

Changes

PHT Weekly Hearing List

Layer / File(s) Summary
Module contracts and package foundation
libs/list-types/pht-weekly-hearing-list/*, docs/tickets/645/*
Defines hearing models, schema, locales, package exports, Excel conversion, email summary extraction, and implementation documentation.
Validation and hearing-list rendering
libs/list-types/pht-weekly-hearing-list/src/validation/*, libs/list-types/pht-weekly-hearing-list/src/rendering/*
Validates hearing-list data and formats dates, times, headers, and hearing rows for English and Welsh output.
Web controller and page delivery
apps/web/src/pages/(list-types)/pht-weekly-hearing-list/*, apps/web/src/app.ts, apps/web/src/pages/(admin)/non-strategic-upload/index.ts, apps/web/package.json
Adds the GET handler and page template, tests HTTP error paths and locale propagation, registers the module with GOV.UK configuration, and derives upload sensitivity from list-type metadata.
PDF generation and rendering
libs/list-types/pht-weekly-hearing-list/src/pdf/*
Adds translated PDF generation, provenance labels, HTML output, and generator tests.
List-type and service registration
libs/list-types/common/src/list-type-data.ts, libs/location/src/location-data.ts, libs/notifications/*, libs/publication/*, tsconfig.json
Registers PHT metadata and location data, connects email and PDF registries, and adds workspace dependencies and TypeScript aliases.

Sequence Diagram(s)

sequenceDiagram
  participant WebRequest
  participant PHTController
  participant PHTRenderer
  participant HearingListTemplate
  WebRequest->>PHTController: Request weekly hearing list
  PHTController->>PHTRenderer: Render hearing data and dates
  PHTRenderer-->>PHTController: Return header and hearings
  PHTController->>HearingListTemplate: Render localised page
  HearingListTemplate-->>WebRequest: Return hearing list HTML
Loading

Possibly related issues

Possibly related PRs

  • hmcts/cath-service#669 — Shares the web module registration and non-strategic upload sensitivity integration points.
  • hmcts/cath-service#772 — Extends the same notification and publication registries for additional hearing-list types.
  • hmcts/cath-service#843 — Relates to list-type sensitivity metadata and non-strategic access-control wiring.
🚥 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 is clear and matches the main change: adding the PHT Weekly Hearing List style guide and PDF support.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/645-PHT-Weekly-Hearing-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.

@github-actions

github-actions Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

🎭 Playwright E2E Test Results

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

Results for commit f9945f7.

♻️ 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: 6

🧹 Nitpick comments (1)
libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-generator.test.ts (1)

31-53: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Expand test coverage beyond the happy path.

Only the success path is tested. Consider adding cases for: PDF generation failure (generatePdfFromHtml returns success: false), missing pdfBuffer, Welsh locale (cy), empty hearings list, and unknown provenance fallback. Asserting mock calls (e.g., savePdfToStorage received the correct artefactId and buffer) would also strengthen the test.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2b4b0133-f9f4-458e-b02c-e478bd24007f

📥 Commits

Reviewing files that changed from the base of the PR and between 609ecd3 and c96c5d3.

⛔ 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/index.ts
  • apps/web/src/pages/(list-types)/pht-weekly-hearing-list/index.test.ts
  • apps/web/src/pages/(list-types)/pht-weekly-hearing-list/index.ts
  • apps/web/src/pages/(list-types)/pht-weekly-hearing-list/pht-weekly-hearing-list.njk
  • docs/tickets/645/plan.md
  • docs/tickets/645/tasks.md
  • docs/tickets/645/ticket.md
  • libs/list-types/common/src/list-type-data.ts
  • libs/list-types/pht-weekly-hearing-list/package.json
  • libs/list-types/pht-weekly-hearing-list/src/config.ts
  • libs/list-types/pht-weekly-hearing-list/src/conversion/pht-config.ts
  • libs/list-types/pht-weekly-hearing-list/src/email-summary/summary-builder.ts
  • libs/list-types/pht-weekly-hearing-list/src/index.ts
  • libs/list-types/pht-weekly-hearing-list/src/locales/cy.ts
  • libs/list-types/pht-weekly-hearing-list/src/locales/en.ts
  • libs/list-types/pht-weekly-hearing-list/src/models/types.ts
  • libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-generator.test.ts
  • libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-generator.ts
  • libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-template.njk
  • libs/list-types/pht-weekly-hearing-list/src/rendering/renderer.test.ts
  • libs/list-types/pht-weekly-hearing-list/src/rendering/renderer.ts
  • libs/list-types/pht-weekly-hearing-list/src/schemas/pht-weekly-hearing-list.json
  • libs/list-types/pht-weekly-hearing-list/tsconfig.json
  • libs/location/src/location-data.ts
  • libs/notifications/package.json
  • libs/notifications/src/notification/notification-service.ts
  • libs/publication/package.json
  • libs/publication/src/processing/service.ts
  • tsconfig.json

Comment on lines +16 to +30
<details class="govuk-details govuk-!-margin-top-6" data-module="govuk-details" open>
<summary class="govuk-details__summary">
<span class="govuk-details__summary-text">
{{ t.importantInformationTitle }}
</span>
</summary>
<div class="govuk-details__text">
<p class="govuk-body">{{ t.importantInformationText }}</p>
<p class="govuk-body">
<a href="{{ t.importantInformationLinkUrl }}" class="govuk-link">
{{ t.importantInformationLinkText }}
</a>
</p>
</div>
</details>

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

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== relevant files ==\n'
git ls-files 'apps/web/src/pages/(list-types)/pht-weekly-hearing-list/pht-weekly-hearing-list.njk' \
             'apps/web/src/pages/**/pht-weekly-hearing-list*' \
             'apps/web/src/**/locales/**' \
             'apps/web/src/**/translations/**' \
             'apps/web/src/**/i18n/**' \
             'apps/web/src/**/content/**' \
             'apps/web/src/**/plans/**' \
             | sed 's#^`#-` #'

printf '\n== search for importantInformation/contactParagraph/observeLink ==\n'
rg -n "importantInformation|contactParagraph|observeLink" apps/web/src -S

printf '\n== inspect target file ==\n'
cat -n apps/web/src/pages/(list-types)/pht-weekly-hearing-list/pht-weekly-hearing-list.njk

Repository: hmcts/cath-service

Length of output: 14219


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== relevant files ==\n'
git ls-files 'apps/web/src/pages/(list-types)/pht-weekly-hearing-list/pht-weekly-hearing-list.njk' \
             'apps/web/src/pages/**/pht-weekly-hearing-list*' \
             'apps/web/src/**/locales/**' \
             'apps/web/src/**/translations/**' \
             'apps/web/src/**/i18n/**' \
             'apps/web/src/**/content/**' \
             'apps/web/src/**/plans/**' \
             | sed 's#^`#-` #'

printf '\n== search for importantInformation/contactParagraph/observeLink ==\n'
rg -n "importantInformation|contactParagraph|observeLink" apps/web/src -S

printf '\n== inspect target file ==\n'
cat -n 'apps/web/src/pages/(list-types)/pht-weekly-hearing-list/pht-weekly-hearing-list.njk'

Repository: hmcts/cath-service

Length of output: 17985


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== pht page implementation ==\n'
cat -n 'apps/web/src/pages/(list-types)/pht-weekly-hearing-list/index.ts'

printf '\n== pht page tests ==\n'
cat -n 'apps/web/src/pages/(list-types)/pht-weekly-hearing-list/index.test.ts'

printf '\n== any pht locale definitions ==\n'
rg -n "pht-weekly-hearing-list|importantInformationTitle|contactParagraph|observeLinkUrl|observeLinkText" apps/web/src -S --glob '!**/node_modules/**'

Repository: hmcts/cath-service

Length of output: 16205


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== pht package references ==\n'
rg -n "`@hmcts/pht-weekly-hearing-list`" . -S

printf '\n== pht key references in tests/config ==\n'
rg -n "importantInformationTitle|importantInformationText|importantInformationLinkUrl|importantInformationLinkText|contactParagraph|observeLinkUrl|observeLinkText" apps/web/src/pages/(list-types)/pht-weekly-hearing-list -S

printf '\n== similar template patterns ==\n'
sed -n '1,40p' 'apps/web/src/pages/(list-types)/ftt-rpt-weekly-hearing-list/ftt-rpt-weekly-hearing-list.njk'
printf '\n---\n'
sed -n '1,40p' 'apps/web/src/pages/(list-types)/wpafcc-weekly-hearing-list/wpafcc-weekly-hearing-list.njk'

Repository: hmcts/cath-service

Length of output: 3234


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== pht package references ==\n'
rg -n "`@hmcts/pht-weekly-hearing-list`" . -S

printf '\n== pht key references in page files ==\n'
rg -n "importantInformationTitle|importantInformationText|importantInformationLinkUrl|importantInformationLinkText|contactParagraph|observeLinkUrl|observeLinkText" 'apps/web/src/pages/(list-types)/pht-weekly-hearing-list' -S

printf '\n== similar template patterns ==\n'
sed -n '1,40p' 'apps/web/src/pages/(list-types)/ftt-rpt-weekly-hearing-list/ftt-rpt-weekly-hearing-list.njk'
printf '\n---\n'
sed -n '1,40p' 'apps/web/src/pages/(list-types)/wpafcc-weekly-hearing-list/wpafcc-weekly-hearing-list.njk'

Repository: hmcts/cath-service

Length of output: 7128


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== library outline ==\n'
ast-grep outline 'libs/list-types/pht-weekly-hearing-list/src' --view expanded

printf '\n== translation key definitions ==\n'
rg -n "importantInformationTitle|importantInformationText|importantInformationLinkUrl|importantInformationLinkText|contactParagraph|observeLinkUrl|observeLinkText|pageTitle|factLinkUrl|factLinkText" 'libs/list-types/pht-weekly-hearing-list/src' -S

printf '\n== relevant translation files ==\n'
git ls-files 'libs/list-types/pht-weekly-hearing-list/src/**' | sed 's#^`#-` #'

Repository: hmcts/cath-service

Length of output: 5942


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== plan excerpt ==\n'
sed -n '68,96p' 'docs/tickets/645/plan.md'

printf '\n== search for pht important information wording ==\n'
rg -n "plain section|collapsible|required per spec|important information" docs/tickets/645 -S

Repository: hmcts/cath-service

Length of output: 2146


Use a plain introductory section here.

The PHT spec calls for always-visible introductory text, not a <details> disclosure.

importantInformationLinkText: "Arsylwi gwrandawiad llys neu dribiwnlys fel newyddiadurwr, ymchwilydd neu aelod o'r cyhoedd",
importantInformationLinkUrl: "https://www.gov.uk/guidance/observe-a-court-or-tribunal-hearing",
searchCasesTitle: "Chwilio Achosion",
searchCasesLabel: "Chwilio yn ôl rhif achos, manylion, lleoliad, barnwr, neu wybodaeth arall",

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

Welsh searchCasesLabel doesn't match English equivalent.

The Welsh translation mentions "rhif achos" (case number) and "barnwr" (judge), while the English version references "case name" and "date". These describe different searchable fields. The label should reference the same fields in both languages to ensure consistent user experience.

🌐 Suggested alignment
-  searchCasesLabel: "Chwilio yn ôl rhif achos, manylion, lleoliad, barnwr, neu wybodaeth arall",
+  searchCasesLabel: "Chwilio yn ôl enw'r achos, dyddiad, lleoliad, neu fanylion eraill",
📝 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
searchCasesLabel: "Chwilio yn ôl rhif achos, manylion, lleoliad, barnwr, neu wybodaeth arall",
searchCasesLabel: "Chwilio yn ôl enw'r achos, dyddiad, lleoliad, neu fanylion eraill",

Comment thread libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-generator.test.ts Outdated
@@ -0,0 +1,64 @@
<!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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Incomplete Welsh language support in the PDF template. Two user-facing aspects of the template are hardcoded to English, breaking Welsh locale output:

  • libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-template.njk#L2-L2: <html lang="en"> is hardcoded — screen readers will use English pronunciation for Welsh PDFs. Pass locale from the generator's render context and use lang="{{ locale }}".
  • libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-template.njk#L51-L51: No hearings scheduled. is hardcoded English — all other user-facing text uses t.* translation keys. Add a noHearingsScheduled key to both en.ts and cy.ts and reference it as {{ t.noHearingsScheduled }}.

Both fixes require a small change to pdf-generator.ts (passing locale to the render context) and to the locale files.

📍 Affects 1 file
  • libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-template.njk#L2-L2 (this comment)
  • libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-template.njk#L51-L51

Comment thread libs/list-types/pht-weekly-hearing-list/src/rendering/renderer.ts Outdated
"@hmcts/list-types-common": "workspace:*",
"@hmcts/london-administrative-court-daily-cause-list": "workspace:*",
"@hmcts/magistrates-public-list": "workspace:*",
"@hmcts/pht-weekly-hearing-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 | 🟠 Major | ⚡ Quick win

Pin the PHT dependency consistently across both manifests.

The same floating workspace:* dependency was added in both package manifests, contrary to the repository requirement for pinned versions.

  • libs/notifications/package.json#L40-L40: replace workspace:* with the exact PHT package version.
  • libs/publication/package.json#L47-L47: replace workspace:* with the same exact PHT package version.
📍 Affects 2 files
  • libs/notifications/package.json#L40-L40 (this comment)
  • libs/publication/package.json#L47-L47

Source: Coding guidelines

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
libs/list-types/pht-weekly-hearing-list/src/schemas/pht-weekly-hearing-list.json (1)

22-22: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Anti-XSS regex rejects legitimate angle-bracket text.

The pattern ^(?!(.|\r|\n)*<[^>]+>)(.|\r|\n)*$ rejects any string containing < followed eventually by >, not just HTML tags. Legitimate hearing data such as "See regulation <R> for details" in additionalInformation or "Case <123>" in caseName would fail validation. Consider narrowing the pattern to match only actual HTML tags (tag name starting with a letter):

🛡️ Proposed regex refinement
-"pattern": "^(?!(.|\\r|\\n)*<[^>]+>)(.|\\r|\\n)*$"
+"pattern": "^(?!(.|\\r|\\n)*<\\s*\\/?\\s*[a-zA-Z][^>]*>)(.|\\r|\\n)*$"

This still rejects <script>, </div>, <img onerror=...>, etc., but allows non-HTML angle-bracket text like <123> or < >.

Also applies to: 29-29, 36-36


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 05b10c38-b2bb-455f-ba3d-e4655ec18eca

📥 Commits

Reviewing files that changed from the base of the PR and between c96c5d3 and 7a36f06.

📒 Files selected for processing (7)
  • apps/web/src/pages/(list-types)/pht-weekly-hearing-list/index.test.ts
  • apps/web/src/pages/(list-types)/pht-weekly-hearing-list/index.ts
  • libs/list-types/pht-weekly-hearing-list/src/index.ts
  • libs/list-types/pht-weekly-hearing-list/src/rendering/renderer.test.ts
  • libs/list-types/pht-weekly-hearing-list/src/schemas/pht-weekly-hearing-list.json
  • libs/list-types/pht-weekly-hearing-list/src/validation/json-validator.test.ts
  • libs/list-types/pht-weekly-hearing-list/src/validation/json-validator.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • libs/list-types/pht-weekly-hearing-list/src/index.ts
  • apps/web/src/pages/(list-types)/pht-weekly-hearing-list/index.ts
  • apps/web/src/pages/(list-types)/pht-weekly-hearing-list/index.test.ts
  • libs/list-types/pht-weekly-hearing-list/src/rendering/renderer.test.ts

import { describe, expect, it } from "vitest";
import { validatePhtWeeklyHearingList } from "./json-validator.js";

const validHearing = {

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

Use SCREAMING_SNAKE_CASE for module-level constants.

validHearing is declared with const outside function scope. As per coding guidelines, constants declared outside function scope should use SCREAMING_SNAKE_CASE.

♻️ Proposed rename
-const validHearing = {
+const VALID_HEARING = {
   date: "02/01/2025",
   caseName: "A Vs B",
   hearingLength: "1 hour",
   hearingType: "mda",
   venue: "Primary Health Tribunal",
   additionalInformation: "None"
 };

All references to validHearing throughout the test file would need to be updated to VALID_HEARING.

📝 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 validHearing = {
const VALID_HEARING = {

Source: Coding guidelines

@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.

@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.

🧹 Nitpick comments (1)
libs/list-types/pht-weekly-hearing-list/src/email-summary/summary-builder.test.ts (1)

8-10: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Remove the unused @hmcts/publication mock. summary-builder.ts only imports from @hmcts/list-types-common, so this setup adds noise without affecting the test.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 581382e3-2bb4-4fcb-84e8-59c733c25691

📥 Commits

Reviewing files that changed from the base of the PR and between 7a36f06 and 464cfe5.

📒 Files selected for processing (6)
  • libs/list-types/pht-weekly-hearing-list/src/email-summary/summary-builder.test.ts
  • libs/list-types/pht-weekly-hearing-list/src/email-summary/summary-builder.ts
  • libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-generator.test.ts
  • libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-generator.ts
  • libs/list-types/pht-weekly-hearing-list/src/rendering/renderer.ts
  • libs/publication/src/processing/service.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • libs/list-types/pht-weekly-hearing-list/src/email-summary/summary-builder.ts
  • libs/list-types/pht-weekly-hearing-list/src/rendering/renderer.ts
  • libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-generator.ts

@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.

@KianKwa KianKwa linked an issue Jul 14, 2026 that may be closed by this pull request
22 tasks
junaidiqbalmoj and others added 3 commits July 14, 2026 15:38
Resolved conflicts by keeping both PHT_WEEKLY_HEARING_LIST (from feature branch) and magistrates adult court list types (from master) in list-type-data.ts, tsconfig.json paths, and the PDF generator registry.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… types

Add pattern/format validation, HTML injection protection, string constraint, and invalid input type tests to magistrates-adult-court-list and magistrates-public-adult-court-list, consistent with the pattern established in PR #844.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…hange state

Undoes unnecessary expansion of these test files — they were not in scope.

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

@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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5d28dd9c-d437-47d4-ba46-edaf4d47978b

📥 Commits

Reviewing files that changed from the base of the PR and between 464cfe5 and 33f139e.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (13)
  • apps/web/package.json
  • apps/web/src/app.ts
  • libs/list-types/common/src/list-type-data.ts
  • libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-generator.test.ts
  • libs/list-types/pht-weekly-hearing-list/src/pdf/pdf-generator.ts
  • libs/list-types/pht-weekly-hearing-list/src/rendering/renderer.test.ts
  • libs/list-types/pht-weekly-hearing-list/src/rendering/renderer.ts
  • libs/notifications/package.json
  • libs/notifications/src/notification/notification-service.ts
  • libs/publication/package.json
  • libs/publication/src/processing/service.test.ts
  • libs/publication/src/processing/service.ts
  • tsconfig.json
🚧 Files skipped from review as they are similar to previous changes (10)
  • tsconfig.json
  • apps/web/package.json
  • libs/notifications/package.json
  • libs/publication/package.json
  • apps/web/src/app.ts
  • libs/publication/src/processing/service.ts
  • libs/list-types/common/src/list-type-data.ts
  • libs/publication/src/processing/service.test.ts
  • libs/notifications/src/notification/notification-service.ts
  • libs/list-types/pht-weekly-hearing-list/src/rendering/renderer.test.ts

const { generateListPdf } = await import("@hmcts/list-types-common");
const { provenance: _, ...optionsWithoutProvenance } = BASE_OPTIONS;

await generatePhtWeeklyHearingListPdf(optionsWithoutProvenance 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

Avoid using any without justification.

The use of as any bypasses strict type checking. As per coding guidelines, TypeScript must use strict mode and must not use any without justification. Replace any with a safer cast.

💡 Proposed fix
-    await generatePhtWeeklyHearingListPdf(optionsWithoutProvenance as any);
+    await generatePhtWeeklyHearingListPdf(optionsWithoutProvenance as unknown as PdfGenerationOptions);
📝 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
await generatePhtWeeklyHearingListPdf(optionsWithoutProvenance as any);
await generatePhtWeeklyHearingListPdf(optionsWithoutProvenance as unknown as PdfGenerationOptions);

Source: Coding guidelines

Comment on lines +4 to +5
export const PHT_COURT_NAME = "Primary Health Tribunal";
export const PHT_LIST_TITLE = "Primary Health Tribunal Weekly Hearing 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.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Do not hardcode display strings.

The court name and list title are hardcoded in English. As per coding guidelines, court names and other list-type-specific display strings must come from English and Welsh locale files, not hardcoded controller strings.

Please remove these constants and retrieve the translations from the locale files (or pass translation keys to be resolved by the PDF template). Note that downstream calls in pdf-generator.ts and its associated tests will also need to be updated to accommodate this change.

Source: Coding guidelines

junaidiqbalmoj and others added 2 commits July 14, 2026 16:27
formatDisplayDate and formatDdMmYyyyDate use day: "numeric" which produces
"2 January 2025" not "02 January 2025". Tests had the wrong expected values.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The CI guard in list-types/common checks for /export\s+.*validate[A-Z]/ in
src/index.ts. A wildcard re-export doesn't satisfy that regex.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@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.

@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.

@junaidiqbalmoj
junaidiqbalmoj merged commit ed63e44 into master Jul 17, 2026
26 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.

Style Guide: Implement PHT Weekly Hearing List

2 participants