Skip to content
Draft
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
19 changes: 12 additions & 7 deletions apps/api/src/app/subscribers/subscribersV1.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,8 @@ export class SubscribersV1Controller {
@Get('/:subscriberId/notifications/feed')
@ApiOperation({
summary: 'Retrieve subscriber notifications',
description: `Retrieve subscriber in-app (inbox) notifications by its unique key identifier **subscriberId**.`,
description: `This API is deprecated, use v2 API instead. Retrieve subscriber in-app notifications by its unique key identifier **subscriberId**.`,
deprecated: true,
})
@ApiResponse(FeedResponseDto)
@SdkGroupName('Subscribers.Notifications')
Expand Down Expand Up @@ -619,7 +620,8 @@ export class SubscribersV1Controller {
@ApiResponse(UnseenCountResponse)
@ApiOperation({
summary: 'Retrieve unseen notifications count',
description: `Retrieve unseen in-app (inbox) notifications count for a subscriber by its unique key identifier **subscriberId**.`,
description: `This API is deprecated, use v2 API instead. Retrieve unseen in-app notifications count for a subscriber by its unique key identifier **subscriberId**.`,
deprecated: true,
})
@SdkGroupName('Subscribers.Notifications')
@SdkMethodName('unseenCount')
Expand Down Expand Up @@ -656,7 +658,7 @@ export class SubscribersV1Controller {
@Post('/:subscriberId/messages/markAs')
@ApiOperation({
summary: 'Mark a subscriber feed messages as seen or as read',
description: `Introducing '/:subscriberId/messages/mark-as endpoint for consistent read and seen message handling,
description: `This API is deprecated, use v2 API instead. Introducing '/:subscriberId/messages/mark-as endpoint for consistent read and seen message handling,
deprecating old legacy endpoint.`,
deprecated: true,
Comment on lines 659 to 663
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Clarify migration target in legacy markAs description.

Line 661 currently says to use v2, but the same sentence also says “introducing /:subscriberId/messages/mark-as,” which points to a v1 path and creates mixed guidance.

✏️ Suggested wording cleanup
   `@ApiOperation`({
     summary: 'Mark a subscriber feed messages as seen or as read',
-    description: `This API is deprecated, use v2 API instead. Introducing '/:subscriberId/messages/mark-as endpoint for consistent read and seen message handling,
-     deprecating old legacy endpoint.`,
+    description: `This API is deprecated, use v2 API instead. This legacy '/:subscriberId/messages/markAs' endpoint is maintained for backward compatibility only.`,
     deprecated: true,
   })
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@ApiOperation({
summary: 'Mark a subscriber feed messages as seen or as read',
description: `Introducing '/:subscriberId/messages/mark-as endpoint for consistent read and seen message handling,
description: `This API is deprecated, use v2 API instead. Introducing '/:subscriberId/messages/mark-as endpoint for consistent read and seen message handling,
deprecating old legacy endpoint.`,
deprecated: true,
`@ApiOperation`({
summary: 'Mark a subscriber feed messages as seen or as read',
description: `This API is deprecated, use v2 API instead. This legacy '/:subscriberId/messages/markAs' endpoint is maintained for backward compatibility only.`,
deprecated: true,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/api/src/app/subscribers/subscribersV1.controller.ts` around lines 659 -
663, Update the ApiOperation description on the deprecated markAs handler to
consistently point to the v2 endpoint and remove the confusing v1 path
reference: edit the ApiOperation decorator (above the markAs method in
subscribersV1.controller.ts) so the description states that this API is
deprecated and directs consumers to the v2 path (e.g., the v2
'/subscribers/:subscriberId/messages/mark-as' endpoint) for consistent read/seen
handling, removing the mixed guidance that currently references the v1-style
path.

})
Expand Down Expand Up @@ -686,8 +688,9 @@ export class SubscribersV1Controller {

@ApiOperation({
summary: 'Update notifications state',
description: `Update subscriber's multiple in-app (inbox) notifications state such as seen, read, unseen or unread by **subscriberId**.
**messageId** is of type mongodbId of notifications`,
description: `This API is deprecated, use v2 API instead. Update subscriber's multiple in-app notifications state such as seen, read, unseen or unread by **subscriberId**.
**messageId** is of type mongodbId of notifications. This API is deprecated, use v2 API instead.`,
deprecated: true,
Comment on lines +691 to +693
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove duplicated deprecation sentence in description.

Line 691 and Line 692 repeat the same deprecation statement, which adds noise in generated docs.

✏️ Suggested wording cleanup
   `@ApiOperation`({
     summary: 'Update notifications state',
     description: `This API is deprecated, use v2 API instead. Update subscriber's multiple in-app notifications state such as seen, read, unseen or unread by **subscriberId**. 
-      **messageId** is of type mongodbId of notifications. This API is deprecated, use v2 API instead.`,
+      **messageId** is of type mongodbId of notifications.`,
     deprecated: true,
   })
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
description: `This API is deprecated, use v2 API instead. Update subscriber's multiple in-app notifications state such as seen, read, unseen or unread by **subscriberId**.
**messageId** is of type mongodbId of notifications. This API is deprecated, use v2 API instead.`,
deprecated: true,
description: `This API is deprecated, use v2 API instead. Update subscriber's multiple in-app notifications state such as seen, read, unseen or unread by **subscriberId**.
**messageId** is of type mongodbId of notifications.`,
deprecated: true,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/api/src/app/subscribers/subscribersV1.controller.ts` around lines 691 -
693, The route description in subscribersV1.controller.ts contains a duplicated
deprecation sentence; open the description value for the affected endpoint (the
description property in the controller's route config) and remove the repeated
"This API is deprecated, use v2 API instead." so the deprecation appears only
once while preserving the rest of the explanatory text and keeping deprecated:
true unchanged.

})
@ExternalApiAccessible()
@RequireAuthentication()
Expand Down Expand Up @@ -720,7 +723,8 @@ export class SubscribersV1Controller {
@Post('/:subscriberId/messages/mark-all')
@ApiOperation({
summary: 'Update all notifications state',
description: `Update all subscriber in-app (inbox) notifications state such as read, unread, seen or unseen by **subscriberId**.`,
description: `This API is deprecated, use v2 API instead. Update all subscriber in-app notifications state such as read, unread, seen or unseen by **subscriberId**.`,
deprecated: true,
})
@ApiCreatedResponse({
type: Number,
Expand Down Expand Up @@ -750,8 +754,9 @@ export class SubscribersV1Controller {
@Post('/:subscriberId/messages/:messageId/actions/:type')
@ApiOperation({
summary: 'Update notification action status',
description: `Update in-app (inbox) notification's action status by its unique key identifier **messageId** and type field **type**.
description: `This API is deprecated, use v2 API instead. Update in-app notification's action status by its unique key identifier **messageId** and type field **type**.
**type** field can be **primary** or **secondary**`,
deprecated: true,
})
@ApiResponse(MessageResponseDto, 201)
@SdkGroupName('Subscribers.Messages')
Expand Down
Loading