Skip to content

Commit

Permalink
MODFQMMGR-311 Fix instance statistical codes
Browse files Browse the repository at this point in the history
This commit fixes several small issues with instance statistical codes
- The incorrect jsonb_array_elements() was used
- The entity type containing stat code names had no ID field. This was
  causing a NullPointerException in the ResultSetRepository when
  retrieving column values for stat codes in simple_instance
- The stat codes field was not marked as queryable (this was
  because we previously marked all array-type fields as non-queryable.
  We'll be making them queryable again as we fix them)
- The translation on the stat codes field was incorrect (it was
  "Statistical code names" which is misleading when there's a
  "Statistical code name" displayed in the Inventory app which isn't the
  same field
  - For now, we'll go with "Statistical code" in order to match the
    Inventory app (this is based on feedback from BELA, so we'll go
    ahead and violate our translation guidelines this time)
- The field was marked as visibleByDefault, which is incorrect

MODFQMMGR-311 Mark the stat code full ID column as an ID

This entity type not having any ID columns causes a NullPointerException
in the ResultSetRepository when retrieving column values for
statistical code names in simple_instance

MODFQMMGR-311 Make statistical code names queryable

bla
  • Loading branch information
mweaver-ebsco committed Aug 2, 2024
1 parent 7bc43ee commit adaa0e1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -909,13 +909,13 @@
SELECT\
array_agg(elems.value::text)\
FROM\
jsonb_array_elements(:sourceAlias.jsonb->'statisticalCodeIds') AS elems\
jsonb_array_elements_text(:sourceAlias.jsonb->'statisticalCodeIds') AS elems\
)",
filterValueGetter: "(\
SELECT\
array_agg(lower(elems.value::text))\
FROM\
jsonb_array_elements(:sourceAlias.jsonb->'statisticalCodeIds') AS elems\
jsonb_array_elements_text(:sourceAlias.jsonb->'statisticalCodeIds') AS elems\
)",
},
{
Expand All @@ -928,8 +928,8 @@
},
},
idColumnName: 'statistical_code_ids',
queryable: false,
visibleByDefault: true,
queryable: true,
visibleByDefault: false,
valueGetter: "( SELECT array_agg(statcode.statistical_code) FILTER (WHERE (statcode.statistical_code) IS NOT NULL) AS array_agg FROM jsonb_array_elements_text((:sourceAlias.jsonb -> 'statisticalCodeIds'::text)) record(value) JOIN drv_inventory_statistical_code_full statcode ON (record.value::text) = statcode.id::text)",
source: {
entityTypeId: 'd2da8cc7-9171-4d3e-8aba-4da286eb5f1c',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
dataType: {
dataType: 'rangedUUIDType',
},
isIdColumn: true,
visibleByDefault: true,
valueGetter: ':sourceAlias.id',
},
Expand Down
2 changes: 1 addition & 1 deletion translations/mod-fqm-manager/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@
"entityType.simple_item_details.permanent_location_id": "Permanent location UUID",
"entityType.simple_item_details.purchase_order_line_identifier": "Purchase order line identifier",
"entityType.simple_item_details.statistical_code_ids": "Statistical code UUIDs",
"entityType.simple_item_details.statistical_code_names": "Statistical code names",
"entityType.simple_item_details.statistical_code_names": "Statistical code",
"entityType.simple_item_details.status_date": "Status date",
"entityType.simple_item_details.status_name": "Status",
"entityType.simple_item_details.tags_tag_list": "Tag list",
Expand Down

0 comments on commit adaa0e1

Please sign in to comment.