Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
18f571b
PDDA Crown Firm List
KianKwa Sep 11, 2025
e953094
Lint fixes
KianKwa Sep 11, 2025
f603b03
Fixed a11y test failure
KianKwa Sep 11, 2025
230fd12
Merge master into PUB-2851
github-actions[bot] Sep 12, 2025
0e1f88b
Update list type friendly name
KianKwa Sep 12, 2025
38095fe
Merge remote-tracking branch 'origin/PUB-2851' into PUB-2851
KianKwa Sep 12, 2025
7bf16e3
Revert update to list type friendly name
KianKwa Sep 12, 2025
e36a1fe
Removed unused texts
KianKwa Sep 15, 2025
b829caa
Removed trailing comma
KianKwa Sep 15, 2025
961014b
PDDA Crown Daily List
KianKwa Sep 16, 2025
b3fd1f7
Merge master into PUB-2851
github-actions[bot] Sep 16, 2025
c383c87
Suppress security vuln
KianKwa Sep 16, 2025
4139758
Merge master into PUB-2851
github-actions[bot] Sep 16, 2025
e045629
Add test file
KianKwa Sep 16, 2025
352186c
Update test file
KianKwa Sep 16, 2025
a0dd16d
Update court name spacing
KianKwa Sep 16, 2025
d0ed9aa
Fix failing tests
KianKwa Sep 17, 2025
daadc30
Lint fixes
KianKwa Sep 17, 2025
8f87b54
Merge branch 'PUB-2851' into PUB-2852
KianKwa Sep 17, 2025
6b19e1e
Fixed e2e test failure after 6.0.2 release (#1542)
KianKwa Sep 18, 2025
29a7f3c
Merge remote-tracking branch 'origin/freeze' into PUB-2851
KianKwa Sep 19, 2025
d6b4573
Merge branch 'PUB-2851' into PUB-2852
KianKwa Sep 19, 2025
8d4f1e4
Create style guide, unit test WIP
junaidiqbalmoj Sep 19, 2025
4a6cd78
fix styling
junaidiqbalmoj Sep 19, 2025
4cde772
Update list sensitivity
KianKwa Sep 22, 2025
f847d66
Merge branch 'PUB-2851' into PUB-2852
KianKwa Sep 22, 2025
0c37d7c
Code review fixes
KianKwa Sep 22, 2025
61d47d2
Add Crime Warned PDDA lists
junaidiqbalmoj Sep 22, 2025
fcbf40c
styling issue
junaidiqbalmoj Sep 22, 2025
f71a47e
Merge remote-tracking branch 'origin/PUB-2851' into pub-2850-crown-wa…
junaidiqbalmoj Sep 22, 2025
70acdd6
Merge remote-tracking branch 'origin/PUB-2852' into pub-2850-crown-wa…
junaidiqbalmoj Sep 22, 2025
a3d26f1
fix space
junaidiqbalmoj Sep 22, 2025
174b782
change default Sensitivity
junaidiqbalmoj Sep 23, 2025
35ca723
fix version and formatting
junaidiqbalmoj Sep 23, 2025
d2917d1
fix code review comment
junaidiqbalmoj Sep 26, 2025
441bc1c
Merge master into PUB-2851
github-actions[bot] Oct 7, 2025
463b5df
Merge master into PUB-2851
github-actions[bot] Oct 8, 2025
98831d9
Merge master into PUB-2851
github-actions[bot] Oct 10, 2025
901a3aa
Merge branch 'PUB-2851' into PUB-2852
KianKwa Oct 10, 2025
cf32cda
Merge remote-tracking branch 'origin/PUB-2852' into pub-2850-crown-wa…
KianKwa Oct 10, 2025
7620476
Merge master into pub-2850-crown-warned-list
github-actions[bot] Oct 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions src/main/controllers/style-guide/CrownPddaListController.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
import { PipRequest } from '../../models/request/PipRequest';
import { Response } from 'express';
import { formatMetaDataListType, isUnexpectedListType, isValidList, isValidListType } from '../../helpers/listHelper';
import { HttpStatusCode } from 'axios';
import { cloneDeep } from 'lodash';
import { ListParseHelperService } from '../../service/ListParseHelperService';
import { LocationService } from '../../service/LocationService';
import { PublicationService } from '../../service/PublicationService';
import { formatDate } from '../../helpers/dateTimeHelper';
import { CrownPddaListService } from '../../service/listManipulation/CrownPddaListService';

const publicationService = new PublicationService();
const locationService = new LocationService();
const helperService = new ListParseHelperService();
const crownPddaListService = new CrownPddaListService();

export default class CrownPddaListController {
public async get(req: PipRequest, res: Response, listType: string): Promise<void> {
const artefactId = req.query.artefactId as string;
const payload = await publicationService.getIndividualPublicationJson(artefactId, req.user?.['userId']);
const metadata = await publicationService.getIndividualPublicationMetadata(artefactId, req.user?.['userId']);
const metadataListType = formatMetaDataListType(metadata);

if (isValidList(payload, metadata) && isValidListType(metadataListType, listType)) {
const listData = crownPddaListService.processPayload(payload as JSON, req.lng, listType);
const returnedLocation = await locationService.getLocationById(metadata['locationId']);
const locationName = locationService.findCourtName(returnedLocation, req.lng, listType);

const isDailyList = listType.includes('daily');
const listPayload = isDailyList ? payload['DailyList'] : payload['FirmList'];
const listHeader = listPayload.ListHeader;
const publishedDate = helperService.publicationDateInUkTime(listHeader.PublishedTime, req.lng);
const publishedTime = helperService.publicationTimeInUkTime(listHeader.PublishedTime);
const startDate = formatDate(crownPddaListService.toIsoDate(listHeader.StartDate), 'dd MMMM yyyy', req.lng);
const endDate =
!isDailyList && listHeader.EndDate
? formatDate(crownPddaListService.toIsoDate(listHeader.EndDate), 'dd MMMM yyyy', req.lng)
: '';
const version = listHeader.Version;
const venueAddress = crownPddaListService.formatAddress(listPayload.CrownCourt.CourtHouseAddress);

res.render(`style-guide/${listType}`, {
...cloneDeep(req.i18n.getDataByLanguage(req.lng)[listType]),
...cloneDeep(req.i18n.getDataByLanguage(req.lng)['list-template']),
listData: listData,
locationName: locationName,
provenance: metadata.provenance,
publishedDate,
publishedTime,
startDate,
endDate,
version,
venueAddress,
});
} else if (
payload === HttpStatusCode.NotFound ||
metadata === HttpStatusCode.NotFound ||
isUnexpectedListType(metadataListType, listType)
) {
res.render('list-not-found', req.i18n.getDataByLanguage(req.lng)['list-not-found']);
} else {
res.render('error', req.i18n.getDataByLanguage(req.lng).error);
}
}
}
70 changes: 70 additions & 0 deletions src/main/controllers/style-guide/CrownWarnedPddaListController.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import { PipRequest } from '../../models/request/PipRequest';
import { Response } from 'express';
import { formatMetaDataListType, isUnexpectedListType, isValidList, isValidListType } from '../../helpers/listHelper';
import { HttpStatusCode } from 'axios';
import { cloneDeep } from 'lodash';
import { ListParseHelperService } from '../../service/ListParseHelperService';
import { LocationService } from '../../service/LocationService';
import { PublicationService } from '../../service/PublicationService';
import { formatDate } from '../../helpers/dateTimeHelper';
import { CrownPddaListService } from '../../service/listManipulation/CrownPddaListService';
import { CrownWarnedPddaListService } from '../../service/listManipulation/CrownWarnedPddaListService';
import { CrownWarnedListService } from '../../service/listManipulation/CrownWarnedListService';

const publicationService = new PublicationService();
const locationService = new LocationService();
const helperService = new ListParseHelperService();
const crownPddaListService = new CrownPddaListService();
const crownWarnedPddaListService = new CrownWarnedPddaListService();
const crownWarnedListService = new CrownWarnedListService();
const listType = 'crown-warned-pdda-list';

export default class CrownWarnedPddaListController {
public async get(req: PipRequest, res: Response): Promise<void> {
const artefactId = req.query.artefactId as string;
const payload = await publicationService.getIndividualPublicationJson(artefactId, req.user?.['userId']);
const metadata = await publicationService.getIndividualPublicationMetadata(artefactId, req.user?.['userId']);
const metadataListType = formatMetaDataListType(metadata);

if (isValidList(payload, metadata) && isValidListType(metadataListType, listType)) {
const returnedLocation = await locationService.getLocationById(metadata['locationId']);
const locationName = locationService.findCourtName(returnedLocation, req.lng, listType);

const listPayload = payload['WarnedList'];
const listHeader = listPayload.ListHeader;
const publishedDate = helperService.publicationDateInUkTime(listHeader.PublishedTime, req.lng);
const publishedTime = helperService.publicationTimeInUkTime(listHeader.PublishedTime);
const startDate = formatDate(crownPddaListService.toIsoDate(listHeader.StartDate), 'dd MMMM yyyy', req.lng);
const endDate = listHeader.EndDate
? formatDate(crownPddaListService.toIsoDate(listHeader.EndDate), 'dd MMMM yyyy', req.lng)
: '';
const version = listHeader.Version;
const venueAddress = crownPddaListService.formatAddress(listPayload.CrownCourt.CourtHouseAddress);

const listData = crownWarnedPddaListService.processPayload(payload as JSON);

res.render(`style-guide/${listType}`, {
...cloneDeep(req.i18n.getDataByLanguage(req.lng)[listType]),
...cloneDeep(req.i18n.getDataByLanguage(req.lng)['list-template']),
listData: listData,
locationName: locationName,
contentDate: crownWarnedListService.formatContentDate(metadata.contentDate, req.lng),
provenance: metadata.provenance,
publishedDate,
publishedTime,
startDate,
endDate,
version,
venueAddress,
});
} else if (
payload === HttpStatusCode.NotFound ||
metadata === HttpStatusCode.NotFound ||
isUnexpectedListType(metadataListType, listType)
) {
res.render('list-not-found', req.i18n.getDataByLanguage(req.lng)['list-not-found']);
} else {
res.render('error', req.i18n.getDataByLanguage(req.lng).error);
}
}
}
36 changes: 32 additions & 4 deletions src/main/resources/listLookup.json
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@
"shortenedFriendlyName": "London Circuit Commercial Court (KB) Daily Cause List",
"url": "london-circuit-commercial-court-kb-daily-cause-list",
"jurisdictionTypes": ["High Court"],
"restrictedProvenances": [],
"restrictedProvenances": [],
"defaultSensitivity": "",
"isNonStrategic": true
},
Expand Down Expand Up @@ -822,9 +822,7 @@
"welshFriendlyName": "Rhestr Achosion Dyddiol y Llys Apêl (Adran Sifil)",
"shortenedFriendlyName": "Court of Appeal (Civil Division) Daily Cause List",
"url": "court-of-appeal-civil-daily-cause-list",
"jurisdictionTypes": [
"Court of Appeal (Civil Division)"
],
"jurisdictionTypes": ["Court of Appeal (Civil Division)"],
"restrictedProvenances": [],
"defaultSensitivity": "",
"isNonStrategic": true
Expand Down Expand Up @@ -929,5 +927,35 @@
"restrictedProvenances": [],
"defaultSensitivity": "CLASSIFIED",
"isNonStrategic": false
},
"CROWN_FIRM_PDDA_LIST": {
"friendlyName": "Crown Firm PDDA List",
"welshFriendlyName": "Rhestr PDDA Cwmni Llys y Goron",
"shortenedFriendlyName": "Crown Firm PDDA List",
"url": "crown-firm-pdda-list",
"jurisdictionTypes": ["Crown Court"],
"restrictedProvenances": [],
"defaultSensitivity": "CLASSIFIED",
"isNonStrategic": false
},
"CROWN_DAILY_PDDA_LIST": {
"friendlyName": "Crown Daily PDDA List",
"welshFriendlyName": "Rhestr PDDA Ddyddiol Llys y Goron",
"shortenedFriendlyName": "Crown Daily PDDA List",
"url": "crown-daily-pdda-list",
"jurisdictionTypes": ["Crown Court"],
"restrictedProvenances": [],
"defaultSensitivity": "CLASSIFIED",
"isNonStrategic": false
},
"CROWN_WARNED_PDDA_LIST": {
"friendlyName": "Crown Warned PDDA List",
"welshFriendlyName": "Rhestr Rybudd PDDA Llys y Goron",
"shortenedFriendlyName": "Crown Warned PDDA List",
"url": "crown-warned-pdda-list",
"jurisdictionTypes": ["Crown Court"],
"restrictedProvenances": [],
"defaultSensitivity": "CLASSIFIED",
"isNonStrategic": false
}
}
26 changes: 26 additions & 0 deletions src/main/resources/locales/cy/crown-daily-pdda-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"title": "Rhestr Ddyddiol Llys y Goron",
"heading": "Rhestr Ddyddiol Llys y Goron ar gyfer",
"listDate": "Rhestr ar gyfer",
"listUpdated": "Diweddarwyd diwethaf",
"at": "am",
"versionText": "Fersiwn",
"restrictionInformationHeading": "Cyfyngiadau ar gyhoeddi neu ysgrifennu am yr achosion hyn.",
"restrictionInformationP1": "Rhaid i chi wirio a oes unrhyw gyfyngiadau riportio yn berthnasol cyn cyhoeddi manylion am unrhyw un o'r achosion a restrir yma, naill ai'n ysgrifenedig, mewn darllediad neu ar y rhyngrwyd, gan gynnwys y cyfryngau cymdeithasol.",
"restrictionInformationBoldText": "Byddwch yn euog o ddirmyg llys os byddwch yn cyhoeddi unrhyw wybodaeth sydd wedi'i diogelu gan gyfyngiad riportio. Gallwch gael dirwy, eich dedfrydu i garchar, neu'r ddau.",
"restrictionInformationP2": "Bydd cyfyngiadau penodol a orchmynnir gan y llys yn cael eu crybwyll ar yr achosion a restrir yma.",
"restrictionInformationP3": "Fodd bynnag, nid yw'r cyfyngiadau bob amser yn cael eu rhestru. Mae rhai yn berthnasol yn awtomatig. Er enghraifft, anhysbysrwydd a roddir i ddioddefwyr rhai troseddau rhywiol.",
"restrictionInformationP4": "I ganfod pa gyfyngiadau riportio sy'n berthnasol ar achos penodol, cysylltwch â'r:",
"restrictionBulletPoint1": "llys yn uniongyrchol",
"restrictionBulletPoint2": "Gwasanaeth Llysoedd a Thribiwnlysoedd EM ar 0330 808 4407",
"court": "LLYS",
"sittingAt": "Yn eistedd yn",
"tableHeaders": [
"Cyfeirnod yr Achos",
"Enw'r Diffynnydd(Diffynyddion)",
"Math o Wrandawiad",
"Yr Awdurdod sy'n Erlyn",
"Nodiadau Rhestru"
],
"dataSource": "Ffynhonnell Data"
}
28 changes: 28 additions & 0 deletions src/main/resources/locales/cy/crown-firm-pdda-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"title": "Rhestr Cwmni Llys y Goron",
"heading": "Rhestr Cwmni Llys y Goron ar gyfer",
"listDate": "Rhestr ar gyfer",
"to": "i",
"listUpdated": "Diweddarwyd diwethaf",
"at": "am",
"versionText": "Fersiwn",
"restrictionInformationHeading": "Cyfyngiadau ar gyhoeddi neu ysgrifennu am yr achosion hyn.",
"restrictionInformationP1": "Rhaid i chi wirio a oes unrhyw gyfyngiadau riportio yn berthnasol cyn cyhoeddi manylion am unrhyw un o'r achosion a restrir yma, naill ai'n ysgrifenedig, mewn darllediad neu ar y rhyngrwyd, gan gynnwys y cyfryngau cymdeithasol.",
"restrictionInformationBoldText": "Byddwch yn euog o ddirmyg llys os byddwch yn cyhoeddi unrhyw wybodaeth sydd wedi'i diogelu gan gyfyngiad riportio. Gallwch gael dirwy, eich dedfrydu i garchar, neu'r ddau.",
"restrictionInformationP2": "Bydd cyfyngiadau penodol a orchmynnir gan y llys yn cael eu crybwyll ar yr achosion a restrir yma.",
"restrictionInformationP3": "Fodd bynnag, nid yw'r cyfyngiadau bob amser yn cael eu rhestru. Mae rhai yn berthnasol yn awtomatig. Er enghraifft, anhysbysrwydd a roddir i ddioddefwyr rhai troseddau rhywiol.",
"restrictionInformationP4": "I ganfod pa gyfyngiadau riportio sy'n berthnasol ar achos penodol, cysylltwch â'r:",
"restrictionBulletPoint1": "llys yn uniongyrchol",
"restrictionBulletPoint2": "Gwasanaeth Llysoedd a Thribiwnlysoedd EM ar 0330 808 4407",
"courtRoom": "Ystafell llys",
"sittingAt": "Yn eistedd yn",
"tableHeaders": [
"Cyfeirnod yr Achos",
"Enw'r Diffynnydd(Diffynyddion)",
"Math o Wrandawiad",
"Cynrychiolir gan",
"Yr Awdurdod sy'n Erlyn",
"Nodiadau Rhestru"
],
"dataSource": "Ffynhonnell Data"
}
30 changes: 30 additions & 0 deletions src/main/resources/locales/cy/crown-warned-pdda-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"title": "Rhestr Rybuddio Llys y Goron",
"heading": "Rhestr Rybuddio Llys y Goron ar gyfer",
"listUpdated": "Diweddarwyd diwethaf DATE am",
"to": "i",
"headingP1": "Rhoir rhybudd yng nghyswllt yr achosion isod am gyfnod gwrandawiad o'r wythnos yn dechrau",
"headingP2": "Dylid cyflwyno unrhyw sylwadau am restru achos i’r Swyddog Rhestru yn ddi-oed",
"headingP3": "Yr awdurdod erlyn yw Gwasanaeth Erlyn y Goron oni nodir yn wahanol",
"headingP4": "Mae (*) yn dynodi diffynnydd a gedwir yn y ddalfa",
"restrictionInformationHeading": "Cyfyngiadau ar gyhoeddi neu ysgrifennu am yr achosion hyn.",
"restrictionInformationP1": "Rhaid i chi wirio a oes unrhyw gyfyngiadau riportio yn berthnasol cyn cyhoeddi manylion am unrhyw un o'r achosion a restrir yma, naill ai'n ysgrifenedig, mewn darllediad neu ar y rhyngrwyd, gan gynnwys y cyfryngau cymdeithasol.",
"restrictionInformationBoldText": "Byddwch yn euog o ddirmyg llys os byddwch yn cyhoeddi unrhyw wybodaeth sydd wedi'i diogelu gan gyfyngiad riportio. Gallwch gael dirwy, eich dedfrydu i garchar, neu'r ddau.",
"restrictionInformationP2": "Bydd cyfyngiadau penodol a orchmynnir gan y llys yn cael eu crybwyll ar yr achosion a restrir yma.",
"restrictionInformationP3": "Fodd bynnag, nid yw'r cyfyngiadau bob amser yn cael eu rhestru. Mae rhai yn berthnasol yn awtomatig. Er enghraifft, anhysbysrwydd a roddir i ddioddefwyr rhai troseddau rhywiol.",
"restrictionInformationP4": "I ganfod pa gyfyngiadau riportio sy'n berthnasol ar achos penodol, cysylltwch â'r:",
"restrictionBulletPoint1": "llys yn uniongyrchol",
"restrictionBulletPoint2": "Gwasanaeth Llysoedd a Thribiwnlysoedd EM ar 0330 808 4407",
"versionText": "Fersiwn",
"tableHeaders": [
"Pennu ar gyfer",
"Cyfeirnod yr Achos",
"Enw'r Diffynnydd",
"Yr Awdurdod sy'n Erlyn",
"Achosion cysylltiedig",
"Nodiadau rhestru"
],
"toBeAllocatedText": "I'w neilltuo",
"dataSource": "Ffynhonnell Data",
"backButton": "Yn ôl"
}
26 changes: 26 additions & 0 deletions src/main/resources/locales/en/crown-daily-pdda-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"title": "Crown Daily List",
"heading": "Crown Daily List for",
"listDate": "List for",
"listUpdated": "Last updated",
"at": "at",
"versionText": "Version",
"restrictionInformationHeading": "Restrictions on publishing or writing about these cases",
"restrictionInformationP1": "You must check if any reporting restrictions apply before publishing details on any of the cases listed here either in writing, in a broadcast or by internet, including social media.",
"restrictionInformationBoldText": "You'll be in contempt of court if you publish any information which is protected by a reporting restriction. You could get a fine, prison sentence or both.",
"restrictionInformationP2": "Specific restrictions ordered by the court will be mentioned on the cases listed here.",
"restrictionInformationP3": "However, restrictions are not always listed. Some apply automatically. For example, anonymity given to the victims of certain sexual offences.",
"restrictionInformationP4": "To find out which reporting restrictions apply on a specific case, contact:",
"restrictionBulletPoint1": "the court directly",
"restrictionBulletPoint2": "HM Courts and Tribunals Service on 0330 808 4407",
"court": "COURT",
"sittingAt": "Sitting at",
"tableHeaders": [
"Case Reference",
"Defendant Name(s)",
"Hearing Type",
"Prosecuting Authority",
"Listing Notes"
],
"dataSource": "Data Source"
}
28 changes: 28 additions & 0 deletions src/main/resources/locales/en/crown-firm-pdda-list.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"title": "Crown Firm List",
"heading": "Crown Firm List for",
"listDate": "List for",
"to": "to",
"listUpdated": "Last updated",
"at": "at",
"versionText": "Version",
"restrictionInformationHeading": "Restrictions on publishing or writing about these cases",
"restrictionInformationP1": "You must check if any reporting restrictions apply before publishing details on any of the cases listed here either in writing, in a broadcast or by internet, including social media.",
"restrictionInformationBoldText": "You'll be in contempt of court if you publish any information which is protected by a reporting restriction. You could get a fine, prison sentence or both.",
"restrictionInformationP2": "Specific restrictions ordered by the court will be mentioned on the cases listed here.",
"restrictionInformationP3": "However, restrictions are not always listed. Some apply automatically. For example, anonymity given to the victims of certain sexual offences.",
"restrictionInformationP4": "To find out which reporting restrictions apply on a specific case, contact:",
"restrictionBulletPoint1": "the court directly",
"restrictionBulletPoint2": "HM Courts and Tribunals Service on 0330 808 4407",
"courtRoom": "Courtroom",
"sittingAt": "Sitting at",
"tableHeaders": [
"Case Number",
"Defendant Name(s)",
"Hearing Type",
"Representative",
"Prosecuting Authority",
"Listing Notes"
],
"dataSource": "Data Source"
}
Loading
Loading