Skip to content

Feature/760 Update RPT lists and add new Market Rents list - #902

Merged
KianKwa merged 6 commits into
masterfrom
feature/760
Aug 5, 2026
Merged

Feature/760 Update RPT lists and add new Market Rents list#902
KianKwa merged 6 commits into
masterfrom
feature/760

Conversation

@KianKwa

@KianKwa KianKwa commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Jira link

#760

Change description

Update RPT lists and add new Market Rents list

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 the Market Rents Weekly Hearing List with region- and locale-aware titles.
    • Added regional office email guidance and Market Rents-specific information.
  • Accessibility and Content
    • Refreshed the “Important information” section with clearer paragraphs and conditional emphasis.
    • Updated Welsh-language content for revised titles and Market Rents guidance.
  • Tests
    • Expanded coverage for regional emails, Welsh rendering, PDF output, and Market Rents content.

@coderabbitai

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

Run ID: 07313623-4c10-4f9f-8396-3f743ce9a54d

📥 Commits

Reviewing files that changed from the base of the PR and between 3fff5a4 and 8a1d09b.

📒 Files selected for processing (1)
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/locales/cy.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/locales/cy.ts

📝 Walkthrough

Walkthrough

Adds the Market Rents weekly hearing list, updates RPT naming and locales, substitutes regional email addresses, conditionally renders Market Rents information, and wires the list through web, PDF, conversion, and notification paths.

Changes

RPT Market Rents list

