Skip to content

Commit adae9fc

Browse files
committed
MODFQMMGR-1053 Add FQM config
1 parent 4e5f98e commit adae9fc

10 files changed

Lines changed: 270 additions & 0 deletions

File tree

fqm-config.toml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[metadata]
2+
team = "spitfire"
3+
domain = "other"
4+
module = "mod-notes"
5+
6+
[[sources]]
7+
name = "note"
8+
table = "note"
9+
10+
[[sources]]
11+
name = "link"
12+
table = "link"
13+
14+
[[sources]]
15+
name = "note_link"
16+
table = "note_link"
17+
18+
[[sources]]
19+
name = "note_type"
20+
table = "type"
21+
22+
[[entityTypes]]
23+
name = "note"
24+
source = "note"
25+
schema = "src/main/resources/fqm/schemas/note.yaml"
26+
permissions = ["notes.collection.get"]
27+
sort = ["id", "ASC"]
28+
includeJsonbField = false
29+
fieldExclusions = ["type", "links"]
30+
31+
[[entityTypes]]
32+
name = "link"
33+
source = "link"
34+
schema = "src/main/resources/fqm/schemas/link.yaml"
35+
permissions = ["note.links.collection.get"]
36+
sort = ["id", "ASC"]
37+
includeJsonbField = false
38+
39+
[[entityTypes]]
40+
name = "note_link"
41+
source = "note_link"
42+
schema = "src/main/resources/fqm/schemas/noteLink.yaml"
43+
permissions = ["note.links.collection.get"]
44+
sort = ["note_id", "ASC"]
45+
includeJsonbField = false
46+
47+
[[entityTypes]]
48+
name = "note_type"
49+
source = "note_type"
50+
schema = "src/main/resources/fqm/schemas/noteType.yaml"
51+
permissions = ["note.types.collection.get"]
52+
sort = ["id", "ASC"]
53+
includeJsonbField = false
54+
55+
[entityTypes.fieldOverrides.metadata_created_date]
56+
x-fqm-visible-by-default = false
57+
x-fqm-essential = false
58+
59+
[entityTypes.fieldOverrides.metadata_created_by_user_id]
60+
x-fqm-visible-by-default = false
61+
x-fqm-essential = false
62+
63+
[entityTypes.fieldOverrides.metadata_updated_date]
64+
x-fqm-visible-by-default = false
65+
x-fqm-essential = false
66+
67+
[entityTypes.fieldOverrides.metadata_updated_by_user_id]
68+
x-fqm-visible-by-default = false
69+
x-fqm-essential = false
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# This wrapper defines the FQM-only link shape directly so the runtime schema can
2+
# stay focused on the API object exposed by mod-notes.
3+
type: object
4+
title: Note link
5+
description: Link record for FQM
6+
properties:
7+
linkId:
8+
$ref: '../../swagger.api/schemas/common.yaml#/uuid'
9+
description: UUID primary key of the link row; used by note_link.link_id
10+
x-fqm-value-getter: ${source}.id
11+
x-fqm-is-id-column: true
12+
x-fqm-visibility: "hidden"
13+
x-fqm-visible-by-default: true
14+
x-fqm-essential: true
15+
x-fqm-joins-to:
16+
- targetModule: mod-notes
17+
targetEntity: link
18+
targetField: link_id
19+
type: equality-cast-uuid
20+
objectId:
21+
$ref: '../../swagger.api/schemas/link.yaml#/link/properties/id'
22+
type:
23+
$ref: '../../swagger.api/schemas/link.yaml#/link/properties/type'
24+
required:
25+
- linkId
26+
- objectId
27+
- type
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# fqm-tools only accepts a file path in `schema = ...`; it cannot target a nested
2+
# schema fragment there, so this wrapper bridges to the real runtime schema.
3+
$ref: '../../swagger.api/schemas/note.yaml#/note'
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Unlike the other wrappers, note_link has no runtime schema to point at, so this
2+
# file defines the FQM-only association shape directly.
3+
type: object
4+
title: Note-link association
5+
description: Association between a note and a link record
6+
properties:
7+
noteId:
8+
$ref: '../../swagger.api/schemas/common.yaml#/uuid'
9+
description: UUID of the associated note
10+
x-fqm-value-getter: ${source}.note_id
11+
x-fqm-is-id-column: true # There are 2 ID columns here, matching the table's primary key.
12+
x-fqm-visibility: "hidden"
13+
x-fqm-essential: true
14+
x-fqm-visible-by-default: false
15+
x-fqm-joins-to:
16+
- targetModule: mod-notes
17+
targetEntity: note
18+
targetField: id
19+
type: equality-cast-uuid
20+
linkId:
21+
$ref: '../../swagger.api/schemas/common.yaml#/uuid'
22+
description: UUID of the associated link
23+
x-fqm-value-getter: ${source}.link_id
24+
x-fqm-is-id-column: true # There are 2 ID columns here, matching the table's primary key.
25+
x-fqm-visibility: "hidden"
26+
x-fqm-essential: true
27+
x-fqm-visible-by-default: false
28+
x-fqm-joins-to:
29+
- targetModule: mod-notes
30+
targetEntity: link
31+
targetField: link_id
32+
type: equality-cast-uuid
33+
required:
34+
- noteId
35+
- linkId
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# fqm-tools only accepts a file path in `schema = ...`; it cannot target a nested
2+
# schema fragment there, so this wrapper bridges to the real runtime schema.
3+
$ref: '../../swagger.api/schemas/noteType.yaml#/noteType'

