@zyacreatives/shared 1.1.4 → 1.2.2

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.
@@ -0,0 +1,162 @@
1
+ import { z } from "@hono/zod-openapi";
2
+ import { CLIENT_TYPES, ClientType, Role, ROLES } from "../constants";
3
+
4
+ export const ProjectEntitySchema = z
5
+ .object({
6
+ id: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
7
+ createdAt: z.coerce
8
+ .date()
9
+ .optional()
10
+ .openapi({ example: "2025-10-13T09:00:00.000Z" }),
11
+ updatedAt: z.coerce
12
+ .date()
13
+ .optional()
14
+ .openapi({ example: "2025-10-13T09:00:00.000Z" }),
15
+ userId: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
16
+ title: z.string().openapi({ example: "Brand Identity Design" }),
17
+ description: z
18
+ .string()
19
+ .optional()
20
+ .openapi({ example: "A full rebrand for a fashion label." }),
21
+ overview: z
22
+ .string()
23
+ .optional()
24
+ .openapi({ example: "Detailed project story and outcomes." }),
25
+ url: z
26
+ .string()
27
+ .url()
28
+ .optional()
29
+ .openapi({ example: "https://example.com/project" }),
30
+ clientId: z.string().optional().openapi({ example: "client_abc123" }),
31
+ clientType: z
32
+ .enum(Object.values(CLIENT_TYPES) as [ClientType, ...ClientType[]])
33
+ .optional()
34
+ .openapi({ example: "BRAND" }),
35
+ clientName: z.string().optional().openapi({ example: "Nike" }),
36
+ projectCreatorType: z
37
+ .enum(Object.values(ROLES) as [Role, ...Role[]])
38
+ .openapi({ example: "CREATIVE" }),
39
+ tags: z
40
+ .array(z.string())
41
+ .optional()
42
+ .openapi({ example: ["branding", "logo"] }),
43
+ isFeatured: z.boolean().optional().openapi({ example: false }),
44
+ startDate: z.coerce
45
+ .date()
46
+ .optional()
47
+ .openapi({ example: "2025-06-01T00:00:00.000Z" }),
48
+ endDate: z.coerce
49
+ .date()
50
+ .optional()
51
+ .openapi({ example: "2025-07-15T00:00:00.000Z" }),
52
+ imagePlaceholderUrl: z
53
+ .string()
54
+ .url()
55
+ .optional()
56
+ .openapi({ example: "https://example.com/project-image.png" }),
57
+ })
58
+ .openapi("ProjectEntity");
59
+
60
+ export const ProjectFileEntitySchema = z
61
+ .object({
62
+ id: z.cuid2().openapi({ example: "pfe_cksd0v6q0000s9a5y8z7p3x9" }),
63
+ projectId: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
64
+ url: z
65
+ .string()
66
+ .url()
67
+ .openapi({ example: "https://cdn.example.com/project/image.jpg" }),
68
+ mimeType: z.string().openapi({ example: "image/jpeg" }),
69
+ fileSize: z.number().int().positive().openapi({ example: 1500000 }), // size in bytes
70
+ })
71
+ .openapi("ProjectFileEntity");
72
+
73
+ export const ProjectSocialGraphEntitySchema = z
74
+ .object({
75
+ noOfLikes: z.number().int().optional().openapi({ example: 150 }),
76
+ noOfComments: z.number().int().optional().openapi({ example: 45 }),
77
+ noOfBookmarks: z.number().int().optional().openapi({ example: 22 }),
78
+ noOfViews: z.number().int().optional().openapi({ example: 1200 }),
79
+ })
80
+ .openapi("ProjectSocialGraphEntity");
81
+
82
+ export const UserSocialGraphEntitySchema = z
83
+ .object({
84
+ followerCount: z.number().int().optional().openapi({ example: 5000 }),
85
+ followingCount: z.number().int().optional().openapi({ example: 150 }),
86
+ })
87
+ .openapi("UserSocialGraphEntity");
88
+
89
+ export const ProjectWithFilesEntitySchema = ProjectEntitySchema.merge(
90
+ ProjectSocialGraphEntitySchema
91
+ )
92
+ .extend({
93
+ projectFiles: z
94
+ .array(ProjectFileEntitySchema)
95
+ .optional()
96
+ .openapi({ description: "Files associated with the project" }),
97
+ })
98
+ .openapi("ProjectWithFilesEntity");
99
+
100
+ export const ProjectViewEntitySchema = z
101
+ .object({
102
+ id: z.cuid2().openapi({ example: "view_cksd0v6q0000s9a5y8z7p3x9" }),
103
+ userId: z.cuid2().optional().openapi({ example: "user_view_xyz" }),
104
+ ipAddress: z.ipv4().optional().openapi({ example: "192.168.1.1" }),
105
+ userAgent: z
106
+ .string()
107
+ .optional()
108
+ .openapi({ example: "Mozilla/5.0 (Windows NT 10.0; Win64)" }),
109
+ projectId: z.cuid2().openapi({ example: "proj_abc456" }),
110
+ sessionId: z.string().optional().openapi({ example: "sess_xyz789" }),
111
+ viewedAt: z.coerce.date().openapi({ example: "2025-10-14T10:30:00.000Z" }),
112
+ viewDate: z.coerce.date().openapi({ example: "2025-10-14T00:00:00.000Z" }),
113
+ })
114
+ .openapi("ProjectViewEntity");
115
+
116
+ export const ProjectLikeEntitySchema = z
117
+ .object({
118
+ createdAt: z.coerce
119
+ .date()
120
+ .optional()
121
+ .openapi({ example: "2025-10-13T11:00:00.000Z" }),
122
+ userId: z.cuid2().openapi({ example: "user_liker_123" }),
123
+ projectId: z.cuid2().openapi({ example: "proj_abc456" }),
124
+ })
125
+ .openapi("ProjectLikeEntity");
126
+
127
+ export const ProjectCommentEntitySchema = z
128
+ .object({
129
+ id: z.cuid2().openapi({ example: "comment_id_1" }),
130
+ createdAt: z.coerce
131
+ .date()
132
+ .optional()
133
+ .openapi({ example: "2025-10-13T12:00:00.000Z" }),
134
+ userId: z.cuid2().openapi({ example: "user_commenter_456" }),
135
+ projectId: z.cuid2().openapi({ example: "proj_abc456" }),
136
+ parentCommentId: z
137
+ .cuid2()
138
+ .optional()
139
+ .openapi({ example: "comment_id_parent_1" }),
140
+ content: z
141
+ .string()
142
+ .min(1)
143
+ .openapi({ example: "Amazing work on the color palette!" }),
144
+ })
145
+ .openapi("ProjectCommentEntity");
146
+
147
+ export const ProjectBookmarkEntitySchema = z
148
+ .object({
149
+ createdAt: z.coerce
150
+ .date()
151
+ .optional()
152
+ .openapi({ example: "2025-10-13T13:00:00.000Z" }),
153
+ userId: z.cuid2().openapi({ example: "user_bookmark_789" }),
154
+ projectId: z.cuid2().openapi({ example: "proj_abc456" }),
155
+ })
156
+ .openapi("ProjectBookmarkEntity");
157
+
158
+ export const ProjectUpdateOutputEntitySchema = z
159
+ .object({
160
+ id: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
161
+ })
162
+ .openapi("ProjectUpdateOutputEntity");
@@ -1,29 +1,14 @@
1
1
  import { z } from "@hono/zod-openapi";
