OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
adapt specification for notifications
ulferts5e9a7413825a
diff --git a/docs/api/apiv3/components/examples/date_alert_notification.yml b/docs/api/apiv3/components/examples/date_alert_notification.ymlnew file mode 100644index 00000000000..78fc0dd7d6a--- /dev/null+++ b/docs/api/apiv3/components/examples/date_alert_notification.yml@@ -0,0 +1,45 @@+# Example: Mentioned notification+---+value:+ _type: Notification+ id: 1+ readIAN: false+ reason: dateAlert+ createdAt: '2022-04-05T14:38:28Z'+ updatedAt: '2022-04-06T09:03:24Z'+ _embedded:+ project:+ _hint: Project resource shortened for brevity+ _type: Project+ id: 11+ name: Jedi Remnant Locator+ resource:+ _hint: WorkPackage resource shortened for brevity+ _type: WorkPackage+ id: 77+ subject: Educate Visas Marr+ details:+ - _type: 'Values::Property'+ property: 'startDate'+ value: '2021-01-01'+ _links:+ self:+ href: 'api/v3/notifications/123/details/0'+ schema:+ href: 'api/v3/values/schemas/startDate'+ _links:+ self:+ href: '/api/v3/notifications/1'+ readIAN:+ href: '/api/v3/notifications/1/read_ian'+ method: post+ actor:+ href: null+ project:+ href: '/api/v3/projects/11'+ title: Jedi Remnant Locator+ activity:+ href: null+ resource:+ href: '/api/v3/work_packages/77'+ title: Educate Visas Marrdiff --git a/docs/api/apiv3/components/examples/mentioned_notification.yml b/docs/api/apiv3/components/examples/mentioned_notification.ymlnew file mode 100644index 00000000000..fac25f67d14--- /dev/null+++ b/docs/api/apiv3/components/examples/mentioned_notification.yml@@ -0,0 +1,48 @@+# Example: Mentioned notification+---+value:+ _type: Notification+ id: 1+ readIAN: false+ reason: mentioned+ createdAt: '2022-04-05T14:38:28Z'+ updatedAt: '2022-04-06T09:03:24Z'+ _embedded:+ author:+ _hint: User resource shortened for brevity+ _type: User+ id: 13+ name: Darth Nihilus+ project:+ _hint: Project resource shortened for brevity+ _type: Project+ id: 11+ name: Jedi Remnant Locator+ activity:+ _hint: Activity resource shortened for brevity+ _type: Activity::Comment+ id: 180+ version: 3+ resource:+ _hint: WorkPackage resource shortened for brevity+ _type: WorkPackage+ id: 77+ subject: Educate Visas Marr+ details: []+ _links:+ self:+ href: '/api/v3/notifications/1'+ readIAN:+ href: '/api/v3/notifications/1/read_ian'+ method: post+ actor:+ href: '/api/v3/users/13'+ title: Darth Nihilus+ project:+ href: '/api/v3/projects/11'+ title: Jedi Remnant Locator+ activity:+ href: '/api/v3/activities/180'+ resource:+ href: '/api/v3/work_packages/77'+ title: Educate Visas Marrdiff --git a/docs/api/apiv3/components/examples/notification_collection.yml b/docs/api/apiv3/components/examples/notification_collection.ymlnew file mode 100644index 00000000000..88c05479c6c--- /dev/null+++ b/docs/api/apiv3/components/examples/notification_collection.yml@@ -0,0 +1,48 @@+# Example: Notification collection+---+value:+ _type: Collection+ count: 2+ total: 2+ offset: 1+ pageSize: 20+ _embedded:+ elements:+ - _hint: Notification resource shortened for brevity+ id: 1+ readIAN: false+ reason: mentioned+ - _hint: Notification resource shortened for brevity+ id: 2+ readIAN: false+ reason: dateAlert+ _embedded:+ details:+ - _type: 'Values::Property'+ property: 'startDate'+ value: '2021-01-01'+ _links:+ self:+ href: 'api/v3/notifications/123/details/0'+ schema:+ href: 'api/v3/values/schemas/startDate'+ detailsSchemas:+ - _type: 'Schema'+ property:+ name: 'Property'+ type: 'String'+ value:+ name: 'Start date'+ type: 'Date'+ _links:+ self:+ href: '/api/v3/values/schemas/startDate'+ _links:+ self:+ href: '/api/v3/notifications?offset=1&pageSize=20'+ jumpTo:+ href: '/api/v3/notifications?filters=%5B%5D&offset=%7Boffset%7D&pageSize=20'+ templated: true+ changeSize:+ href: '/api/v3/notifications?filters=%5B%5D&offset=1&pageSize=%7Bsize%7D'+ templated: truediff --git a/docs/api/apiv3/components/examples/values_property_schema.yml b/docs/api/apiv3/components/examples/values_property_schema.ymlnew file mode 100644index 00000000000..ed3b5883891--- /dev/null+++ b/docs/api/apiv3/components/examples/values_property_schema.yml@@ -0,0 +1,13 @@+# Example: Values::Property schema+---+value:+ _type: 'Schema'+ property:+ name: 'Property'+ type: 'String'+ value:+ name: 'Start date'+ type: 'Date'+ _links:+ self:+ href: 'api/v3/values/schemas/startDate'diff --git a/docs/api/apiv3/components/examples/values_property_start_date.yml b/docs/api/apiv3/components/examples/values_property_start_date.ymlnew file mode 100644index 00000000000..1769572bfbf--- /dev/null+++ b/docs/api/apiv3/components/examples/values_property_start_date.yml@@ -0,0 +1,11 @@+# Example: Values::Property+---+value:+ _type: 'Values::Property'+ property: 'startDate'+ value: '2021-01-01'+ _links:+ self:+ href: 'api/v3/notifications/123/details/0'+ schema:+ href: 'api/v3/values/schemas/startDate'diff --git a/docs/api/apiv3/components/schemas/notification_collection_model.yml b/docs/api/apiv3/components/schemas/notification_collection_model.ymlindex 59c0e5d3020..a9346136b2a 100644--- a/docs/api/apiv3/components/schemas/notification_collection_model.yml+++ b/docs/api/apiv3/components/schemas/notification_collection_model.yml@@ -37,39 +37,14 @@ allOf:type: objectrequired:- elements+ - detailsSchemasproperties:elements:type: arrayitems:$ref: './notification_model.yml'--example:- _type: Collection- count: 2- total: 2- offset: 1- pageSize: 20- _embedded:- elements:- - _hint: Notification resource shortened for brevity- id: 1- readIAN: false- reason: mentioned- - _hint: Notification resource shortened for brevity- id: 2- readIAN: false- reason: date_alert- message:- - property: 'startDate'- value: '2022-10-05'- - property: 'stopDate'- value: '2022-10-10'- _links:- self:- href: '/api/v3/notifications?offset=1&pageSize=20'- jumpTo:- href: '/api/v3/notifications?filters=%5B%5D&offset=%7Boffset%7D&pageSize=20'- templated: true- changeSize:- href: '/api/v3/notifications?filters=%5B%5D&offset=1&pageSize=%7Bsize%7D'- templated: true+ detailsSchemas:+ type: array+ items:+ oneOf:+ $ref: './schema_model.yml'diff --git a/docs/api/apiv3/components/schemas/notification_model.yml b/docs/api/apiv3/components/schemas/notification_model.ymlindex 0482fb36368..6b624047585 100644--- a/docs/api/apiv3/components/schemas/notification_model.yml+++ b/docs/api/apiv3/components/schemas/notification_model.yml@@ -17,7 +17,7 @@ properties:- assigned- commented- created- - date_alert+ - dateAlert- mentioned- prioritized- processed@@ -28,26 +28,12 @@ properties:readIAN:type: booleandescription: Whether the notification is marked as read- message:+ details:type: arrayitems:- allOf:- - type: object- properties:- property:- type: string- description: |-- The name of the message's property. It can vary based on the reason provided.- For example, the "date_alert" reason can be associated with either a "startDate" or a "dueDate".- value:- type: string- description: |-- The value associated with the property, it can hold any arbitrary string- or a datetime value in ISO 8601 format.- - description: |-- It provides additional information on constructing a user friendly message.- One or more properties can be associated with a message, their number can vary depending- on the reason provided.+ oneOf:+ - $ref: './values_property_model.yml'+ description: A list of objects including detailed information about the notification.createdAt:type: stringformat: date-time@@ -59,9 +45,7 @@ properties:_embedded:type: objectrequired:- - actor- project- - activity- resourceproperties:actor:@@ -81,6 +65,7 @@ properties:- actor- activity- resource+ - detailsproperties:self:allOf:@@ -110,7 +95,8 @@ properties:allOf:- "$ref": "./link.yml"- description: |-- The user that caused the notification+ The user that caused the notification. This might be null in+ case no user triggered the notification.**Resource**: Userresource:@@ -124,54 +110,17 @@ properties:allOf:- "$ref": "./link.yml"- description: |-- The journal activity, if the notification originated from a journal entry+ The journal activity, if the notification originated from a journal entry. This might be null in+ case no activity triggered the notification.**Resource**: Activity-example:- _type: Notification- id: 1- readIAN: false- reason: mentioned- message:- - property: 'startDate'- value: '2022-04-06'- createdAt: '2022-04-05T14:38:28Z'- updatedAt: '2022-04-06T09:03:24Z'- _embedded:- author:- _hint: User resource shortened for brevity- _type: User- id: 13- name: Darth Nihilus- project:- _hint: Project resource shortened for brevity- _type: Project- id: 11- name: Jedi Remnant Locator- activity:- _hint: Activity resource shortened for brevity- _type: Activity::Comment- id: 180- version: 3- resource:- _hint: WorkPackage resource shortened for brevity- _type: WorkPackage- id: 77- subject: Educate Visas Marr- _links:- self:- href: '/api/v3/notifications/1'- readIAN:- href: '/api/v3/notifications/1/read_ian'- method: post- actor:- href: '/api/v3/users/13'- title: Darth Nihilus- project:- href: '/api/v3/projects/11'- title: Jedi Remnant Locator- activity:- href: '/api/v3/activities/180'- resource:- href: '/api/v3/work_packages/77'- title: Educate Visas Marr+ details:+ type: array+ items:+ allOf:+ - "$ref": "./link.yml"+ - description: |-+ A list of objects including detailed information about the notification. The contents of+ and type of this can vary widely between different notification reasons.++ **Resource**: Polymorphic (e.g. Values::Property)diff --git a/docs/api/apiv3/components/schemas/values_property_model.yml b/docs/api/apiv3/components/schemas/values_property_model.ymlnew file mode 100644index 00000000000..414b6817740--- /dev/null+++ b/docs/api/apiv3/components/schemas/values_property_model.yml@@ -0,0 +1,45 @@+# Schema: Values::PropertyModel+---+type: object+required:+ - _type+ - property+ - value+ - _links+properties:+ _type:+ type: string+ enum:+ - Values::Property+ property:+ type: string+ description: The key of the key - value pair represented by the Values::Property+ value:+ type:+ oneOf:+ - String+ - Integer+ - Float+ - Duration+ - Date+ description: The value of the key - value pair represented by the Values::Property+ _links:+ type: object+ required:+ - self+ - schema+ properties:+ self:+ allOf:+ - $ref: './link.yml'+ - description: |-+ This key - value pair.++ **Resource**: Storage+ schema:+ allOf:+ - $ref: './link.yml'+ - description: |-+ The schema describing the key - value pair.++ **Resource**: Schemadiff --git a/docs/api/apiv3/openapi-spec.yml b/docs/api/apiv3/openapi-spec.ymlindex 7af8ce9206c..e92c32f9d40 100644--- a/docs/api/apiv3/openapi-spec.yml+++ b/docs/api/apiv3/openapi-spec.yml@@ -245,6 +245,8 @@ paths:"$ref": "./paths/notifications_unread.yml""/api/v3/notifications/{id}":"$ref": "./paths/notification.yml"+ "/api/v3/notifications/{notification_id}/details/{id}":+ "$ref": "./paths/notification_details.yml""/api/v3/notifications/{id}/read_ian":"$ref": "./paths/notification_read.yml""/api/v3/notifications/{id}/unread_ian":@@ -386,6 +388,8 @@ paths:"$ref": "./paths/user_form.yml""/api/v3/users/{id}/lock":"$ref": "./paths/user_lock.yml"+ "/api/v3/values/schema/{id}":+ "$ref": "./paths/values_schema.yml""/api/v3/versions":"$ref": "./paths/versions.yml""/api/v3/versions/available_projects":@@ -445,6 +449,12 @@ paths:components:examples:+ DateAlertNotification:+ $ref: './components/examples/date_alert_notification.yml'+ MentionedNotification:+ $ref: './components/examples/mentioned_notification.yml'+ NotificationCollection:+ $ref: './components/examples/notification_collection.yml'Project:$ref: "./components/examples/project.yml"ProjectBody:@@ -455,6 +465,10 @@ components:"$ref": "./components/examples/query.yml"QuerySchemaModel:"$ref": "./components/examples/query_schema.yml"+ ValuesPropertySchema:+ "$ref": "./components/examples/values_property_schema.yml"+ ValuesPropertyStartDate:+ "$ref": "./components/examples/values_property_start_date.yml"Views:"$ref": "./components/examples/views.yml"ViewWorkPackagesTable:@@ -760,6 +774,8 @@ components:"$ref": "./components/schemas/user_create_form.yml"User_update_form:"$ref": "./components/schemas/user_update_form.yml"+ ValuesPropertyModel:+ "$ref": "./components/schemas/values_property_model.yml"VersionModel:"$ref": "./components/schemas/version_model.yml"Version_create_form:@@ -866,6 +882,7 @@ tags:- "$ref": "./tags/types.yml"- "$ref": "./tags/userpreferences.yml"- "$ref": "./tags/users.yml"+ - "$ref": "./tags/values_property.yml"- "$ref": "./tags/versions.yml"- "$ref": "./tags/views.yml"- "$ref": "./tags/wiki_pages.yml"diff --git a/docs/api/apiv3/paths/notification.yml b/docs/api/apiv3/paths/notification.ymlindex 1b1f29a5400..915f5a6a1d9 100644--- a/docs/api/apiv3/paths/notification.yml+++ b/docs/api/apiv3/paths/notification.yml@@ -20,6 +20,11 @@ get:application/hal+json:schema:$ref: '../components/schemas/notification_model.yml'+ examples:+ 'Date alert notification':+ $ref: '../components/examples/date_alert_notification.yml'+ 'Mentioned notification':+ $ref: '../components/examples/mentioned_notification.yml'description: OK'404':content:diff --git a/docs/api/apiv3/paths/notification_details.yml b/docs/api/apiv3/paths/notification_details.ymlnew file mode 100644index 00000000000..9e318db2e9b--- /dev/null+++ b/docs/api/apiv3/paths/notification_details.yml@@ -0,0 +1,47 @@+# /api/v3/notifications/{notification_id}/details/{id}+---+get:+ summary: Get a notification detail+ operationId: view_notification_detail+ tags:+ - Notifications+ - Values::Property+ description: Returns an individual detail of a notification identified by the notification id and the id of the detail.+ parameters:+ - name: notification_id+ in: path+ description: notification id+ example: '1'+ required: true+ schema:+ type: integer+ - name: id+ in: path+ description: detail id+ example: '0'+ required: true+ schema:+ type: integer+ responses:+ '200':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/values_property_model.yml'+ examples:+ 'Start date notification detail':+ $ref: '../components/examples/values_property_start_date.yml'+ description: OK+ '404':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/error_response.yml'+ example:+ _type: Error+ errorIdentifier: urn:openproject-org:api:v3:errors:NotFound+ message: The requested resource could not be found.+ description: |-+ Returned if the notification or the detail of it does not exist or if the user does not have permission to view it.++ **Required permission** being recipient of the notificationdiff --git a/docs/api/apiv3/paths/notifications.yml b/docs/api/apiv3/paths/notifications.ymlindex a0d2e7cab26..52859d323af 100644--- a/docs/api/apiv3/paths/notifications.yml+++ b/docs/api/apiv3/paths/notifications.yml@@ -8,6 +8,10 @@ get:description: |-Returns the collection of available in-app notifications. The notifications returned depend on the providedparameters and also on the requesting user's permissions.++ Contrary to most collections, this one also links to and embeds schemas for the `details` properties of the notifications returned.+ This is an optimization. Clients will receive the information necessary to display the various types of details that a notification+ can carry.parameters:- name: offsetdescription: Page number inside the requested collection.@@ -79,6 +83,9 @@ get:application/hal+json:schema:$ref: '../components/schemas/notification_collection_model.yml'+ examples:+ 'Collection of notifications':+ $ref: '../components/examples/notification_collection.yml'description: OK'400':content:@@ -88,8 +95,7 @@ get:example:_type: ErrorerrorIdentifier: urn:openproject-org:api:v3:errors:InvalidQuery- message:- - Filters Invalid filter does not exist.+ message: Filters Invalid filter does not exist.description: Returned if the client sends invalid request parameters e.g. filters'403':content:diff --git a/docs/api/apiv3/paths/values_schema.yml b/docs/api/apiv3/paths/values_schema.ymlnew file mode 100644index 00000000000..d3bde9ed425--- /dev/null+++ b/docs/api/apiv3/paths/values_schema.yml@@ -0,0 +1,38 @@+# /api/v3/values/schemas/{id}+---+get:+ parameters:+ - name: id+ in: path+ description: The identifier of the value. This is typically the value of the `property` property of the `Values` resource.+ example: 'startDate'+ required: true+ schema:+ type: String+ responses:+ '200':+ content:+ application/hal+json:+ schema:+ "$ref": "../components/schemas/schema_model.yml"+ examples:+ 'Values::Property Start date schema':+ $ref: '../components/examples/values_property_schema.yml'+ description: OK+ headers: {}+ '404':+ content:+ application/hal+json:+ schema:+ $ref: '../components/schemas/error_response.yml'+ example:+ _type: Error+ errorIdentifier: urn:openproject-org:api:v3:errors:NotFound+ message: The requested resource could not be found.+ description: |-+ Returned if the schema does not exist.+ tags:+ - Values::Property+ description: The schema of a `Values` resource.+ operationId: View_values_schema+ summary: View Values schemadiff --git a/docs/api/apiv3/tags/notifications.yml b/docs/api/apiv3/tags/notifications.ymlindex ba7fb0c4974..8b6a3531249 100644--- a/docs/api/apiv3/tags/notifications.yml+++ b/docs/api/apiv3/tags/notifications.yml@@ -1,6 +1,9 @@---description: |-Notifications are created through notifiable actions in OpenProject.+ Notifications are triggered by actions carried out in the system by users, e.g. editing a work package, but can also be send out because+ of time passing e.g. when a user is notified of a work package that is overdue.+This endpoint only returns in-app notifications.## Actions@@ -12,13 +15,14 @@ description: |-## Linked Properties- | Link | Description | Type | Constraints | Supported operations | Condition |- | :-----------: | ---------------------------------------- | -------------- | --------------------- | -------------------- | ----------------------------------------- |- | self | This notification | Notification | not null | READ | |- | project | The project containng the resource | Project | not null | READ | |- | actor | The user that caused the notification | User | not null | READ | |- | resource | The resource the notification belongs to | Polymorphic | not null | READ | |- | activity | The journal the notification belongs to | Polymorphic | | READ | optional |+ | Link | Description | Type | Constraints | Supported operations | Condition |+ | :-----------: | ---------------------------------------- | -------------- | --------------------- | -------------------- | ----------------------------------------- |+ | self | This notification | Notification | not null | READ | |+ | project | The project containing the resource | Project | not null | READ | |+ | actor | The user that caused the notification | User | | READ | optional |+ | resource | The resource the notification belongs to | Polymorphic | not null | READ | |+ | activity | The journal the notification belongs to | Polymorphic | | READ | optional |+ | details | A list of objects including detailed information | Polymorphic | | READ | optional |## Local Propertiesdiff --git a/docs/api/apiv3/tags/values_property.yml b/docs/api/apiv3/tags/values_property.ymlnew file mode 100644index 00000000000..36e6728c65d--- /dev/null+++ b/docs/api/apiv3/tags/values_property.yml@@ -0,0 +1,23 @@+---+description: |-+ `Values::Property` represents a single key - value pair. That pair typically is an+ excerpt of the properties of a resource. `Values::Property` itself is not an independent resource. It will always be nested and as such+ will only exist as part of another resource.++ It is currently used e.g. in the Notification resource.++ ## Linked Properties++ | Property | Description | Type | Constraints | Supported operations | Condition |+ | :--------------: | ----------------------------| ----------- | --------------------- | -------------------- | ------------------------- |+ | self | This value | Values::Property | not null | READ | |+ | schema | This value's schema | Schema | not null | READ | |++ ## Local Properties++ | Property | Description | Type | Constraints | Supported operations | Condition |+ | :--------------: | ------------------------------------------------------ | ----------- | -------------- | -------------------- | ---------------------------- |+ | property | The pairs' key name | String | not null | READ | |+ | value | The pairs' value | Polymorphic | | READ | |++name: Values::Property