From 18bf25e7aae65aa3d2b220c2603b80ed033aa7f7 Mon Sep 17 00:00:00 2001 From: joe-fol Date: Wed, 21 Aug 2024 08:10:24 +0100 Subject: [PATCH] Revert "Remove sort against cjs offences" This reverts commit 294936b088a38e49a3abd846a90275256ec9b8f5. --- src/merge-offence-data.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/merge-offence-data.ts b/src/merge-offence-data.ts index c0b232d..b888dd8 100644 --- a/src/merge-offence-data.ts +++ b/src/merge-offence-data.ts @@ -1,10 +1,12 @@ import fs from "fs" import offenceCodeB7CategoryOverrides from "../input-data/offence-code/b7-overrides.json" import pncOffenceCodes from "../input-data/offence-code/pnc-ccjs-cjs-offences.json" -import standingDataOffenceCodes from "../input-data/offence-code/standing-data-api-offences.json" +import standingDataOffenceCodes from "../input-data/offence-code/standing-data-api.json" import currentOffenceCodes from "../output-data/data/offence-code.json" import consistentSort from "./lib/consistentSort" import createOffenceCodeLookup from "./lib/createOffenceCodeLookup" +import HomeOfficeClassifictionPriority from "./merge/HomeOfficeClassificationPriority" +import NotifiableToHOPriority from "./merge/NotifiableToHOPriority" import OffenceCategoryPriority from "./merge/OffenceCategoryPriority" import OffenceCodeMerger from "./merge/OffenceCodeMerger" import OffenceTitlePriority from "./merge/OffenceTitlePriority" @@ -26,6 +28,16 @@ const allOffenceCodeKeys = new Set( ) const main = async () => { + const hoClassification = new HomeOfficeClassifictionPriority( + currentOffenceCodeLookup, + standingDataOffenceCodeLookup + ) + + const notifiableToHo = new NotifiableToHOPriority( + currentOffenceCodeLookup, + standingDataOffenceCodeLookup + ) + const offenceCategory = new OffenceCategoryPriority( currentOffenceCodeLookup, offenceCodeB7CategoryOverrides, @@ -47,6 +59,8 @@ const main = async () => { const merger = new OffenceCodeMerger( allOffenceCodeKeys, + hoClassification, + notifiableToHo, offenceCategory, offenceTitle, recordableOnPnc