2
2
 
3
- import {
4
- ROLES,
5
- USER_STATUSES,
6
- ONBOARDING_PAGES,
7
- EXPERIENCE_LEVELS,
8
- INVESTOR_TYPES,
9
- INVESTMENT_SIZES,
10
- GEOGRAPHIC_FOCUS,
11
- } from "../constants";
12
- import type {
13
- Role,
14
- UserStatus,
15
- OnboardingPage,
16
- ExperienceLevel,
17
- InvestorType,
18
- InvestmentSize,
19
- GeographicFocus,
20
- } from "../constants";
3
+ import { ROLES, USER_STATUSES, ONBOARDING_PAGES } from "../constants";
4
+ import type { Role, UserStatus, OnboardingPage } from "../constants";
21
5
  import { UserSocialGraphEntitySchema } from "./common";
6
+ import { ProjectBookmarkEntitySchema, ProjectEntitySchema } from "./project";
22
7
 
23
8
  export const BaseUserEntitySchema = z
24
9
  .object({
25
10
  id: z.cuid2().openapi({ example: "cksd0v6q0000s9a5y8z7p3x9" }),
26
- email: z.email().openapi({ example: "user@example.com" }),
11
+ email: z.string().email().openapi({ example: "user@example.com" }),
27
12
  emailVerified: z.boolean().openapi({ example: true }),
28
13
  name: z.string().optional().openapi({ example: "John Doe" }),
29
14
  image: z
@@ -47,12 +32,8 @@ export const BaseUserEntitySchema = z
47
32
  .openapi({
48
33
  example: "DONE",
49
34
  }),
50
- createdAt: z.iso
51
- .datetime()
52
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
53
- updatedAt: z.iso
54
- .datetime()
55
- .openapi({ example: "2025-10-13T09:00:00.000Z" }),
35
+ createdAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
36
+ updatedAt: z.coerce.date().openapi({ example: "2025-10-13T09:00:00.000Z" }),
56
37
  })
