From 6091b413ed0abee1e78f0c0c3358606310b66936 Mon Sep 17 00:00:00 2001 From: afwilcox Date: Fri, 27 Sep 2024 12:16:52 -0700 Subject: [PATCH] fix: Display order of values, add none --- .../schedule_sector_xref.service.ts | 7 +++ migrations/sql/R__code-table-data.sql.sql | 54 ++++++++++++++++++- 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/backend/src/schedule_sector_xref/schedule_sector_xref.service.ts b/backend/src/schedule_sector_xref/schedule_sector_xref.service.ts index d6735606..92390a01 100644 --- a/backend/src/schedule_sector_xref/schedule_sector_xref.service.ts +++ b/backend/src/schedule_sector_xref/schedule_sector_xref.service.ts @@ -19,6 +19,13 @@ export class ScheduleSectorXrefService { }, active_ind: true, }, + orderBy: [ + { + sector_code_schedule_sector_xref_sector_codeTosector_code: { + display_order: "asc", + }, + }, + ], }); return codes.map( diff --git a/migrations/sql/R__code-table-data.sql.sql b/migrations/sql/R__code-table-data.sql.sql index d1c2868f..0296af1b 100644 --- a/migrations/sql/R__code-table-data.sql.sql +++ b/migrations/sql/R__code-table-data.sql.sql @@ -4045,7 +4045,8 @@ where update case_management.sector_code set - long_description = 'Meat by-product processing industry' + long_description = 'Meat by-product processing industry', + display_order = 340 where sector_code = 'MEATBYPROD'; @@ -4542,6 +4543,57 @@ where sector_code IN 'VENDGENLAN' ); +-- +-- Add Other/None as a schedule/sector code +-- INSERT sector_code value +-- +INSERT INTO + case_management.sector_code ( + sector_code, + short_description, + long_description, + display_order, + active_ind, + create_user_id, + create_utc_timestamp, + update_user_id, + update_utc_timestamp + ) +VALUES + ( + 'NONE', + 'None', + 'None', + 1030, + 'Y', + CURRENT_USER, + CURRENT_TIMESTAMP, + CURRENT_USER, + CURRENT_TIMESTAMP + ) ON CONFLICT +DO NOTHING; +INSERT INTO + case_management.schedule_sector_xref ( + schedule_sector_xref_guid, + schedule_code, + sector_code, + active_ind, + create_user_id, + create_utc_timestamp, + update_user_id, + update_utc_timestamp + ) +VALUES + ( + uuid_generate_v4 (), + 'OTHER', + 'NONE', + 'Y', + CURRENT_USER, + CURRENT_TIMESTAMP, + CURRENT_USER, + CURRENT_TIMESTAMP + ) ON CONFLICT DO NOTHING; --------------------------