Skip to content

Commit

Permalink
Add nil report to briefing notes
Browse files Browse the repository at this point in the history
  • Loading branch information
RabiaSajjad authored Oct 18, 2023
1 parent 53e0047 commit 062c976
Showing 1 changed file with 136 additions and 0 deletions.
136 changes: 136 additions & 0 deletions ckanext/canada/tables/briefingt.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,142 @@ resources:
tracking_number: 1089-4266
sort: tracking_number asc

- title: Proactive Publication - Briefing Note Titles and Numbers Nothing to Report
resource_name: briefingt-nil
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: Year
description:
en: This tab / field in the template is only populated if there are no briefing notes for the reporting period. This field should be populated with the year of the reporting period.
fr: Cet onglet/champ du modèle n’est rempli que s'il n'y a pas de notes de breffage pour la période d’établissement de rapports. Ce champ doit être rempli avec l’année de la période d’établissement de rapports.
obligation: Mandatory
excel_required: true
form_required: true
validation: This field must not be empty
excel_column_width: 10
extract_date_year: true
form_attrs:
size: 20

- datastore_id: month
datastore_type: text
label:
en: Month
fr: mois
description:
en: This tab / field in the template is only populated if there are no briefing notes for the reporting period. This field should be populated with the month of the reporting period.
fr: Cet onglet/champ du modèle n’est rempli que s'il n'y a pas de notes de breffage pour la période d’établissement de rapports. Ce champ doit être rempli avec le mois de la période d’établissement de rapports.
obligation: Mandatory
excel_required: true
form_required: true
validation: This field must not be empty
excel_full_text_choices: true
choices:
P01:
en: April
fr: avril
P02:
en: May
fr: mai
P03:
en: June
fr: juin
P04:
en: July
fr: juillet
P05:
en: August
fr: août
P06:
en: September
fr: septembre
P07:
en: October
fr: octobre
P08:
en: November
fr: novembre
P09:
en: December
fr: décembre
P10:
en: January
fr: janvier
P11:
en: February
fr: février
P12:
en: March
fr: 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:
nothing_to_report_en: Nothing to report for this period
nothing_to_report_fr: Rien à signaler pour cette période
report_type_en: Nothing to report
report_type_fr: Rien à signaler

datastore_primary_key: [year, month]
datastore_indexes: ""

triggers:
- briefingt_nil_trigger: |
DECLARE
errors text[][] := '{{}}';
crval RECORD;
BEGIN
errors := errors || required_error(NEW.year, 'year');
errors := errors || required_error(NEW.month, 'month');
errors := errors || choice_error(NEW.month, {month}, 'month');
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: 2023
month: P01
filters:
year: 2023
filter_one:
year: 2023
month: P01
sort: year desc, month desc

excel_edge_style:
PatternFill:
fgColor: FF3d4647
Expand Down

0 comments on commit 062c976

Please sign in to comment.