feat(#2): Get notifications working again

This commit is contained in:
2025-11-01 08:47:02 +01:00
parent 841341857d
commit 2cf492cd6c
16 changed files with 609 additions and 380 deletions

View File

@@ -609,6 +609,12 @@ paths:
tags:
- notification
parameters:
- in: query
name: organizationId
required: true
schema:
type: string
description: Organization ID to get notifications for
- in: query
name: page
schema:
@@ -663,6 +669,13 @@ paths:
operationId: getUnreadNotifications
tags:
- notification
parameters:
- in: query
name: organizationId
required: true
schema:
type: string
description: Organization ID to get unread notifications for
responses:
"200":
description: List of unread notifications
@@ -674,15 +687,30 @@ paths:
$ref: "#/components/schemas/NotificationDto"
"401":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/Unauthorized"
"403":
description: User is not authorized to access this organization
"500":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServerError"
/notifications/unread/count:
get:
summary: Get count of unread notifications for the current user
summary: Get count of unread notifications for a user (public endpoint)
operationId: getUnreadNotificationCount
tags:
- notification
parameters:
- in: query
name: userId
required: true
schema:
type: string
description: Keycloak user ID to get notification count for
- in: query
name: organizationId
required: true
schema:
type: string
description: Organization ID to get notification count for
responses:
"200":
description: Count of unread notifications
@@ -691,8 +719,6 @@ paths:
schema:
type: integer
format: int64
"401":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/Unauthorized"
"500":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServerError"
@@ -702,11 +728,43 @@ paths:
operationId: markAllNotificationsAsRead
tags:
- notification
parameters:
- in: query
name: organizationId
required: true
schema:
type: string
description: Organization ID to mark notifications as read for
responses:
"204":
description: All notifications marked as read
"401":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/Unauthorized"
"403":
description: User is not authorized to access this organization
"500":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServerError"
/notifications/clear-all:
delete:
summary: Clear all notifications for the current user
operationId: clearAllNotifications
tags:
- notification
parameters:
- in: query
name: organizationId
required: true
schema:
type: string
description: Organization ID to clear notifications for
responses:
"204":
description: All notifications cleared
"401":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/Unauthorized"
"403":
description: User is not authorized to access this organization
"500":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServerError"
@@ -723,6 +781,13 @@ paths:
operationId: markNotificationAsRead
tags:
- notification
parameters:
- in: query
name: organizationId
required: true
schema:
type: string
description: Organization ID for authorization
responses:
"200":
description: Notification marked as read
@@ -734,6 +799,8 @@ paths:
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/NotFound"
"401":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/Unauthorized"
"403":
description: User is not authorized to access this organization
"500":
$ref: "https://api.swaggerhub.com/domains/smartbear-public/ProblemDetails/1.0.0#/components/responses/ServerError"
@@ -1130,7 +1197,6 @@ components:
- message
- clickTarget
- isRead
- role
- type
- createdAt
- organizationId
@@ -1150,8 +1216,10 @@ components:
nullable: true
allOf:
- $ref: "#/components/schemas/UserDto"
role:
targetRoles:
type: string
description: Comma-separated list of target roles (only for role-based notifications)
nullable: true
type:
$ref: "#/components/schemas/NotificationType"
organizationId:
@@ -1166,7 +1234,6 @@ components:
- title
- message
- clickTarget
- role
- type
- organizationId
properties:
@@ -1176,16 +1243,21 @@ components:
type: string
clickTarget:
type: string
recipient:
nullable: true
allOf:
- $ref: "#/components/schemas/UserDto"
role:
recipientId:
type: string
description: Keycloak ID of the recipient user. If not provided, notification will be role-based or organization-wide.
nullable: true
targetRoles:
type: array
items:
type: string
description: List of roles to send notification to. If both recipientId and targetRoles are null, notification will be sent to all organization members.
nullable: true
type:
$ref: "#/components/schemas/NotificationType"
organizationId:
type: string
description: The organization ID for this notification
PagedNotificationDto:
type: object