@dvsa/des-scheduling-config 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.
- package/.github/PULL_REQUEST_TEMPLATE.md +20 -0
- package/.github/workflows/ci.yaml +13 -0
- package/.github/workflows/publish.yaml +15 -0
- package/.github/workflows/security.yaml +9 -0
- package/.husky/pre-commit +4 -0
- package/.husky/pre-push +4 -0
- package/.idea/des-scheduling-config.iml +8 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/.npm-version +1 -0
- package/package.json +25 -0
- package/src/schemas/scheduling-schema.ts +112 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Description and relevant Jira numbers
|
|
2
|
+
|
|
3
|
+
## Pull Request checklist
|
|
4
|
+
|
|
5
|
+
- [ ] [WIP] tag removed from PR title
|
|
6
|
+
- [ ] PR has an understandable description
|
|
7
|
+
|
|
8
|
+
## Git feature branch checklist
|
|
9
|
+
|
|
10
|
+
- [ ] branch name comply with our branching strategy
|
|
11
|
+
- [ ] git branch contains relevant JIRA ticket number
|
|
12
|
+
- [ ] branch rebased against the latest develop
|
|
13
|
+
|
|
14
|
+
## Sign off process checklist
|
|
15
|
+
|
|
16
|
+
- [ ] Code has been tested manually
|
|
17
|
+
- [ ] Tested by QA
|
|
18
|
+
- [ ] PO's approval
|
|
19
|
+
- [ ] Reviewers selected in Github
|
|
20
|
+
- [ ] PR link added to JIRA
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
name: Publish package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- develop
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
uses: dvsa/des-workflow-actions/.github/workflows/publish-package.yaml@main
|
|
11
|
+
with:
|
|
12
|
+
WORKING_DIRECTORY: '.'
|
|
13
|
+
PACKAGE_NAME: '@dvsa/mes-microservice-common'
|
|
14
|
+
secrets:
|
|
15
|
+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
package/.husky/pre-push
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<module type="WEB_MODULE" version="4">
|
|
3
|
+
<component name="NewModuleRootManager">
|
|
4
|
+
<content url="file://$MODULE_DIR$" />
|
|
5
|
+
<orderEntry type="inheritedJdk" />
|
|
6
|
+
<orderEntry type="sourceFolder" forTests="false" />
|
|
7
|
+
</component>
|
|
8
|
+
</module>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<project version="4">
|
|
3
|
+
<component name="ProjectModuleManager">
|
|
4
|
+
<modules>
|
|
5
|
+
<module fileurl="file://$PROJECT_DIR$/.idea/des-scheduling-config.iml" filepath="$PROJECT_DIR$/.idea/des-scheduling-config.iml" />
|
|
6
|
+
</modules>
|
|
7
|
+
</component>
|
|
8
|
+
</project>
|
package/.idea/vcs.xml
ADDED
package/.npm-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
10.1.0
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dvsa/des-scheduling-config",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The config for the DES schedulng table",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"clean": "rimraf build artefacts dist lib application domain framework",
|
|
8
|
+
"lint": "eslint -c .eslintrc.js --ext .ts src",
|
|
9
|
+
"package": "npm run clean && npm run test && npm run lint",
|
|
10
|
+
"test": "npm run compile && jasmine",
|
|
11
|
+
"compile": "npm run clean && tsc"
|
|
12
|
+
},
|
|
13
|
+
"author": "DVSA",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"drizzle-orm": "^0.45.1",
|
|
17
|
+
"mysql": "^2.18.1"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"husky": "^9.1.7",
|
|
21
|
+
"rimraf": "^6.1.2",
|
|
22
|
+
"ts-node": "^10.9.2",
|
|
23
|
+
"typescript": "^5.9.3"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import {
|
|
2
|
+
varchar,
|
|
3
|
+
int,
|
|
4
|
+
tinyint,
|
|
5
|
+
decimal,
|
|
6
|
+
text,
|
|
7
|
+
json,
|
|
8
|
+
datetime,
|
|
9
|
+
mysqlEnum,
|
|
10
|
+
bigint, mysqlTable,
|
|
11
|
+
} from 'drizzle-orm/mysql-core';
|
|
12
|
+
|
|
13
|
+
export const ScheduleBookings = mysqlTable(
|
|
14
|
+
'bookings',
|
|
15
|
+
{
|
|
16
|
+
created_date: datetime('created_date').notNull(),
|
|
17
|
+
last_updated_date: datetime('last_updated_date').notNull(),
|
|
18
|
+
booking_reference: varchar('booking_reference', {length: 50}).notNull().primaryKey(),
|
|
19
|
+
|
|
20
|
+
marked_for_deletion: tinyint('marked_for_deletion'),
|
|
21
|
+
dsp_created_date: datetime('dsp_created_date').notNull(),
|
|
22
|
+
dsp_last_updated_date: datetime('dsp_last_updated_date').notNull(),
|
|
23
|
+
|
|
24
|
+
examiner_staff_number: varchar('examiner_staff_number', {length: 50}).notNull(),
|
|
25
|
+
examiner_title: varchar('examiner_title', {length: 50}).notNull(),
|
|
26
|
+
examiner_first_name: varchar('examiner_first_name', {length: 100}).notNull(),
|
|
27
|
+
examiner_second_name: varchar('examiner_second_name', {length: 100}).notNull(),
|
|
28
|
+
examiner_third_name: varchar('examiner_third_name', {length: 100}).notNull(),
|
|
29
|
+
examiner_last_name: varchar('examiner_last_name', {length: 100}).notNull(),
|
|
30
|
+
|
|
31
|
+
testslot_start: datetime('testslot_start').notNull(),
|
|
32
|
+
slot_id: bigint('slot_id', {mode: 'bigint'}).notNull(),
|
|
33
|
+
testslot_duration_minutes: int('testslot_duration_minutes').notNull(),
|
|
34
|
+
testslot_vehicle_type_code: mysqlEnum('testslot_vehicle_type_code', [
|
|
35
|
+
'L',
|
|
36
|
+
'C',
|
|
37
|
+
'B',
|
|
38
|
+
'T',
|
|
39
|
+
'A2',
|
|
40
|
+
'A3',
|
|
41
|
+
'V4',
|
|
42
|
+
'B1',
|
|
43
|
+
'B2',
|
|
44
|
+
'O',
|
|
45
|
+
'LM',
|
|
46
|
+
'BE',
|
|
47
|
+
'TC',
|
|
48
|
+
'SC']).notNull(),
|
|
49
|
+
testslot_vehicle_slot_type_code: int('testslot_vehicle_slot_type_code'),
|
|
50
|
+
|
|
51
|
+
testcentre_name: varchar('testcentre_name', {length: 255}).notNull(),
|
|
52
|
+
testcentre_cost_code: varchar('testcentre_cost_code', {length: 50}).notNull(),
|
|
53
|
+
|
|
54
|
+
candidate_title: varchar('candidate_title', {length: 50}).notNull(),
|
|
55
|
+
candidate_first_name: varchar('candidate_first_name', {length: 100}).notNull(),
|
|
56
|
+
candidate_second_name: varchar('candidate_second_name', {length: 100}).notNull(),
|
|
57
|
+
candidate_third_name: varchar('candidate_third_name', {length: 100}).notNull(),
|
|
58
|
+
candidate_last_name: varchar('candidate_last_name', {length: 100}).notNull(),
|
|
59
|
+
candidate_driver_number: varchar('candidate_driver_number', {length: 50}).notNull(),
|
|
60
|
+
candidate_date_of_birth: datetime('candidate_date_of_birth').notNull(),
|
|
61
|
+
candidate_gender: mysqlEnum('candidate_gender', ['M', 'F']).notNull(),
|
|
62
|
+
candidate_address_line1: varchar('candidate_address_line1', {length: 255}).notNull(),
|
|
63
|
+
candidate_address_line2: varchar('candidate_address_line2', {length: 255}).notNull(),
|
|
64
|
+
candidate_address_line3: varchar('candidate_address_line3', {length: 255}).notNull(),
|
|
65
|
+
candidate_address_line4: varchar('candidate_address_line4', {length: 255}).notNull(),
|
|
66
|
+
candidate_address_line5: varchar('candidate_address_line5', {length: 255}).notNull(),
|
|
67
|
+
candidate_postcode: varchar('candidate_postcode', {length: 20}).notNull(),
|
|
68
|
+
candidate_primary_telephone: varchar('candidate_primary_telephone', {length: 50}).notNull(),
|
|
69
|
+
candidate_secondary_telephone: varchar('candidate_secondary_telephone', {length: 50}).notNull(),
|
|
70
|
+
candidate_mobile_telephone: varchar('candidate_mobile_telephone', {length: 50}).notNull(),
|
|
71
|
+
candidate_email_address: varchar('candidate_email_address', {length: 255}).notNull(),
|
|
72
|
+
candidate_prn: int('candidate_prn'),
|
|
73
|
+
candidate_previous_adi_tests: int('candidate_previous_adi_tests'),
|
|
74
|
+
candidate_ethnicity_code: varchar('candidate_ethnicity_code', {length: 5}),
|
|
75
|
+
|
|
76
|
+
application_welsh_test: tinyint('application_welsh_test').notNull(),
|
|
77
|
+
application_extended_test: tinyint('application_extended_test').notNull(),
|
|
78
|
+
application_meeting_place: varchar('application_meeting_place', {length: 255}).notNull(),
|
|
79
|
+
application_progressive_access: tinyint('application_progressive_access').notNull(),
|
|
80
|
+
application_special_needs: text('application_special_needs').notNull(),
|
|
81
|
+
application_special_needs_ext_test: tinyint('application_special_needs_ext_test').notNull(),
|
|
82
|
+
application_special_needs_code: mysqlEnum('application_special_needs_code', ['NONE', 'YES', 'EXTRA']).notNull(),
|
|
83
|
+
application_entitlement_check: tinyint('application_entitlement_check').notNull(),
|
|
84
|
+
application_fit_marker: tinyint('application_fit_marker').notNull(),
|
|
85
|
+
application_fit_case_number: varchar('application_fit_case_number', {length: 50}).notNull(),
|
|
86
|
+
application_category_entitlement_check: tinyint('application_category_entitlement_check').notNull(),
|
|
87
|
+
application_vehicle_seats: int('application_vehicle_seats'),
|
|
88
|
+
application_vehicle_height_m: decimal('application_vehicle_height_m', {precision: 5, scale: 2}),
|
|
89
|
+
application_vehicle_width_m: decimal('application_vehicle_width_m', {precision: 5, scale: 2}),
|
|
90
|
+
application_vehicle_length_m: decimal('application_vehicle_length_m', {precision: 5, scale: 2}),
|
|
91
|
+
application_test_category: varchar('application_test_category', {length: 10}).notNull(),
|
|
92
|
+
application_vehicle_gearbox: mysqlEnum('application_vehicle_gearbox',
|
|
93
|
+
[
|
|
94
|
+
'Manual',
|
|
95
|
+
'Semi-Automatic',
|
|
96
|
+
'Automatic',
|
|
97
|
+
]).notNull(),
|
|
98
|
+
|
|
99
|
+
previous_cancellation: json('previous_cancellation').$type<string[]>(),
|
|
100
|
+
business_id: int('business_id'),
|
|
101
|
+
business_name: varchar('business_name', {length: 255}),
|
|
102
|
+
business_address_line1: varchar('business_address_line1', {length: 255}),
|
|
103
|
+
business_address_line2: varchar('business_address_line2', {length: 255}),
|
|
104
|
+
business_address_line3: varchar('business_address_line3', {length: 255}),
|
|
105
|
+
business_address_line4: varchar('business_address_line4', {length: 255}),
|
|
106
|
+
business_address_line5: varchar('business_address_line5', {length: 255}),
|
|
107
|
+
business_postcode: varchar('business_postcode', {length: 20}),
|
|
108
|
+
business_telephone: varchar('business_telephone', {length: 50}),
|
|
109
|
+
|
|
110
|
+
examiner_visiting: tinyint('examiner_visiting'),
|
|
111
|
+
},
|
|
112
|
+
);
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"outDir": "./build",
|
|
4
|
+
"strict": true,
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"allowJs": false,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"lib": [
|
|
9
|
+
"es6",
|
|
10
|
+
"es2017",
|
|
11
|
+
"dom"
|
|
12
|
+
],
|
|
13
|
+
"target": "es5",
|
|
14
|
+
"types": [
|
|
15
|
+
"node",
|
|
16
|
+
],
|
|
17
|
+
"experimentalDecorators": true,
|
|
18
|
+
"emitDecoratorMetadata": true
|
|
19
|
+
},
|
|
20
|
+
"include": [
|
|
21
|
+
"./src/**/*",
|
|
22
|
+
],
|
|
23
|
+
"exclude": [
|
|
24
|
+
"node_modules"
|
|
25
|
+
]
|
|
26
|
+
}
|