Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

feat(notif): add subtype to more payloads (#3277)

Sean Aye57e4e8468cc6
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/commentedOnDocumentMetadata.ts b/js/app/packages/service-clients/service-notification/generated/schemas/commentedOnDocumentMetadata.ts
index a2cc1370a5..1ab703cb0c 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/commentedOnDocumentMetadata.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/commentedOnDocumentMetadata.ts
@@ -6,6 +6,7 @@
*/
import type { CommentedOnDocumentMetadataFileType } from './commentedOnDocumentMetadataFileType';
import type { CommentedOnDocumentMetadataSenderProfilePictureUrl } from './commentedOnDocumentMetadataSenderProfilePictureUrl';
+import type { CommentedOnDocumentMetadataSubType } from './commentedOnDocumentMetadataSubType';
/**
* Notification sent when someone comments on a document the user owns.
@@ -20,6 +21,7 @@ export interface CommentedOnDocumentMetadata {
/** The owner of the document. */
owner: string;
senderProfilePictureUrl?: CommentedOnDocumentMetadataSenderProfilePictureUrl;
+ subType?: CommentedOnDocumentMetadataSubType;
/** the text of the comment */
text: string;
/** the thread id */
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/commentedOnDocumentMetadataSubType.ts b/js/app/packages/service-clients/service-notification/generated/schemas/commentedOnDocumentMetadataSubType.ts
new file mode 100644
index 0000000000..4580c4be31
--- /dev/null
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/commentedOnDocumentMetadataSubType.ts
@@ -0,0 +1,10 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * notification_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { NotificationDocumentSubType } from './notificationDocumentSubType';
+
+export type CommentedOnDocumentMetadataSubType =
+ null | NotificationDocumentSubType;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/index.ts b/js/app/packages/service-clients/service-notification/generated/schemas/index.ts
index 00986d100d..2ebe82848b 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/index.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/index.ts
@@ -30,6 +30,7 @@ export * from './channelType';
export * from './commentedOnDocumentMetadata';
export * from './commentedOnDocumentMetadataFileType';
export * from './commentedOnDocumentMetadataSenderProfilePictureUrl';
+export * from './commentedOnDocumentMetadataSubType';
export * from './commonChannelMetadata';
export * from './connGatewayInnerNotifValue';
export * from './connGatewayInnerNotifValueAllOf';
@@ -64,6 +65,7 @@ export * from './macroUserIdStr';
export * from './mentionedInDocumentCommentMetadata';
export * from './mentionedInDocumentCommentMetadataFileType';
export * from './mentionedInDocumentCommentMetadataSenderProfilePictureUrl';
+export * from './mentionedInDocumentCommentMetadataSubType';
export * from './newEmailMetadata';
export * from './newEmailMetadataSender';
export * from './notifEvent';
@@ -102,9 +104,11 @@ export * from './pushNotificationDataSenderProfilePictureUrl';
export * from './repliedToDocumentCommentThreadMetadata';
export * from './repliedToDocumentCommentThreadMetadataFileType';
export * from './repliedToDocumentCommentThreadMetadataSenderProfilePictureUrl';
+export * from './repliedToDocumentCommentThreadMetadataSubType';
export * from './taggedContentValue';
export * from './taskAssignedMetadata';
export * from './taskAssignedMetadataSenderProfilePictureUrl';
+export * from './taskAssignedMetadataSubType';
export * from './taskAssignedMetadataTaskName';
export * from './unsubscribeItemPathParams';
export * from './userUnsubscribe';
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/mentionedInDocumentCommentMetadata.ts b/js/app/packages/service-clients/service-notification/generated/schemas/mentionedInDocumentCommentMetadata.ts
index cd6c810c75..346cec15b9 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/mentionedInDocumentCommentMetadata.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/mentionedInDocumentCommentMetadata.ts
@@ -6,6 +6,7 @@
*/
import type { MentionedInDocumentCommentMetadataFileType } from './mentionedInDocumentCommentMetadataFileType';
import type { MentionedInDocumentCommentMetadataSenderProfilePictureUrl } from './mentionedInDocumentCommentMetadataSenderProfilePictureUrl';
+import type { MentionedInDocumentCommentMetadataSubType } from './mentionedInDocumentCommentMetadataSubType';
/**
* Notification sent when a user is mentioned in a document comment.
@@ -22,6 +23,7 @@ export interface MentionedInDocumentCommentMetadata {
/** The owner of the document. */
owner: string;
senderProfilePictureUrl?: MentionedInDocumentCommentMetadataSenderProfilePictureUrl;
+ subType?: MentionedInDocumentCommentMetadataSubType;
/** the text of the comment */
text: string;
/** the thread id */
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/mentionedInDocumentCommentMetadataSubType.ts b/js/app/packages/service-clients/service-notification/generated/schemas/mentionedInDocumentCommentMetadataSubType.ts
new file mode 100644
index 0000000000..8982cb380d
--- /dev/null
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/mentionedInDocumentCommentMetadataSubType.ts
@@ -0,0 +1,10 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * notification_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { NotificationDocumentSubType } from './notificationDocumentSubType';
+
+export type MentionedInDocumentCommentMetadataSubType =
+ null | NotificationDocumentSubType;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/repliedToDocumentCommentThreadMetadata.ts b/js/app/packages/service-clients/service-notification/generated/schemas/repliedToDocumentCommentThreadMetadata.ts
index 07b554b6d0..d4fa4c7512 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/repliedToDocumentCommentThreadMetadata.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/repliedToDocumentCommentThreadMetadata.ts
@@ -6,6 +6,7 @@
*/
import type { RepliedToDocumentCommentThreadMetadataFileType } from './repliedToDocumentCommentThreadMetadataFileType';
import type { RepliedToDocumentCommentThreadMetadataSenderProfilePictureUrl } from './repliedToDocumentCommentThreadMetadataSenderProfilePictureUrl';
+import type { RepliedToDocumentCommentThreadMetadataSubType } from './repliedToDocumentCommentThreadMetadataSubType';
/**
* Notification sent when someone replies to a document comment thread.
@@ -20,6 +21,7 @@ export interface RepliedToDocumentCommentThreadMetadata {
/** The owner of the document. */
owner: string;
senderProfilePictureUrl?: RepliedToDocumentCommentThreadMetadataSenderProfilePictureUrl;
+ subType?: RepliedToDocumentCommentThreadMetadataSubType;
/** the text of the comment */
text: string;
/** the thread id */
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/repliedToDocumentCommentThreadMetadataSubType.ts b/js/app/packages/service-clients/service-notification/generated/schemas/repliedToDocumentCommentThreadMetadataSubType.ts
new file mode 100644
index 0000000000..a8cd926ebd
--- /dev/null
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/repliedToDocumentCommentThreadMetadataSubType.ts
@@ -0,0 +1,10 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * notification_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { NotificationDocumentSubType } from './notificationDocumentSubType';
+
+export type RepliedToDocumentCommentThreadMetadataSubType =
+ null | NotificationDocumentSubType;
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/taskAssignedMetadata.ts b/js/app/packages/service-clients/service-notification/generated/schemas/taskAssignedMetadata.ts
index c285d22c68..bf1d3224b8 100644
--- a/js/app/packages/service-clients/service-notification/generated/schemas/taskAssignedMetadata.ts
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/taskAssignedMetadata.ts
@@ -5,6 +5,7 @@
* OpenAPI spec version: 0.1.0
*/
import type { TaskAssignedMetadataSenderProfilePictureUrl } from './taskAssignedMetadataSenderProfilePictureUrl';
+import type { TaskAssignedMetadataSubType } from './taskAssignedMetadataSubType';
import type { TaskAssignedMetadataTaskName } from './taskAssignedMetadataTaskName';
/**
@@ -14,6 +15,7 @@ export interface TaskAssignedMetadata {
/** The user who assigned the task */
assignedBy: string;
senderProfilePictureUrl?: TaskAssignedMetadataSenderProfilePictureUrl;
+ subType?: TaskAssignedMetadataSubType;
/** The unique identifier of the task */
taskId: string;
/** The name of the task (optional) */
diff --git a/js/app/packages/service-clients/service-notification/generated/schemas/taskAssignedMetadataSubType.ts b/js/app/packages/service-clients/service-notification/generated/schemas/taskAssignedMetadataSubType.ts
new file mode 100644
index 0000000000..58d8a0c0d8
--- /dev/null
+++ b/js/app/packages/service-clients/service-notification/generated/schemas/taskAssignedMetadataSubType.ts
@@ -0,0 +1,9 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * notification_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { NotificationDocumentSubType } from './notificationDocumentSubType';
+
+export type TaskAssignedMetadataSubType = null | NotificationDocumentSubType;
diff --git a/js/app/packages/service-clients/service-notification/generated/zod.ts b/js/app/packages/service-clients/service-notification/generated/zod.ts
index 029a345c54..e794a31694 100644
--- a/js/app/packages/service-clients/service-notification/generated/zod.ts
+++ b/js/app/packages/service-clients/service-notification/generated/zod.ts
@@ -255,6 +255,18 @@ export const listTypedNotificationsResponse = zod
.string()
.describe('The owner of the document.'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
text: zod
.string()
.describe('the text of the comment'),
@@ -282,6 +294,18 @@ export const listTypedNotificationsResponse = zod
.string()
.describe('The owner of the document.'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
text: zod
.string()
.describe('the text of the comment'),
@@ -311,6 +335,18 @@ export const listTypedNotificationsResponse = zod
.string()
.describe('The owner of the document.'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
text: zod
.string()
.describe('the text of the comment'),
@@ -479,6 +515,18 @@ export const listTypedNotificationsResponse = zod
.string()
.describe('The user who assigned the task'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
taskId: zod
.string()
.describe('The unique identifier of the task'),
@@ -717,6 +765,18 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zod
.string()
.describe('The owner of the document.'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
text: zod
.string()
.describe('the text of the comment'),
@@ -744,6 +804,18 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zod
.string()
.describe('The owner of the document.'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
text: zod
.string()
.describe('the text of the comment'),
@@ -773,6 +845,18 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zod
.string()
.describe('The owner of the document.'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
text: zod
.string()
.describe('the text of the comment'),
@@ -941,6 +1025,18 @@ export const bulkGetTypedNotificationsByEventItemIdsResponse = zod
.string()
.describe('The user who assigned the task'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
taskId: zod
.string()
.describe('The unique identifier of the task'),
@@ -1173,6 +1269,18 @@ export const getTypedNotificationsByEventItemIdResponse = zod
.string()
.describe('The owner of the document.'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
text: zod
.string()
.describe('the text of the comment'),
@@ -1200,6 +1308,18 @@ export const getTypedNotificationsByEventItemIdResponse = zod
.string()
.describe('The owner of the document.'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
text: zod
.string()
.describe('the text of the comment'),
@@ -1229,6 +1349,18 @@ export const getTypedNotificationsByEventItemIdResponse = zod
.string()
.describe('The owner of the document.'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
text: zod
.string()
.describe('the text of the comment'),
@@ -1397,6 +1529,18 @@ export const getTypedNotificationsByEventItemIdResponse = zod
.string()
.describe('The user who assigned the task'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
taskId: zod
.string()
.describe('The unique identifier of the task'),
@@ -1632,6 +1776,18 @@ export const getTypedNotificationByIdResponse = zod
mentionId: zod.string().describe('The mention ID.'),
owner: zod.string().describe('The owner of the document.'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
text: zod.string().describe('the text of the comment'),
threadId: zod.number().describe('the thread id'),
})
@@ -1655,6 +1811,18 @@ export const getTypedNotificationByIdResponse = zod
.describe('The file type of the document.'),
owner: zod.string().describe('The owner of the document.'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
text: zod.string().describe('the text of the comment'),
threadId: zod.number().describe('the thread id'),
})
@@ -1680,6 +1848,18 @@ export const getTypedNotificationByIdResponse = zod
.describe('The file type of the document.'),
owner: zod.string().describe('The owner of the document.'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
text: zod.string().describe('the text of the comment'),
threadId: zod.number().describe('the thread id'),
})
@@ -1832,6 +2012,18 @@ export const getTypedNotificationByIdResponse = zod
.string()
.describe('The user who assigned the task'),
senderProfilePictureUrl: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .object({
+ type: zod.enum(['task']),
+ })
+ .describe(
+ 'The sub type of a document in a notification.\nSerializes as `{ \"type\": \"task\" }` matching the storage service pattern.'
+ ),
+ ])
+ .optional(),
taskId: zod
.string()
.describe('The unique identifier of the task'),
diff --git a/js/app/packages/service-clients/service-notification/openapi.json b/js/app/packages/service-clients/service-notification/openapi.json
index 78c2046923..f0c429c1f8 100644
--- a/js/app/packages/service-clients/service-notification/openapi.json
+++ b/js/app/packages/service-clients/service-notification/openapi.json
@@ -1243,6 +1243,17 @@
"senderProfilePictureUrl": {
"type": ["string", "null"]
},
+ "subType": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/NotificationDocumentSubType",
+ "description": "The sub type of the document (e.g. task)."
+ }
+ ]
+ },
"text": {
"type": "string",
"description": "the text of the comment"
@@ -1609,6 +1620,17 @@
"senderProfilePictureUrl": {
"type": ["string", "null"]
},
+ "subType": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/NotificationDocumentSubType",
+ "description": "The sub type of the document (e.g. task)."
+ }
+ ]
+ },
"text": {
"type": "string",
"description": "the text of the comment"
@@ -1904,6 +1926,17 @@
"senderProfilePictureUrl": {
"type": ["string", "null"]
},
+ "subType": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/NotificationDocumentSubType",
+ "description": "The sub type of the document (e.g. task)."
+ }
+ ]
+ },
"text": {
"type": "string",
"description": "the text of the comment"
@@ -1938,6 +1971,17 @@
"senderProfilePictureUrl": {
"type": ["string", "null"]
},
+ "subType": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/NotificationDocumentSubType",
+ "description": "The sub type of the backing document (task)."
+ }
+ ]
+ },
"taskId": {
"type": "string",
"description": "The unique identifier of the task"
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/documentBasic.ts b/js/app/packages/service-clients/service-storage/generated/schemas/documentBasic.ts
index e65b020882..8673e7265d 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/documentBasic.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/documentBasic.ts
@@ -10,6 +10,7 @@ import type { DocumentBasicDeletedAt } from './documentBasicDeletedAt';
import type { DocumentBasicDocumentFamilyId } from './documentBasicDocumentFamilyId';
import type { DocumentBasicFileType } from './documentBasicFileType';
import type { DocumentBasicProjectId } from './documentBasicProjectId';
+import type { DocumentBasicSubType } from './documentBasicSubType';
/**
* Returns basic information of a document used for some db queries
@@ -24,4 +25,5 @@ export interface DocumentBasic {
fileType?: DocumentBasicFileType;
owner: string;
projectId?: DocumentBasicProjectId;
+ subType?: DocumentBasicSubType;
}
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/documentBasicSubType.ts b/js/app/packages/service-clients/service-storage/generated/schemas/documentBasicSubType.ts
new file mode 100644
index 0000000000..2dd9e6b0f6
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/documentBasicSubType.ts
@@ -0,0 +1,9 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { DocumentSubType } from './documentSubType';
+
+export type DocumentBasicSubType = null | DocumentSubType;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/editCommentResponseAllOf.ts b/js/app/packages/service-clients/service-storage/generated/schemas/editCommentResponseAllOf.ts
index ca2b1bad3e..8200710276 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/editCommentResponseAllOf.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/editCommentResponseAllOf.ts
@@ -5,10 +5,12 @@
* OpenAPI spec version: 0.1.0
*/
import type { EditCommentResponseAllOfFileType } from './editCommentResponseAllOfFileType';
+import type { EditCommentResponseAllOfSubType } from './editCommentResponseAllOfSubType';
export type EditCommentResponseAllOf = {
documentId: string;
documentName: string;
documentOwner: string;
fileType?: EditCommentResponseAllOfFileType;
+ subType?: EditCommentResponseAllOfSubType;
};
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/editCommentResponseAllOfSubType.ts b/js/app/packages/service-clients/service-storage/generated/schemas/editCommentResponseAllOfSubType.ts
new file mode 100644
index 0000000000..0df6d5ae0b
--- /dev/null
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/editCommentResponseAllOfSubType.ts
@@ -0,0 +1,9 @@
+/**
+ * Generated by orval v7.21.0 🍺
+ * Do not edit manually.
+ * document_storage_service
+ * OpenAPI spec version: 0.1.0
+ */
+import type { DocumentSubType } from './documentSubType';
+
+export type EditCommentResponseAllOfSubType = null | DocumentSubType;
diff --git a/js/app/packages/service-clients/service-storage/generated/schemas/index.ts b/js/app/packages/service-clients/service-storage/generated/schemas/index.ts
index 947990fa02..c9aa81081b 100644
--- a/js/app/packages/service-clients/service-storage/generated/schemas/index.ts
+++ b/js/app/packages/service-clients/service-storage/generated/schemas/index.ts
@@ -238,6 +238,7 @@ export * from './documentBasicDeletedAt';
export * from './documentBasicDocumentFamilyId';
export * from './documentBasicFileType';
export * from './documentBasicProjectId';
+export * from './documentBasicSubType';
export * from './documentContent';
export * from './documentContentLocation';
export * from './documentContentLocationProperty';
@@ -314,6 +315,7 @@ export * from './editCommentRequestText';
export * from './editCommentResponse';
export * from './editCommentResponseAllOf';
export * from './editCommentResponseAllOfFileType';
+export * from './editCommentResponseAllOfSubType';
export * from './editDocumentResponse';
export * from './editDocumentServiceArgs';
export * from './editDocumentServiceArgsDocumentName';
diff --git a/js/app/packages/service-clients/service-storage/generated/zod.ts b/js/app/packages/service-clients/service-storage/generated/zod.ts
index c62c65454f..9c5f1f4f23 100644
--- a/js/app/packages/service-clients/service-storage/generated/zod.ts
+++ b/js/app/packages/service-clients/service-storage/generated/zod.ts
@@ -564,6 +564,16 @@ export const editCommentResponse = zod
documentName: zod.string(),
documentOwner: zod.string(),
fileType: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .enum(['task'])
+ .describe(
+ 'The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'
+ ),
+ ])
+ .optional(),
})
);
@@ -3596,6 +3606,16 @@ export const getDocumentLocationV3Response = zod
fileType: zod.string().nullish(),
owner: zod.string(),
projectId: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .enum(['task'])
+ .describe(
+ 'The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'
+ ),
+ ])
+ .optional(),
})
.describe(
'Returns basic information of a document used for some db queries'
@@ -3642,6 +3662,16 @@ export const getDocumentLocationV3Response = zod
fileType: zod.string().nullish(),
owner: zod.string(),
projectId: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .enum(['task'])
+ .describe(
+ 'The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'
+ ),
+ ])
+ .optional(),
})
.describe(
'Returns basic information of a document used for some db queries'
@@ -3699,6 +3729,16 @@ export const getDocumentLocationV3Response = zod
fileType: zod.string().nullish(),
owner: zod.string(),
projectId: zod.string().nullish(),
+ subType: zod
+ .union([
+ zod.null(),
+ zod
+ .enum(['task'])
+ .describe(
+ 'The document sub type enum represents all values of document sub types.\nThese values should match the `document_sub_type_value` table in macrodb.'
+ ),
+ ])
+ .optional(),
})
.describe(
'Returns basic information of a document used for some db queries'
diff --git a/js/app/packages/service-clients/service-storage/openapi.json b/js/app/packages/service-clients/service-storage/openapi.json
index 376cd2b000..01e7083a5a 100644
--- a/js/app/packages/service-clients/service-storage/openapi.json
+++ b/js/app/packages/service-clients/service-storage/openapi.json
@@ -7917,6 +7917,16 @@
},
"projectId": {
"type": ["string", "null"]
+ },
+ "subType": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/DocumentSubType"
+ }
+ ]
}
}
},
@@ -8532,6 +8542,16 @@
},
"fileType": {
"type": ["string", "null"]
+ },
+ "subType": {
+ "oneOf": [
+ {
+ "type": "null"
+ },
+ {
+ "$ref": "#/components/schemas/DocumentSubType"
+ }
+ ]
}
}
}
diff --git a/rust/cloud-storage/.sqlx/query-056dbddac4957596098ed8444564f7eb4ee08f375c95d9e40bd879d1439a8342.json b/rust/cloud-storage/.sqlx/query-056dbddac4957596098ed8444564f7eb4ee08f375c95d9e40bd879d1439a8342.json
new file mode 100644
index 0000000000..72038b7a9a
--- /dev/null
+++ b/rust/cloud-storage/.sqlx/query-056dbddac4957596098ed8444564f7eb4ee08f375c95d9e40bd879d1439a8342.json
@@ -0,0 +1,61 @@
+{
+ "db_name": "PostgreSQL",
+ "query": "\n SELECT c.owner, t.\"documentId\" as document_id, d.name as document_name, d.\"fileType\" as file_type, dt.sub_type as \"sub_type?: DocumentSubType\", d.owner as document_owner\n FROM \"Comment\" c\n JOIN \"Thread\" t ON c.\"threadId\" = t.id\n JOIN \"Document\" d ON t.\"documentId\" = d.id\n LEFT JOIN document_sub_type dt ON dt.document_id = d.id\n WHERE c.id = $1 and c.\"deletedAt\" IS NULL AND t.\"deletedAt\" IS NULL\n ",
+ "describe": {
+ "columns": [
+ {
+ "ordinal": 0,
+ "name": "owner",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 1,
+ "name": "document_id",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 2,
+ "name": "document_name",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 3,
+ "name": "file_type",
+ "type_info": "Text"
+ },
+ {
+ "ordinal": 4,
+ "name": "sub_type?: DocumentSubType",
+ "type_info": {
+ "Custom": {
+ "name": "document_sub_type_value",
+ "kind": {
+ "Enum": [
+ "task"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "ordinal": 5,
+ "name": "document_owner",
+ "type_info": "Text"
+ }
+ ],
+ "parameters": {
+ "Left": [
+ "Int8"
+ ]
+ },
+ "nullable": [
+ false,
+ false,
+ false,
+ true,
+ false,
+ false
+ ]
+ },
+ "hash": "056dbddac4957596098ed8444564f7eb4ee08f375c95d9e40bd879d1439a8342"
+}
diff --git a/rust/cloud-storage/.sqlx/query-fcb8fda242203a9ff6044c928c4edbcb50fd47035cee6880001fb874b67e9c73.json b/rust/cloud-storage/.sqlx/query-17b1a9529bc693aeb668fd0c432d6b55a4c527fd3105bfa9cf83dbc70516011c.json
similarity index 68%
rename from rust/cloud-storage/.sqlx/query-fcb8fda242203a9ff6044c928c4edbcb50fd47035cee6880001fb874b67e9c73.json
rename to rust/cloud-storage/.sqlx/query-17b1a9529bc693aeb668fd0c432d6b55a4c527fd3105bfa9cf83dbc70516011c.json
index cc4bb224fc..e676d23086 100644
--- a/rust/cloud-storage/.sqlx/query-fcb8fda242203a9ff6044c928c4edbcb50fd47035cee6880001fb874b67e9c73.json
+++ b/rust/cloud-storage/.sqlx/query-17b1a9529bc693aeb668fd0c432d6b55a4c527fd3105bfa9cf83dbc70516011c.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT\n d.id as \"document_id\",\n d.owner,\n d.name as \"document_name\",\n d.\"branchedFromId\" as \"branched_from_id\",\n d.\"branchedFromVersionId\" as \"branched_from_version_id\",\n d.\"documentFamilyId\" as \"document_family_id\",\n d.\"fileType\" as \"file_type\",\n d.\"projectId\" as \"project_id\",\n d.\"deletedAt\"::timestamptz as \"deleted_at\"\n FROM\n \"Document\" d\n WHERE\n d.id = $1\n ",
+ "query": "\n SELECT\n d.id as \"document_id\",\n d.owner,\n d.name as \"document_name\",\n d.\"branchedFromId\" as \"branched_from_id\",\n d.\"branchedFromVersionId\" as \"branched_from_version_id\",\n d.\"documentFamilyId\" as \"document_family_id\",\n d.\"fileType\" as \"file_type\",\n dt.sub_type as \"sub_type?: DocumentSubType\",\n d.\"projectId\" as \"project_id\",\n d.\"deletedAt\"::timestamptz as \"deleted_at\"\n FROM\n \"Document\" d\n LEFT JOIN document_sub_type dt ON dt.document_id = d.id\n WHERE\n d.id = $1\n LIMIT 1\n ",
"describe": {
"columns": [
{
@@ -40,11 +40,25 @@
},
{
"ordinal": 7,
+ "name": "sub_type?: DocumentSubType",
+ "type_info": {
+ "Custom": {
+ "name": "document_sub_type_value",
+ "kind": {
+ "Enum": [
+ "task"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "ordinal": 8,
"name": "project_id",
"type_info": "Text"
},
{
- "ordinal": 8,
+ "ordinal": 9,
"name": "deleted_at",
"type_info": "Timestamptz"
}
@@ -62,9 +76,10 @@
true,
true,
true,
+ false,
true,
null
]
},
- "hash": "fcb8fda242203a9ff6044c928c4edbcb50fd47035cee6880001fb874b67e9c73"
+ "hash": "17b1a9529bc693aeb668fd0c432d6b55a4c527fd3105bfa9cf83dbc70516011c"
}
diff --git a/rust/cloud-storage/.sqlx/query-76ca09231164d0c838d59d477f6406b67ddfeaea2b6fe078c30927277b6d3fa0.json b/rust/cloud-storage/.sqlx/query-2930435da61e2e75a6ec3a127f3f1591934bb55a9f2fed8e47dd4406085fa6b2.json
similarity index 71%
rename from rust/cloud-storage/.sqlx/query-76ca09231164d0c838d59d477f6406b67ddfeaea2b6fe078c30927277b6d3fa0.json
rename to rust/cloud-storage/.sqlx/query-2930435da61e2e75a6ec3a127f3f1591934bb55a9f2fed8e47dd4406085fa6b2.json
index 0a9bbbd734..69a58fd254 100644
--- a/rust/cloud-storage/.sqlx/query-76ca09231164d0c838d59d477f6406b67ddfeaea2b6fe078c30927277b6d3fa0.json
+++ b/rust/cloud-storage/.sqlx/query-2930435da61e2e75a6ec3a127f3f1591934bb55a9f2fed8e47dd4406085fa6b2.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT\n d.id as \"document_id\",\n d.owner,\n d.name as \"document_name\",\n d.\"branchedFromId\" as \"branched_from_id\",\n d.\"branchedFromVersionId\" as \"branched_from_version_id\",\n d.\"documentFamilyId\" as \"document_family_id\",\n d.\"fileType\" as \"file_type\",\n d.\"projectId\" as \"project_id\",\n d.\"deletedAt\"::timestamptz as \"deleted_at\"\n FROM\n \"Document\" d\n WHERE\n d.id = $1\n LIMIT 1\n ",
+ "query": "\n SELECT\n d.id as \"document_id\",\n d.owner,\n d.name as \"document_name\",\n d.\"branchedFromId\" as \"branched_from_id\",\n d.\"branchedFromVersionId\" as \"branched_from_version_id\",\n d.\"documentFamilyId\" as \"document_family_id\",\n d.\"fileType\" as \"file_type\",\n dt.sub_type as \"sub_type?: DocumentSubType\",\n d.\"projectId\" as \"project_id\",\n d.\"deletedAt\"::timestamptz as \"deleted_at\"\n FROM\n \"Document\" d\n LEFT JOIN document_sub_type dt ON dt.document_id = d.id\n WHERE\n d.id = $1\n LIMIT 1\n ",
"describe": {
"columns": [
{
@@ -40,11 +40,25 @@
},
{
"ordinal": 7,
+ "name": "sub_type?: DocumentSubType",
+ "type_info": {
+ "Custom": {
+ "name": "document_sub_type_value",
+ "kind": {
+ "Enum": [
+ "task"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "ordinal": 8,
"name": "project_id",
"type_info": "Text"
},
{
- "ordinal": 8,
+ "ordinal": 9,
"name": "deleted_at",
"type_info": "Timestamptz"
}
@@ -62,9 +76,10 @@
true,
true,
true,
+ false,
true,
null
]
},
- "hash": "76ca09231164d0c838d59d477f6406b67ddfeaea2b6fe078c30927277b6d3fa0"
+ "hash": "2930435da61e2e75a6ec3a127f3f1591934bb55a9f2fed8e47dd4406085fa6b2"
}
diff --git a/rust/cloud-storage/.sqlx/query-3e8c8b376d3e0ae4e7245e3b07a3e64b8847f80831d648ae9b5216560d5e27eb.json b/rust/cloud-storage/.sqlx/query-3e8c8b376d3e0ae4e7245e3b07a3e64b8847f80831d648ae9b5216560d5e27eb.json
deleted file mode 100644
index 98172db9c0..0000000000
--- a/rust/cloud-storage/.sqlx/query-3e8c8b376d3e0ae4e7245e3b07a3e64b8847f80831d648ae9b5216560d5e27eb.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "UPDATE \"Document\" SET \"uploaded\" = true WHERE id = $1",
- "describe": {
- "columns": [],
- "parameters": {
- "Left": [
- "Text"
- ]
- },
- "nullable": []
- },
- "hash": "3e8c8b376d3e0ae4e7245e3b07a3e64b8847f80831d648ae9b5216560d5e27eb"
-}
diff --git a/rust/cloud-storage/.sqlx/query-4ffa9cfbefb9f75c3964db40d92d40085e0093d476d8b3d8aab8e81e575e1897.json b/rust/cloud-storage/.sqlx/query-4ffa9cfbefb9f75c3964db40d92d40085e0093d476d8b3d8aab8e81e575e1897.json
deleted file mode 100644
index 1e340576fa..0000000000
--- a/rust/cloud-storage/.sqlx/query-4ffa9cfbefb9f75c3964db40d92d40085e0093d476d8b3d8aab8e81e575e1897.json
+++ /dev/null
@@ -1,46 +0,0 @@
-{
- "db_name": "PostgreSQL",
- "query": "\n SELECT c.owner, t.\"documentId\" as document_id, d.name as document_name, d.\"fileType\" as file_type, d.owner as document_owner\n FROM \"Comment\" c\n JOIN \"Thread\" t ON c.\"threadId\" = t.id\n JOIN \"Document\" d ON t.\"documentId\" = d.id\n WHERE c.id = $1 and c.\"deletedAt\" IS NULL AND t.\"deletedAt\" IS NULL\n ",
- "describe": {
- "columns": [
- {
- "ordinal": 0,
- "name": "owner",
- "type_info": "Text"
- },
- {
- "ordinal": 1,
- "name": "document_id",
- "type_info": "Text"
- },
- {
- "ordinal": 2,
- "name": "document_name",
- "type_info": "Text"
- },
- {
- "ordinal": 3,
- "name": "file_type",
- "type_info": "Text"
- },
- {
- "ordinal": 4,
- "name": "document_owner",
- "type_info": "Text"
- }
- ],
- "parameters": {
- "Left": [
- "Int8"
- ]
- },
- "nullable": [
- false,
- false,
- false,
- true,
- false
- ]
- },
- "hash": "4ffa9cfbefb9f75c3964db40d92d40085e0093d476d8b3d8aab8e81e575e1897"
-}
diff --git a/rust/cloud-storage/.sqlx/query-27a48907486b15f7c32fe0e84865904a6f2389ae59275c8b14ceb52035c473c0.json b/rust/cloud-storage/.sqlx/query-a9fee4b6ef042c94f5dfc2ba668423e760ba3632bfae3aef9da1f146b7a9c638.json
similarity index 69%
rename from rust/cloud-storage/.sqlx/query-27a48907486b15f7c32fe0e84865904a6f2389ae59275c8b14ceb52035c473c0.json
rename to rust/cloud-storage/.sqlx/query-a9fee4b6ef042c94f5dfc2ba668423e760ba3632bfae3aef9da1f146b7a9c638.json
index e927a616e0..aae5d98d86 100644
--- a/rust/cloud-storage/.sqlx/query-27a48907486b15f7c32fe0e84865904a6f2389ae59275c8b14ceb52035c473c0.json
+++ b/rust/cloud-storage/.sqlx/query-a9fee4b6ef042c94f5dfc2ba668423e760ba3632bfae3aef9da1f146b7a9c638.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT\n d.id as \"document_id\",\n d.owner,\n d.name as \"document_name\",\n d.\"branchedFromId\" as \"branched_from_id\",\n d.\"branchedFromVersionId\" as \"branched_from_version_id\",\n d.\"documentFamilyId\" as \"document_family_id\",\n d.\"fileType\" as \"file_type\",\n d.\"projectId\" as \"project_id\",\n d.\"deletedAt\"::timestamptz as \"deleted_at\"\n FROM\n \"Document\" d\n WHERE\n d.id = $1\n LIMIT 1\n ",
+ "query": "\n SELECT\n d.id as \"document_id\",\n d.owner,\n d.name as \"document_name\",\n d.\"branchedFromId\" as \"branched_from_id\",\n d.\"branchedFromVersionId\" as \"branched_from_version_id\",\n d.\"documentFamilyId\" as \"document_family_id\",\n d.\"fileType\" as \"file_type\",\n dt.sub_type as \"sub_type?: DocumentSubType\",\n d.\"projectId\" as \"project_id\",\n d.\"deletedAt\"::timestamptz as \"deleted_at\"\n FROM\n \"Document\" d\n LEFT JOIN document_sub_type dt ON dt.document_id = d.id\n WHERE\n d.id = $1\n ",
"describe": {
"columns": [
{
@@ -40,11 +40,25 @@
},
{
"ordinal": 7,
+ "name": "sub_type?: DocumentSubType",
+ "type_info": {
+ "Custom": {
+ "name": "document_sub_type_value",
+ "kind": {
+ "Enum": [
+ "task"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "ordinal": 8,
"name": "project_id",
"type_info": "Text"
},
{
- "ordinal": 8,
+ "ordinal": 9,
"name": "deleted_at",
"type_info": "Timestamptz"
}
@@ -62,9 +76,10 @@
true,
true,
true,
+ false,
true,
null
]
},
- "hash": "27a48907486b15f7c32fe0e84865904a6f2389ae59275c8b14ceb52035c473c0"
+ "hash": "a9fee4b6ef042c94f5dfc2ba668423e760ba3632bfae3aef9da1f146b7a9c638"
}
diff --git a/rust/cloud-storage/.sqlx/query-e005d05a4d52c32e5e7a2b4b6cfda3b6809a01149579c45d3bcbf921e155dd25.json b/rust/cloud-storage/.sqlx/query-ecd59864bf9f241755a73ed370146370580a768c26a4c9f6b1fe9d8244abdb36.json
similarity index 68%
rename from rust/cloud-storage/.sqlx/query-e005d05a4d52c32e5e7a2b4b6cfda3b6809a01149579c45d3bcbf921e155dd25.json
rename to rust/cloud-storage/.sqlx/query-ecd59864bf9f241755a73ed370146370580a768c26a4c9f6b1fe9d8244abdb36.json
index 71ddec2104..8c528f8899 100644
--- a/rust/cloud-storage/.sqlx/query-e005d05a4d52c32e5e7a2b4b6cfda3b6809a01149579c45d3bcbf921e155dd25.json
+++ b/rust/cloud-storage/.sqlx/query-ecd59864bf9f241755a73ed370146370580a768c26a4c9f6b1fe9d8244abdb36.json
@@ -1,6 +1,6 @@
{
"db_name": "PostgreSQL",
- "query": "\n SELECT\n d.id as \"document_id\",\n d.owner,\n d.name as \"document_name\",\n d.\"branchedFromId\" as \"branched_from_id\",\n d.\"branchedFromVersionId\" as \"branched_from_version_id\",\n d.\"documentFamilyId\" as \"document_family_id\",\n d.\"fileType\" as \"file_type\",\n d.\"projectId\" as \"project_id\",\n d.\"deletedAt\"::timestamptz as \"deleted_at\"\n FROM\n \"Document\" d\n WHERE\n d.id = ANY($1)\n ",
+ "query": "\n SELECT\n d.id as \"document_id\",\n d.owner,\n d.name as \"document_name\",\n d.\"branchedFromId\" as \"branched_from_id\",\n d.\"branchedFromVersionId\" as \"branched_from_version_id\",\n d.\"documentFamilyId\" as \"document_family_id\",\n d.\"fileType\" as \"file_type\",\n dt.sub_type as \"sub_type?: DocumentSubType\",\n d.\"projectId\" as \"project_id\",\n d.\"deletedAt\"::timestamptz as \"deleted_at\"\n FROM\n \"Document\" d\n LEFT JOIN document_sub_type dt ON dt.document_id = d.id\n WHERE\n d.id = ANY($1)\n ",
"describe": {
"columns": [
{
@@ -40,11 +40,25 @@
},
{
"ordinal": 7,
+ "name": "sub_type?: DocumentSubType",
+ "type_info": {
+ "Custom": {
+ "name": "document_sub_type_value",
+ "kind": {
+ "Enum": [
+ "task"
+ ]
+ }
+ }
+ }
+ },
+ {
+ "ordinal": 8,
"name": "project_id",
"type_info": "Text"
},
{
- "ordinal": 8,
+ "ordinal": 9,
"name": "deleted_at",
"type_info": "Timestamptz"
}
@@ -63,8 +77,9 @@
true,
true,
true,
+ true,
null
]
},
- "hash": "e005d05a4d52c32e5e7a2b4b6cfda3b6809a01149579c45d3bcbf921e155dd25"
+ "hash": "ecd59864bf9f241755a73ed370146370580a768c26a4c9f6b1fe9d8244abdb36"
}
diff --git a/rust/cloud-storage/document_storage_service/src/api/annotations/create_comment.rs b/rust/cloud-storage/document_storage_service/src/api/annotations/create_comment.rs
index a8417dbbf3..4e6a1f6277 100644
--- a/rust/cloud-storage/document_storage_service/src/api/annotations/create_comment.rs
+++ b/rust/cloud-storage/document_storage_service/src/api/annotations/create_comment.rs
@@ -22,6 +22,7 @@ use model::{
response::ErrorResponse,
user::UserContext,
};
+use model_notifications::NotificationDocumentSubType;
use models_properties::service::property_value::PropertyValue;
use notification::domain::service::NotificationIngress;
use properties::PropertiesService as _;
@@ -138,6 +139,9 @@ pub async fn create_comment_handler(
document_id: document_id.to_string(),
owner: document_context.owner.clone(),
file_type: document_context.file_type.clone(),
+ sub_type: document_context
+ .sub_type
+ .map(|_| NotificationDocumentSubType::Task),
sender_id: sender_id.clone(),
sender_profile_picture_url,
};
diff --git a/rust/cloud-storage/document_storage_service/src/api/annotations/edit_comment.rs b/rust/cloud-storage/document_storage_service/src/api/annotations/edit_comment.rs
index 8fbbc644e1..36cffd64a6 100644
--- a/rust/cloud-storage/document_storage_service/src/api/annotations/edit_comment.rs
+++ b/rust/cloud-storage/document_storage_service/src/api/annotations/edit_comment.rs
@@ -20,6 +20,7 @@ use model::{
response::ErrorResponse,
user::UserContext,
};
+use model_notifications::NotificationDocumentSubType;
use notification::domain::service::NotificationIngress;
use sqlx::PgPool;
@@ -76,6 +77,7 @@ pub async fn edit_comment_handler(
document_id: res.document_id.to_string(),
owner: res.document_owner.clone(),
file_type: res.file_type.clone(),
+ sub_type: res.sub_type.map(|_| NotificationDocumentSubType::Task),
sender_id: user_id.clone().try_into().ok(),
sender_profile_picture_url,
};
diff --git a/rust/cloud-storage/document_storage_service/src/api/annotations/mod.rs b/rust/cloud-storage/document_storage_service/src/api/annotations/mod.rs
index 47ee4fd030..ab2cfc4ff8 100644
--- a/rust/cloud-storage/document_storage_service/src/api/annotations/mod.rs
+++ b/rust/cloud-storage/document_storage_service/src/api/annotations/mod.rs
@@ -20,7 +20,7 @@ use macro_user_id::user_id::MacroUserIdStr;
use model::response::ErrorResponse;
use model_entity::EntityType;
use model_notifications::{
- CommentedOnDocumentMetadata, MentionedInDocumentCommentMetadata,
+ CommentedOnDocumentMetadata, MentionedInDocumentCommentMetadata, NotificationDocumentSubType,
RepliedToDocumentCommentThreadMetadata,
};
use notification::domain::models::SendNotificationRequestBuilder;
@@ -245,6 +245,7 @@ pub(crate) struct CommentNotifContext {
pub document_id: String,
pub owner: MacroUserIdStr<'static>,
pub file_type: Option<String>,
+ pub sub_type: Option<NotificationDocumentSubType>,
pub sender_id: Option<MacroUserIdStr<'static>>,
pub sender_profile_picture_url: Option<String>,
}
@@ -259,6 +260,7 @@ impl CommentNotifContext {
document_name: self.document_name.clone(),
owner: self.owner.clone(),
file_type: self.file_type.clone(),
+ sub_type: self.sub_type.clone(),
mention_id: mention_id.to_string(),
comment_id: self.comment_id,
thread_id: self.thread_id,
@@ -282,6 +284,7 @@ impl CommentNotifContext {
document_name: self.document_name.clone(),
owner: self.owner.clone(),
file_type: self.file_type.clone(),
+ sub_type: self.sub_type.clone(),
comment_id: self.comment_id,
thread_id: self.thread_id,
text: self.text.clone(),
@@ -301,6 +304,7 @@ impl CommentNotifContext {
document_name: self.document_name.clone(),
owner: self.owner.clone(),
file_type: self.file_type.clone(),
+ sub_type: self.sub_type.clone(),
comment_id: self.comment_id,
thread_id: self.thread_id,
text: self.text.clone(),
diff --git a/rust/cloud-storage/document_storage_service/src/api/annotations/test.rs b/rust/cloud-storage/document_storage_service/src/api/annotations/test.rs
index b616e2f8de..b59dad9b8e 100644
--- a/rust/cloud-storage/document_storage_service/src/api/annotations/test.rs
+++ b/rust/cloud-storage/document_storage_service/src/api/annotations/test.rs
@@ -6,6 +6,7 @@ fn check_ser_meta() -> Result<(), Box<dyn std::error::Error>> {
document_name: "test".to_string(),
owner: MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap(),
file_type: None,
+ sub_type: None,
mention_id: "xxx".to_string(),
thread_id: 42,
comment_id: 99,
diff --git a/rust/cloud-storage/documents/src/outbound/pg_document_repo.rs b/rust/cloud-storage/documents/src/outbound/pg_document_repo.rs
index 90f6e7a61e..e32c2484f3 100644
--- a/rust/cloud-storage/documents/src/outbound/pg_document_repo.rs
+++ b/rust/cloud-storage/documents/src/outbound/pg_document_repo.rs
@@ -189,10 +189,12 @@ impl DocumentRepo for PgDocumentRepo {
d."branchedFromVersionId" as "branched_from_version_id",
d."documentFamilyId" as "document_family_id",
d."fileType" as "file_type",
+ dt.sub_type as "sub_type?: DocumentSubType",
d."projectId" as "project_id",
d."deletedAt"::timestamptz as "deleted_at"
FROM
"Document" d
+ LEFT JOIN document_sub_type dt ON dt.document_id = d.id
WHERE
d.id = $1
LIMIT 1
@@ -207,6 +209,7 @@ impl DocumentRepo for PgDocumentRepo {
.map_err(|e| sqlx::Error::Decode(Box::new(e)))?
.into_owned(),
file_type: row.file_type,
+ sub_type: row.sub_type,
branched_from_id: row.branched_from_id,
branched_from_version_id: row.branched_from_version_id,
document_family_id: row.document_family_id,
diff --git a/rust/cloud-storage/macro_db_client/src/annotations/edit_comment.rs b/rust/cloud-storage/macro_db_client/src/annotations/edit_comment.rs
index 7e793e20bd..248d5777fe 100644
--- a/rust/cloud-storage/macro_db_client/src/annotations/edit_comment.rs
+++ b/rust/cloud-storage/macro_db_client/src/annotations/edit_comment.rs
@@ -1,4 +1,5 @@
use anyhow::{Result, bail};
+use document_sub_type::DocumentSubType;
use macro_user_id::{cowlike::CowLike, user_id::MacroUserIdStr};
use model::annotations::{
Comment,
@@ -14,17 +15,27 @@ pub async fn edit_document_comment(
user_id: &str,
req: &EditCommentRequest,
) -> Result<EditCommentResponse> {
- let (comment_owner, document_id, document_name, file_type, document_owner) = sqlx::query!(
+ let (comment_owner, document_id, document_name, file_type, sub_type, document_owner) = sqlx::query!(
r#"
- SELECT c.owner, t."documentId" as document_id, d.name as document_name, d."fileType" as file_type, d.owner as document_owner
+ SELECT c.owner, t."documentId" as document_id, d.name as document_name, d."fileType" as file_type, dt.sub_type as "sub_type?: DocumentSubType", d.owner as document_owner
FROM "Comment" c
JOIN "Thread" t ON c."threadId" = t.id
JOIN "Document" d ON t."documentId" = d.id
+ LEFT JOIN document_sub_type dt ON dt.document_id = d.id
WHERE c.id = $1 and c."deletedAt" IS NULL AND t."deletedAt" IS NULL
"#,
comment_id
)
- .map(|row| (row.owner, row.document_id, row.document_name, row.file_type, row.document_owner))
+ .map(|row| {
+ (
+ row.owner,
+ row.document_id,
+ row.document_name,
+ row.file_type,
+ row.sub_type,
+ row.document_owner,
+ )
+ })
.fetch_one(db)
.await
.map_err(|e| match e {
@@ -65,6 +76,7 @@ pub async fn edit_document_comment(
document_id,
document_name,
file_type,
+ sub_type,
document_owner: MacroUserIdStr::parse_from_str(&document_owner)?.into_owned(),
comment,
})
@@ -95,12 +107,14 @@ mod tests {
document_id,
document_name,
file_type,
+ sub_type,
document_owner,
} = result.unwrap();
assert_eq!(comment.text, "Updated comment text");
assert_eq!(document_id, "document-with-comments");
assert_eq!(document_name, "Document With Comments");
assert_eq!(file_type, Some("pdf".to_string()));
+ assert_eq!(sub_type, None);
assert_eq!(
document_owner,
MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap()
diff --git a/rust/cloud-storage/macro_db_client/src/document/get_document.rs b/rust/cloud-storage/macro_db_client/src/document/get_document.rs
index eb14a33bf9..4d8308a590 100644
--- a/rust/cloud-storage/macro_db_client/src/document/get_document.rs
+++ b/rust/cloud-storage/macro_db_client/src/document/get_document.rs
@@ -140,10 +140,12 @@ pub async fn get_basic_document(
d."branchedFromVersionId" as "branched_from_version_id",
d."documentFamilyId" as "document_family_id",
d."fileType" as "file_type",
+ dt.sub_type as "sub_type?: DocumentSubType",
d."projectId" as "project_id",
d."deletedAt"::timestamptz as "deleted_at"
FROM
"Document" d
+ LEFT JOIN document_sub_type dt ON dt.document_id = d.id
WHERE
d.id = $1
LIMIT 1
@@ -158,6 +160,7 @@ pub async fn get_basic_document(
.map_err(|e| sqlx::Error::Decode(Box::new(e)))?
.into_owned(),
file_type: row.file_type,
+ sub_type: row.sub_type,
branched_from_id: row.branched_from_id,
branched_from_version_id: row.branched_from_version_id,
document_family_id: row.document_family_id,
@@ -189,10 +192,12 @@ pub async fn get_basic_documents(
d."branchedFromVersionId" as "branched_from_version_id",
d."documentFamilyId" as "document_family_id",
d."fileType" as "file_type",
+ dt.sub_type as "sub_type?: DocumentSubType",
d."projectId" as "project_id",
d."deletedAt"::timestamptz as "deleted_at"
FROM
"Document" d
+ LEFT JOIN document_sub_type dt ON dt.document_id = d.id
WHERE
d.id = ANY($1)
"#,
@@ -206,6 +211,7 @@ pub async fn get_basic_documents(
.map_err(|e| sqlx::Error::Decode(Box::new(e)))?
.into_owned(),
file_type: row.file_type,
+ sub_type: row.sub_type,
branched_from_id: row.branched_from_id,
branched_from_version_id: row.branched_from_version_id,
document_family_id: row.document_family_id,
@@ -234,10 +240,12 @@ pub async fn get_deleted_document_info(
d."branchedFromVersionId" as "branched_from_version_id",
d."documentFamilyId" as "document_family_id",
d."fileType" as "file_type",
+ dt.sub_type as "sub_type?: DocumentSubType",
d."projectId" as "project_id",
d."deletedAt"::timestamptz as "deleted_at"
FROM
"Document" d
+ LEFT JOIN document_sub_type dt ON dt.document_id = d.id
WHERE
d.id = $1
"#,
@@ -251,6 +259,7 @@ pub async fn get_deleted_document_info(
.map_err(|e| sqlx::Error::Decode(Box::new(e)))?
.into_owned(),
file_type: row.file_type,
+ sub_type: row.sub_type,
branched_from_id: row.branched_from_id,
branched_from_version_id: row.branched_from_version_id,
document_family_id: row.document_family_id,
diff --git a/rust/cloud-storage/macro_db_client/src/document/save_document.rs b/rust/cloud-storage/macro_db_client/src/document/save_document.rs
index edb19e5968..1704717ab1 100644
--- a/rust/cloud-storage/macro_db_client/src/document/save_document.rs
+++ b/rust/cloud-storage/macro_db_client/src/document/save_document.rs
@@ -470,6 +470,7 @@ pub async fn save_document(
.map_err(|e| sqlx::Error::Decode(Box::new(e)))?
.into_owned(),
file_type: row.file_type,
+ sub_type: None,
branched_from_id: row.branched_from_id,
branched_from_version_id: row.branched_from_version_id,
document_family_id: row.document_family_id,
diff --git a/rust/cloud-storage/model/src/annotations/edit.rs b/rust/cloud-storage/model/src/annotations/edit.rs
index 5eaa32918e..6158b5115c 100644
--- a/rust/cloud-storage/model/src/annotations/edit.rs
+++ b/rust/cloud-storage/model/src/annotations/edit.rs
@@ -1,3 +1,4 @@
+use document_sub_type::DocumentSubType;
use macro_user_id::user_id::MacroUserIdStr;
use serde::{Deserialize, Serialize};
use serde_json::Value;
@@ -55,6 +56,8 @@ pub struct EditCommentResponse {
pub document_id: String,
pub document_name: String,
pub file_type: Option<String>,
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub sub_type: Option<DocumentSubType>,
#[schema(value_type = String)]
pub document_owner: MacroUserIdStr<'static>,
#[serde(flatten)]
diff --git a/rust/cloud-storage/model/src/document/basic.rs b/rust/cloud-storage/model/src/document/basic.rs
index 1db5e473f1..1aaa429a14 100644
--- a/rust/cloud-storage/model/src/document/basic.rs
+++ b/rust/cloud-storage/model/src/document/basic.rs
@@ -2,6 +2,7 @@ use std::str::FromStr;
use super::file_type::FileType;
use crate::document::FileTypeExt;
+use document_sub_type::DocumentSubType;
use macro_user_id::user_id::MacroUserIdStr;
use utoipa::ToSchema;
@@ -99,6 +100,8 @@ pub struct DocumentBasic {
pub owner: MacroUserIdStr<'static>,
#[serde(skip_serializing_if = "Option::is_none")]
pub file_type: Option<String>,
+ #[serde(default, skip_serializing_if = "Option::is_none")]
+ pub sub_type: Option<DocumentSubType>,
#[serde(skip_serializing_if = "Option::is_none")]
pub branched_from_id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
diff --git a/rust/cloud-storage/model/src/document/test.rs b/rust/cloud-storage/model/src/document/test.rs
index 8fc8b094ac..0423bd9941 100644
--- a/rust/cloud-storage/model/src/document/test.rs
+++ b/rust/cloud-storage/model/src/document/test.rs
@@ -8,6 +8,7 @@ fn test_document_basic_serde_roundtrip() {
document_name: "Test Document".to_string(),
owner: MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap(),
file_type: Some("pdf".to_string()),
+ sub_type: None,
branched_from_id: Some("parent-doc-456".to_string()),
branched_from_version_id: Some(42),
document_family_id: Some(100),
@@ -29,6 +30,7 @@ fn test_document_basic_serde_minimal() {
document_name: "Minimal Doc".to_string(),
owner: MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap(),
file_type: None,
+ sub_type: None,
branched_from_id: None,
branched_from_version_id: None,
document_family_id: None,
@@ -51,6 +53,7 @@ fn test_document_basic_serde_with_deleted_at() {
document_name: "Deleted Doc".to_string(),
owner: MacroUserIdStr::parse_from_str("macro|[email protected]").unwrap(),
file_type: Some("docx".to_string()),
+ sub_type: None,
branched_from_id: None,
branched_from_version_id: None,
document_family_id: None,
diff --git a/rust/cloud-storage/model_notifications/src/metadata.rs b/rust/cloud-storage/model_notifications/src/metadata.rs
index 501dbcf276..8f89561b5a 100644
--- a/rust/cloud-storage/model_notifications/src/metadata.rs
+++ b/rust/cloud-storage/model_notifications/src/metadata.rs
@@ -375,6 +375,10 @@ pub struct TaskAssignedMetadata {
/// The name of the task (optional)
#[serde(alias = "task_name")]
pub task_name: Option<String>,
+ /// The sub type of the backing document (task).
+ #[serde(alias = "sub_type")]
+ #[serde(default)]
+ pub sub_type: Option<NotificationDocumentSubType>,
/// The user who assigned the task
#[serde(alias = "assigned_by")]
#[schema(value_type = String)]
@@ -600,6 +604,10 @@ pub struct MentionedInDocumentCommentMetadata {
pub owner: MacroUserIdStr<'static>,
/// The file type of the document.
pub file_type: Option<String>,
+ /// The sub type of the document (e.g. task).
+ #[serde(alias = "sub_type")]
+ #[serde(default)]
+ pub sub_type: Option<NotificationDocumentSubType>,
/// The mention ID.
pub mention_id: String,
/// the comment id
@@ -646,6 +654,10 @@ pub struct RepliedToDocumentCommentThreadMetadata {
pub owner: MacroUserIdStr<'static>,
/// The file type of the document.
pub file_type: Option<String>,
+ /// The sub type of the document (e.g. task).
+ #[serde(alias = "sub_type")]
+ #[serde(default)]
+ pub sub_type: Option<NotificationDocumentSubType>,
/// the comment id
pub comment_id: i64,
/// the thread id
@@ -714,6 +726,10 @@ pub struct CommentedOnDocumentMetadata {
pub owner: MacroUserIdStr<'static>,
/// The file type of the document.
pub file_type: Option<String>,
+ /// The sub type of the document (e.g. task).
+ #[serde(alias = "sub_type")]
+ #[serde(default)]
+ pub sub_type: Option<NotificationDocumentSubType>,
/// the comment id
pub comment_id: i64,
/// the thread id
diff --git a/rust/cloud-storage/properties/src/domain/service_impl/task_properties.rs b/rust/cloud-storage/properties/src/domain/service_impl/task_properties.rs
index b5c91a7e1e..82d93c2ae4 100644
--- a/rust/cloud-storage/properties/src/domain/service_impl/task_properties.rs
+++ b/rust/cloud-storage/properties/src/domain/service_impl/task_properties.rs
@@ -206,6 +206,7 @@ where
let metadata = model_notifications::TaskAssignedMetadata {
task_id: task_id.to_string(),
task_name: task_name.clone(),
+ sub_type: Some(model_notifications::NotificationDocumentSubType::Task),
assigned_by: assigned_by.clone(),
sender_profile_picture_url: sender_profile_picture_url.clone(),
};