57
38
  .openapi("BaseUserEntity");
58
39
 
@@ -70,56 +51,53 @@ export const UserEntitySchema = BaseUserEntitySchema.merge(
70
51
  ).openapi("UserEntity");
71
52
 
72
53
  export const UserProfileEntitySchema = UserEntitySchema.extend({
73
- profileType: z.enum(["creative", "brand", "investor"]).optional().openapi({
74
- example: "creative",
75
- }),
76
- bio: z.string().optional().openapi({
77
- example: "Passionate digital artist focusing on UI/UX.",
78
- }),
79
- location: z.string().optional().openapi({
80
- example: "Lagos, Nigeria",
81
- }),
82
- experienceLevel: z
83
- .enum(
84
- Object.values(EXPERIENCE_LEVELS) as [
85
- ExperienceLevel,
86
- ...ExperienceLevel[]
87
- ]
88
- )
89
- .optional()
90
- .openapi({ example: EXPERIENCE_LEVELS.YEAR_1_3 }),
91
- disciplines: z
92
- .array(z.string())
93
- .optional()
94
- .openapi({
95
- example: ["ui-ux", "frontend"],
96
- }),
97
- tags: z
98
- .array(z.string())
99
- .optional()
100
- .openapi({
101
- example: ["react", "design", "product"],
102
- }),
103
- brandName: z.string().optional().openapi({
104
- example: "Acme Creative Studio",
105
- }),
106
- websiteURL: z.string().optional().openapi({
107
- example: "https://acme-creative.com",
108
- }),
109
- investorType: z
110
- .enum(Object.values(INVESTOR_TYPES) as [InvestorType, ...InvestorType[]])
111
- .optional()
112
- .openapi({ example: INVESTOR_TYPES.ANGEL_INVESTOR }),
113
- investmentSize: z
114
- .enum(
115
- Object.values(INVESTMENT_SIZES) as [InvestmentSize, ...InvestmentSize[]]
116
- )
117
- .optional()
118
- .openapi({ example: INVESTMENT_SIZES.BETWEEN_25K_100K }),
119
- geographicFocus: z
120
- .enum(
121
- Object.values(GEOGRAPHIC_FOCUS) as [GeographicFocus, ...GeographicFocus[]]
122
- )
123
- .optional()
124
- .openapi({ example: GEOGRAPHIC_FOCUS.AFRICA }),
54
+ profileType: z.enum(["creative", "brand", "investor"]).optional(),
55
+ bio: z.string().optional(),
56
+ location: z.string().optional(),
57
+ experienceLevel: z.string().optional(),
58
+ disciplines: z.array(z.any()).optional(),
59
+ tags: z.array(z.any()).optional(),
60
+ brandName: z.string().optional(),
61
+ websiteURL: z.string().url().optional(),
62
+ investorType: z.string().optional(),
63
+ investmentSize: z.string().optional(),
64
+ geographicFocus: z.string().optional(),
125
65
  }).openapi("UserProfileEntity");