src/main/resources/swagger.api/schemas/common.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,66 @@ metadata:
1111
type: string
1212
format: date-time
1313
description: Date and time when the record was created
14+
x-fqm-value-getter: to_char(${source}.created_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"')
15+
x-fqm-visibility: "all"
16+
x-fqm-visible-by-default: true
17+
x-fqm-essential: true
1418
createdByUserId:
1519
$ref: '#/uuid'
1620
description: ID of the user who created the record
21+
x-fqm-value-getter: ${source}.created_by
22+
x-fqm-visibility: "all"
23+
x-fqm-visible-by-default: false
24+
x-fqm-essential: true
25+
x-fqm-joins-to-raw:
26+
- targetId: bb058933-cd06-4539-bd3a-6f248ff98ee2
27+
targetField: id
28+
direction: left
29+
type: equality-cast-uuid
30+
- targetId: f2615ea6-450b-425d-804d-6a495afd9308
31+
targetField: id
32+
direction: left
33+
type: equality-cast-uuid
1734
createdByUsername:
1835
type: string
1936
description: Username of the user who created the record (when available)
37+
x-fqm-ignore: true
2038
createdBy:
2139
$ref: '#/userInfo'
2240
description: Additional information of the user who created the record (when available)
41+
x-fqm-ignore: true
2342
updatedDate:
2443
type: string
2544
format: date-time
2645
description: Date and time when the record was last updated
46+
x-fqm-value-getter: to_char(${source}.updated_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"')
47+
x-fqm-visibility: "all"
48+
x-fqm-visible-by-default: false
49+
x-fqm-essential: true
2750
updatedByUserId:
2851
$ref: '#/uuid'
2952
description: ID of the user who last updated the record
53+
x-fqm-value-getter: ${source}.updated_by
54+
x-fqm-visibility: "all"
55+
x-fqm-visible-by-default: false
56+
x-fqm-essential: true
57+
x-fqm-joins-to-raw:
58+
- targetId: bb058933-cd06-4539-bd3a-6f248ff98ee2
59+
targetField: id
60+
direction: left
61+
type: equality-cast-uuid
62+
- targetId: f2615ea6-450b-425d-804d-6a495afd9308
63+
targetField: id
64+
direction: left
65+
type: equality-cast-uuid
3066
updatedByUsername:
3167
type: string
3268
description: Username of the user who updated the record (when available)
69+
x-fqm-ignore: true
3370
updatedBy:
3471
$ref: '#/userInfo'
3572
description: Additional information of the user who updated the record (when available)
73+
x-fqm-ignore: true
3674
required:
3775
- createdDate
3876

src/main/resources/swagger.api/schemas/link.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,25 @@ link:
66
id:
77
type: string
88
description: Id of object linked to note
9+
x-fqm-value-getter: ${source}.object_id
10+
x-fqm-is-id-column: false # Despite the name, this is not the unique ID for the link record.
11+
x-fqm-visibility: "hidden"
12+
x-fqm-essential: true
13+
x-fqm-joins-to-raw:
14+
- targetId: bb058933-cd06-4539-bd3a-6f248ff98ee2
15+
targetField: id
16+
direction: left
17+
type: equality-cast-uuid
18+
- targetId: f2615ea6-450b-425d-804d-6a495afd9308
19+
targetField: id
20+
direction: left
21+
type: equality-cast-uuid
922
type:
1023
type: string
1124
description: Type of object linked to note
25+
x-fqm-value-getter: ${source}.object_type
26+
x-fqm-visibility: "hidden"
27+
x-fqm-essential: true
1228
required:
1329
- id
1430
- type

src/main/resources/swagger.api/schemas/note.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,58 @@ note:
55
id:
66
$ref: 'common.yaml#/uuid'
77
description: Unique generated identifier for the note
8+
x-fqm-value-getter: ${source}.id
9+
x-fqm-filter-value-getter: ${source}.id
10+
x-fqm-visibility: "all"
11+
x-fqm-visible-by-default: false
12+
x-fqm-essential: true
813
typeId:
914
$ref: 'common.yaml#/uuid'
1015
description: Type id of note
16+
x-fqm-value-getter: ${source}.type_id
17+
x-fqm-filter-value-getter: ${source}.type_id
18+
x-fqm-visibility: "hidden"
19+
x-fqm-essential: true
20+
x-fqm-joins-to:
21+
- targetModule: mod-notes
22+
targetEntity: note_type
23+
targetField: id
24+
type: equality-cast-uuid
1125
type:
1226
type: string
1327
description: Type of note (configured in settings)
1428
title:
1529
type: string
1630
description: Note title
31+
x-fqm-value-getter: ${source}.title
32+
x-fqm-visibility: "all"
33+
x-fqm-visible-by-default: true
34+
x-fqm-essential: true
1735
domain:
1836
type: string
1937
description: Domain associated with this note
38+
x-fqm-value-getter: ${source}.domain
39+
x-fqm-visibility: "all"
40+
x-fqm-visible-by-default: true
41+
x-fqm-essential: true
2042
content:
2143
type: string
2244
description: Content of the note
45+
x-fqm-value-getter: ${source}.content
46+
x-fqm-visibility: "all"
47+
x-fqm-essential: true
2348
popUpOnCheckOut:
2449
type: boolean
2550
description: Flag that specify need of pop-up on check-out app
51+
x-fqm-value-getter: ${source}.pop_up_on_check_out
52+
x-fqm-visibility: "all"
53+
x-fqm-essential: true
2654
popUpOnUser:
2755
type: boolean
2856
description: Flag that specify need of pop-up on users app
57+
x-fqm-value-getter: ${source}.pop_up_on_user
58+
x-fqm-visibility: "all"
59+
x-fqm-essential: true
2960
links:
3061
type: array
3162
description: Collection of links to associated objects

src/main/resources/swagger.api/schemas/noteType.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,30 @@ noteType:
66
id:
77
$ref: 'common.yaml#/uuid'
88
description: A UUID identifying this note type
9+
x-fqm-value-getter: ${source}.id
10+
x-fqm-visibility: "hidden"
11+
x-fqm-essential: true
912
name:
1013
type: string
1114
description: The unique name of this type
1215
maxLength: 255
16+
x-fqm-value-getter: ${source}.name
17+
x-fqm-visibility: "all"
18+
x-fqm-essential: true
19+
x-fqm-id-column-name: id
20+
x-fqm-source:
21+
entityTypeId: 5cba8da3-3203-59a4-ad79-f91401850d9f
22+
columnName: name
23+
x-fqm-value-source-api:
24+
path: note-types
25+
valueJsonPath: $.noteTypes.*.id
26+
labelJsonPath: $.noteTypes.*.name
27+
x-fqm-visible-by-default: true
1328
usage:
1429
type: object
1530
readOnly: true
1631
description: Type usage statistics
32+
x-fqm-ignore: true
1733
properties:
1834
isAssigned:
1935
type: boolean

translations/mod-notes/en.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"fqm.entityType.note": "Note",
3+
"fqm.entityType.note._description": "Notes stored in mod-notes.",
4+
"fqm.entityType.note.id": "Note UUID",
5+
"fqm.entityType.note.type_id": "Note type UUID",
6+
"fqm.entityType.note.title": "Title",
7+
"fqm.entityType.note.domain": "Domain",
8+
"fqm.entityType.note.content": "Content",
9+
"fqm.entityType.note.pop_up_on_check_out": "Show pop-up on checkout",
10+
"fqm.entityType.note.pop_up_on_user": "Show pop-up on user",
11+
"fqm.entityType.note.metadata_created_date": "Created at",
12+
"fqm.entityType.note.metadata_created_by_user_id": "Created by user UUID",
13+
"fqm.entityType.note.metadata_updated_date": "Updated at",
14+
"fqm.entityType.note.metadata_updated_by_user_id": "Updated by user UUID",
15+
"fqm.entityType.link": "Link",
16+
"fqm.entityType.link._description": "Link records used by notes.",
17+
"fqm.entityType.link.link_id": "Link UUID",
18+
"fqm.entityType.link.object_id": "Linked record ID",
19+
"fqm.entityType.link.type": "Linked record type",
20+
"fqm.entityType.note_link": "Note link",
21+
"fqm.entityType.note_link._description": "Relationships between notes and link records.",
22+
"fqm.entityType.note_link.note_id": "Note UUID",
23+
"fqm.entityType.note_link.link_id": "Link UUID",
24+
"fqm.entityType.note_type": "Note type",
25+
"fqm.entityType.note_type._description": "Configured note types.",
26+
"fqm.entityType.note_type.id": "Note type UUID",
27+
"fqm.entityType.note_type.name": "Name",
28+
"fqm.entityType.note_type.metadata_created_date": "Created at",
29+
"fqm.entityType.note_type.metadata_created_by_user_id": "Created by user UUID",
30+
"fqm.entityType.note_type.metadata_updated_date": "Updated at",
31+
"fqm.entityType.note_type.metadata_updated_by_user_id": "Updated by user UUID"
32+
}

0 commit comments

Comments
 (0)