Skip to content

Commit 98fd658

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

10 files changed

Lines changed: 217 additions & 0 deletions

File tree

fqm-config.toml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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
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/link.yaml#/fqmLink'
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: "all"
13+
x-fqm-essential: true
14+
x-fqm-visible-by-default: true
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: "all"
26+
x-fqm-essential: true
27+
x-fqm-visible-by-default: true
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: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,44 @@ 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-essential: true
1417
createdByUserId:
1518
$ref: '#/uuid'
1619
description: ID of the user who created the record
20+
x-fqm-value-getter: ${source}.created_by
21+
x-fqm-visibility: "all"
22+
x-fqm-essential: true
1723
createdByUsername:
1824
type: string
1925
description: Username of the user who created the record (when available)
26+
x-fqm-ignore: true
2027
createdBy:
2128
$ref: '#/userInfo'
2229
description: Additional information of the user who created the record (when available)
30+
x-fqm-ignore: true
2331
updatedDate:
2432
type: string
2533
format: date-time
2634
description: Date and time when the record was last updated
35+
x-fqm-value-getter: to_char(${source}.updated_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"')
36+
x-fqm-visibility: "all"
37+
x-fqm-essential: true
2738
updatedByUserId:
2839
$ref: '#/uuid'
2940
description: ID of the user who last updated the record
41+
x-fqm-value-getter: ${source}.updated_by
42+
x-fqm-visibility: "all"
43+
x-fqm-essential: true
3044
updatedByUsername:
3145
type: string
3246
description: Username of the user who updated the record (when available)
47+
x-fqm-ignore: true
3348
updatedBy:
3449
$ref: '#/userInfo'
3550
description: Additional information of the user who updated the record (when available)
51+
x-fqm-ignore: true
3652
required:
3753
- createdDate
3854

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,45 @@ 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: "all"
12+
x-fqm-essential: true
913
type:
1014
type: string
1115
description: Type of object linked to note
16+
x-fqm-value-getter: ${source}.object_type
17+
x-fqm-visibility: "all"
18+
x-fqm-essential: true
1219
required:
1320
- id
1421
- type
1522
example:
1623
id: 1234-5678
1724
type: package
1825

26+
fqmLink:
27+
type: object
28+
title: Note link
29+
description: Link record for FQM
30+
properties:
31+
linkId:
32+
$ref: 'common.yaml#/uuid'
33+
description: UUID primary key of the link row; used by note_link.link_id
34+
x-fqm-value-getter: ${source}.id
35+
x-fqm-is-id-column: true
36+
x-fqm-visibility: "all"
37+
x-fqm-visible-by-default: true
38+
x-fqm-essential: true
39+
id:
40+
$ref: '#/link/properties/id'
41+
type:
42+
$ref: '#/link/properties/type'
43+
required:
44+
- linkId
45+
- id
46+
- type
47+
1948
linkStatus:
2049
type: string
2150
enum: [ ASSIGNED, UNASSIGNED ]

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

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,61 @@ 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: true
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: "all"
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
1734
domain:
1835
type: string
1936
description: Domain associated with this note
37+
x-fqm-value-getter: ${source}.domain
38+
x-fqm-visibility: "all"
39+
x-fqm-visible-by-default: true
2040
content:
2141
type: string
2242
description: Content of the note
43+
x-fqm-value-getter: ${source}.content
44+
x-fqm-visibility: "all"
2345
popUpOnCheckOut:
2446
type: boolean
2547
description: Flag that specify need of pop-up on check-out app
48+
x-fqm-value-getter: ${source}.pop_up_on_check_out
49+
x-fqm-visibility: "all"
2650
popUpOnUser:
2751
type: boolean
2852
description: Flag that specify need of pop-up on users app
53+
x-fqm-value-getter: ${source}.pop_up_on_user
54+
x-fqm-visibility: "all"
2955
links:
3056
type: array
3157
description: Collection of links to associated objects
3258
items:
3359
$ref: 'link.yaml#/link'
3460
metadata:
3561
$ref: 'common.yaml#/metadata'
62+
x-fqm-visibility: "all"
3663
required:
3764
- typeId
3865
- domain

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: "all"
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.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)