66
+
67
+ export const UserWithProjectsEntitySchema = z
68
+ .object({
69
+ userId: z.cuid2(),
70
+ projects: z.array(ProjectEntitySchema.omit({ overview: true })),
71
+ })
72
+ .openapi("UserWithProjectsEntity");
73
+
74
+ export const UserWithProjectBookmarksEntitySchema = z
75
+ .object({
76
+ userId: z.cuid2(),
77
+ projectBookmarks: z.array(
78
+ ProjectBookmarkEntitySchema.extend({
79
+ project: ProjectEntitySchema.pick({
80
+ id: true,
81
+ title: true,
82
+ description: true,
83
+ tags: true,
84
+ startDate: true,
85
+ endDate: true,
86
+ imagePlaceholderUrl: true,
87
+ }),
88
+ })
89
+ ),
90
+ })
91
+ .openapi("UserWithProjectBookmarksEntity");
92
+
93
+ export const UserWithFollowingEntitySchema = MinimalUserSchema.extend({
94
+ following: z
95
+ .array(MinimalUserSchema)
96
+ .openapi({ description: "List of users this user is following." }),
97
+ }).openapi("UserWithFollowingEntity");
98
+
99
+ export const UserWithFollowersEntitySchema = MinimalUserSchema.extend({
100
+ followers: z
101
+ .array(MinimalUserSchema)
102
+ .openapi({ description: "List of users who follow this user." }),
103
+ }).openapi("UserWithFollowersEntity");
File without changes
@@ -1,27 +1,41 @@
1
- import type { MinimalUser } from "./user";
1
+ import { z } from "@hono/zod-openapi";
2
+ import {
3
+ BrandEntitySchema,
4
+ BrandWithUserEntitySchema,
5
+ CreateBrandEndpointResponseSchema,
6
+ CreateBrandProfileSchema,
7
+ GetBrandEndpointResponseSchema,
8
+ GetBrandParamsSchema,
9
+ GetBrandQuerySchema,
10
+ ListBrandsInputSchema,
11
+ UpdateBrandEndpointResponseSchema,
12
+ UpdateBrandProfileSchema,
13
+ } from "../schemas";
2
14
 
