Spike: [ERM-4015] Investigate table structure for Agreements and agreement lines
Agreement / Agreement Line FQM Spike
Summary
To expose Agreements and Agreement Lines as queryable entity types in mod-fqm-manager, the following needs to be added. Per-column field design, FQM property choices (essential, visibleByDefault, datatypes, value functions), and exact permission strings will be settled during implementation.
Scope
Draft simple ETs for Agreement and Agreement Line, plus the two composite ETs that combine them with supporting children.
The supporting simple ETs (period, org, internal_contact, remote_license_link, po_line_proxy) are not standalone deliverables but are required as
entity-typesources for the composites.
Files to Create
1. DB source views
Path: src/main/resources/db/source-views/bundled/agreements/mod-agreements/. Each is a thin SELECT * over a mod-agreements table; trivial to author.
View | Underlying table | Consumed by |
|---|---|---|
|
| simple_agreements_agreement |
|
| simple_agreements_agreement_line |
|
| simple_agreements_agreement_line |
|
| simple_agreements_period |
|
| simple_agreements_org |
|
| simple_agreements_org |
|
| simple_agreements_internal_contact |
|
| simple_agreements_remote_license_link |
|
| simple_agreements_po_line_proxy |
|
| every simple ET that has enumerated columns |
Total: 10 views.
2. Simple entity types
Path: src/main/resources/entity-types/agreements/. One root view per ET, plus LEFT JOINs to src_agr_refdata_value for each enumerated column.
Simple ET | Purpose | Refdata joins | Cross-module / inter-simple |
|---|---|---|---|
| Agreement (subscription_agreement) core | 6 (status, type, renewal priority, perpetual flag, content review, reason for closure) | sa_vendor_fk -> simple_agreements_org |
| Agreement Line (entitlement) core | 2 (resource type, resource sub-type — via erm_resource) | ent_owner_fk -> simple_agreements_agreement |
| Renewal periods | 0 | per_owner -> simple_agreements_agreement |
| Agreement ↔ vendor link | 1 (role) | sao_owner_fk -> simple_agreements_agreement; |
| Internal contact (user + role) | 1 (role) | ic_owner_fk → simple_agreements_agreement; |
| Linked license (mod-licenses) | 1 (status) | rll_owner -> simple_agreements_agreement |
| Agreement Line ↔ POL link | 0 | pop_owner → simple_agreements_agreement_line; |
Total: 7 simple ETs.
3. Composite entity types
Path: src/main/resources/entity-types/agreements/. Each composite reuses the simple ETs above through entity-type sources.
Composite ET | Sources |
|---|---|
| agreement, agreement_line, period, agreement_org, simple_organization (cross-module), internal_contact, simple_user_details (cross-module), remote_license_link, po_line_proxy |
| agreement, agreement_line, po_line_proxy, composite_order_invoice_analytics (cross-module), simple_organization (cross-module, as |
Total: 2 composite ETs.
4. Translations
translations/mod-fqm-manager/en.json only — one key per ET, per composite source alias, and per column. Other locales fall back to en.json. Estimated ~110–130 new keys.
Construction Order
All 10 source views (no inter-dependencies).
Simple ETs in dependency order:
simple_agreements_agreement->simple_agreements_agreement_line-> period / org / internal_contact / remote_license_link / po_line_proxy.composite_agreement_with_lines.composite_agreement_with_lines_and_order_invoice_analytics.Translations: incremental per ET, single en.json edit at the end is fine.
Epic Coverage
Sample query | Satisfied by |
|---|---|
Invoices for a given agreement line |
|
Agreements / lines for a given vendor |
|
Agreements / lines for a given fund |
|