From 9c1093a5439497f0410c3cbbad42cce52359656a Mon Sep 17 00:00:00 2001 From: afwilcox Date: Thu, 2 Jan 2025 15:21:35 -0800 Subject: [PATCH] feat: Sort equipment by display order --- .../equipment_code/equipment_code.service.ts | 3 + migrations/sql/R__code-table-data.sql.sql | 80 ++++++++++++++++++- 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/backend/src/equipment_code/equipment_code.service.ts b/backend/src/equipment_code/equipment_code.service.ts index b2c5e5d2..2ae4d172 100644 --- a/backend/src/equipment_code/equipment_code.service.ts +++ b/backend/src/equipment_code/equipment_code.service.ts @@ -16,6 +16,9 @@ export class EquipmentCodeService { active_ind: true, is_trap_ind: true, }, + orderBy: { + display_order: "asc", + }, }); const equipmentCodes: EquipmentCode[] = prismaEquipmentCodes.map((prismaEquipmentCodes) => ({ diff --git a/migrations/sql/R__code-table-data.sql.sql b/migrations/sql/R__code-table-data.sql.sql index 0126a118..5a969dd3 100644 --- a/migrations/sql/R__code-table-data.sql.sql +++ b/migrations/sql/R__code-table-data.sql.sql @@ -5502,7 +5502,8 @@ values ('FTRAP', 'Foothold trap', 'Foothold trap', 10, true, 'FLYWAY', now(), 'FLYWAY', now(), 'Y'), ('LTRAP', 'Live trap', 'Live trap', 20, true, 'FLYWAY', now(), 'FLYWAY', now(), 'Y'), ('LLTHL', 'Less lethal', 'Less lethal', 60, true, 'FLYWAY', now(), 'FLYWAY', now(), 'N'), - ('K9UNT', 'K9 unit', 'K9 unit', 70, true, 'FLYWAY', now(), 'FLYWAY', now(), 'N'); + ('K9UNT', 'K9 unit', 'K9 unit', 70, true, 'FLYWAY', now(), 'FLYWAY', now(), 'N') +on conflict do nothing; update case_management.equipment_code set @@ -5522,6 +5523,83 @@ set where equipment_code = 'TRCAM'; + +-------------------------- +-- Outcome code updates +------------------------- + +update case_management.hwcr_outcome_code +set + short_description = 'Relocated - within home range', + long_description = 'Relocated - within home range' +where + hwcr_outcome_code = 'SHRTRELOC'; + +update case_management.hwcr_outcome_code +set + short_description = 'Translocated - outside home range', + long_description = 'Translocated - outside home range' +where + hwcr_outcome_code = 'TRANSLCTD'; + +update case_management.hwcr_outcome_code +set + short_description = 'Euthanized by other', + long_description = 'Euthanized by other' +where + hwcr_outcome_code = 'EUTHOTH'; + +update case_management.hwcr_outcome_code +set + short_description = 'Dispatched by other', + long_description = 'Dispatched by other' +where + hwcr_outcome_code = 'DESTRYOTH'; + +insert into + case_management.hwcr_outcome_code ( + hwcr_outcome_code, + short_description, + long_description, + display_order, + active_ind, + create_user_id, + create_utc_timestamp, + update_user_id, + update_utc_timestamp + ) +values + ( + 'RELSITE', + 'Released on-site', + 'Released on-site', + 65, + true, + 'FLYWAY', + now (), + 'FLYWAY', + now () + ), + ( + 'NOTRCVD', + 'Not recovered', + 'Not recovered', + 55, + true, + 'FLYWAY', + now (), + 'FLYWAY', + now () + ) +on conflict do nothing; + +update case_management.hwcr_outcome_code +set + active_ind = 'N' +where + hwcr_outcome_code = 'LESSLETHAL'; + + -------------------------- -- New Changes above this line -------------------------