-
Notifications
You must be signed in to change notification settings - Fork 36
/
adminaircraft.yaml
347 lines (313 loc) · 12.4 KB
/
adminaircraft.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
dataset_type: adminaircraft
target_dataset: adminaircraft
title: Proactive Publication - Use of Administrative Aircraft
shortname: Use of Administrative Aircraft
notes: Access, upload and modify government administrative aircraft use
template_version: 3
portal_type: info
resources:
- title: Proactive Publication - Use of Administrative Aircraft
collection: pd
resources:
- title: Proactive Publication - Use of Administrative Aircraft
resource_name: adminaircraft
published_resource_id: 1495406e-338c-43ec-9995-ec8d8c90d17e
create_form: true
edit_form: true
fields:
# 3.1
- datastore_id: reference_number
label:
en: Reference Number
fr: Numéro de référence
description:
en: This field is populated by the user with the reference number of the trip. This number is a mandatory system requirement when publishing a template.
fr: Ce champ est rempli par l’utilisateur avec le numéro de référence du voyage. Le numéro est une exigence de système obligatoire pour la publication d’un modèle.
obligation: Mandatory
excel_required: true
form_required: true
format_type: Free text
validation: This field must not be empty
visible_to_public: Yes
occurrence: Single
datastore_type: text
# 3.2
- datastore_id: minister
label:
en: Title of Minister
fr: Titre du ministre
description:
en: This field will display the title of the Minister who requested the trip.
fr: Ce champ affichera le titre du ministre qui a demandé le voyage.
obligation: Mandatory
excel_required: true
form_required: true
format_type: Controlled List
validation: This field must not be empty
visible_to_public: Yes
occurrence: Single
datastore_type: text
excel_full_text_choices: True
choices_file: choices/aircraft_minister.json
excel_error_formula: 'FALSE'
# 3.3
- datastore_id: purpose_en
label:
en: Purpose of the trip (English)
fr: But du voyage (anglais)
description:
en: A description of the reason for the government trip in question. The description should be succinct (one line if possible) and provide users with a general sense of the trip's purpose. Use of acronyms should be avoided, in English.
fr: Description de la raison du voyage, en anglais, en service commandé visé. La description doit être brève (une ligne dans la mesure du possible) et donner une indication générale aux utilisateurs du but du voyage. Il faut éviter d’utiliser des acronymes.
obligation: Mandatory
excel_required: true
form_required: true
format_type: Free text
validation: This field must not be empty
visible_to_public: Yes
occurrence: Single
datastore_type: text
excel_column_width: 30
form_attrs:
size: 60
# 3.4
- datastore_id: purpose_fr
label:
en: Purpose of the trip (French)
fr: But du voyage (français)
description:
en: A description, in French, of the reason for the government trip in question. The description should be succinct (one line if possible) and provide users with a general sense of the trip's purpose. Use of acronyms should be avoided, in French
fr: Description de la raison du voyage, en français, en service commandé visé. La description doit être brève (une ligne dans la mesure du possible) et donner une indication générale aux utilisateurs du but du voyage. Il faut éviter d’utiliser des acronymes.
obligation: Mandatory
excel_required: true
form_required: true
format_type: Free Text
validation: This field must not be empty
visible_to_public: Yes
occurrence: Single
datastore_type: text
excel_column_width: 30
form_attrs:
size: 60
# 3.5
- datastore_id: start_date
label:
en: Travel start date
fr: Date du début du voyage
description:
en: The date the travel started.
fr: Date du début du voyage.
obligation: Mandatory
excel_required: true
form_required: true
format_type: Date (Please format the data as YYYY-MM-DD)
validation: This field must not be empty
visible_to_public: Yes
occurrence: Single
datastore_type: date
form_snippet: scheming/form_snippets/date.html
# 3.6
- datastore_id: end_date
label:
en: Travel end date
fr: Date de fin du voyage
description:
en: The date the travel ended (can be the same as travel start date).
fr: Date de fin du voyage (peut être la même date que la date du début du voyage).
obligation: Mandatory
excel_required: true
form_required: true
format_type: Date (Please format the data as YYYY-MM-DD)
validation: This field must not be empty
visible_to_public: Yes
occurrence: Single
datastore_type: date
form_snippet: scheming/form_snippets/date.html
# 3.7
- datastore_id: locations_en
label:
en: Location(s) visited (English)
fr: Endroit(s) visité (anglais)
description:
en: To include names of all places visited to conduct government business during the trip in question, in English. (separate multiple locations with semicolons)
fr: Cette zone indique, en anglais, le nom de tous les lieux qui ont été visités dans le cadre du voyage en question réalisé pour le compte du gouvernement. (séparer plusieurs emplacements avec des points-virgules)
obligation: Mandatory
excel_required: true
form_required: true
format_type: Free Text (Note, use full city/region, province/state and country name where possible. Seperate multiple locations with semicolons.)
validation: This field must not be empty
visible_to_public: Yes
occurrence: Repeatable
datastore_type: text
form_snippet: scheming/form_snippets/textarea.html
form_attrs:
style: "width: 100%; display: block"
# 3.8
- datastore_id: locations_fr
label:
en: Location(s) visited (French)
fr: Endroit(s) visité (français)
description:
en: To include names of all places visited to conduct government business during the trip in question, in french. (separate multiple locations with semicolons)
fr: Cette zone indique, en français, le nom de tous les lieux qui ont été visités dans le cadre du voyage en question réalisé pour le compte du gouvernement. (séparer plusieurs emplacements avec des points-virgules)
obligation: Mandatory
excel_required: true
form_required: true
format_type: Free Text (Note, use full city/region, province/state and country name where possible. Seperate multiple locations with semicolons.)
validation: This field must not be empty
visible_to_public: Yes
occurrence: Repeatable
datastore_type: text
form_snippet: scheming/form_snippets/textarea.html
form_attrs:
style: "width: 100%; display: block"
# 3.9
- datastore_id: hours
label:
en: Number of hours flown
fr: Le nombre d’heures de vol
description:
en: The number of hours flown.
fr: Le nombre d’heures de vol.
obligation: Mandatory
excel_required: true
form_required: true
format_type: Decimal
validation: This field must not be empty
visible_to_public: Yes
occurrence: Single
datastore_type: numeric
form_snippet: scheming/form_snippets/textarea.html
form_attrs:
style: "width: 100%; display: block"
# 3.10
- datastore_id: passengers
label:
en: Passenger names
fr: Nom des passagers
description:
en: Full list of flight passengers. (Comma seperated)
fr: Liste complète des passagers du vol. (séparées par des virgules)
obligation: Mandatory
format_type: Free Text (separated by commas)
validation: This field must not be empty
visible_to_public: Yes
occurrence: Repeatable
datastore_type: text
form_snippet: scheming/form_snippets/textarea.html
form_attrs:
style: "width: 100%; display: block"
# 3.11
- datastore_id: additional_information_en
label:
en: Additional Information (English)
fr: Renseignements supplémentaires (anglais)
description:
en: This field will display any additional information, as deemed necessary, in English.
fr: Ce champ affichera tout renseignement supplémentaire, en anglais, selon les besoins.
obligation: Optional
format_type: Free Text (separate paragraphs with two blank lines)
validation: None
visible_to_public: Yes
occurrence: Repeatable
datastore_type: text
form_snippet: scheming/form_snippets/textarea.html
form_attrs:
style: "width: 100%; display: block"
# 3.12
- datastore_id: additional_information_fr
label:
en: Additional Information (French)
fr: Renseignements supplémentaires (français)
description:
en: This field will display any additional information, as deemed necessary, in French.
fr: Ce champ affichera tout renseignement supplémentaire, en français, selon les besoins.
obligation: Optional
format_type: Free Text (separate paragraphs with two blank lines)
validation: None
visible_to_public: Yes
occurrence: Repeatable
datastore_type: text
form_snippet: scheming/form_snippets/textarea.html
form_attrs:
style: "width: 100%; display: block"
# audit trail
- 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
datastore_primary_key: reference_number
datastore_indexes: ""
default_preview_sort: reference_number
excel_example_height: 100
excel_data_num_rows: 500
triggers:
- adminaircraft_trigger: |
DECLARE
errors text[][] := '{{}}';
crval RECORD;
BEGIN
errors := errors || required_error(NEW.reference_number, 'reference_number');
IF NEW.reference_number LIKE '%,%' THEN
errors := errors || ARRAY[['reference_number', {reference_number_error}]];
END IF;
errors := errors || required_error(NEW.minister, 'minister');
errors := errors || required_error(NEW.purpose_en, 'purpose_en');
errors := errors || required_error(NEW.purpose_fr, 'purpose_fr');
errors := errors || required_error(NEW.start_date, 'start_date');
errors := errors || required_error(NEW.end_date, 'end_date');
errors := errors || required_error(NEW.locations_en, 'locations_en');
errors := errors || required_error(NEW.locations_fr, 'locations_fr');
errors := errors || required_error(NEW.hours, 'hours');
errors := errors || required_error(NEW.passengers, 'passengers');
errors := errors || choice_error(NEW.minister, {minister}, 'minister');
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
reference_number_error: Comma is not allowed in Reference Number field
examples:
record:
reference_number: "T-2019-Q3-00001"
minister: "PTB"
purpose_en: "To attend the 2021 G7 Leaders summit meeting."
purpose_fr: "Participer au sommet des dirigeants G7 2021."
start_date: "2019-11-25"
end_date: "2019-11-26"
locations_en: "London, United Kingdom; Ottawa, Ontario, Canada"
locations_fr: "Londres, Royaume-Uni; Ottawa, Ontario, Canada"
hours: "11.5"
passengers: "John Smith, Martha Smith, LGen Robert Jones, Thomas Cruise"
additional_information_en: "A large focus of the 2021 G7 was resolving to work together to beat COVID-19 and rebuild."
additional_information_fr: "Un des principaux objectifs du G7 de 2021 était de travailler ensemble pour vaincre le COVID-19 et reconstruire."
filter_one:
reference_number: T-2019-Q3-00001
sort: start_date desc
excel_edge_style:
PatternFill:
fgColor: FF336B87
patternType: solid
excel_header_style:
PatternFill:
patternType: solid
fgColor: FF6832e3
excel_column_heading_style:
PatternFill:
patternType: solid
fgColor: FFEFEFEF