@zyacreatives/shared 2.5.52 → 2.5.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +0 -1
  3. package/dist/schemas/activity.d.ts +1 -0
  4. package/dist/schemas/auth.d.ts +2 -0
  5. package/dist/schemas/bookmark.d.ts +62 -7
  6. package/dist/schemas/bookmark.js +32 -30
  7. package/dist/schemas/brand.d.ts +3 -3
  8. package/dist/schemas/chat.d.ts +96 -52
  9. package/dist/schemas/chat.js +44 -18
  10. package/dist/schemas/comment.d.ts +65 -21
  11. package/dist/schemas/comment.js +48 -54
  12. package/dist/schemas/common.d.ts +15 -11
  13. package/dist/schemas/creative.d.ts +21 -21
  14. package/dist/schemas/creative.js +3 -3
  15. package/dist/schemas/discipline.d.ts +63 -12
  16. package/dist/schemas/discipline.js +62 -65
  17. package/dist/schemas/entity-stats.d.ts +35 -3
  18. package/dist/schemas/entity-stats.js +24 -38
  19. package/dist/schemas/feed.d.ts +50 -3
  20. package/dist/schemas/feed.js +43 -13
  21. package/dist/schemas/file.d.ts +65 -24
  22. package/dist/schemas/file.js +60 -49
  23. package/dist/schemas/index.d.ts +1 -0
  24. package/dist/schemas/index.js +1 -0
  25. package/dist/schemas/investor-shortlist.d.ts +68 -11
  26. package/dist/schemas/investor-shortlist.js +46 -24
  27. package/dist/schemas/investor-signal.d.ts +52 -12
  28. package/dist/schemas/investor-signal.js +59 -39
  29. package/dist/schemas/investor.d.ts +3 -3
  30. package/dist/schemas/job-application.d.ts +291 -279
  31. package/dist/schemas/job-application.js +59 -95
  32. package/dist/schemas/job.d.ts +200 -659
  33. package/dist/schemas/job.js +98 -231
  34. package/dist/schemas/like.d.ts +3 -0
  35. package/dist/schemas/message.d.ts +125 -94
  36. package/dist/schemas/message.js +54 -55
  37. package/dist/schemas/notification.d.ts +99 -32
  38. package/dist/schemas/notification.js +46 -42
  39. package/dist/schemas/payout-method.d.ts +51 -31
  40. package/dist/schemas/payout-method.js +48 -58
  41. package/dist/schemas/post.d.ts +295 -204
  42. package/dist/schemas/post.js +148 -272
  43. package/dist/schemas/product.d.ts +308 -229
  44. package/dist/schemas/product.js +111 -94
  45. package/dist/schemas/project.d.ts +75 -107
  46. package/dist/schemas/project.js +1 -5
  47. package/dist/schemas/seller.d.ts +10 -10
  48. package/dist/schemas/user-strike.d.ts +3 -0
  49. package/dist/schemas/user.d.ts +128 -126
  50. package/dist/schemas/user.js +10 -1
  51. package/dist/schemas/username.d.ts +1 -0
  52. package/dist/schemas/view.d.ts +1 -0
  53. package/dist/types/activity.d.ts +1 -3
  54. package/dist/types/auth.d.ts +1 -4
  55. package/dist/types/bookmark.d.ts +1 -3
  56. package/dist/types/chat.d.ts +1 -11
  57. package/dist/types/comment.d.ts +1 -5
  58. package/dist/types/common.d.ts +2 -8
  59. package/dist/types/discipline.d.ts +1 -11
  60. package/dist/types/entity-stats.d.ts +1 -3
  61. package/dist/types/feed.d.ts +1 -5
  62. package/dist/types/investor-shortlist.d.ts +1 -6
  63. package/dist/types/investor-signal.d.ts +1 -7
  64. package/dist/types/like.d.ts +1 -3
  65. package/dist/types/message.d.ts +1 -9
  66. package/dist/types/notification.d.ts +1 -9
  67. package/dist/types/user-strike.d.ts +1 -5
  68. package/dist/types/username.d.ts +1 -3
  69. package/package.json +1 -1
  70. package/src/index.ts +4 -5
  71. package/src/schemas/activity.ts +5 -4
  72. package/src/schemas/auth.ts +14 -10
  73. package/src/schemas/bookmark.ts +48 -29
  74. package/src/schemas/chat.ts +79 -18
  75. package/src/schemas/comment.ts +63 -49
  76. package/src/schemas/common.ts +8 -3
  77. package/src/schemas/creative.ts +3 -3
  78. package/src/schemas/discipline.ts +103 -71
  79. package/src/schemas/entity-stats.ts +32 -38
  80. package/src/schemas/feed.ts +62 -15
  81. package/src/schemas/file.ts +85 -58
  82. package/src/schemas/index.ts +1 -0
  83. package/src/schemas/investor-shortlist.ts +57 -8
  84. package/src/schemas/investor-signal.ts +79 -27
  85. package/src/schemas/job-application.ts +81 -115
  86. package/src/schemas/job.ts +160 -301
  87. package/src/schemas/like.ts +5 -1
  88. package/src/schemas/message.ts +71 -64
  89. package/src/schemas/notification.ts +63 -51
  90. package/src/schemas/payout-method.ts +47 -63
  91. package/src/schemas/post.ts +211 -272
  92. package/src/schemas/product.ts +202 -139
  93. package/src/schemas/project.ts +7 -10
  94. package/src/schemas/user-strike.ts +7 -1
  95. package/src/schemas/user.ts +17 -5
  96. package/src/schemas/username.ts +5 -3
  97. package/src/schemas/view.ts +0 -50
  98. package/src/types/activity.ts +0 -4
  99. package/src/types/auth.ts +0 -5
  100. package/src/types/bookmark.ts +0 -4
  101. package/src/types/chat.ts +0 -31
  102. package/src/types/comment.ts +0 -12
  103. package/src/types/common.ts +0 -14
  104. package/src/types/discipline.ts +0 -32
  105. package/src/types/entity-stats.ts +0 -4
  106. package/src/types/feed.ts +0 -10
  107. package/src/types/index.ts +0 -16
  108. package/src/types/investor-shortlist.ts +0 -18
  109. package/src/types/investor-signal.ts +0 -26
  110. package/src/types/like.ts +0 -4
  111. package/src/types/message.ts +0 -26
  112. package/src/types/notification.ts +0 -34
  113. package/src/types/user-strike.ts +0 -10
  114. package/src/types/username.ts +0 -4
