Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Features
* Use static value for note types limit ([MODNOTES-274](https://folio-org.atlassian.net/browse/MODNOTES-274))
* Update an error message for note types limit reached ([MODNOTES-277](https://folio-org.atlassian.net/browse/MODNOTES-277))
* Add support for FQM entity type generation based on the mod-notes data schema ([MODNOTES-294](https://folio-org.atlassian.net/browse/MODNOTES-294))

### Bug fixes
* Description ([ISSUE](https://folio-org.atlassian.net/browse/ISSUE))
Expand Down
69 changes: 69 additions & 0 deletions fqm-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[metadata]
team = "spitfire"
domain = "other"
module = "mod-notes"

[[sources]]
name = "note"
table = "note"

[[sources]]
name = "link"
table = "link"

[[sources]]
name = "note_link"
table = "note_link"

[[sources]]
name = "note_type"
table = "type"

[[entityTypes]]
name = "note"
source = "note"
schema = "src/main/resources/fqm/schemas/note.yaml"
permissions = ["notes.collection.get"]
sort = ["id", "ASC"]
includeJsonbField = false
fieldExclusions = ["type", "links"]
Comment thread
mweaver-ebsco marked this conversation as resolved.

[[entityTypes]]
name = "link"
source = "link"
schema = "src/main/resources/fqm/schemas/link.yaml"
permissions = ["note.links.collection.get"]
sort = ["id", "ASC"]
includeJsonbField = false

[[entityTypes]]
name = "note_link"
source = "note_link"
schema = "src/main/resources/fqm/schemas/noteLink.yaml"
permissions = ["note.links.collection.get"]
sort = ["note_id", "ASC"]
includeJsonbField = false

[[entityTypes]]
name = "note_type"
source = "note_type"
schema = "src/main/resources/fqm/schemas/noteType.yaml"
permissions = ["note.types.collection.get"]
sort = ["id", "ASC"]
includeJsonbField = false

[entityTypes.fieldOverrides.metadata_created_date]
x-fqm-visible-by-default = false
x-fqm-essential = false

[entityTypes.fieldOverrides.metadata_created_by_user_id]
x-fqm-visible-by-default = false
x-fqm-essential = false

[entityTypes.fieldOverrides.metadata_updated_date]
x-fqm-visible-by-default = false
x-fqm-essential = false

[entityTypes.fieldOverrides.metadata_updated_by_user_id]
x-fqm-visible-by-default = false
x-fqm-essential = false
27 changes: 27 additions & 0 deletions src/main/resources/fqm/schemas/link.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This wrapper defines the FQM-only link shape directly so the runtime schema can
# stay focused on the API object exposed by mod-notes.
type: object
title: Note link
description: Link record for FQM
properties:
linkId:
$ref: '../../swagger.api/schemas/common.yaml#/uuid'
description: UUID primary key of the link row; used by note_link.link_id
x-fqm-value-getter: ${source}.id
x-fqm-is-id-column: true
x-fqm-visibility: "hidden"
x-fqm-visible-by-default: true
x-fqm-essential: true
x-fqm-joins-to:
- targetModule: mod-notes
targetEntity: link
targetField: link_id
type: equality-cast-uuid
objectId:
$ref: '../../swagger.api/schemas/link.yaml#/link/properties/id'
type:
$ref: '../../swagger.api/schemas/link.yaml#/link/properties/type'
required:
- linkId
- objectId
- type
3 changes: 3 additions & 0 deletions src/main/resources/fqm/schemas/note.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# fqm-tools only accepts a file path in `schema = ...`; it cannot target a nested
# schema fragment there, so this wrapper bridges to the real runtime schema.
$ref: '../../swagger.api/schemas/note.yaml#/note'
35 changes: 35 additions & 0 deletions src/main/resources/fqm/schemas/noteLink.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Unlike the other wrappers, note_link has no runtime schema to point at, so this
# file defines the FQM-only association shape directly.
type: object
title: Note-link association
description: Association between a note and a link record
properties:
Comment thread
mweaver-ebsco marked this conversation as resolved.
noteId:
$ref: '../../swagger.api/schemas/common.yaml#/uuid'
description: UUID of the associated note
x-fqm-value-getter: ${source}.note_id
x-fqm-is-id-column: true # There are 2 ID columns here, matching the table's primary key.
x-fqm-visibility: "hidden"
x-fqm-essential: true
x-fqm-visible-by-default: false
x-fqm-joins-to:
- targetModule: mod-notes
targetEntity: note
targetField: id
type: equality-cast-uuid
linkId:
$ref: '../../swagger.api/schemas/common.yaml#/uuid'
description: UUID of the associated link
x-fqm-value-getter: ${source}.link_id
x-fqm-is-id-column: true # There are 2 ID columns here, matching the table's primary key.
x-fqm-visibility: "hidden"
x-fqm-essential: true
x-fqm-visible-by-default: false
x-fqm-joins-to:
- targetModule: mod-notes
targetEntity: link
targetField: link_id
type: equality-cast-uuid
required:
- noteId
- linkId
3 changes: 3 additions & 0 deletions src/main/resources/fqm/schemas/noteType.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# fqm-tools only accepts a file path in `schema = ...`; it cannot target a nested
# schema fragment there, so this wrapper bridges to the real runtime schema.
$ref: '../../swagger.api/schemas/noteType.yaml#/noteType'
38 changes: 38 additions & 0 deletions src/main/resources/swagger.api/schemas/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,66 @@ metadata:
type: string
format: date-time
description: Date and time when the record was created
x-fqm-value-getter: to_char(${source}.created_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"')
x-fqm-visibility: "all"
x-fqm-visible-by-default: true
x-fqm-essential: true
createdByUserId:
$ref: '#/uuid'
description: ID of the user who created the record
x-fqm-value-getter: ${source}.created_by
x-fqm-visibility: "all"
x-fqm-visible-by-default: false
x-fqm-essential: true
x-fqm-joins-to-raw:
- targetId: bb058933-cd06-4539-bd3a-6f248ff98ee2
targetField: id
direction: left
type: equality-cast-uuid
- targetId: f2615ea6-450b-425d-804d-6a495afd9308
targetField: id
direction: left
type: equality-cast-uuid
createdByUsername:
type: string
description: Username of the user who created the record (when available)
x-fqm-ignore: true
createdBy:
$ref: '#/userInfo'
description: Additional information of the user who created the record (when available)
x-fqm-ignore: true
updatedDate:
type: string
format: date-time
description: Date and time when the record was last updated
x-fqm-value-getter: to_char(${source}.updated_date, 'YYYY-MM-DD"T"HH24:MI:SS.MS"Z"')
x-fqm-visibility: "all"
x-fqm-visible-by-default: false
x-fqm-essential: true
updatedByUserId:
$ref: '#/uuid'
description: ID of the user who last updated the record
x-fqm-value-getter: ${source}.updated_by
x-fqm-visibility: "all"
x-fqm-visible-by-default: false
x-fqm-essential: true
x-fqm-joins-to-raw:
- targetId: bb058933-cd06-4539-bd3a-6f248ff98ee2
targetField: id
direction: left
type: equality-cast-uuid
- targetId: f2615ea6-450b-425d-804d-6a495afd9308
targetField: id
direction: left
type: equality-cast-uuid
updatedByUsername:
type: string
description: Username of the user who updated the record (when available)
x-fqm-ignore: true
updatedBy:
$ref: '#/userInfo'
description: Additional information of the user who updated the record (when available)
x-fqm-ignore: true
required:
- createdDate

Expand Down
16 changes: 16 additions & 0 deletions src/main/resources/swagger.api/schemas/link.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,25 @@ link:
id:
type: string
description: Id of object linked to note
x-fqm-value-getter: ${source}.object_id
x-fqm-is-id-column: false # Despite the name, this is not the unique ID for the link record.
x-fqm-visibility: "hidden"
x-fqm-essential: true
x-fqm-joins-to-raw:
- targetId: bb058933-cd06-4539-bd3a-6f248ff98ee2
targetField: id
direction: left
type: equality-cast-uuid
- targetId: f2615ea6-450b-425d-804d-6a495afd9308
targetField: id
direction: left
type: equality-cast-uuid
type:
type: string
description: Type of object linked to note
x-fqm-value-getter: ${source}.object_type
x-fqm-visibility: "hidden"
x-fqm-essential: true
required:
- id
- type
Expand Down
31 changes: 31 additions & 0 deletions src/main/resources/swagger.api/schemas/note.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,58 @@ note:
id:
$ref: 'common.yaml#/uuid'
description: Unique generated identifier for the note
x-fqm-value-getter: ${source}.id
Comment thread
mweaver-ebsco marked this conversation as resolved.
x-fqm-filter-value-getter: ${source}.id
x-fqm-visibility: "all"
x-fqm-visible-by-default: false
x-fqm-essential: true
typeId:
$ref: 'common.yaml#/uuid'
description: Type id of note
x-fqm-value-getter: ${source}.type_id
x-fqm-filter-value-getter: ${source}.type_id
x-fqm-visibility: "hidden"
x-fqm-essential: true
x-fqm-joins-to:
- targetModule: mod-notes
targetEntity: note_type
targetField: id
type: equality-cast-uuid
type:
type: string
description: Type of note (configured in settings)
title:
type: string
description: Note title
x-fqm-value-getter: ${source}.title
x-fqm-visibility: "all"
x-fqm-visible-by-default: true
x-fqm-essential: true
domain:
type: string
description: Domain associated with this note
x-fqm-value-getter: ${source}.domain
x-fqm-visibility: "all"
x-fqm-visible-by-default: true
x-fqm-essential: true
content:
type: string
description: Content of the note
x-fqm-value-getter: ${source}.content
x-fqm-visibility: "all"
x-fqm-essential: true
popUpOnCheckOut:
type: boolean
description: Flag that specify need of pop-up on check-out app
x-fqm-value-getter: ${source}.pop_up_on_check_out
x-fqm-visibility: "all"
x-fqm-essential: true
popUpOnUser:
type: boolean
description: Flag that specify need of pop-up on users app
x-fqm-value-getter: ${source}.pop_up_on_user
x-fqm-visibility: "all"
x-fqm-essential: true
links:
type: array
description: Collection of links to associated objects
Expand Down
16 changes: 16 additions & 0 deletions src/main/resources/swagger.api/schemas/noteType.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,30 @@ noteType:
id:
$ref: 'common.yaml#/uuid'
description: A UUID identifying this note type
x-fqm-value-getter: ${source}.id
x-fqm-visibility: "hidden"
x-fqm-essential: true
name:
type: string
description: The unique name of this type
maxLength: 255
x-fqm-value-getter: ${source}.name
x-fqm-visibility: "all"
x-fqm-essential: true
x-fqm-id-column-name: id
x-fqm-source:
entityTypeId: 5cba8da3-3203-59a4-ad79-f91401850d9f
columnName: name
x-fqm-value-source-api:
path: note-types
valueJsonPath: $.noteTypes.*.id
labelJsonPath: $.noteTypes.*.name
x-fqm-visible-by-default: true
usage:
type: object
readOnly: true
description: Type usage statistics
x-fqm-ignore: true
properties:
isAssigned:
type: boolean
Expand Down
32 changes: 32 additions & 0 deletions translations/mod-notes/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"fqm.entityType.note": "Note",
"fqm.entityType.note._description": "Notes stored in mod-notes.",
"fqm.entityType.note.id": "Note UUID",
"fqm.entityType.note.type_id": "Note type UUID",
"fqm.entityType.note.title": "Title",
"fqm.entityType.note.domain": "Domain",
"fqm.entityType.note.content": "Content",
"fqm.entityType.note.pop_up_on_check_out": "Show pop-up on checkout",
"fqm.entityType.note.pop_up_on_user": "Show pop-up on user",
"fqm.entityType.note.metadata_created_date": "Created at",
"fqm.entityType.note.metadata_created_by_user_id": "Created by user UUID",
"fqm.entityType.note.metadata_updated_date": "Updated at",
"fqm.entityType.note.metadata_updated_by_user_id": "Updated by user UUID",
"fqm.entityType.link": "Link",
"fqm.entityType.link._description": "Link records used by notes.",
"fqm.entityType.link.link_id": "Link UUID",
"fqm.entityType.link.object_id": "Linked record ID",
"fqm.entityType.link.type": "Linked record type",
"fqm.entityType.note_link": "Note link",
"fqm.entityType.note_link._description": "Relationships between notes and link records.",
"fqm.entityType.note_link.note_id": "Note UUID",
"fqm.entityType.note_link.link_id": "Link UUID",
"fqm.entityType.note_type": "Note type",
"fqm.entityType.note_type._description": "Configured note types.",
"fqm.entityType.note_type.id": "Note type UUID",
"fqm.entityType.note_type.name": "Name",
"fqm.entityType.note_type.metadata_created_date": "Created at",
"fqm.entityType.note_type.metadata_created_by_user_id": "Created by user UUID",
"fqm.entityType.note_type.metadata_updated_date": "Updated at",
"fqm.entityType.note_type.metadata_updated_by_user_id": "Updated by user UUID"
}
Loading