3
- export type BrandEntity = {
4
- id: string;
15
+ export type BrandEntity = z.infer<typeof BrandEntitySchema>;
16
+
17
+ export type BrandWithUserEntity = z.infer<typeof BrandWithUserEntitySchema>;
18
+
19
+ export type ListBrandsInput = z.infer<typeof ListBrandsInputSchema>;
20
+
21
+ export type CreateBrandDto = z.infer<typeof CreateBrandProfileSchema> & {
5
22
  userId: string;
6
- brandName: string;
7
- searchVector?: string;
8
- bio?: string;
9
- tags?: string[];
10
- createdAt: Date;
11
- updatedAt: Date;
12
23
  };
13
24
 
14
- export type BrandWithUserEntity = BrandEntity & {
15
- user: MinimalUser;
16
- disciplines: string[];
25
+ export type UpdateBrandDto = z.infer<typeof UpdateBrandProfileSchema> & {
26
+ userId: string;
17
27
  };
18
28
 
19
- export type ListBrandsInput = {
20
- query?: string;
21
- disciplines?: string[];
22
- experienceLevels?: string[];
23
- location?: string;
24
- tags?: string[];
25
- page?: number;
26
- perPage?: number;
27
- };
29
+ export type GetBrandParams = z.infer<typeof GetBrandParamsSchema>;
30
+
31
+ export type GetBrandQuery = z.infer<typeof GetBrandQuerySchema>;
32
+
33
+ export type CreateBrandEndpointResponse = z.infer<
34
+ typeof CreateBrandEndpointResponseSchema
35
+ >;
36
+ export type GetBrandEndpointResponse = z.infer<
37
+ typeof GetBrandEndpointResponseSchema
38
+ >;
39
+ export type UpdateBrandEndpointResponse = z.infer<
40
+ typeof UpdateBrandEndpointResponseSchema
41
+ >;
@@ -1,32 +1,44 @@
1
- import type { ExperienceLevel } from "../constants";
2
- import type { MinimalUser } from "./user";
1
+ import { z } from "@hono/zod-openapi";
2
+ import {
3
+ CreateCreativeEndpointResponseSchema,
4
+ CreateCreativeProfileSchema,
5
+ CreativeEntitySchema,
6
+ CreativeWithUserEntitySchema,
7
+ GetCreativeEndpointResponseSchema,
8
+ GetCreativeParamsSchema,
9
+ GetCreativeQuerySchema,
10
+ ListCreativesInputSchema,
11
+ UpdateCreativeEndpointResponseSchema,
12
+ UpdateCreativeProfileSchema,
13
+ } from "../schemas";
3
14
 
4
- export type BaseCreativeEntity = {
5
- id: string;
15
+ export type CreativeEntity = z.infer<typeof CreativeEntitySchema>;
16
+
17
+ export type CreativeWithUserEntity = z.infer<
18
+ typeof CreativeWithUserEntitySchema
19
+ >
20
+
21
+ export type ListCreativesDto = z.infer<typeof ListCreativesInputSchema>;
22
+
23
+ export type CreateCreativeDto = z.infer<typeof CreateCreativeProfileSchema> & {
24
+ userId: string;
25
+ };
26
+ export type UpdateCreativeDto = z.infer<typeof UpdateCreativeProfileSchema> & {
6
27
  userId: string;
7
- bio?: string;
8
- location?: string;
9
- experienceLevel?: ExperienceLevel;
10
- tags?: string[];
11
- disciplines?: string[];
12
- user?: any;
13
- createdAt: Date;
14
- updatedAt: Date;
15
28
  };
16
29
 
17
- export type CreativeEntity = BaseCreativeEntity;
30
+ export type GetCreativeParams = z.infer<typeof GetCreativeParamsSchema>;
18
31
 
19
- export type CreativeWithUserEntity = CreativeEntity & {
20
- user: MinimalUser;
21
- disciplines: string[];
22
- };
32
+ export type GetCreativeQuery = z.infer<typeof GetCreativeQuerySchema>;
33
+
34
+ export type CreateCreativeEndpointResponse = z.infer<
35
+ typeof CreateCreativeEndpointResponseSchema
36
+ >;
37
+
38
+ export type GetCreativeEndpointResponse = z.infer<
39
+ typeof GetCreativeEndpointResponseSchema
40
+ >;
23
41
 
24
- export type ListCreativesInput = {
25
- query?: string;
26
- disciplines?: string[];
27
- experienceLevels?: string[];
28
- location?: string;
29
- tags?: string[];
30
- page?: number;
31
- perPage?: number;
32
- };
42
+ export type UpdateCreativeEndpointResponse = z.infer<
43
+ typeof UpdateCreativeEndpointResponseSchema
44
+ >;
@@ -1,38 +1,43 @@
1
- import type {
2
- ExperienceLevel,
3
- GeographicFocus,
4
- InvestmentSize,
5
- InvestorType,
6
- } from "../constants";
7
- import type { MinimalUser } from "./user";
8
-
9
- export type InvestorEntity = {
10
- id: string;
1
+ import { z } from "@hono/zod-openapi";
2
+ import {
3
+ CreateInvestorEndpointResponseSchema,
4
+ CreateInvestorProfileSchema,
5
+ GetInvestorEndpointResponseSchema,
6
+ GetInvestorParamsSchema,
7
+ GetInvestorQuerySchema,
8
+ InvestorEntitySchema,
9
+ InvestorWithUserEntitySchema,
10
+ ListInvestorsInputSchema,
11
+ UpdateInvestorEndpointResponseSchema,
12
+ UpdateInvestorProfileSchema,
13
+ } from "../schemas/investor";
14
+
15
+ export type InvestorEntity = z.infer<typeof InvestorEntitySchema>;
16
+
17
+ export type InvestorWithUserEntity = z.infer<
18
+ typeof InvestorWithUserEntitySchema
19
+ >;
20
+
21
+ export type ListInvestorsInput = z.infer<typeof ListInvestorsInputSchema>;
22
+
23
+ export type CreateInvestorDto = z.infer<typeof CreateInvestorProfileSchema> & {
11
24
  userId: string;
12
- bio?: string;
13
- location?: string;
14
- experienceLevel?: ExperienceLevel;
15
- geographicFocus?: GeographicFocus;
16
- investmentSize?: InvestmentSize;
17
- investorType?: InvestorType;
18
- websiteURL?: string;
19
- disciplines?: string[];
20
- user?: any;
21
- createdAt: Date;
22
- updatedAt: Date;
23
25
  };
24
26
 
25
- export type InvestorWithUserEntity = InvestorEntity & {
26
- user: MinimalUser;
27
- disciplines: string[];
27
+ export type UpdateInvestorDto = z.infer<typeof UpdateInvestorProfileSchema> & {
28
+ userId: string;
28
29
  };
29
30
 
30
- export type ListInvestorsInput = {
31
- query?: string;
32
- disciplines?: string[];
33
- experienceLevels?: string[];
34
- location?: string;
35
- tags?: string[];
36
- page?: number;
37
- perPage?: number;
38
- };
31
+ export type GetInvestorParams = z.infer<typeof GetInvestorParamsSchema>;
32
+
33
+ export type GetInvestorQuery = z.infer<typeof GetInvestorQuerySchema>;
34
+
35
+ export type CreateInvestorEndpointResponse = z.infer<
36
+ typeof CreateInvestorEndpointResponseSchema
37
+ >;
38
+ export type GetInvestorEndpointResponse = z.infer<
39
+ typeof GetInvestorEndpointResponseSchema
40
+ >;
41
+ export type UpdateInvestorEndpointResponse = z.infer<
42
+ typeof UpdateInvestorEndpointResponseSchema
43
+ >;
@@ -25,9 +25,9 @@ export type ProjectEntity = {
25
25
  projectCreatorType: Role;
26
26
  tags?: string[];
27
27
  isFeatured?: boolean;
28
- startDate?: Date | null;
28
+ startDate?: Date;
29
29
  imagePlaceholderUrl?: string;
30
- endDate?: Date | null;
30
+ endDate?: Date;
31
31
  };
32
32
 
33
33
  export type ProjectWithFilesEntity = ProjectEntity &
package/src/types/user.ts CHANGED
@@ -1,61 +1,35 @@
1
- import type { OnboardingPage, Role, UserStatus } from "../constants";
2
- import type { UserSocialGraphEntity } from "./common";
3
- import type { ProjectBookmarkEntity, ProjectEntity } from "./project";
4
-
5
- export type BaseUserEntity = {
6
- id: string;
7
- email: string;
8
- emailVerified: boolean;
9
- name?: string;
10
- image?: string;
11
- username?: string;
12
- displayUsername?: string;
13
- searchVector?: string;
14
- role: Role;
15
- status: UserStatus;
16
- onboardingPage: OnboardingPage;
17
- createdAt: Date;
18
- updatedAt: Date;
19
- };
20
-
21
- export type MinimalUser = Pick<
22
- BaseUserEntity,
23
- "id" | "name" | "email" | "image" | "username" | "role"
1
+ import { z } from "@hono/zod-openapi";
2
+ import {
3
+ BaseUserEntitySchema,
4
+ UserWithFollowingEntitySchema,
5
+ MinimalUserSchema,
6
+ UserEntitySchema,
7
+ UserProfileEntitySchema,
8
+ UserWithProjectBookmarksEntitySchema,
9
+ UserWithProjectsEntitySchema,
10
+ UserWithFollowersEntitySchema,
11
+ } from "../schemas";
12
+
13
+ export type BaseUserEntity = z.infer<typeof BaseUserEntitySchema>;
14
+
15
+ export type MinimalUser = z.infer<typeof MinimalUserSchema>;
16
+
17
+ export type UserEntity = z.infer<typeof UserEntitySchema>;
18
+
19
+ export type UserProfileEntity = z.infer<typeof UserProfileEntitySchema>;
20
+
21
+ export type UserWithProjectsEntity = z.infer<
22
+ typeof UserWithProjectsEntitySchema
24
23
  >;
25
24
 
26
- export type UserEntity = BaseUserEntity & UserSocialGraphEntity;
27
-
28
- export type UserProfileEntity = UserEntity & {
29
- profileType?: "creative" | "brand" | "investor";
30
- bio?: string;
31
- location?: string;
32
- experienceLevel?: string;
33
- disciplines?: any[];
34
- tags?: any[];
35
- brandName?: string;
36
- websiteURL?: string;
37
- investorType?: string;
38
- investmentSize?: string;
39
- geographicFocus?: string;
40
- };
41
-
42
- export type UserWithProjectsEntity = {
43
- userId: string;
44
- projects: Omit<ProjectEntity, "overview">[];
45
- };
46
-
47
- export type UserWithProjectBookmarksEntity = {
48
- userId: string;
49
- projectBookmarks: (ProjectBookmarkEntity & {
50
- project: Pick<
51
- ProjectEntity,
52
- | "id"
53
- | "title"
54
- | "description"
55
- | "tags"
56
- | "startDate"
57
- | "endDate"
58
- | "imagePlaceholderUrl"
59
- >;
60
- })[];
61
- };
25
+ export type UserWithProjectBookmarksEntity = z.infer<
26
+ typeof UserWithProjectBookmarksEntitySchema
27
+ >;
28
+
29
+ export type UserWithFollowingEntity = z.infer<
30
+ typeof UserWithFollowingEntitySchema
31
+ >;
32
+
33
+ export type UserWithFollowersEntity = z.infer<
34
+ typeof UserWithFollowersEntitySchema
35
+ >;
@@ -0,0 +1,10 @@
1
+ export const slugify = ({ value }: { value: string }) => {
2
+ return value
3
+ .normalize("NFKD")
4
+ .replace(/[\u0300-\u036f]/g, "") // Remove diacritics
5
+ .toLowerCase()
6
+ .trim()
7
+ .replace(/[^a-z0-9]+/g, "_") // Replace non-alphanum with underscore
8
+ .replace(/^_+|_+$/g, "") // Trim leading/trailing underscores
9
+ .replace(/__+/g, "_"); // Collapse multiple underscores
10
+ };