@@ -1,43 +1,37 @@
1
1
  import { z } from "@hono/zod-openapi";
2
+
2
3
  import { ACTIVITY_PARENT_TYPES } from "../constants";
3
4
 
4
- export const EntityStatsSchema = z
5
+ /**
6
+ * --------------------------------
7
+ * SHAPE
8
+ * --------------------------------
9
+ */
10
+
11
+ const EntityStatsShape = z.object({
12
+ parentId: z.cuid2(),
13
+ parentType: z.enum(ACTIVITY_PARENT_TYPES),
14
+
15
+ likesCount: z.number(),
16
+ bookmarksCount: z.number(),
17
+ viewsCount: z.number(),
18
+ commentsCount: z.number(),
19
+ });
20
+
21
+ export type EntityStatsShapeType = z.infer<typeof EntityStatsShape>;
22
+
23
+ /**
24
+ * --------------------------------
25
+ * BASE ENTITY
26
+ * --------------------------------
27
+ */
28
+
29
+ export const EntityStatsEntitySchema = z
5
30
  .object({
6
- updatedAt: z.coerce.date().optional().openapi({
7
- description: "Timestamp of the last update to the entity statistics.",
8
- title: "Updated At",
9
- }),
10
- createdAt: z.coerce.date().optional().openapi({
11
- description: "Timestamp of the creationn to the entity statistics.",
12
- title: "Updated At",
13
- }),
14
- parentId: z.cuid2().openapi({
15
- description:
16
- "Unique identifier of the parent entity (e.g., project, post, etc.).",
17
- title: "Parent ID",
18
- }),
19
- parentType: z.enum(ACTIVITY_PARENT_TYPES).openapi({
20
- description: "Type of the parent entity this statistic belongs to.",
21
- title: "Parent Type",
22
- }),
23
- likesCount: z.number().openapi({
24
- description: "Total number of likes associated with the entity.",
25
- title: "Likes Count",
26
- }),
27
- bookmarksCount: z.number().openapi({
28
- description: "Total number of bookmarks associated with the entity.",
29
- title: "Bookmarks Count",
30
- }),
31
- viewsCount: z.number().openapi({
32
- description: "Total number of views recorded for the entity.",
33
- title: "Views Count",
34
- }),
35
- commentsCount: z.number().openapi({
36
- description: "Total number of comments linked to the entity.",
37
- title: "Comments Count",
38
- }),
31
+ ...EntityStatsShape.shape,
32
+ createdAt: z.iso.datetime(),
33
+ updatedAt: z.iso.datetime(),
39
34
  })
