-
Notifications
You must be signed in to change notification settings - Fork 36
/
reclassification.yaml
417 lines (374 loc) · 12.1 KB
/
reclassification.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
dataset_type: reclassification
target_dataset: reclassification
title: Proactive Publication - Position Reclassification
shortname: Position Reclassification
notes: Access, upload and modify the position reclassification reports for your organization
template_version: 3
template_updated: 2020-09-15
portal_type: info
collection: pd
resources:
- title: Proactive Publication - Position Reclassification
resource_name: reclassification
published_resource_id: bdaa5515-3782-4e5c-9d44-c25e032addb7
create_form: true
edit_form: true
fields:
- datastore_id: ref_number
datastore_type: text
label:
en: Reference Number
fr: Numéro de référence
obligation: Mandatory
excel_required: true
form_required: true
validation: This field must not be empty
format_type: Free text
excel_column_width: 30
form_attrs:
size: 60
- datastore_id: job_number
datastore_type: text
label:
en: Job Number
fr: Numéro d'emploi
format_type: Free text
excel_column_width: 30
form_attrs:
size: 60
- datastore_id: pos_number
datastore_type: text
label:
en: Position Number
fr: Numéro du poste
obligation: Mandatory
excel_required: true
form_required: true
validation: This field must not be empty
format_type: Free text
excel_column_width: 30
form_attrs:
size: 60
- datastore_id: date
datastore_type: date
label:
en: Date
fr: Date
obligation: Mandatory
excel_required: true
form_required: true
validation: This field must not be empty
format_type: Date (Please format the data as YYYY-MM-DD)
excel_column_width: 20
extract_date_year: true
extract_date_month: true
extract_date_clean: true
form_snippet: scheming/form_snippets/date.html
- datastore_id: pos_title_en
datastore_type: text
label:
en: Position Title (English)
fr: Titre du poste (anglais)
obligation: Mandatory
excel_required: true
form_required: true
validation: This field must not be empty
format_type: Free text
excel_column_width: 30
form_attrs:
size: 60
- datastore_id: pos_title_fr
datastore_type: text
label:
en: Position Title (French)
fr: Titre du poste (français)
obligation: Mandatory
excel_required: true
form_required: true
validation: This field must not be empty
format_type: Free text
excel_column_width: 30
form_attrs:
size: 60
- datastore_id: old_class_group_code
datastore_type: text
label:
en: Previous Position Classification Group
fr: Groupe de classification du poste antérieur
obligation: Mandatory
excel_required: true
form_required: true
format_type: Controlled List
validation: This field must not be empty
excel_full_text_choices: True
form_choices_prefix_code: True
choices_file: choices/classification_group.yaml
excel_error_formula: 'FALSE'
- datastore_id: old_class_level
datastore_type: text
label:
en: Previous Position Classification Level Number
fr: Numéro de niveau de la classification du poste antérieur
obligation: Mandatory
excel_required: true
form_required: true
format_type: Controlled List
validation: This field must not be empty
excel_full_text_choices: False
choices_file: choices/level_number.yaml
excel_error_formula: 'FALSE'
- datastore_id: new_class_group_code
datastore_type: text
label:
en: Reclassified Position Classification Group
fr: Groupe de classification du poste reclassifié
obligation: Mandatory
excel_required: true
form_required: true
format_type: Controlled List
validation: This field must not be empty
excel_full_text_choices: True
form_choices_prefix_code: True
choices_file: choices/classification_group.yaml
excel_error_formula: 'FALSE'
- datastore_id: new_class_level
datastore_type: text
label:
en: Reclassified Position Classification Level Number
fr: Numéro de niveau de la classification du poste reclassifié
obligation: Mandatory
excel_required: true
form_required: true
format_type: Controlled List
validation: This field must not be empty
excel_full_text_choices: False
choices_file: choices/level_number.yaml
excel_error_formula: 'FALSE'
- datastore_id: old_differential
datastore_type: text
label:
en: Previous Supervisory Differential
fr: Ancienne prime de surveillance
format_type: Free Text
form_attrs:
size: 60
- datastore_id: new_differential
datastore_type: text
label:
en: Reclassified Supervisory Differential
fr: Prime de surveillance précédente
format_type: Free Text
form_attrs:
size: 60
- datastore_id: reason_en
datastore_type: text
label:
en: Reason for Reclassification (English)
fr: Raison de la decision en anglais
obligation: Mandatory
excel_required: true
form_required: true
format_type: Free Text
validation: This field must not be empty
form_snippet: scheming/form_snippets/textarea.html
form_attrs:
style: "width: 100%; display: block"
- datastore_id: reason_fr
datastore_type: text
label:
en: Reason for Reclassification (French)
fr: Raison de la decision en français
obligation: Mandatory
excel_required: true
form_required: true
format_type: Free Text
validation: This field must not be empty
form_snippet: scheming/form_snippets/textarea.html
form_attrs:
style: "width: 100%; display: block"
- datastore_id: record_created
label: Record Creation Time
import_template_include: false
visible_to_public: false
datastore_type: timestamp
preview_class: bg-info
- datastore_id: record_modified
label: Last Record Modification Time
import_template_include: false
visible_to_public: false
datastore_type: timestamp
preview_class: bg-info
- datastore_id: user_modified
label: User Last Modified Record
import_template_include: false
visible_to_public: false
datastore_type: text
preview_class: bg-info
solr_static_fields:
report_type_en: Position Reclassification
report_type_fr: Reclassifications de postes
datastore_primary_key: [ref_number]
datastore_indexes: ""
triggers:
- reclassification_trigger: |
DECLARE
errors text[][] := '{{}}';
crval RECORD;
BEGIN
errors := errors || required_error(NEW.ref_number, 'ref_number');
IF NEW.ref_number LIKE '%,%' THEN
errors := errors || ARRAY[['ref_number', {ref_number_error}]];
END IF;
errors := errors || required_error(NEW.pos_number, 'pos_number');
errors := errors || required_error(NEW.date, 'date');
errors := errors || required_error(NEW.pos_title_en, 'pos_title_en');
errors := errors || required_error(NEW.pos_title_fr, 'pos_title_fr');
errors := errors || required_error(NEW.old_class_group_code, 'old_class_group_code');
errors := errors || choice_error(NEW.old_class_group_code, {old_class_group_code}, 'old_class_group_code');
errors := errors || required_error(NEW.new_class_group_code, 'new_class_group_code');
errors := errors || choice_error(NEW.new_class_group_code, {new_class_group_code}, 'new_class_group_code');
errors := errors || required_error(NEW.old_class_level, 'old_class_level');
errors := errors || required_error(NEW.new_class_level, 'new_class_level');
NEW.old_class_level := lpad(NEW.old_class_level::text, 2, '0');
errors := errors || choice_error(NEW.old_class_level, {old_class_level}, 'old_class_level');
NEW.new_class_level := lpad(NEW.new_class_level::text, 2, '0');
errors := errors || choice_error(NEW.new_class_level, {new_class_level}, 'new_class_level');
errors := errors || required_error(NEW.reason_en, 'reason_en');
errors := errors || required_error(NEW.reason_fr, 'reason_fr');
IF errors = '{{}}' THEN
RETURN NEW;
END IF;
RAISE EXCEPTION E'TAB-DELIMITED\t%', array_to_string(errors, E'\t');
END;
- update_record_modified_created_trigger
trigger_strings: # yaml | not supported
ref_number_error: Comma is not allowed in Reference Number field
examples:
record:
ref_number: "PR-2019-Q1-00005"
pos_number: "14999"
date: "2019-03-01"
pos_title_en: "Chief, Facilities Services Management"
pos_title_fr: "Chef, Gestion des services aux immeubles"
old_class_group_code: "AS"
old_class_level: "03"
new_class_group_code: "AS"
new_class_level: "04"
reason_en: "Change of Duties"
reason_fr: "Changements des les fonctions de travail"
filters:
pos_number: "14999"
filter_one:
ref_number: "PR-2019-Q1-00005"
sort: date desc
- title: Proactive Publication - Position Reclassification Nothing to Report
resource_name: reclassification-nil
published_resource_id: 1e955e4d-df35-4441-bf38-b7086192ece2
create_form: true
edit_form: false #edit not possible for nil reports since only stored data is primary key
fields:
- datastore_id: year
datastore_type: year
label:
en: Year
fr: Année
obligation: Mandatory
excel_required: true
form_required: true
validation: This field must not be empty
excel_column_width: 10
extract_date_year: true
excel_error_formula: '{cell}>YEAR(TODAY())'
- datastore_id: quarter
datastore_type: text
label:
en: Quarter
fr: Trimestre
excel_column_width: 10
obligation: Mandatory
excel_required: true
form_required: true
validation: This field must not be empty
excel_full_text_choices: true
choices:
Q1:
en: April 1 - June 30
fr: 1 avril - 30 juin
Q2:
en: July 1 - September 30
fr: 1 juillet - 30 septembre
Q3:
en: October 1 - December 31
fr: 1 octobre - 31 décembre
Q4:
en: January 1 - March 31
fr: 1 janvier - 31 mars
- datastore_id: record_created
label: Record Creation Time
import_template_include: false
visible_to_public: false
datastore_type: timestamp
preview_class: bg-info
- datastore_id: record_modified
label: Last Record Modification Time
import_template_include: false
visible_to_public: false
datastore_type: timestamp
preview_class: bg-info
- datastore_id: user_modified
label: User Last Modified Record
import_template_include: false
visible_to_public: false
datastore_type: text
preview_class: bg-info
solr_static_fields:
report_type_en: Nothing to report
report_type_fr: Rien à signaler
datastore_primary_key: [year, quarter]
datastore_indexes: ""
triggers:
- reclassification_nil_trigger: |
DECLARE
errors text[][] := '{{}}';
crval RECORD;
BEGIN
errors := errors || required_error(NEW.year, 'year');
errors := errors || required_error(NEW.quarter, 'quarter');
errors := errors || choice_error(NEW.quarter, {quarter}, 'quarter');
IF NEW.year > date_part('year', CURRENT_DATE) THEN
errors := errors || ARRAY[['year', {year_error}]];
END IF;
IF errors = '{{}}' THEN
RETURN NEW;
END IF;
RAISE EXCEPTION E'TAB-DELIMITED\t%', array_to_string(errors, E'\t');
END;
- update_record_modified_created_trigger
trigger_strings: # yaml | not supported
year_error: This must list the year you are reporting on (not the fiscal year).
examples:
record:
year: 2016
quarter: Q2
filters:
year: 2016
filter_one:
year: 2016
quarter: Q2
sort: year desc, quarter desc
# https://design.gccollab.ca/component/colour "Green and Blue" colours 2, 3
excel_edge_style:
PatternFill:
patternType: solid
fgColor: FF4e4741
Font:
color: FFFFFF
size: 14
excel_header_style:
PatternFill:
patternType: solid
fgColor: FF83c3f2
excel_column_heading_style:
PatternFill:
patternType: solid
fgColor: FF83c3f2