@moj-bichard7-developers/bichard7-next-data 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/.eslintcache +1 -0
  2. package/data/actual-offence-date.json +26 -0
  3. package/data/alcohol-level-method.json +102 -0
  4. package/data/amount.json +50 -0
  5. package/data/country.json +958 -0
  6. package/data/court-type.json +34 -0
  7. package/data/crest-disposal.json +15160 -0
  8. package/data/defendant-present-at-hearing.json +14 -0
  9. package/data/duration-type.json +34 -0
  10. package/data/duration-unit.json +51 -0
  11. package/data/gender.json +30 -0
  12. package/data/mode-of-trial-reason.json +47 -0
  13. package/data/number.json +10 -0
  14. package/data/offence-category.json +98 -0
  15. package/data/offence-code.json +271532 -0
  16. package/data/offence-initiation.json +14 -0
  17. package/data/organisation-unit.json +69940 -0
  18. package/data/plea-status.json +50 -0
  19. package/data/pnc-court-mapping.json +7 -0
  20. package/data/pnc-disposal.json +398 -0
  21. package/data/qualifier.json +18 -0
  22. package/data/remand-status.json +44 -0
  23. package/data/result-class.json +34 -0
  24. package/data/result-code.json +5098 -0
  25. package/data/result-qualifier-code.json +1198 -0
  26. package/data/summons.json +18 -0
  27. package/data/target-court-type.json +10 -0
  28. package/data/type-of-hearing.json +202 -0
  29. package/data/vehicle-code.json +10 -0
  30. package/data/verdict.json +32 -0
  31. package/data/yes-no.json +18 -0
  32. package/dist/data/actual-offence-date.json +26 -0
  33. package/dist/data/alcohol-level-method.json +102 -0
  34. package/dist/data/amount.json +50 -0
  35. package/dist/data/country.json +958 -0
  36. package/dist/data/court-type.json +34 -0
  37. package/dist/data/crest-disposal.json +15160 -0
  38. package/dist/data/defendant-present-at-hearing.json +14 -0
  39. package/dist/data/duration-type.json +34 -0
  40. package/dist/data/duration-unit.json +51 -0
  41. package/dist/data/gender.json +30 -0
  42. package/dist/data/mode-of-trial-reason.json +47 -0
  43. package/dist/data/number.json +10 -0
  44. package/dist/data/offence-category.json +98 -0
  45. package/dist/data/offence-code.json +271532 -0
  46. package/dist/data/offence-initiation.json +14 -0
  47. package/dist/data/organisation-unit.json +69940 -0
  48. package/dist/data/plea-status.json +50 -0
  49. package/dist/data/pnc-court-mapping.json +7 -0
  50. package/dist/data/pnc-disposal.json +398 -0
  51. package/dist/data/qualifier.json +18 -0
  52. package/dist/data/remand-status.json +44 -0
  53. package/dist/data/result-class.json +34 -0
  54. package/dist/data/result-code.json +5098 -0
  55. package/dist/data/result-qualifier-code.json +1198 -0
  56. package/dist/data/summons.json +18 -0
  57. package/dist/data/target-court-type.json +10 -0
  58. package/dist/data/type-of-hearing.json +202 -0
  59. package/dist/data/vehicle-code.json +10 -0
  60. package/dist/data/verdict.json +32 -0
  61. package/dist/data/yes-no.json +18 -0
  62. package/dist/index.d.ts +85 -0
  63. package/dist/index.js +98 -0
  64. package/dist/index.js.map +1 -0
  65. package/dist/types/types.d.ts +110 -0
  66. package/dist/types/types.js +3 -0
  67. package/dist/types/types.js.map +1 -0
  68. package/index.ts +127 -0
  69. package/package.json +39 -0
  70. package/tsconfig.json +23 -0
  71. package/types/types.ts +160 -0