40
- .openapi({
41
- description: "Represents engagement statistics for a specific entity.",
42
- title: "EntityStats",
43
- });
35
+ .openapi("EntityStats");
36
+
37
+ export type EntityStatsEntity = z.infer<typeof EntityStatsEntitySchema>;
@@ -1,24 +1,71 @@
1
1
  import { z } from "@hono/zod-openapi";
2
- import { MinimalUserSchema } from "./user";
3
2
 
4
- export const FeedTagsSchema = z.object({
5
- userId: z.cuid2(),
3
+ /**
4
+ * --------------------------------
5
+ * SHAPE
6
+ * --------------------------------
7
+ */
8
+
9
+ const FeedTagsShape = z.object({
6
10
  tags: z.array(z.string()),
7
11
  });
8
12
 
9
- export const FeedTagsInputSchema = z.object({
10
- tags: z.array(z.string()),
13
+ export type FeedTagsShapeType = z.infer<typeof FeedTagsShape>;
14
+
15
+ /**
16
+ * --------------------------------
17
+ * BASE ENTITY
18
+ * --------------------------------
19
+ */
20
+
21
+ export const FeedTagsEntitySchema = z
22
+ .object({
23
+ userId: z.cuid2(),
24
+ ...FeedTagsShape.shape,
25
+ })
26
+ .openapi("FeedTags");
27
+
28
+ export type FeedTagsEntity = z.infer<typeof FeedTagsEntitySchema>;
29
+
30
+ /**
31
+ * --------------------------------
32
+ * DERIVED ENTITIES
33
+ * --------------------------------
34
+ */
35
+
36
+ export const TrendingUserSchema = z.object({
37
+ creatorId: z.cuid2(),
38
+ creatorUsername: z.string(),
39
+ creatorName: z.string(),
40
+ creatorImageUrl: z.url(),
41
+ isFollowing: z.boolean().optional(),
42
+ followsYou: z.boolean().optional(),
11
43
  });
12
44
 
45
+ export type TrendingUser = z.infer<typeof TrendingUserSchema>;
46
+
47
+ /**
48
+ * --------------------------------
49
+ * INPUTS
50
+ * --------------------------------
51
+ */
52
+
53
+ export const UpdateFeedTagsInputSchema = FeedTagsShape.extend({});
54
+
55
+ export type UpdateFeedTagsInput = z.infer<typeof UpdateFeedTagsInputSchema>;
56
+
57
+ /**
58
+ * --------------------------------
59
+ * OUTPUTS
60
+ * --------------------------------
61
+ */
62
+
63
+ export const FeedTagsOutputSchema = FeedTagsEntitySchema;
64
+
65
+ export type FeedTagsOutput = z.infer<typeof FeedTagsOutputSchema>;
66
+
13
67
  export const TrendingUsersOutputSchema = z.object({
14
- creators: z.array(
15
- z.object({
16
- creatorUsername: z.string(),
17
- creatorName: z.string(),
18
- creatorId: z.cuid2(),
19
- creatorImageUrl: z.url(),
20
- isFollowing: z.boolean().optional(),
21
- followsYou: z.boolean().optional(),
22
- }),
23
- ),
68
+ creators: z.array(TrendingUserSchema),
24
69
  });
70
+
71
+ export type TrendingUsersOutput = z.infer<typeof TrendingUsersOutputSchema>;
@@ -1,99 +1,126 @@
1
1
  import { z } from "@hono/zod-openapi";
2
+
2
3
  import { ACTIVITY_PARENT_TYPES } from "../constants";
3
4
 
5
+ /**
6
+ * --------------------------------
7
+ * SHAPE
8
+ * --------------------------------
9
+ */
10
+
11
+ const FileShape = z.object({
12
+ key: z.string(),
13
+ mimeType: z.string(),
14
+ parentId: z.cuid2().nullable(),
15
+ parentType: z.enum(ACTIVITY_PARENT_TYPES).nullable(),
16
+ isThumbnail: z.boolean().nullable(),
17
+ order: z.number().int(),
18
+ });
19
+
20
+ export type FileShapeType = z.infer<typeof FileShape>;
21
+
22
+ /**
23
+ * --------------------------------
24
+ * BASE ENTITY
25
+ * --------------------------------
26
+ */
27
+
4
28
  export const FileEntitySchema = z
5
29
  .object({
6
- id: z.cuid2().openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
7
- key: z.string().openapi({ example: "profile-pic-12345" }),
8
- mimeType: z.string().openapi({ example: "image/jpeg" }),
9
- url: z.url().openapi({ example: "https://example.com/file.jpg" }),
10
- parentId: z.cuid2().nullable().openapi({ example: "ckj1a2b3c0000xyz" }),
11
- parentType: z.enum(ACTIVITY_PARENT_TYPES).nullable(),
12
- isThumbnail: z.boolean().nullable().openapi({ example: false }),
13
- order: z.number().int().openapi({ example: 0 }),
14
- createdAt: z.coerce.date().openapi({ example: "2025-10-14T08:00:00.000Z" }),
15
- updatedAt: z.coerce.date().openapi({ example: "2025-10-14T09:00:00.000Z" }),
16
- deletedAt: z.coerce.date().nullable().openapi({ example: null }),
30
+ id: z.cuid2(),
31
+ url: z.url(),
32
+ ...FileShape.shape,
33
+ createdAt: z.iso.datetime(),
34
+ updatedAt: z.iso.datetime(),
35
+ deletedAt: z.iso.datetime().nullable(),
17
36
  })
18
- .openapi({ title: "FileEntity" });
37
+ .openapi("File");
38
+
19
39
  export type FileEntity = z.infer<typeof FileEntitySchema>;
20
40
 
21
- // ─── Inputs ───────────────────────────────────────────────────────────────────
41
+ /**
42
+ * --------------------------------
43
+ * INPUTS
44
+ * --------------------------------
45
+ */
22
46
 
23
47
  export const CreateFileInputSchema = z.object({
24
- key: z.string().openapi({ example: "uploads/audio/podcast789.mp3" }),
25
- mimeType: z.string().openapi({ example: "audio/mpeg" }),
26
- parentId: z.cuid2().optional().openapi({ example: "ckj1a2b3c0000xyz" }),
27
- parentType: z
28
- .enum(ACTIVITY_PARENT_TYPES)
29
- .optional()
30
- .openapi({ example: "POST" }),
31
- isThumbnail: z.boolean().optional().openapi({ example: false }),
32
- order: z.number().int().optional().default(0).openapi({ example: 0 }),
48
+ key: z.string(),
49
+ mimeType: z.string(),
50
+ parentId: z.cuid2().optional(),
51
+ parentType: z.enum(ACTIVITY_PARENT_TYPES).optional(),
52
+ isThumbnail: z.boolean().optional(),
53
+ order: z.number().int().default(0),
33
54
  });
55
+
34
56
  export type CreateFileInput = z.infer<typeof CreateFileInputSchema>;
35
57
 
36
- export const FileUpdateInputSchema = z
37
- .object({
38
- id: z.cuid2().openapi({ example: "f123e4567-e89b-12d3-a456-426614174000" }),
39
- parentId: z.cuid2().optional().openapi({ example: "ckj1a2b3c0000xyz" }),
40
- parentType: z
41
- .enum(ACTIVITY_PARENT_TYPES)
42
- .optional()
43
- .openapi({ example: "POST" }),
44
- isThumbnail: z.boolean().optional().openapi({ example: false }),
45
- order: z.number().int().optional().openapi({ example: 1 }),
46
- })
47
- .openapi({ title: "FileUpdateInput" });
48
- export type FileUpdateEntity = z.infer<typeof FileUpdateInputSchema>;
58
+ export const UpdateFileInputSchema = z.object({
59
+ fileId: z.cuid2(),
60
+ parentId: z.cuid2().optional(),
61
+ parentType: z.enum(ACTIVITY_PARENT_TYPES).optional(),
62
+ isThumbnail: z.boolean().optional(),
63
+ order: z.number().int().optional(),
64
+ });
65
+
66
+ export type UpdateFileInput = z.infer<typeof UpdateFileInputSchema>;
49
67
 
50
68
  export const DeleteFileInputSchema = z.object({
51
- fileId: z.cuid2().optional().openapi({ example: "0irjif0qur09481u90r1u" }),
69
+ fileId: z.cuid2().optional(),
52
70
  key: z.string().optional(),
53
71
  });
54
72
 
55
73
  export type DeleteFileInput = z.infer<typeof DeleteFileInputSchema>;
56
74
 
57
- export const FileKeySchema = z.object({
58
- key: z
59
- .string()
60
- .max(400, { error: "Key should not be longer than 400 characters" }),
75
+ export const FileKeyInputSchema = z.object({
76
+ key: z.string().max(400),
77
+ });
78
+
79
+ export type FileKeyInput = z.infer<typeof FileKeyInputSchema>;
80
+
81
+ export const GetPresignedUploadUrlInputSchema = z.object({
82
+ key: z.string(),
61
83
  });
62
- export type FileKeyInput = z.infer<typeof FileKeySchema>;
63
84
 
64
- // ─── Outputs ──────────────────────────────────────────────────────────────────
85
+ export type GetPresignedUploadUrlInput = z.infer<
86
+ typeof GetPresignedUploadUrlInputSchema
87
+ >;
88
+
89
+ export const GetPresignedDownloadUrlInputSchema = z.object({
90
+ fileId: z.cuid2(),
91
+ });
92
+
93
+ export type GetPresignedDownloadUrlInput = z.infer<
94
+ typeof GetPresignedDownloadUrlInputSchema
95
+ >;
96
+
97
+ /**
98
+ * --------------------------------
99
+ * OUTPUTS
100
+ * --------------------------------
101
+ */
65
102
 
66
103
  export const CreateFileOutputSchema = FileEntitySchema;
104
+
67
105
  export type CreateFileOutput = z.infer<typeof CreateFileOutputSchema>;
68
106
 
69
107
  export const DeleteFileOutputSchema = z.object({
70
- id: z.cuid2().openapi({ example: "r90rjnaneifijhi31" }),
108
+ id: z.cuid2(),
71
109
  });
72
- export type DeleteFileOutput = z.infer<typeof DeleteFileOutputSchema>;
73
110
 
74
- export const GetPresignedUploadUrlInputSchema = z.object({
75
- key: z.string().openapi({ example: "/users/123/pfp" }),
76
- });
77
- export type GetPresignedUploadUrlInput = z.infer<
78
- typeof GetPresignedUploadUrlInputSchema
79
- >;
111
+ export type DeleteFileOutput = z.infer<typeof DeleteFileOutputSchema>;
80
112
 
81
113
  export const GetPresignedUploadUrlOutputSchema = z.object({
82
- url: z.url().openapi({ example: "https://www.cloudflare.img" }),
114
+ url: z.url(),
83
115
  });
116
+
84
117
  export type GetPresignedUploadUrlOutput = z.infer<
85
118
  typeof GetPresignedUploadUrlOutputSchema
86
119
  >;
87
120
 
88
- export const GetPresignedDownloadUrlInputSchema = z.object({
89
- fileId: z.cuid2().openapi({ example: "0irjif0qur09481u90r1u" }),
90
- });
91
- export type GetPresignedDownloadUrlInput = z.infer<
92
- typeof GetPresignedDownloadUrlInputSchema
93
- >;
94
-
95
121
  export const GetPresignedDownloadUrlOutputSchema =
96
122
  GetPresignedUploadUrlOutputSchema;
123
+
97
124
  export type GetPresignedDownloadUrlOutput = z.infer<
98
125
  typeof GetPresignedDownloadUrlOutputSchema
99
126
  >;
@@ -1,6 +1,7 @@
1
1
  export * from "./auth";
2
2
  export * from "./brand";
3
3
  export * from "./common";
4
+ export * from "./comment";
4
5
  export * from "./creative";
5
6
  export * from "./user";
6
7
  export * from "./project";
@@ -1,9 +1,14 @@
1
- import z from "zod";
1
+ import { z } from "@hono/zod-openapi";
2
+
2
3
  import { VENTURE_STAGES, WAGES_CURRENCY } from "../constants";
3
4
 
4
- export const InvestorShortlistEntitySchema = z.object({
5
- id: z.cuid2(),
6
- userId: z.cuid2(),
5
+ /**
6
+ * --------------------------------
7
+ * SHAPE
8
+ * --------------------------------
9
+ */
10
+
11
+ const InvestorShortlistShape = z.object({
7
12
  projectId: z.cuid2(),
8
13
  projectImage: z.url(),
9
14
  projectCreatorImage: z.url().optional(),
@@ -12,19 +17,63 @@ export const InvestorShortlistEntitySchema = z.object({
12
17
  projectTotalRaising: z.string(),
13
18
  projectTotalRaisingCurrency: z.enum(WAGES_CURRENCY),
14
19
  projectVentureStage: z.enum(VENTURE_STAGES).optional(),
15
- createdAt: z.coerce.date(),
16
- updatedAt: z.coerce.date(),
17
20
  });
18
21
 
22
+ export type InvestorShortlistShapeType = z.infer<typeof InvestorShortlistShape>;
23
+
24
+ /**
25
+ * --------------------------------
26
+ * BASE ENTITY
27
+ * --------------------------------
28
+ */
29
+
30
+ export const InvestorShortlistEntitySchema = z
31
+ .object({
32
+ id: z.cuid2(),
33
+ userId: z.cuid2(),
34
+ ...InvestorShortlistShape.shape,
35
+ createdAt: z.iso.datetime(),
36
+ updatedAt: z.iso.datetime(),
37
+ })
38
+ .openapi("InvestorShortlist");
39
+
40
+ export type InvestorShortlistEntity = z.infer<
41
+ typeof InvestorShortlistEntitySchema
42
+ >;
43
+
44
+ /**
45
+ * --------------------------------
46
+ * INPUTS
47
+ * --------------------------------
48
+ */
49
+
19
50
  export const CreateInvestorShortlistInputSchema = z.object({
20
51
  projectId: z.cuid2(),
21
52
  });
22
53
 
54
+ export type CreateInvestorShortlistInput = z.infer<
55
+ typeof CreateInvestorShortlistInputSchema
56
+ >;
57
+
23
58
  export const GetInvestorShortlistInputSchema = z.object({
24
- cursor: z.string().optional().nullable(),
59
+ cursor: z.string().optional(),
25
60
  });
26
61
 
62
+ export type GetInvestorShortlistInput = z.infer<
63
+ typeof GetInvestorShortlistInputSchema
64
+ >;
65
+
66
+ /**
67
+ * --------------------------------
68
+ * OUTPUTS
69
+ * --------------------------------
70
+ */
71
+
27
72
  export const GetInvestorShortlistOutputSchema = z.object({
28
- nextCursor: z.string().optional().nullable(),
73
+ nextCursor: z.string().optional(),
29
74
  shortlistItems: z.array(InvestorShortlistEntitySchema),
30
75
  });
76
+
77
+ export type GetInvestorShortlistOutput = z.infer<
78
+ typeof GetInvestorShortlistOutputSchema
79
+ >;
@@ -1,4 +1,5 @@
1
- import z from "zod";
1
+ import { z } from "@hono/zod-openapi";
2
+
2
3
  import {
3
4
  SIGNAL_INTEREST_TYPES,
4
5
  SIGNAL_STATUS,
@@ -6,45 +7,96 @@ import {
6
7
  WAGES_CURRENCY,
7
8
  } from "../constants";
8
9
 
9
- export const InvestorSignalEntitySchema = z.object({
10
- id: z.cuid2(),
11
- userId: z.cuid2(),
12
- projectId: z.cuid2(),
13
- projectCreatorUserId: z.cuid2(),
14
- projectImage: z.url(),
15
- projectCreatorUsername: z.string(),
16
- projectName: z.string(),
17
- projectCreatorImage: z.url().optional(),
18
- projectCreatorName: z.string(),
19
- projectTotalRaising: z.string(),
20
- projectTotalRaisingCurrency: z.enum(WAGES_CURRENCY),
21
- projectVentureStage: z.enum(VENTURE_STAGES),
22
- signalInterestType: z.enum(SIGNAL_INTEREST_TYPES),
23
- interestDetails: z.string().max(600),
24
- signalStatus: z.enum(SIGNAL_STATUS).default("PENDING"),
25
- createdAt: z.coerce.date(),
26
- version: z.int(),
27
- updatedAt: z.coerce.date(),
28
- });
10
+ /**
11
+ * --------------------------------
12
+ * SHAPE
13
+ * --------------------------------
14
+ */
29
15
 
30
- export const CreateInvestorSignalInputSchema = z.object({
16
+ const InvestorSignalShape = z.object({
31
17
  projectId: z.cuid2(),
32
18
  signalInterestType: z.enum(SIGNAL_INTEREST_TYPES),
33
19
  interestDetails: z.string().max(600),
34
20
  });
35
21
 
36
- export const UpdateInvestorSignalStatusSchema = z.object({
22
+ export type InvestorSignalShapeType = z.infer<typeof InvestorSignalShape>;
23
+
24
+ /**
25
+ * --------------------------------
26
+ * BASE ENTITY
27
+ * --------------------------------
28
+ */
29
+
30
+ export const InvestorSignalEntitySchema = z
31
+ .object({
32
+ id: z.cuid2(),
33
+ userId: z.cuid2(),
34
+ projectId: z.cuid2(),
35
+ projectCreatorUserId: z.cuid2(),
36
+
37
+ projectImage: z.url(),
38
+ projectCreatorUsername: z.string(),
39
+ projectName: z.string(),
40
+ projectCreatorImage: z.url().optional(),
41
+ projectCreatorName: z.string(),
42
+ projectTotalRaising: z.string(),
43
+ projectTotalRaisingCurrency: z.enum(WAGES_CURRENCY),
44
+ projectVentureStage: z.enum(VENTURE_STAGES),
45
+
46
+ signalInterestType: z.enum(SIGNAL_INTEREST_TYPES),
47
+ interestDetails: z.string().max(600),
48
+ signalStatus: z.enum(SIGNAL_STATUS).default("PENDING"),
49
+
50
+ createdAt: z.iso.datetime(),
51
+ updatedAt: z.iso.datetime(),
52
+ version: z.int(),
53
+ })
54
+ .openapi("InvestorSignal");
55
+
56
+ export type InvestorSignalEntity = z.infer<typeof InvestorSignalEntitySchema>;
57
+
58
+ /**
59
+ * --------------------------------
60
+ * INPUTS
61
+ * --------------------------------
62
+ */
63
+
64
+ export const CreateInvestorSignalInputSchema = InvestorSignalShape.extend({});
65
+
66
+ export type CreateInvestorSignalInput = z.infer<
67
+ typeof CreateInvestorSignalInputSchema
68
+ >;
69
+
70
+ export const UpdateInvestorSignalStatusInputSchema = z.object({
37
71
  id: z.cuid2(),
38
- signalStatus: z.enum(SIGNAL_STATUS).default("PENDING"),
72
+ signalStatus: z.enum(SIGNAL_STATUS),
39
73
  version: z.int(),
40
74
  });
41
75
 
76
+ export type UpdateInvestorSignalStatusInput = z.infer<
77
+ typeof UpdateInvestorSignalStatusInputSchema
78
+ >;
79
+
42
80
  export const GetInvestorSignalInputSchema = z.object({
43
- cursor: z.string().optional().nullable(),
44
- signalStatus: z.enum(SIGNAL_STATUS).optional().nullable(),
81
+ cursor: z.string().optional(),
82
+ signalStatus: z.enum(SIGNAL_STATUS).optional(),
45
83
  });
46
84
 
85
+ export type GetInvestorSignalInput = z.infer<
86
+ typeof GetInvestorSignalInputSchema
87
+ >;
88
+
89
+ /**
90
+ * --------------------------------
91
+ * OUTPUTS
92
+ * --------------------------------
93
+ */
94
+
47
95
  export const GetInvestorSignalOutputSchema = z.object({
48
- nextCursor: z.string().optional().nullable(),
96
+ nextCursor: z.string().optional(),
49
97
  signals: z.array(InvestorSignalEntitySchema),
50
98
  });
99
+
100
+ export type GetInvestorSignalOutput = z.infer<
101
+ typeof GetInvestorSignalOutputSchema
102
+ >;