Skip to content

Commit

Permalink
Merge pull request #489 from folio-org/MODFQMMGR-529
Browse files Browse the repository at this point in the history
MODFQMMGR-529:simple PO entity adjustments
  • Loading branch information
kjain110 authored Oct 17, 2024
2 parents 06d0d80 + a58e2b3 commit 046b8a3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
alias: 'po',
type: 'entity-type',
id: '48de4796-11a2-44e9-abb7-01e84af87234', // simple_purchase_order
essentialOnly: true,
join: {
type: 'join',
joinTo: 'pol.pol',
Expand Down
36 changes: 29 additions & 7 deletions src/main/resources/entity-types/orders/simple_purchase_order.json5
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
isIdColumn: true,
queryable: true,
visibleByDefault: false,
essential: true,
hidden: true,
valueGetter: ':sourceAlias.id',
},
{
Expand All @@ -35,6 +37,8 @@
isIdColumn: false,
queryable: true,
visibleByDefault: false,
hidden: true,
essential: true,
valueGetter: ':sourceAlias.created_by',
},
{
Expand All @@ -45,7 +49,8 @@
},
isIdColumn: false,
queryable: true,
visibleByDefault: false,
essential: true,
visibleByDefault: true,
valueGetter: ":sourceAlias.jsonb -> 'metadata' ->> 'createdDate'",
filterValueGetter: "\"left\"(lower(${tenant_id}_mod_orders_storage.f_unaccent((:sourceAlias.jsonb -> 'metadata'::text) ->> 'createdDate'::text)), 600)",
valueFunction: '"left"(lower(${tenant_id}_mod_orders_storage.f_unaccent(:value)), 600)'
Expand All @@ -58,7 +63,8 @@
},
isIdColumn: false,
queryable: true,
visibleByDefault: false,
essential: true,
visibleByDefault: true,
valueGetter: ":sourceAlias.jsonb->>'approved'",
filterValueGetter: '"left"(lower(${tenant_id}_mod_orders_storage.f_unaccent(:sourceAlias.jsonb ->> \'approved\'::text)), 600)',
valueFunction: '"left"(lower(${tenant_id}_mod_orders_storage.f_unaccent(:value)), 600)',
Expand Down Expand Up @@ -125,7 +131,7 @@
},
isIdColumn: false,
queryable: true,
visibleByDefault: false,
visibleByDefault: true,
valueGetter: ":sourceAlias.jsonb->>'dateOrdered'",
},
{
Expand All @@ -137,6 +143,7 @@
isIdColumn: false,
queryable: true,
visibleByDefault: false,
hidden: true,
valueGetter: ":sourceAlias.jsonb->>'manualPo'",
values: [
{
Expand All @@ -152,6 +159,8 @@
{
name: 'notes',
sourceAlias: 'po',
hidden: true,
essential: true,
dataType: {
dataType: 'arrayType',
itemDataType: {
Expand Down Expand Up @@ -183,7 +192,8 @@
},
isIdColumn: false,
queryable: true,
visibleByDefault: false,
visibleByDefault: true,
essential: true,
valueGetter: ":sourceAlias.jsonb->>'poNumber'",
},
{
Expand Down Expand Up @@ -216,7 +226,8 @@
},
isIdColumn: false,
queryable: true,
visibleByDefault: false,
essential: true,
visibleByDefault: true,
valueGetter: ":sourceAlias.jsonb->>'orderType'",
filterValueGetter: '"left"(lower(${tenant_id}_mod_orders_storage.f_unaccent(:sourceAlias.jsonb ->> \'orderType\'::text)), 600)',
valueFunction: '"left"(lower(${tenant_id}_mod_orders_storage.f_unaccent(:value)), 600)',
Expand All @@ -240,6 +251,7 @@
isIdColumn: false,
queryable: true,
visibleByDefault: false,
essential: true,
valueGetter: ":sourceAlias.jsonb->>'reEncumber'",
values: [
{
Expand Down Expand Up @@ -281,6 +293,7 @@
dataType: 'rangedUUIDType',
},
isIdColumn: false,
hidden: true,
queryable: true,
visibleByDefault: false,
valueGetter: ":sourceAlias.jsonb->>'vendor'",
Expand Down Expand Up @@ -322,6 +335,7 @@
},
isIdColumn: false,
queryable: false,
essential: true,
visibleByDefault: false,
valueGetter: "(\
SELECT\
Expand All @@ -345,9 +359,10 @@
dataType: 'stringType',
},
},
essential: true,
idColumnName: 'acq_unit_ids',
queryable: false,
visibleByDefault: false,
visibleByDefault: true,
valueGetter: "( SELECT array_agg(acq_unit.jsonb ->> 'name'::text) FILTER (WHERE (acq_unit.jsonb ->> 'name'::text) IS NOT NULL) AS array_agg FROM jsonb_array_elements_text((:sourceAlias.jsonb -> 'acqUnitIds'::text)) record(value) JOIN src_acquisitions_unit acq_unit ON lower(record.value::text) = acq_unit.id::text)",
filterValueGetter: "( SELECT array_agg(lower(acq_unit.jsonb ->> 'name'::text)) FILTER (WHERE (acq_unit.jsonb ->> 'name'::text) IS NOT NULL) AS array_agg FROM jsonb_array_elements_text((:sourceAlias.jsonb -> 'acqUnitIds'::text)) record(value) JOIN src_acquisitions_unit acq_unit ON (record.value::text) = acq_unit.id::text)",
valueFunction: 'lower(:value)',
Expand Down Expand Up @@ -375,6 +390,7 @@
},
{
name: 'tags',
essential: true,
sourceAlias: 'po',
dataType: {
dataType: 'arrayType',
Expand Down Expand Up @@ -406,7 +422,8 @@
},
isIdColumn: false,
queryable: true,
visibleByDefault: false,
visibleByDefault: true,
essential: true,
valueGetter: ":sourceAlias.jsonb->'metadata'->>'updatedDate'",
},
{
Expand All @@ -418,6 +435,8 @@
isIdColumn: false,
queryable: true,
visibleByDefault: false,
essential: true,
hidden: true,
valueGetter: ":sourceAlias.jsonb->'metadata'->>'updatedByUserId'",
},
{
Expand All @@ -429,6 +448,8 @@
isIdColumn: false,
queryable: true,
visibleByDefault: false,
essential: true,
hidden: true,
valueGetter: ":sourceAlias.jsonb->>'assignedTo'",
},
{
Expand All @@ -440,6 +461,7 @@
isIdColumn: false,
queryable: false,
hidden: true,
essential: true,
visibleByDefault: false,
valueGetter: ":sourceAlias.jsonb::text",
}
Expand Down

0 comments on commit 046b8a3

Please sign in to comment.