Skip to content

Commit

Permalink
MODFQMMGR-432 Switch back to a nested table for instance classifications
Browse files Browse the repository at this point in the history
This commit reverts the work that split instance classifications into
separate columns, but keeps the changes the translations and value
getters
  • Loading branch information
mweaver-ebsco committed Oct 18, 2024
1 parent c3915ce commit adacd65
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 55 deletions.
101 changes: 49 additions & 52 deletions src/main/resources/entity-types/inventory/simple_instance.json5
Original file line number Diff line number Diff line change
Expand Up @@ -520,66 +520,63 @@
valueFunction: 'lower(:value)',
},
{
name: 'classification_type_ids',
sourceAlias: 'inst',
dataType: {
dataType: 'arrayType',
itemDataType: {
dataType: 'rangedUUIDType',
},
},
isIdColumn: false,
queryable: true,
visibleByDefault: false,
essential: true,
hidden: true,
valueGetter:
"(SELECT array_agg(elems.value->>'classificationTypeId' ORDER BY elems.value->>'classificationTypeId') \
FROM jsonb_array_elements(:sourceAlias.jsonb->'classifications') AS elems \
)",
filterValueGetter:
"(SELECT array_agg(lower(elems.value->>'classificationTypeId') ORDER BY elems.value->>'classificationTypeId') \
FROM jsonb_array_elements(:sourceAlias.jsonb->'classifications') AS elems \
)"
},
{
name: 'classification_type_names',
sourceAlias: 'inst',
essential: true,
dataType: {
dataType: 'arrayType',
itemDataType: {
dataType: 'stringType',
},
},
idColumnName: 'classification_type_ids',
queryable: true,
visibleByDefault: false,
valueGetter:
"(SELECT array_agg(class_type.jsonb ->> 'name' ORDER BY record.value ->> 'classificationTypeId') \
FILTER (WHERE (class_type.jsonb ->> 'name') IS NOT NULL) AS array_agg \
FROM jsonb_array_elements((:sourceAlias.jsonb -> 'classifications')) record(value) \
JOIN src_inventory_classification_type class_type \
ON (record.value ->> 'classificationTypeId') = class_type.id::text \
)"
},
{
name: 'classification_numbers',
name: 'classifications',
sourceAlias: 'inst',
essential: true,
dataType: {
dataType: 'arrayType',
itemDataType: {
dataType: 'stringType',
dataType: 'objectType',
properties: [
{
name: 'type_name',
property: 'classificationType',
dataType: {
dataType: 'rangedUUIDType',
},
queryable: false,
valueGetter: "(SELECT array_agg(class_type.jsonb ->> 'name' ORDER BY record.value ->> 'classificationTypeId') \
FILTER (WHERE (class_type.jsonb ->> 'name') IS NOT NULL) AS array_agg \
FROM jsonb_array_elements((:sourceAlias.jsonb -> 'classifications')) record(value) \
JOIN src_inventory_classification_type class_type \
ON (record.value ->> 'classificationTypeId') = class_type.id::text \
)",
},
{
name: 'number',
property: 'classificationNumber',
dataType: {
dataType: 'stringType',
},
queryable: false,
valueGetter: "(SELECT array_agg(record.value ->> 'classificationNumber' ORDER BY record.value ->> 'classificationTypeId') \
FILTER (WHERE (record.value ->> 'classificationNumber') IS NOT NULL) AS array_agg \
FROM jsonb_array_elements((:sourceAlias.jsonb -> 'classifications')) record(value) \
)"
},
// {
// name: 'type_id',
// property: 'classificationTypeId',
// dataType: {
// dataType: 'rangedUUIDType',
// },
// queryable: false,
// valueGetter: "(SELECT array_agg(elems.value->>'classificationTypeId' ORDER BY elems.value->>'classificationTypeId') \
// FROM jsonb_array_elements(:sourceAlias.jsonb->'classifications') AS elems \
// )",
// },
],
},
},
queryable: true,
isIdColumn: false,
queryable: false,
visibleByDefault: false,
valueGetter:
"(SELECT array_agg(record.value ->> 'classificationNumber' ORDER BY record.value ->> 'classificationTypeId') \
FILTER (WHERE (record.value ->> 'classificationNumber') IS NOT NULL) AS array_agg \
FROM jsonb_array_elements((:sourceAlias.jsonb -> 'classifications')) record(value) \
)",
valueGetter: "(SELECT jsonb_agg(record.value || \
jsonb_build_object('classificationType', class_type.jsonb ->> 'name') \
ORDER BY record.value ->> 'classificationTypeId') \
FROM jsonb_array_elements((:sourceAlias.jsonb -> 'classifications')) record(value) \
LEFT JOIN src_inventory_classification_type class_type \
ON (record.value ->> 'classificationTypeId') = class_type.id::text)::text",
},
{
name: 'publication',
Expand Down
10 changes: 7 additions & 3 deletions translations/mod-fqm-manager/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -638,9 +638,13 @@
"entityType.simple_instance.alternative_titles": "Alternative titles",
"entityType.simple_instance.alternative_titles_ids": "Alternative titles - Type UUID",
"entityType.simple_instance.cataloged_date": "Cataloged date",
"entityType.simple_instance.classification_type_ids": "Classification type UUIDs",
"entityType.simple_instance.classification_type_names": "Classification identifier type",
"entityType.simple_instance.classification_numbers": "Classification",
"entityType.simple_instance.classifications": "Classifications",
"entityType.simple_instance.classifications.number": "Classification",
"entityType.simple_instance.classifications.number._qualified": "Classification number",
"entityType.simple_instance.classifications.type_id": "Identifier type UUID",
"entityType.simple_instance.classifications.type_id._qualified": "Classification identifier type UUID",
"entityType.simple_instance.classifications.type_name": "Classification identifier type",
"entityType.simple_instance.classifications.type_name._qualified": "Classification identifier type",
"entityType.simple_instance.complete_updated_date": "Complete updated date",
"entityType.simple_instance.contributor_type_id": "Contributor type UUID",
"entityType.simple_instance.contributors_name": "Contributor name",
Expand Down

0 comments on commit adacd65

Please sign in to comment.