Layer / File(s) Summary
List data and locale contracts
libs/list-types/common/src/list-type-data.ts, libs/location/src/location-data.ts, libs/list-types/ftt-rpt-weekly-hearing-list/src/locales/*, libs/list-types/ftt-rpt-weekly-hearing-list/src/locales/important-information-text.*, libs/list-types/ftt-rpt-weekly-hearing-list/src/index.ts
Adds Market Rents metadata, updates the sub-jurisdiction name, introduces regional email and extra-information locale values, updates Welsh content, and adds email placeholder substitution.
Publication and PDF generation
libs/list-types/ftt-rpt-weekly-hearing-list/src/conversion/*, libs/list-types/common/src/pdf/*, libs/list-types/ftt-rpt-weekly-hearing-list/src/pdf/*, libs/publication/src/processing/service.ts, libs/notifications/src/notification/notification-service.ts, libs/list-types/ftt-rpt-weekly-hearing-list/package.json, libs/public-pages/src/flat-file/flat-file-service.ts
Registers Market Rents conversion, PDF, and email handling; resolves PDF template variables; updates PDF content; and removes obsolete build/import entries.
Web regional rendering
apps/web/src/pages/(list-types)/ftt-rpt-weekly-hearing-list/*
Resolves list configuration and regional email text, renders the second and conditional extra-information paragraphs, and tests English, Welsh, regional, and Market Rents behaviour.
Ticket implementation record
docs/tickets/760/*
Documents the requirements, implementation plan, task checklist, locale content, acceptance criteria, and validation scenarios.

Sequence Diagram(s)

sequenceDiagram
  participant Publisher
  participant PublicationProcessing
  participant FttRptPdfGenerator
  participant WebHandler
  participant HearingListTemplate
  Publisher->>PublicationProcessing: publish Market Rents hearing list
  PublicationProcessing->>FttRptPdfGenerator: generate PDF with listTypeName
  FttRptPdfGenerator->>HearingListTemplate: render regional email and conditional extra information
  WebHandler->>HearingListTemplate: render public hearing list with resolved regional text
Loading

Possibly related issues

  • Issue 612 — Extends the existing FTT RPT weekly hearing-list implementation across templates, controller, locales, PDF generation, and tests.
  • Issue 760 — Directly covers the venue rename, Market Rents list, regional email wording, and related rendering changes.

Possibly related PRs

  • hmcts/cath-service#749 — Introduces the FTT RPT weekly hearing-list implementation that this PR extends.
  • hmcts/cath-service#827 — Provides the name-based list-type handling used by the updated FTT RPT controller and converter registration.
  • hmcts/cath-service#864 — Adds related list-type registrations across shared catalogues and downstream services.
🚥 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 clearly summarises the main changes: updating RPT lists and adding the Market Rents list.
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/760

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 29, 2026

Copy link
Copy Markdown
Contributor

🎭 Playwright E2E Test Results

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

Results for commit 8a1d09b.

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


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: baf616a2-0451-4d41-beab-0121f23f6ac9

📥 Commits

Reviewing files that changed from the base of the PR and between d9320ea and 3d9611e.

📒 Files selected for processing (24)
  • apps/web/src/pages/(list-types)/ftt-rpt-weekly-hearing-list/ftt-rpt-weekly-hearing-list.njk
  • apps/web/src/pages/(list-types)/ftt-rpt-weekly-hearing-list/ftt-rpt-weekly-hearing-list.njk.test.ts
  • apps/web/src/pages/(list-types)/ftt-rpt-weekly-hearing-list/index.test.ts
  • apps/web/src/pages/(list-types)/ftt-rpt-weekly-hearing-list/index.ts
  • docs/tickets/760/plan.md
  • docs/tickets/760/tasks.md
  • docs/tickets/760/ticket.md
  • libs/list-types/common/src/list-type-data.ts
  • libs/list-types/common/src/pdf/pdf-utilities.ts
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/conversion/ftt-rpt-config.ts
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/index.ts
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/locales/cy.ts
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/locales/en.ts
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/locales/important-information-text.test.ts
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/locales/important-information-text.ts
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/locales/regional-email-guard.test.ts
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/pdf/pdf-generator.test.ts
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/pdf/pdf-generator.ts
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/pdf/pdf-template.njk
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/views/ftt-rpt-weekly-hearing-list.njk
  • libs/location/src/location-data.ts
  • libs/notifications/src/notification/notification-service.ts
  • libs/public-pages/src/flat-file/flat-file-service.ts
  • libs/publication/src/processing/service.ts
💤 Files with no reviewable changes (2)
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/views/ftt-rpt-weekly-hearing-list.njk
  • libs/public-pages/src/flat-file/flat-file-service.ts

Comment on lines +295 to +326
it("should resolve the Welsh regional email and extra information text for Market Rents", async () => {
// Arrange
res.locals = { locale: "cy" };
const mockArtefact = {
artefactId: "test-market-rents-cy",
listTypeId: 38,
listTypeName: "FTT_RPT_MARKET_RENTS_WEEKLY_HEARING_LIST",
contentDate: new Date("2026-01-01"),
lastReceivedDate: new Date("2026-01-01T12:00:00Z"),
provenance: "MANUAL_UPLOAD"
};
req.query = { artefactId: "test-market-rents-cy" };
vi.mocked(getArtefactById).mockResolvedValue(mockArtefact as any);
vi.mocked(getPublicationJson).mockResolvedValue(MOCK_JSON_DATA);
mockValidate.mockReturnValue({ isValid: true, errors: [] });
vi.mocked(renderFttRptData).mockReturnValue({
header: { listTitle: "title", weekCommencingDate: "", lastUpdatedDate: "", lastUpdatedTime: "" },
hearings: []
});

// Act
await GET(req as Request, res as Response);

// Assert
expect(res.render).toHaveBeenCalledWith(
"ftt-rpt-weekly-hearing-list",
expect.objectContaining({
importantInformationText: expect.stringContaining("marketrents@justice.gov.uk"),
extraInformationText: MARKET_RENTS_EXTRA_INFORMATION_CY
})
);
});

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

Test Welsh content through ?lng=cy.

This injects res.locals.locale directly, bypassing the i18n selection path. Add a request-level page test that exercises the route with ?lng=cy.

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

Source: Coding guidelines

Comment thread docs/tickets/760/plan.md
Comment on lines +167 to +175
| `searchCasesLabel` | **No verified match anywhere in the codebase** (RPT's exact English wording is unique) | `[WELSH TRANSLATION REQUIRED: 'Search by case reference number, date, venue, or other details']` |
| `tableHeaders.date/time/venue/caseType/judges/members/hearingMethod` | **No verified match anywhere in the codebase** — even `grc-weekly-hearing-list` (which shares `judges`/`members` keys) has these marked `[WELSH TRANSLATION REQUIRED: ...]`, unresolved | `[WELSH TRANSLATION REQUIRED: '<English value>']` for each, following the exact bracket convention already used in `grc-weekly-hearing-list/src/locales/cy.ts` |
| `tableHeaders.caseReferenceNumber` | **No verified match** | `[WELSH TRANSLATION REQUIRED: 'Case reference number']` |
| `tableHeaders.additionalInformation` | Reused verbatim (verified in multiple sibling files) | "Gwybodaeth ychwanegol" |
| `rptEastern/London/Midlands/Northern/SouthernCourtName` + `PageTitle` (5 existing, untouched per Clarification 1) | **No verified match; ticket does not supply these** | `[WELSH TRANSLATION REQUIRED: '<English value>']` each |
| `rptMarketRentsCourtName` / `rptMarketRentsPageTitle` | **Ticket-supplied** | Ticket's Welsh translations for the new list title/short name |
| Venue name (`location-data.ts` `welshName`) | **Ticket-supplied** | "Tribiwnlys Haen Gyntaf (Siambr Eiddo) – Adran Eiddo Preswyl" |

**Rule applied:** never invent legal/procedural Welsh translations. Reuse only strings already verified as professionally translated identically elsewhere in the codebase; everything else uses the existing `[WELSH TRANSLATION REQUIRED: '...']` convention (already established in-repo, e.g. `grc-weekly-hearing-list/src/locales/cy.ts`) pending sign-off from the ticket's named Welsh translator (Kimberley Newton, per the ticket).

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 release public Welsh placeholder text.

The plan and completed task record permit literal [WELSH TRANSLATION REQUIRED: ...] values for page content. That fails the Welsh-content acceptance criteria and would expose unfinished text to citizens. Obtain approved translations and keep this work unresolved until they are applied.

  • docs/tickets/760/plan.md#L167-L175: replace the placeholder strategy with approved Welsh content before declaring the implementation complete.
  • docs/tickets/760/tasks.md#L11-L12: reopen the task until every public locale key has approved Welsh text.
📍 Affects 2 files
  • docs/tickets/760/plan.md#L167-L175 (this comment)
  • docs/tickets/760/tasks.md#L11-L12

Comment thread libs/list-types/ftt-rpt-weekly-hearing-list/src/locales/cy.ts Outdated
contentDate: Date;
courtName: string;
listTitle: string;
listTypeName?: string;

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

Require a configured list type for PDF generation.

An omitted or unmapped listTypeName silently produces an empty important-information paragraph. Require the stable list type name and fail configuration without a regional email instead of publishing a list without contact details. As per coding guidelines, use stable listTypeName for guards, routing, PDF generation, converter registration, and queries; never use numeric listTypeId or ListType.id.

Also applies to: 29-43

Source: Coding guidelines

Comment on lines +19 to +43
listTypeName?: string;
}

interface RptTranslations {
importantInformationTextTemplate: string;
rptRegionalEmail: Record<string, string>;
marketRentsExtraInformation: string;
}

export async function generateFttRptWeeklyHearingListPdf(options: PdfGenerationOptions): Promise<PdfGenerationResult> {
const listTypeName = options.listTypeName ?? "";

return generateFttSiacWeeklyHearingListPdf({
...options,
moduleDir: __dirname,
provenanceLabel: options.provenance ? PROVENANCE_LABELS[options.provenance as keyof typeof PROVENANCE_LABELS] || options.provenance : "",
importEn: () => import("../locales/en.js"),
importCy: () => import("../locales/cy.js"),
generatePdf: generatePdfFromHtml,
renderData: renderFttRptData
renderData: renderFttRptData,
resolveTemplateVars: (translations) => {
const t = translations as unknown as RptTranslations;
const regionalEmail = t.rptRegionalEmail[listTypeName];
const importantInformationText = regionalEmail ? buildImportantInformationText(t.importantInformationTextTemplate, regionalEmail) : "";
const extraInformationText = listTypeName === MARKET_RENTS_LIST_TYPE ? t.marketRentsExtraInformation : "";

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

Make listTypeName mandatory throughout the RPT PDF flow. The optional fallback allows publication of PDFs with no regional contact details and no Market Rents guidance.

  • libs/list-types/ftt-rpt-weekly-hearing-list/src/pdf/pdf-generator.ts#L19-L43: require listTypeName and reject unmapped regional-email configuration.
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/pdf/pdf-generator.test.ts#L227-L250: replace the successful missing-name scenario with a required-name/configuration-failure assertion.
  • libs/publication/src/processing/service.ts#L256-L262: explicitly pass FTT_RPT_MARKET_RENTS_WEEKLY_HEARING_LIST to the generator.
📍 Affects 3 files
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/pdf/pdf-generator.ts#L19-L43 (this comment)
  • libs/list-types/ftt-rpt-weekly-hearing-list/src/pdf/pdf-generator.test.ts#L227-L250
  • libs/publication/src/processing/service.ts#L256-L262

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.

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

@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 30, 2026 that may be closed by this pull request
@sonarqubecloud

sonarqubecloud Bot commented Aug 4, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Aug 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.

@KianKwa
KianKwa merged commit 29f7616 into master Aug 5, 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.

Changes to Residential Property Tribunal (new list + name change)

2 participants