package/index.ts ADDED
@@ -0,0 +1,127 @@
1
+ import {
2
+ ActualOffenceDate,
3
+ AlcoholLevelMethod,
4
+ Amount,
5
+ Country,
6
+ CourtType,
7
+ CrestDisposal,
8
+ DefendantPresentAtHearing,
9
+ DurationType,
10
+ DurationUnit,
11
+ Gender,
12
+ ModeOfTrialReason,
13
+ Number,
14
+ OffenceCategory,
15
+ OffenceCode,
16
+ OffenceInitiation,
17
+ OrganisationUnit,
18
+ PleaStatus,
19
+ PncCourtMapping,
20
+ PncDisposal,
21
+ Qualifier,
22
+ RemandStatus,
23
+ ResultClass,
24
+ ResultCode,
25
+ ResultQualifierCode,
26
+ Summons,
27
+ TargetCourtType,
28
+ TypeOfHearing,
29
+ VehicleCode,
30
+ Verdict,
31
+ YesNo
32
+ } from "./types/types"
33
+
34
+ import actualOffenceDateData from "./data/actual-offence-date.json"
35
+ import alcoholLevelMethodData from "./data/alcohol-level-method.json"
36
+ import amountData from "./data/amount.json"
37
+ import countryData from "./data/country.json"
38
+ import courtTypeData from "./data/court-type.json"
39
+ import crestDisposalData from "./data/crest-disposal.json"
40
+ import defendantPresentAtHearingData from "./data/defendant-present-at-hearing.json"
41
+ import durationTypeData from "./data/duration-type.json"
42
+ import durationUnitData from "./data/duration-unit.json"
43
+ import genderData from "./data/gender.json"
44
+ import modeOfTrialReasonData from "./data/mode-of-trial-reason.json"
45
+ import numberData from "./data/number.json"
46
+ import offenceCategoryData from "./data/offence-category.json"
47
+ import offenceCodeData from "./data/offence-code.json"
48
+ import offenceInitiationData from "./data/offence-initiation.json"
49
+ import organisationUnitData from "./data/organisation-unit.json"
50
+ import pleaStatusData from "./data/plea-status.json"
51
+ import pncCourtMappingData from "./data/pnc-court-mapping.json"
52
+ import pncDisposalData from "./data/pnc-disposal.json"
53
+ import qualifierData from "./data/qualifier.json"
54
+ import remandStatusData from "./data/remand-status.json"
55
+ import resultClassData from "./data/result-class.json"
56
+ import resultCodeData from "./data/result-code.json"
57
+ import resultQualifierCodeData from "./data/result-qualifier-code.json"
58
+ import summonsData from "./data/summons.json"
59
+ import targetCourtTypeData from "./data/target-court-type.json"
60
+ import typeOfHearingData from "./data/type-of-hearing.json"
61
+ import vehicleCodeData from "./data/vehicle-code.json"
62
+ import verdictData from "./data/verdict.json"
63
+ import yesNoData from "./data/yes-no.json"
64
+
65
+ const actualOffenceDate: ActualOffenceDate[] = actualOffenceDateData
66
+ const alcoholLevelMethod: AlcoholLevelMethod[] = alcoholLevelMethodData
67
+ const amount: Amount[] = amountData
68
+ const country: Country[] = countryData
69
+ const courtType: CourtType[] = courtTypeData
70
+ const crestDisposal: CrestDisposal[] = crestDisposalData
71
+ const defendantPresentAtHearing: DefendantPresentAtHearing[] = defendantPresentAtHearingData
72
+ const durationType: DurationType[] = durationTypeData
73
+ const durationUnit: DurationUnit[] = durationUnitData
74
+ const gender: Gender[] = genderData
75
+ const modeOfTrialReason: ModeOfTrialReason[] = modeOfTrialReasonData
76
+ const number: Number[] = numberData
77
+ const offenceCategory: OffenceCategory[] = offenceCategoryData
78
+ const offenceCode: OffenceCode[] = offenceCodeData
79
+ const offenceInitiation: OffenceInitiation[] = offenceInitiationData
80
+ const organisationUnit: OrganisationUnit[] = organisationUnitData
81
+ const pleaStatus: PleaStatus[] = pleaStatusData
82
+ const pncCourtMapping: PncCourtMapping[] = pncCourtMappingData
83
+ const pncDisposal: PncDisposal[] = pncDisposalData
84
+ const qualifier: Qualifier[] = qualifierData
85
+ const remandStatus: RemandStatus[] = remandStatusData
86
+ const resultClass: ResultClass[] = resultClassData
87
+ const resultCode: ResultCode[] = resultCodeData
88
+ const resultQualifierCode: ResultQualifierCode[] = resultQualifierCodeData
89
+ const summons: Summons[] = summonsData
90
+ const targetCourtType: TargetCourtType[] = targetCourtTypeData
91
+ const typeOfHearing: TypeOfHearing[] = typeOfHearingData
92
+ const vehicleCode: VehicleCode[] = vehicleCodeData
93
+ const verdict: Verdict[] = verdictData
94
+ const yesNo: YesNo[] = yesNoData
95
+
96
+ export default {
97
+ actualOffenceDate,
98
+ alcoholLevelMethod,
99
+ amount,
100
+ country,
101
+ courtType,
102
+ crestDisposal,
103
+ defendantPresentAtHearing,
104
+ durationType,
105
+ durationUnit,
106
+ gender,
107
+ modeOfTrialReason,
108
+ number,
109
+ offenceCategory,
110
+ offenceCode,
111
+ offenceInitiation,
112
+ organisationUnit,
113
+ pleaStatus,
114
+ pncCourtMapping,
115
+ pncDisposal,
116
+ qualifier,
117
+ remandStatus,
118
+ resultClass,
119
+ resultCode,
120
+ resultQualifierCode,
121
+ summons,
122
+ targetCourtType,
123
+ typeOfHearing,
124
+ vehicleCode,
125
+ verdict,
126
+ yesNo
127
+ }
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@moj-bichard7-developers/bichard7-next-data",
3
+ "version": "1.0.0",
4
+ "description": "The standing data for Bichard",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "scripts": {
8
+ "test": "jest",
9
+ "build": "tsc -p tsconfig.json"
10
+ },
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/ministryofjustice/bichard7-next-data.git"
14
+ },
15
+ "author": "",
16
+ "license": "MIT",
17
+ "bugs": {
18
+ "url": "https://github.com/ministryofjustice/bichard7-next-data/issues"
19
+ },
20
+ "homepage": "https://github.com/ministryofjustice/bichard7-next-data#readme",
21
+ "dependencies": {
22
+ "jest": "^27.5.1",
23
+ "jest-extended": "^2.0.0",
24
+ "ts-jest": "^27.1.3",
25
+ "typescript": "^4.5.5"
26
+ },
27
+ "lint-staged": {
28
+ "*.{js,ts}": "eslint --cache --fix"
29
+ },
30
+ "release": {
31
+ "branches": [
32
+ "main",
33
+ "publish-package-to-npm-registry"
34
+ ]
35
+ },
36
+ "publishConfig": {
37
+ "access": "public"
38
+ }
39
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "module": "CommonJS",
4
+ "moduleResolution": "node",
5
+ "target": "ES2020",
6
+ "noImplicitAny": true,
7
+ "preserveConstEnums": true,
8
+ "sourceMap": true,
9
+ "strict": true,
10
+ "esModuleInterop": true,
11
+ "noUnusedLocals": true,
12
+ "noUnusedParameters": true,
13
+ "resolveJsonModule": true,
14
+ "strictNullChecks": true,
15
+ "strictPropertyInitialization": false,
16
+ "skipLibCheck": true,
17
+ "declaration": true,
18
+ "outDir": "dist"
19
+ },
20
+ "include": [
21
+ "./*.ts", "index.js",
22
+ ]
23
+ }
package/types/types.ts ADDED
@@ -0,0 +1,160 @@
1
+ type CjsCodeAndDescription = {
2
+ cjsCode: string
3
+ description: string
4
+ }
5
+
6
+ type ActualOffenceDate = CjsCodeAndDescription
7
+ type Amount = CjsCodeAndDescription
8
+
9
+ type AlcoholLevelMethod = {
10
+ cjsCode: string
11
+ description: string
12
+ spiCode: string
13
+ }
14
+
15
+ type Country = CjsCodeAndDescription
16
+ type CourtType = CjsCodeAndDescription
17
+
18
+ type CrestDisposal = {
19
+ amountInResult: string
20
+ amountInResultType: string
21
+ dateInResult: string
22
+ disposalCode: string
23
+ duration: string
24
+ durationType: string
25
+ durationUnit: string
26
+ exception: string
27
+ hoQualifiers: string
28
+ hoResultCode: string
29
+ id: string
30
+ needsMapping: string
31
+ numberInResult: string
32
+ numberInResultType: string
33
+ qData: string
34
+ qDilSeqNo: string
35
+ rData: string
36
+ rDilSeqNo: string
37
+ template: string
38
+ timeInResult: string
39
+ }
40
+
41
+ type DefendantPresentAtHearing = CjsCodeAndDescription
42
+ type DurationType = CjsCodeAndDescription
43
+
44
+ type DurationUnit = {
45
+ cjsCode: string
46
+ description: string
47
+ pncCode: string
48
+ spiCode: string
49
+ xhibitCode: string
50
+ }
51
+
52
+ type Gender = DurationUnit
53
+
54
+ type ModeOfTrialReason = {
55
+ cjsCode: string
56
+ description: string
57
+ spiCode: string
58
+ }
59
+
60
+ type Number = CjsCodeAndDescription
61
+ type OffenceCategory = CjsCodeAndDescription
62
+
63
+ type OffenceCode = {
64
+ cjsCode: string
65
+ description: string
66
+ homeOfficeClassification: string
67
+ notifiableToHo: string
68
+ offenceCategory: string
69
+ offenceTitle: string
70
+ recordableOnPnc: string
71
+ resultHalfLifeHours?: string | null
72
+ }
73
+
74
+ type OffenceInitiation = CjsCodeAndDescription
75
+
76
+ type OrganisationUnit = {
77
+ bottomLevelCode: string
78
+ bottomLevelName: string
79
+ secondLevelCode: string
80
+ secondLevelName: string
81
+ thirdLevelCode: string
82
+ thirdLevelName: string
83
+ thirdLevelPsaCode: string
84
+ topLevelCode: string
85
+ topLevelName: string
86
+ }
87
+
88
+ type PleaStatus = {
89
+ cjsCode: string
90
+ description: string
91
+ pncCode: string
92
+ spiCode: string
93
+ }
94
+
95
+ type PncCourtMapping = {
96
+ cjsCode: string
97
+ description: string
98
+ pncCode: string
99
+ }
100
+
101
+ type PncDisposal = {
102
+ cjsCode: string
103
+ description: string
104
+ pncAdjudication: string
105
+ pncNonAdjudication: string
106
+ }
107
+
108
+ type Qualifier = CjsCodeAndDescription
109
+ type RemandStatus = PleaStatus
110
+ type ResultClass = CjsCodeAndDescription
111
+
112
+ type ResultCode = {
113
+ cjsCode: string
114
+ description: string
115
+ recordableOnPnc: string
116
+ resultCodeQualifiers: string
117
+ resultHalfLifeHours: string
118
+ type: string
119
+ }
120
+
121
+ type ResultQualifierCode = CjsCodeAndDescription
122
+ type Summons = CjsCodeAndDescription
123
+ type TargetCourtType = CjsCodeAndDescription
124
+ type TypeOfHearing = CjsCodeAndDescription
125
+ type VehicleCode = CjsCodeAndDescription
126
+ type Verdict = PleaStatus
127
+ type YesNo = CjsCodeAndDescription
128
+
129
+ export {
130
+ ActualOffenceDate,
131
+ AlcoholLevelMethod,
132
+ Amount,
133
+ Country,
134
+ CourtType,
135
+ CrestDisposal,
136
+ DefendantPresentAtHearing,
137
+ DurationType,
138
+ DurationUnit,
139
+ Gender,
140
+ ModeOfTrialReason,
141
+ Number,
142
+ OffenceCategory,
143
+ OffenceCode,
144
+ OffenceInitiation,
145
+ OrganisationUnit,
146
+ PleaStatus,
147
+ PncCourtMapping,
148
+ PncDisposal,
149
+ Qualifier,
150
+ RemandStatus,
151
+ ResultClass,
152
+ ResultCode,
153
+ ResultQualifierCode,
154
+ Summons,
155
+ TargetCourtType,
156
+ TypeOfHearing,
157
+ VehicleCode,
158
+ Verdict,
159
+ YesNo
160
+ }