founder-schema 0.25.0 → 0.26.0

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 (34) hide show
  1. package/dist/domains/communities/communities.d.ts +9 -9
  2. package/dist/domains/discover/discover.d.ts +88 -0
  3. package/dist/domains/discover/discover.d.ts.map +1 -1
  4. package/dist/domains/feed/feed.d.ts +11 -11
  5. package/dist/domains/follows/follows.d.ts +186 -3
  6. package/dist/domains/follows/follows.d.ts.map +1 -1
  7. package/dist/domains/follows/follows.js +15 -4
  8. package/dist/domains/follows/follows.js.map +1 -1
  9. package/dist/domains/follows/relation.d.ts +24 -0
  10. package/dist/domains/follows/relation.d.ts.map +1 -1
  11. package/dist/domains/follows/relation.js +24 -0
  12. package/dist/domains/follows/relation.js.map +1 -1
  13. package/dist/domains/onboarding/onboarding-answers.d.ts +12 -8
  14. package/dist/domains/onboarding/onboarding-answers.d.ts.map +1 -1
  15. package/dist/domains/onboarding/onboarding-answers.js +20 -21
  16. package/dist/domains/onboarding/onboarding-answers.js.map +1 -1
  17. package/dist/domains/onboarding/onboarding.d.ts +210 -174
  18. package/dist/domains/onboarding/onboarding.d.ts.map +1 -1
  19. package/dist/domains/onboarding/onboarding.js +104 -70
  20. package/dist/domains/onboarding/onboarding.js.map +1 -1
  21. package/dist/domains/products/products.d.ts +3 -3
  22. package/dist/domains/profile/founder-profile.d.ts +143 -1
  23. package/dist/domains/profile/founder-profile.d.ts.map +1 -1
  24. package/dist/domains/profile/founder-profile.js +44 -1
  25. package/dist/domains/profile/founder-profile.js.map +1 -1
  26. package/dist/domains/profile/my-profile.d.ts +119 -40
  27. package/dist/domains/profile/my-profile.d.ts.map +1 -1
  28. package/dist/domains/profile/my-profile.js +28 -14
  29. package/dist/domains/profile/my-profile.js.map +1 -1
  30. package/dist/index.d.ts +4 -4
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +4 -4
  33. package/dist/index.js.map +1 -1
  34. package/package.json +1 -1
@@ -7,7 +7,7 @@
7
7
  * @module founder-schema/domains/profile
8
8
  */
9
9
  import { z } from 'zod';
10
- import { chosenUsernameSchema, fullNameSchema, GOAL_VALUES, genderSchema, goalSchema, httpUrlSchema, industrySchema, locationSchema, objectIdSchema, optionalTrimmedString, phoneSchema, requiredGoalListSchema, skillListSchema, skillSchema, startupStageSchema, usernameSchema, } from '../../core/common.js';
10
+ import { chosenUsernameSchema, eachOnce, fullNameSchema, GOAL_VALUES, genderSchema, goalSchema, httpUrlSchema, industrySchema, locationSchema, objectIdSchema, optionalTrimmedString, phoneSchema, requiredGoalListSchema, skillListSchema, skillSchema, startupStageSchema, usernameSchema, } from '../../core/common.js';
11
11
  import { ABOUT_MAX, DISPLAY_NAME_MAX, FOUNDED_YEAR_MIN, HEADLINE_MAX, SKILLS_MAX, TEAM_SIZE_MAX, TEAM_SIZE_MIN, VENTURE_NAME_MAX, VENTURE_TAGLINE_MAX, } from '../../core/limits.js';
12
12
  import { VALIDATION_MESSAGE } from '../../core/validation.js';
13
13
  import { followCountsSchema, followRelationSchema } from '../follows/relation.js';
@@ -15,6 +15,35 @@ import { locationPickSchema, placeSchema } from '../location/areas.js';
15
15
  import { mediaImageSchema } from '../media/media.js';
16
16
  import { personSchema } from '../people/person.js';
17
17
  // ─── Venture ─────────────────────────────────────────────────────────────────
18
+ /**
19
+ * The member's role at their startup (2026-11-22, the user: "role at startup
20
+ * (give dropdown options like founder, cofounder, ceo, cto, cfo etc let user
21
+ * chose mutliple of them)"). Several at once: a founder is often its CEO too.
22
+ * Public with the rest of the venture (the member's page shows it).
23
+ *
24
+ * ⚠ Stored on the profile's venture and a Mongoose enum. Append only.
25
+ */
26
+ export const VENTURE_ROLE_VALUES = [
27
+ 'founder',
28
+ 'co_founder',
29
+ 'ceo',
30
+ 'cto',
31
+ 'coo',
32
+ 'cfo',
33
+ 'cmo',
34
+ 'cpo',
35
+ 'other',
36
+ ];
37
+ export const ventureRoleSchema = z.enum(VENTURE_ROLE_VALUES);
38
+ /**
39
+ * The roles a venture's member holds: each once, at least one. ABSENT when
40
+ * none is picked, never an empty list: "not answered" stays absent.
41
+ */
42
+ export const ventureRolesSchema = z
43
+ .array(ventureRoleSchema)
44
+ .min(1)
45
+ .max(VENTURE_ROLE_VALUES.length)
46
+ .refine(eachOnce, { error: VALIDATION_MESSAGE.rolesDuplicate });
18
47
  /**
19
48
  * ⚠ NUMBERS ARE NUMBERS, never coerced. This is a BODY, which arrives as JSON
20
49
  * and already carries types. `z.coerce.number()` here accepted `teamSize: true`
@@ -29,6 +58,13 @@ export const ventureSchema = z.object({
29
58
  website: httpUrlSchema.optional(),
30
59
  industry: industrySchema,
31
60
  stage: startupStageSchema,
61
+ /**
62
+ * The member's roles at it (2026-11-22). OPTIONAL HERE, on what is READ: every
63
+ * venture saved before has none, and a card or a page must still show it.
64
+ * Every WRITE requires them (`ventureWriteSchema`, the user: "keep the role
65
+ * field mendetory"): a member is asked the next time they save their business.
66
+ */
67
+ roles: ventureRolesSchema.optional(),
32
68
  /** Team size including the founder. Optional: a solo pre-idea founder has none to report. */
33
69
  teamSize: z.number().int().min(TEAM_SIZE_MIN).max(TEAM_SIZE_MAX).optional(),
34
70
  /**
@@ -50,6 +86,13 @@ export const ventureSchema = z.object({
50
86
  })
51
87
  .optional(),
52
88
  });
89
+ /**
90
+ * A venture as it is WRITTEN (2026-11-22): onboarding's startup step and
91
+ * finish, and Me's business editor. The roles are REQUIRED, at least one, beside
92
+ * the name, industry and stage (the user: "keep the role field mendetory"); the
93
+ * READ shape (`ventureSchema`) keeps them optional for the ventures saved before.
94
+ */
95
+ export const ventureWriteSchema = ventureSchema.extend({ roles: ventureRolesSchema });
53
96
  /**
54
97
  * A venture's fields, in order, and which of them may be left out (0.17.0):
55
98
  * what the backend lists when it saves or compares a venture, read from here.
@@ -1 +1 @@
1
- {"version":3,"file":"founder-profile.js","sourceRoot":"","sources":["../../../src/domains/profile/founder-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG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B,0EAA0E;IAC1E,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B;;;;OAIG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,0FAA0F;IAC1F,UAAU,EAAE,uBAAuB;CACpC,CAAC,CAAC;AAGH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD;;;;OAIG;IACH,QAAQ,EAAE,cAAc,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,WAAW,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B;;;;;;OAMG;IACH,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAClD,+CAA+C;IAC/C,UAAU,EAAE,uBAAuB,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACzD,CAAC,CAAC;AAGH,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAAC;AAGzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["/**\n * founder-schema — The founder profile\n *\n * One member, one profile. The central auth account owns identity (email,\n * verification, deletion); this owns everything Founder Circle shows.\n *\n * @module founder-schema/domains/profile\n */\n\nimport { z } from 'zod';\nimport {\n chosenUsernameSchema,\n fullNameSchema,\n GOAL_VALUES,\n genderSchema,\n goalSchema,\n httpUrlSchema,\n industrySchema,\n locationSchema,\n objectIdSchema,\n optionalTrimmedString,\n phoneSchema,\n requiredGoalListSchema,\n skillListSchema,\n skillSchema,\n startupStageSchema,\n usernameSchema,\n} from '../../core/common.js';\nimport {\n ABOUT_MAX,\n DISPLAY_NAME_MAX,\n FOUNDED_YEAR_MIN,\n HEADLINE_MAX,\n SKILLS_MAX,\n TEAM_SIZE_MAX,\n TEAM_SIZE_MIN,\n VENTURE_NAME_MAX,\n VENTURE_TAGLINE_MAX,\n} from '../../core/limits.js';\nimport { VALIDATION_MESSAGE } from '../../core/validation.js';\nimport { followCountsSchema, followRelationSchema } from '../follows/relation.js';\nimport { locationPickSchema, placeSchema } from '../location/areas.js';\nimport { mediaImageSchema } from '../media/media.js';\nimport { personSchema } from '../people/person.js';\n\n// ─── Venture ─────────────────────────────────────────────────────────────────\n\n/**\n * ⚠ NUMBERS ARE NUMBERS, never coerced. This is a BODY, which arrives as JSON\n * and already carries types. `z.coerce.number()` here accepted `teamSize: true`\n * as 1 and `\" \"` as 0, and made the schema's input type `unknown`, so a form\n * typed against it could put anything in the field. Coercion belongs to query\n * strings, where everything is text; a form converts its text input before it\n * builds the body.\n */\nexport const ventureSchema = z.object({\n name: z.string().trim().min(1).max(VENTURE_NAME_MAX),\n tagline: optionalTrimmedString(VENTURE_TAGLINE_MAX),\n website: httpUrlSchema.optional(),\n industry: industrySchema,\n stage: startupStageSchema,\n /** Team size including the founder. Optional: a solo pre-idea founder has none to report. */\n teamSize: z.number().int().min(TEAM_SIZE_MIN).max(TEAM_SIZE_MAX).optional(),\n /**\n * Not in the future. The bound is read per parse, never captured once.\n *\n * `.max(new Date().getUTCFullYear())` looks equivalent and is not: it is\n * evaluated when this module is imported, so a server process still up on\n * 1 January rejects the new year until somebody restarts it. The backend's\n * Mongoose model deliberately carries no upper bound for the same reason, a\n * `max` there being frozen at schema construction. This is where the ceiling\n * lives.\n */\n foundedYear: z\n .number()\n .int()\n .min(FOUNDED_YEAR_MIN)\n .refine((year) => year <= new Date().getUTCFullYear(), {\n error: VALIDATION_MESSAGE.foundedYearFuture,\n })\n .optional(),\n});\nexport type Venture = z.infer<typeof ventureSchema>;\n\n/**\n * A venture's fields, in order, and which of them may be left out (0.17.0):\n * what the backend lists when it saves or compares a venture, read from here.\n */\nexport const VENTURE_KEYS = ventureSchema.keyof().options;\nexport type VentureKey = (typeof VENTURE_KEYS)[number];\nexport const VENTURE_OPTIONAL_KEYS: readonly VentureKey[] = VENTURE_KEYS.filter(\n (key) => ventureSchema.shape[key].safeParse(undefined).success,\n);\n\n// ─── A member as other surfaces name them ────────────────────────────────────\n\n/**\n * A member as a byline renders them: on a post (`feedAuthorSchema` is this), a\n * product's team, a review, a notification, the top-helpers list. Since\n * 0.20.0 it is `personSchema` (one shape for every person, its doc says why)\n * with the member's one-line headline.\n *\n * Every field is LIVE, joined at read time rather than frozen onto the post or\n * review at write time. So a new name, handle, photo or headline shows\n * everywhere, the link always targets the current username, and nothing\n * personal survives in other people's rows once an account is deleted: the\n * byline of a deleted account is `former: true` with no name or picture.\n */\nexport const memberBylineSchema = personSchema.extend({\n /** The member's one-line headline, live-joined. Absent for a former member. */\n headline: z.string().optional(),\n});\nexport type MemberByline = z.infer<typeof memberBylineSchema>;\n\n/**\n * What a member has given the community, on their profile and card.\n *\n * `score` is points earned from OTHER members' recognition only: a product's\n * team marking your feedback helpful, confirming you tested their product,\n * and members finding your review helpful (writing one earns nothing by\n * itself). Nothing a member\n * does to their own product counts, so the score cannot be bought by having a\n * popular one. `helpedCount` is how many different founders recognised that\n * help (\"Helped 12 founders\"). See `domains/contributions`.\n */\nexport const contributionSummarySchema = z.object({\n score: z.number().int().nonnegative(),\n helpedCount: z.number().int().nonnegative(),\n});\nexport type ContributionSummary = z.infer<typeof contributionSummarySchema>;\n\n// ─── Profile ─────────────────────────────────────────────────────────────────\n\n/**\n * The founder's off-platform links. ONE shape: onboarding's contact step picks\n * its three from this, so a link one side knows can never be missing on the\n * other. (It was written twice until 0.2.0, and the profile side lacked\n * Instagram, which onboarding collected.)\n *\n * Defined without a default, because the read side wants one and the write\n * side must not have one; each adds its own.\n */\nexport const founderLinksSchema = z.object({\n linkedin: httpUrlSchema.optional(),\n x: httpUrlSchema.optional(),\n instagram: httpUrlSchema.optional(),\n github: httpUrlSchema.optional(),\n website: httpUrlSchema.optional(),\n});\nexport type FounderLinks = z.infer<typeof founderLinksSchema>;\n\n/**\n * The profile's links, by key, in order (0.17.0): what the backend's model and\n * its projections list. Read from here, never written out again: a copy of\n * this list is how the profile model once lost Instagram.\n */\nexport const FOUNDER_LINK_KEYS = founderLinksSchema.keyof().options;\nexport type FounderLinkKey = (typeof FOUNDER_LINK_KEYS)[number];\n\n/**\n * The profile as the owner sees it. A peer sees the redacted projection\n * (`founderCardSchema`), which is built on the server and never by dropping\n * fields on the client.\n */\nexport const founderProfileSchema = z.object({\n id: z.string(),\n userId: z.string(),\n username: usernameSchema,\n /**\n * First and last name joined (0.20.0): DERIVED by the server from\n * `firstName` and `lastName`, never written as a value of its own.\n */\n displayName: z.string().trim().min(1).max(DISPLAY_NAME_MAX),\n /** The first word of the member's full name (0.20.0). */\n firstName: z.string(),\n /** Everything after the first space; `''` for a one-word name (0.20.0). */\n lastName: z.string(),\n headline: optionalTrimmedString(HEADLINE_MAX),\n about: optionalTrimmedString(ABOUT_MAX),\n /**\n * Plain `z.url()`, NOT `httpUrlSchema`, and the difference is deliberate.\n *\n * No member can write this field: it appears in no write body, and\n * `public-surface.test.ts` asserts that and will fail the day somebody adds it\n * to a form. So the scheme restriction would be defending a field that takes\n * no member input, while refusing hosts we legitimately serve avatars from,\n * our own dev host among them. A read schema that rejects our own response is\n * a self-inflicted outage.\n *\n * ⚠️ That argument holds only while nothing member-supplied reaches this\n * field. Two sources write an avatar today and NEITHER is a member typing a\n * URL: our own upload path, and the central-auth `user.created` /\n * `user.updated` webhook, which carries the Google OAuth picture. If a\n * \"paste a link to your photo\" control is ever added, this goes back to\n * `httpUrlSchema` and the ruling behind it is void.\n *\n * WHICH picture: the member's uploaded photo at its small size (192, see\n * `MEDIA_SIZES.avatar`), else their sign-in provider's picture, else absent.\n * Every surface that shows this member resolves it the same way.\n */\n avatarUrl: z.url().optional(),\n /**\n * The uploaded photo itself, every size, when the member has one. Absent\n * means `avatarUrl` (if any) is the sign-in provider's picture, so a client\n * offers \"Remove photo\" only when this is present. Not on `founderCardSchema`:\n * a card needs one small picture, not the set.\n */\n avatar: mediaImageSchema.optional(),\n /**\n * The member's choice about their sign-in provider's picture (0.20.0): when\n * false it is never shown, so with no upload they appear with their\n * initials. `hasProviderPhoto` says whether there is one to offer at all.\n */\n useProviderPhoto: z.boolean(),\n hasProviderPhoto: z.boolean(),\n location: locationSchema.optional(),\n /**\n * The member's own location as picked (0.19.0): state, district and\n * locality with their area ids, for Me's location field and the drawer.\n * OWNER-ONLY: no card or member page carries it (they pick `location`).\n * Absent for a location stored as text before 0.19.0.\n */\n place: placeSchema.optional(),\n venture: ventureSchema.optional(),\n skills: z.array(skillSchema).max(SKILLS_MAX).default([]),\n goals: z.array(goalSchema).max(GOAL_VALUES.length).default([]),\n links: founderLinksSchema.default({}),\n /**\n * Their contribution to other founders. Server-computed, never written by a\n * member. REQUIRED, no default: a read-side default would let a server that\n * forgot the field pass as a real zero.\n */\n contribution: contributionSummarySchema,\n createdAt: z.iso.datetime(),\n updatedAt: z.iso.datetime(),\n});\nexport type FounderProfile = z.infer<typeof founderProfileSchema>;\n\n/**\n * What one founder sees of another in Discover and on a profile page.\n *\n * Built server-side. Keep it a strict subset of `founderProfileSchema` — if a\n * private field ever needs to show here, that is a product decision, not an\n * accident of spreading the full document.\n */\n// ⚠ The web's Discover cache follows the member's own saves of exactly these\n// fields (`discoverChangedBy` in the web's features/profile/api.ts derives its\n// list from this shape): adding a field here is enough, there is no second list.\nexport const founderCardSchema = founderProfileSchema.pick({\n id: true,\n /**\n * The MEMBER's id (0.6.0): what a team invitation, a chat and every byline\n * key on. `id` is the profile's own id, which nothing takes as input.\n */\n userId: true,\n username: true,\n displayName: true,\n headline: true,\n avatarUrl: true,\n location: true,\n venture: true,\n skills: true,\n goals: true,\n contribution: true,\n});\nexport type FounderCard = z.infer<typeof founderCardSchema>;\n\n/** The fields a Discover card shows. */\nexport const FOUNDER_CARD_FIELDS = founderCardSchema.keyof().options;\nexport type FounderCardField = (typeof FOUNDER_CARD_FIELDS)[number];\n\n/**\n * The card fields a member's own edit can change, the ones that move them up\n * Discover: every card field but the ids, which never change, and the points\n * (`contribution`), which other people's acts move all day and which would\n * otherwise reorder Discover with every helpful mark.\n */\nexport const FOUNDER_CARD_EDIT_FIELDS = FOUNDER_CARD_FIELDS.filter(\n (field) => field !== 'id' && field !== 'userId' && field !== 'contribution',\n);\n\n/**\n * Whether a write changed what a member's Discover card shows (0.18.0): ONE\n * rule for every profile writer, which decides whether the member moves up\n * Discover (its \"recently updated\" order) and whether a client reloads it.\n * `changed` names the fields the write actually changed: a body's keys, or\n * for the business editor `venture` only when its PUBLIC part changed. Before\n * 0.18.0 five writers decided it four ways: an edit to the About text alone\n * lifted a member to the top of everyone's Discover, a new username never did.\n * Points never count (`FOUNDER_CARD_EDIT_FIELDS`): they are not the member's\n * edit.\n */\nexport function changesDiscoverCard(changed: readonly string[]): boolean {\n return changed.some((field) => (FOUNDER_CARD_EDIT_FIELDS as readonly string[]).includes(field));\n}\n\n// ─── What a member chooses to show (0.11.0) ──────────────────────────────────\n\n/**\n * The four personal details a member MAY show on their profile page (the\n * user's ruling, 2026-10-11). Each is PRIVATE until its owner turns it on;\n * everything else on a profile is public as before. Changed only through\n * `PATCH /profiles/me/personal`.\n */\nexport const CONTACT_VISIBILITY_FIELDS = ['email', 'phone', 'gender', 'birthday'] as const;\nexport type ContactVisibilityField = (typeof CONTACT_VISIBILITY_FIELDS)[number];\n\n/**\n * WHO sees each of the four once its owner turns it on (0.18.0). The user,\n * 2026-10-20: \"any person who has the platform membership can view them if\n * they are public\", so all four go to members only (and to the member\n * themself), never to an account without membership. One table: the server\n * builds `shown` from it, and every screen words its switch from it.\n */\nexport const PROFILE_AUDIENCE_VALUES = ['members'] as const;\nexport type ProfileAudience = (typeof PROFILE_AUDIENCE_VALUES)[number];\nexport const CONTACT_VISIBILITY_AUDIENCE = {\n email: 'members',\n phone: 'members',\n gender: 'members',\n birthday: 'members',\n} as const satisfies Record<ContactVisibilityField, ProfileAudience>;\n\n/** Which of the four the member shows. Every key present on a read: false is private. */\nexport const contactVisibilitySchema = z.object(\n Object.fromEntries(CONTACT_VISIBILITY_FIELDS.map((field) => [field, z.boolean()])) as Record<\n ContactVisibilityField,\n z.ZodBoolean\n >,\n);\nexport type ContactVisibility = z.infer<typeof contactVisibilitySchema>;\n\n/**\n * A birthday as OTHERS see it: day and month, NEVER the year (the user's\n * ruling). The year would give away the age and, with the name, the full date\n * of birth that identity checks ask for. The year is never on the wire.\n */\nexport const publicBirthdaySchema = z.object({\n day: z.number().int().min(1).max(31),\n month: z.number().int().min(1).max(12),\n});\nexport type PublicBirthday = z.infer<typeof publicBirthdaySchema>;\n\n/**\n * `GET /api/v1/founders/by-username/:username` (0.11.0): one member's profile\n * page, as a signed-in member (or the member themself) sees it.\n *\n * The card's fields, what only a page has room for (about, links, member\n * since), and `shown`: the personal details this member has CHOSEN to show,\n * and nothing else, to the audience `CONTACT_VISIBILITY_AUDIENCE` names\n * (members only, all four, 0.18.0); the server decides, and a client renders\n * what arrives. Built field by field on the server\n * (`toMemberPublic`), never by dropping fields from a fuller document.\n *\n * `viewer.canMessage` is the server's answer to \"offer Message\": the tap\n * opens a conversation, or (0.13.0) the sheet that makes one possible (the\n * membership for a viewer, the plans for a member without one). Who may\n * message whom follows membership and plans, so no client works it out.\n */\nexport const memberProfileSchema = founderProfileSchema\n .pick({\n id: true,\n userId: true,\n username: true,\n displayName: true,\n headline: true,\n about: true,\n avatarUrl: true,\n location: true,\n venture: true,\n skills: true,\n goals: true,\n links: true,\n contribution: true,\n createdAt: true,\n })\n .extend({\n shown: z.object({\n email: z.string().optional(),\n phone: z.string().optional(),\n gender: genderSchema.optional(),\n birthday: publicBirthdaySchema.optional(),\n }),\n viewer: z.object({ isSelf: z.boolean(), canMessage: z.boolean() }),\n /** How many follow them and whom they follow, counted when read (2026-11-20). */\n follows: followCountsSchema,\n /** The viewer and them (2026-11-20): all false for the viewer's own page. */\n follow: followRelationSchema,\n });\nexport type MemberProfile = z.infer<typeof memberProfileSchema>;\n\n/** The member page's address: `/discover/<username>`. */\nexport const memberHandleParamsSchema = z.object({ username: usernameSchema });\nexport type MemberHandleParams = z.infer<typeof memberHandleParamsSchema>;\n\n// ─── Write bodies ────────────────────────────────────────────────────────────\n\n/**\n * A text field the member is allowed to empty.\n *\n * Three states, and they are deliberately distinct:\n * absent do not touch this field\n * null clear it (the backend turns this into an `$unset`)\n * \"\" REJECTED\n *\n * The empty string is refused on purpose. A form that forgets to convert a\n * cleared input to `null` then fails loudly at the boundary, instead of being\n * silently dropped and leaving the member staring at text they just deleted.\n * `optionalTrimmedString` does the dropping, which is right for a create body\n * and wrong for a patch.\n */\nconst clearableText = (maxLength: number) =>\n z.string().trim().min(1, VALIDATION_MESSAGE.clearWithNull).max(maxLength).nullable().optional();\n\n/**\n * Patch body for the Me tab. Only the keys the member actually changed.\n *\n * ⚠️ Written as its own object ON PURPOSE. Do NOT rebuild it as\n * `founderProfileSchema.pick({...}).partial()`: `.partial()` does not switch\n * off `.default()`, so `skills`, `goals` and `links` would materialise as\n * `[]`, `[]` and `{}` on every request, including an empty one. Under a `$set`\n * that wipes a member's skills and every one of their links the moment they\n * edit their display name. `tsc` cannot see it and the request looks correct in\n * the network tab.\n *\n * The rule this comes from: defaults belong on the READ side. A write body\n * states what the caller sent and nothing else.\n *\n * ONE WRITER PER FIELD (0.18.0): the name and the city are the personal\n * details' (`PATCH /profiles/me/personal`), the venture is the business\n * editor's (`PUT /profiles/me/business`), the handle has its own route. They\n * were taken here too, a second path with its own rules for Discover's order.\n * STRICT: any other key is refused (a 400 naming it), never dropped without a\n * word, so a client still sending a name here learns it at once instead of\n * losing the member's edit.\n */\nexport const updateFounderProfileBodySchema = z\n .object({\n headline: clearableText(HEADLINE_MAX),\n about: clearableText(ABOUT_MAX),\n /** The same list rules as onboarding's finish (each value once, 0.17.0). */\n skills: skillListSchema.optional(),\n /**\n * The same rules as onboarding's finish, its minimum included (0.18.0, the\n * user: \"we already have at least one goal required\"): Me cannot save a\n * member down to no goals.\n */\n goals: requiredGoalListSchema.optional(),\n /** Sent whole. To drop one link, send the object without that key. */\n links: founderLinksSchema.optional(),\n })\n .strict();\nexport type UpdateFounderProfileBody = z.infer<typeof updateFounderProfileBodySchema>;\n\n/**\n * Username change. Separate from the profile patch because it needs a\n * uniqueness check, and it refuses a reserved handle (`chosenUsernameSchema`).\n */\nexport const updateUsernameBodySchema = z.object({ username: chosenUsernameSchema });\nexport type UpdateUsernameBody = z.infer<typeof updateUsernameBodySchema>;\n\n/** `GET /api/v1/profiles/username-available?username=` (0.13.0): the handle asked about. */\nexport const usernameAvailabilityQuerySchema = z.object({ username: usernameSchema });\nexport type UsernameAvailabilityQuery = z.infer<typeof usernameAvailabilityQuerySchema>;\n\n/** Why a username is not available. */\nexport const USERNAME_UNAVAILABLE_REASON_VALUES = ['taken', 'reserved'] as const;\nexport type UsernameUnavailableReason = (typeof USERNAME_UNAVAILABLE_REASON_VALUES)[number];\n\nexport const usernameAvailabilitySchema = z.object({\n username: usernameSchema,\n available: z.boolean(),\n /** Present when unavailable. */\n reason: z.enum(USERNAME_UNAVAILABLE_REASON_VALUES).optional(),\n});\nexport type UsernameAvailability = z.infer<typeof usernameAvailabilitySchema>;\n\n// ─── The member's own personal details ──────────────────────────────────────\n\n/**\n * `GET /api/v1/profiles/me/personal` (0.10.0): what ONLY the member sees of\n * themselves, the \"Personal details\" card of the Me tab's Profile.\n *\n * ⚠ OWNER ONLY, and kept OFF `founderProfileSchema` on purpose. Email, phone,\n * gender and date of birth are personal data: they appear on no card, no\n * search, no team list, no byline and no audit detail. The profile is read on\n * every page by the app shell; these do not travel with it, they are asked\n * for only where they are shown.\n *\n * Read shapes are plain where the stored value may predate today's rule (a\n * phone seeded from the sign-in provider in another format): a read schema\n * that rejects our own stored value is a self-inflicted outage. The write\n * body holds the rules.\n */\nexport const myPersonalDetailsSchema = z.object({\n /** First and last name joined, derived (0.20.0): the card's first row. */\n displayName: z.string(),\n /** As stored (0.20.0): what Me's \"Full name\" box is filled from, joined. */\n firstName: z.string(),\n lastName: z.string(),\n /** The sign-in account's. Changed there (Account settings), never here. */\n email: z.string().optional(),\n /** Ten digits as stored on the account mirror; display adds the `+91`. */\n phone: z.string().optional(),\n gender: genderSchema.optional(),\n /**\n * `YYYY-MM-DD`. READ ONLY: it is the 18+ check's input, given once at\n * onboarding. A date of birth that could be edited later would be an age\n * gate anyone could walk around.\n */\n dateOfBirth: z.string().optional(),\n /** Which of email, phone, gender and birthday the member shows on their page (0.11.0). */\n visibility: contactVisibilitySchema,\n});\nexport type MyPersonalDetails = z.infer<typeof myPersonalDetailsSchema>;\n\n/**\n * `PATCH /api/v1/profiles/me/personal` (0.10.0): name, phone and gender. Only\n * the keys the member changed; answers with `myPersonalDetailsSchema`.\n *\n * ONE RULE PER FIELD: the very schemas onboarding finishes with (the display\n * name, the ten-digit phone, the gender enum with prefer-not-to-say), so a\n * value one accepts the other can never refuse.\n *\n * ⚠ NO `.default()` and no `.partial()` of a read shape (see\n * `updateFounderProfileBodySchema`): absent means unchanged, and a default\n * would overwrite what is stored. No `dateOfBirth`: read only, above. No\n * `email`: the sign-in account owns it.\n *\n * Name and phone are PRODUCT-OWNED on Founder Circle's account mirror: the\n * sign-in service seeds them once and never overwrites them, so this edits\n * Founder Circle's copy and never calls the sign-in service.\n */\nexport const updateMyPersonalDetailsBodySchema = z.object({\n /**\n * The full name as typed (0.20.0; `displayName` until 0.19.0): the server\n * splits it at the first space into first and last name and derives the\n * display name from them (`splitFullName`, `joinFullName`).\n */\n fullName: fullNameSchema.optional(),\n phone: phoneSchema.optional(),\n gender: genderSchema.optional(),\n /**\n * The location, or `null` to remove it (0.11.0): it moved to the Personal\n * Details card, so its editor saves it here, with the rest, in one\n * transaction; only here since 0.18.0 (`PATCH /profiles/me` took it too).\n * Area ids from the drawer or GPS (0.19.0, `locationPickSchema`): the server\n * names the place and its public city from `master_db`.\n */\n location: locationPickSchema.nullable().optional(),\n /** Only the switches that changed (0.11.0). */\n visibility: contactVisibilitySchema.partial().optional(),\n});\nexport type UpdateMyPersonalDetailsBody = z.infer<typeof updateMyPersonalDetailsBodySchema>;\n\n// ─── The member's own photo ──────────────────────────────────────────────────\n\n/**\n * `PUT /api/v1/profiles/me/avatar`: use a completed upload (purpose `avatar`)\n * as the member's photo. Answers with the updated `founderProfileSchema`.\n *\n * The previous photo is deleted from storage, not merely unlinked, so its old\n * address stops working. `DELETE /api/v1/profiles/me/avatar` removes the photo\n * the same way and the member falls back to their sign-in provider's picture.\n */\nexport const setAvatarBodySchema = z.object({ mediaId: objectIdSchema });\nexport type SetAvatarBody = z.infer<typeof setAvatarBodySchema>;\n\n/**\n * `PATCH /api/v1/profiles/me/photo-settings` (0.20.0): show or hide the\n * sign-in provider's picture (Google's). Off, a member with no upload appears\n * with their initials everywhere. Answers with the updated `founderProfileSchema`.\n */\nexport const updatePhotoSettingsBodySchema = z.object({ useProviderPhoto: z.boolean() }).strict();\nexport type UpdatePhotoSettingsBody = z.infer<typeof updatePhotoSettingsBodySchema>;\n"]}
1
+ {"version":3,"file":"founder-profile.js","sourceRoot":"","sources":["../../../src/domains/profile/founder-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,oBAAoB,EACpB,QAAQ,EACR,cAAc,EACd,WAAW,EACX,YAAY,EACZ,UAAU,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,WAAW,EACX,sBAAsB,EACtB,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,cAAc,GACf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,SAA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,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC","sourcesContent":["/**\n * founder-schema — The founder profile\n *\n * One member, one profile. The central auth account owns identity (email,\n * verification, deletion); this owns everything Founder Circle shows.\n *\n * @module founder-schema/domains/profile\n */\n\nimport { z } from 'zod';\nimport {\n chosenUsernameSchema,\n eachOnce,\n fullNameSchema,\n GOAL_VALUES,\n genderSchema,\n goalSchema,\n httpUrlSchema,\n industrySchema,\n locationSchema,\n objectIdSchema,\n optionalTrimmedString,\n phoneSchema,\n requiredGoalListSchema,\n skillListSchema,\n skillSchema,\n startupStageSchema,\n usernameSchema,\n} from '../../core/common.js';\nimport {\n ABOUT_MAX,\n DISPLAY_NAME_MAX,\n FOUNDED_YEAR_MIN,\n HEADLINE_MAX,\n SKILLS_MAX,\n TEAM_SIZE_MAX,\n TEAM_SIZE_MIN,\n VENTURE_NAME_MAX,\n VENTURE_TAGLINE_MAX,\n} from '../../core/limits.js';\nimport { VALIDATION_MESSAGE } from '../../core/validation.js';\nimport { followCountsSchema, followRelationSchema } from '../follows/relation.js';\nimport { locationPickSchema, placeSchema } from '../location/areas.js';\nimport { mediaImageSchema } from '../media/media.js';\nimport { personSchema } from '../people/person.js';\n\n// ─── Venture ─────────────────────────────────────────────────────────────────\n\n/**\n * The member's role at their startup (2026-11-22, the user: \"role at startup\n * (give dropdown options like founder, cofounder, ceo, cto, cfo etc let user\n * chose mutliple of them)\"). Several at once: a founder is often its CEO too.\n * Public with the rest of the venture (the member's page shows it).\n *\n * ⚠ Stored on the profile's venture and a Mongoose enum. Append only.\n */\nexport const VENTURE_ROLE_VALUES = [\n 'founder',\n 'co_founder',\n 'ceo',\n 'cto',\n 'coo',\n 'cfo',\n 'cmo',\n 'cpo',\n 'other',\n] as const;\nexport const ventureRoleSchema = z.enum(VENTURE_ROLE_VALUES);\nexport type VentureRole = z.infer<typeof ventureRoleSchema>;\n\n/**\n * The roles a venture's member holds: each once, at least one. ABSENT when\n * none is picked, never an empty list: \"not answered\" stays absent.\n */\nexport const ventureRolesSchema = z\n .array(ventureRoleSchema)\n .min(1)\n .max(VENTURE_ROLE_VALUES.length)\n .refine(eachOnce, { error: VALIDATION_MESSAGE.rolesDuplicate });\n\n/**\n * ⚠ NUMBERS ARE NUMBERS, never coerced. This is a BODY, which arrives as JSON\n * and already carries types. `z.coerce.number()` here accepted `teamSize: true`\n * as 1 and `\" \"` as 0, and made the schema's input type `unknown`, so a form\n * typed against it could put anything in the field. Coercion belongs to query\n * strings, where everything is text; a form converts its text input before it\n * builds the body.\n */\nexport const ventureSchema = z.object({\n name: z.string().trim().min(1).max(VENTURE_NAME_MAX),\n tagline: optionalTrimmedString(VENTURE_TAGLINE_MAX),\n website: httpUrlSchema.optional(),\n industry: industrySchema,\n stage: startupStageSchema,\n /**\n * The member's roles at it (2026-11-22). OPTIONAL HERE, on what is READ: every\n * venture saved before has none, and a card or a page must still show it.\n * Every WRITE requires them (`ventureWriteSchema`, the user: \"keep the role\n * field mendetory\"): a member is asked the next time they save their business.\n */\n roles: ventureRolesSchema.optional(),\n /** Team size including the founder. Optional: a solo pre-idea founder has none to report. */\n teamSize: z.number().int().min(TEAM_SIZE_MIN).max(TEAM_SIZE_MAX).optional(),\n /**\n * Not in the future. The bound is read per parse, never captured once.\n *\n * `.max(new Date().getUTCFullYear())` looks equivalent and is not: it is\n * evaluated when this module is imported, so a server process still up on\n * 1 January rejects the new year until somebody restarts it. The backend's\n * Mongoose model deliberately carries no upper bound for the same reason, a\n * `max` there being frozen at schema construction. This is where the ceiling\n * lives.\n */\n foundedYear: z\n .number()\n .int()\n .min(FOUNDED_YEAR_MIN)\n .refine((year) => year <= new Date().getUTCFullYear(), {\n error: VALIDATION_MESSAGE.foundedYearFuture,\n })\n .optional(),\n});\nexport type Venture = z.infer<typeof ventureSchema>;\n\n/**\n * A venture as it is WRITTEN (2026-11-22): onboarding's startup step and\n * finish, and Me's business editor. The roles are REQUIRED, at least one, beside\n * the name, industry and stage (the user: \"keep the role field mendetory\"); the\n * READ shape (`ventureSchema`) keeps them optional for the ventures saved before.\n */\nexport const ventureWriteSchema = ventureSchema.extend({ roles: ventureRolesSchema });\n\n/**\n * A venture's fields, in order, and which of them may be left out (0.17.0):\n * what the backend lists when it saves or compares a venture, read from here.\n */\nexport const VENTURE_KEYS = ventureSchema.keyof().options;\nexport type VentureKey = (typeof VENTURE_KEYS)[number];\nexport const VENTURE_OPTIONAL_KEYS: readonly VentureKey[] = VENTURE_KEYS.filter(\n (key) => ventureSchema.shape[key].safeParse(undefined).success,\n);\n\n// ─── A member as other surfaces name them ────────────────────────────────────\n\n/**\n * A member as a byline renders them: on a post (`feedAuthorSchema` is this), a\n * product's team, a review, a notification, the top-helpers list. Since\n * 0.20.0 it is `personSchema` (one shape for every person, its doc says why)\n * with the member's one-line headline.\n *\n * Every field is LIVE, joined at read time rather than frozen onto the post or\n * review at write time. So a new name, handle, photo or headline shows\n * everywhere, the link always targets the current username, and nothing\n * personal survives in other people's rows once an account is deleted: the\n * byline of a deleted account is `former: true` with no name or picture.\n */\nexport const memberBylineSchema = personSchema.extend({\n /** The member's one-line headline, live-joined. Absent for a former member. */\n headline: z.string().optional(),\n});\nexport type MemberByline = z.infer<typeof memberBylineSchema>;\n\n/**\n * What a member has given the community, on their profile and card.\n *\n * `score` is points earned from OTHER members' recognition only: a product's\n * team marking your feedback helpful, confirming you tested their product,\n * and members finding your review helpful (writing one earns nothing by\n * itself). Nothing a member\n * does to their own product counts, so the score cannot be bought by having a\n * popular one. `helpedCount` is how many different founders recognised that\n * help (\"Helped 12 founders\"). See `domains/contributions`.\n */\nexport const contributionSummarySchema = z.object({\n score: z.number().int().nonnegative(),\n helpedCount: z.number().int().nonnegative(),\n});\nexport type ContributionSummary = z.infer<typeof contributionSummarySchema>;\n\n// ─── Profile ─────────────────────────────────────────────────────────────────\n\n/**\n * The founder's off-platform links. ONE shape: onboarding's contact step picks\n * its three from this, so a link one side knows can never be missing on the\n * other. (It was written twice until 0.2.0, and the profile side lacked\n * Instagram, which onboarding collected.)\n *\n * Defined without a default, because the read side wants one and the write\n * side must not have one; each adds its own.\n */\nexport const founderLinksSchema = z.object({\n linkedin: httpUrlSchema.optional(),\n x: httpUrlSchema.optional(),\n instagram: httpUrlSchema.optional(),\n github: httpUrlSchema.optional(),\n website: httpUrlSchema.optional(),\n});\nexport type FounderLinks = z.infer<typeof founderLinksSchema>;\n\n/**\n * The profile's links, by key, in order (0.17.0): what the backend's model and\n * its projections list. Read from here, never written out again: a copy of\n * this list is how the profile model once lost Instagram.\n */\nexport const FOUNDER_LINK_KEYS = founderLinksSchema.keyof().options;\nexport type FounderLinkKey = (typeof FOUNDER_LINK_KEYS)[number];\n\n/**\n * The profile as the owner sees it. A peer sees the redacted projection\n * (`founderCardSchema`), which is built on the server and never by dropping\n * fields on the client.\n */\nexport const founderProfileSchema = z.object({\n id: z.string(),\n userId: z.string(),\n username: usernameSchema,\n /**\n * First and last name joined (0.20.0): DERIVED by the server from\n * `firstName` and `lastName`, never written as a value of its own.\n */\n displayName: z.string().trim().min(1).max(DISPLAY_NAME_MAX),\n /** The first word of the member's full name (0.20.0). */\n firstName: z.string(),\n /** Everything after the first space; `''` for a one-word name (0.20.0). */\n lastName: z.string(),\n headline: optionalTrimmedString(HEADLINE_MAX),\n about: optionalTrimmedString(ABOUT_MAX),\n /**\n * Plain `z.url()`, NOT `httpUrlSchema`, and the difference is deliberate.\n *\n * No member can write this field: it appears in no write body, and\n * `public-surface.test.ts` asserts that and will fail the day somebody adds it\n * to a form. So the scheme restriction would be defending a field that takes\n * no member input, while refusing hosts we legitimately serve avatars from,\n * our own dev host among them. A read schema that rejects our own response is\n * a self-inflicted outage.\n *\n * ⚠️ That argument holds only while nothing member-supplied reaches this\n * field. Two sources write an avatar today and NEITHER is a member typing a\n * URL: our own upload path, and the central-auth `user.created` /\n * `user.updated` webhook, which carries the Google OAuth picture. If a\n * \"paste a link to your photo\" control is ever added, this goes back to\n * `httpUrlSchema` and the ruling behind it is void.\n *\n * WHICH picture: the member's uploaded photo at its small size (192, see\n * `MEDIA_SIZES.avatar`), else their sign-in provider's picture, else absent.\n * Every surface that shows this member resolves it the same way.\n */\n avatarUrl: z.url().optional(),\n /**\n * The uploaded photo itself, every size, when the member has one. Absent\n * means `avatarUrl` (if any) is the sign-in provider's picture, so a client\n * offers \"Remove photo\" only when this is present. Not on `founderCardSchema`:\n * a card needs one small picture, not the set.\n */\n avatar: mediaImageSchema.optional(),\n /**\n * The member's choice about their sign-in provider's picture (0.20.0): when\n * false it is never shown, so with no upload they appear with their\n * initials. `hasProviderPhoto` says whether there is one to offer at all.\n */\n useProviderPhoto: z.boolean(),\n hasProviderPhoto: z.boolean(),\n location: locationSchema.optional(),\n /**\n * The member's own location as picked (0.19.0): state, district and\n * locality with their area ids, for Me's location field and the drawer.\n * OWNER-ONLY: no card or member page carries it (they pick `location`).\n * Absent for a location stored as text before 0.19.0.\n */\n place: placeSchema.optional(),\n venture: ventureSchema.optional(),\n skills: z.array(skillSchema).max(SKILLS_MAX).default([]),\n goals: z.array(goalSchema).max(GOAL_VALUES.length).default([]),\n links: founderLinksSchema.default({}),\n /**\n * Their contribution to other founders. Server-computed, never written by a\n * member. REQUIRED, no default: a read-side default would let a server that\n * forgot the field pass as a real zero.\n */\n contribution: contributionSummarySchema,\n createdAt: z.iso.datetime(),\n updatedAt: z.iso.datetime(),\n});\nexport type FounderProfile = z.infer<typeof founderProfileSchema>;\n\n/**\n * What one founder sees of another in Discover and on a profile page.\n *\n * Built server-side. Keep it a strict subset of `founderProfileSchema` — if a\n * private field ever needs to show here, that is a product decision, not an\n * accident of spreading the full document.\n */\n// ⚠ The web's Discover cache follows the member's own saves of exactly these\n// fields (`discoverChangedBy` in the web's features/profile/api.ts derives its\n// list from this shape): adding a field here is enough, there is no second list.\nexport const founderCardSchema = founderProfileSchema.pick({\n id: true,\n /**\n * The MEMBER's id (0.6.0): what a team invitation, a chat and every byline\n * key on. `id` is the profile's own id, which nothing takes as input.\n */\n userId: true,\n username: true,\n displayName: true,\n headline: true,\n avatarUrl: true,\n location: true,\n venture: true,\n skills: true,\n goals: true,\n contribution: true,\n});\nexport type FounderCard = z.infer<typeof founderCardSchema>;\n\n/** The fields a Discover card shows. */\nexport const FOUNDER_CARD_FIELDS = founderCardSchema.keyof().options;\nexport type FounderCardField = (typeof FOUNDER_CARD_FIELDS)[number];\n\n/**\n * The card fields a member's own edit can change, the ones that move them up\n * Discover: every card field but the ids, which never change, and the points\n * (`contribution`), which other people's acts move all day and which would\n * otherwise reorder Discover with every helpful mark.\n */\nexport const FOUNDER_CARD_EDIT_FIELDS = FOUNDER_CARD_FIELDS.filter(\n (field) => field !== 'id' && field !== 'userId' && field !== 'contribution',\n);\n\n/**\n * Whether a write changed what a member's Discover card shows (0.18.0): ONE\n * rule for every profile writer, which decides whether the member moves up\n * Discover (its \"recently updated\" order) and whether a client reloads it.\n * `changed` names the fields the write actually changed: a body's keys, or\n * for the business editor `venture` only when its PUBLIC part changed. Before\n * 0.18.0 five writers decided it four ways: an edit to the About text alone\n * lifted a member to the top of everyone's Discover, a new username never did.\n * Points never count (`FOUNDER_CARD_EDIT_FIELDS`): they are not the member's\n * edit.\n */\nexport function changesDiscoverCard(changed: readonly string[]): boolean {\n return changed.some((field) => (FOUNDER_CARD_EDIT_FIELDS as readonly string[]).includes(field));\n}\n\n// ─── What a member chooses to show (0.11.0) ──────────────────────────────────\n\n/**\n * The four personal details a member MAY show on their profile page (the\n * user's ruling, 2026-10-11). Each is PRIVATE until its owner turns it on;\n * everything else on a profile is public as before. Changed only through\n * `PATCH /profiles/me/personal`.\n */\nexport const CONTACT_VISIBILITY_FIELDS = ['email', 'phone', 'gender', 'birthday'] as const;\nexport type ContactVisibilityField = (typeof CONTACT_VISIBILITY_FIELDS)[number];\n\n/**\n * WHO sees each of the four once its owner turns it on (0.18.0). The user,\n * 2026-10-20: \"any person who has the platform membership can view them if\n * they are public\", so all four go to members only (and to the member\n * themself), never to an account without membership. One table: the server\n * builds `shown` from it, and every screen words its switch from it.\n */\nexport const PROFILE_AUDIENCE_VALUES = ['members'] as const;\nexport type ProfileAudience = (typeof PROFILE_AUDIENCE_VALUES)[number];\nexport const CONTACT_VISIBILITY_AUDIENCE = {\n email: 'members',\n phone: 'members',\n gender: 'members',\n birthday: 'members',\n} as const satisfies Record<ContactVisibilityField, ProfileAudience>;\n\n/** Which of the four the member shows. Every key present on a read: false is private. */\nexport const contactVisibilitySchema = z.object(\n Object.fromEntries(CONTACT_VISIBILITY_FIELDS.map((field) => [field, z.boolean()])) as Record<\n ContactVisibilityField,\n z.ZodBoolean\n >,\n);\nexport type ContactVisibility = z.infer<typeof contactVisibilitySchema>;\n\n/**\n * A birthday as OTHERS see it: day and month, NEVER the year (the user's\n * ruling). The year would give away the age and, with the name, the full date\n * of birth that identity checks ask for. The year is never on the wire.\n */\nexport const publicBirthdaySchema = z.object({\n day: z.number().int().min(1).max(31),\n month: z.number().int().min(1).max(12),\n});\nexport type PublicBirthday = z.infer<typeof publicBirthdaySchema>;\n\n/**\n * `GET /api/v1/founders/by-username/:username` (0.11.0): one member's profile\n * page, as a signed-in member (or the member themself) sees it.\n *\n * The card's fields, what only a page has room for (about, links, member\n * since), and `shown`: the personal details this member has CHOSEN to show,\n * and nothing else, to the audience `CONTACT_VISIBILITY_AUDIENCE` names\n * (members only, all four, 0.18.0); the server decides, and a client renders\n * what arrives. Built field by field on the server\n * (`toMemberPublic`), never by dropping fields from a fuller document.\n *\n * `viewer.canMessage` is the server's answer to \"offer Message\": the tap\n * opens a conversation, or (0.13.0) the sheet that makes one possible (the\n * membership for a viewer, the plans for a member without one). Who may\n * message whom follows membership and plans, so no client works it out.\n */\nexport const memberProfileSchema = founderProfileSchema\n .pick({\n id: true,\n userId: true,\n username: true,\n displayName: true,\n headline: true,\n about: true,\n avatarUrl: true,\n location: true,\n venture: true,\n skills: true,\n goals: true,\n links: true,\n contribution: true,\n createdAt: true,\n })\n .extend({\n shown: z.object({\n email: z.string().optional(),\n phone: z.string().optional(),\n gender: genderSchema.optional(),\n birthday: publicBirthdaySchema.optional(),\n }),\n viewer: z.object({ isSelf: z.boolean(), canMessage: z.boolean() }),\n /** How many follow them and whom they follow, counted when read (2026-11-20). */\n follows: followCountsSchema,\n /** The viewer and them (2026-11-20): all false for the viewer's own page. */\n follow: followRelationSchema,\n });\nexport type MemberProfile = z.infer<typeof memberProfileSchema>;\n\n/** The member page's address: `/discover/<username>`. */\nexport const memberHandleParamsSchema = z.object({ username: usernameSchema });\nexport type MemberHandleParams = z.infer<typeof memberHandleParamsSchema>;\n\n// ─── Write bodies ────────────────────────────────────────────────────────────\n\n/**\n * A text field the member is allowed to empty.\n *\n * Three states, and they are deliberately distinct:\n * absent do not touch this field\n * null clear it (the backend turns this into an `$unset`)\n * \"\" REJECTED\n *\n * The empty string is refused on purpose. A form that forgets to convert a\n * cleared input to `null` then fails loudly at the boundary, instead of being\n * silently dropped and leaving the member staring at text they just deleted.\n * `optionalTrimmedString` does the dropping, which is right for a create body\n * and wrong for a patch.\n */\nconst clearableText = (maxLength: number) =>\n z.string().trim().min(1, VALIDATION_MESSAGE.clearWithNull).max(maxLength).nullable().optional();\n\n/**\n * Patch body for the Me tab. Only the keys the member actually changed.\n *\n * ⚠️ Written as its own object ON PURPOSE. Do NOT rebuild it as\n * `founderProfileSchema.pick({...}).partial()`: `.partial()` does not switch\n * off `.default()`, so `skills`, `goals` and `links` would materialise as\n * `[]`, `[]` and `{}` on every request, including an empty one. Under a `$set`\n * that wipes a member's skills and every one of their links the moment they\n * edit their display name. `tsc` cannot see it and the request looks correct in\n * the network tab.\n *\n * The rule this comes from: defaults belong on the READ side. A write body\n * states what the caller sent and nothing else.\n *\n * ONE WRITER PER FIELD (0.18.0): the name and the city are the personal\n * details' (`PATCH /profiles/me/personal`), the venture is the business\n * editor's (`PUT /profiles/me/business`), the handle has its own route. They\n * were taken here too, a second path with its own rules for Discover's order.\n * STRICT: any other key is refused (a 400 naming it), never dropped without a\n * word, so a client still sending a name here learns it at once instead of\n * losing the member's edit.\n */\nexport const updateFounderProfileBodySchema = z\n .object({\n headline: clearableText(HEADLINE_MAX),\n about: clearableText(ABOUT_MAX),\n /** The same list rules as onboarding's finish (each value once, 0.17.0). */\n skills: skillListSchema.optional(),\n /**\n * The same rules as onboarding's finish, its minimum included (0.18.0, the\n * user: \"we already have at least one goal required\"): Me cannot save a\n * member down to no goals.\n */\n goals: requiredGoalListSchema.optional(),\n /** Sent whole. To drop one link, send the object without that key. */\n links: founderLinksSchema.optional(),\n })\n .strict();\nexport type UpdateFounderProfileBody = z.infer<typeof updateFounderProfileBodySchema>;\n\n/**\n * Username change. Separate from the profile patch because it needs a\n * uniqueness check, and it refuses a reserved handle (`chosenUsernameSchema`).\n */\nexport const updateUsernameBodySchema = z.object({ username: chosenUsernameSchema });\nexport type UpdateUsernameBody = z.infer<typeof updateUsernameBodySchema>;\n\n/** `GET /api/v1/profiles/username-available?username=` (0.13.0): the handle asked about. */\nexport const usernameAvailabilityQuerySchema = z.object({ username: usernameSchema });\nexport type UsernameAvailabilityQuery = z.infer<typeof usernameAvailabilityQuerySchema>;\n\n/** Why a username is not available. */\nexport const USERNAME_UNAVAILABLE_REASON_VALUES = ['taken', 'reserved'] as const;\nexport type UsernameUnavailableReason = (typeof USERNAME_UNAVAILABLE_REASON_VALUES)[number];\n\nexport const usernameAvailabilitySchema = z.object({\n username: usernameSchema,\n available: z.boolean(),\n /** Present when unavailable. */\n reason: z.enum(USERNAME_UNAVAILABLE_REASON_VALUES).optional(),\n});\nexport type UsernameAvailability = z.infer<typeof usernameAvailabilitySchema>;\n\n// ─── The member's own personal details ──────────────────────────────────────\n\n/**\n * `GET /api/v1/profiles/me/personal` (0.10.0): what ONLY the member sees of\n * themselves, the \"Personal details\" card of the Me tab's Profile.\n *\n * ⚠ OWNER ONLY, and kept OFF `founderProfileSchema` on purpose. Email, phone,\n * gender and date of birth are personal data: they appear on no card, no\n * search, no team list, no byline and no audit detail. The profile is read on\n * every page by the app shell; these do not travel with it, they are asked\n * for only where they are shown.\n *\n * Read shapes are plain where the stored value may predate today's rule (a\n * phone seeded from the sign-in provider in another format): a read schema\n * that rejects our own stored value is a self-inflicted outage. The write\n * body holds the rules.\n */\nexport const myPersonalDetailsSchema = z.object({\n /** First and last name joined, derived (0.20.0): the card's first row. */\n displayName: z.string(),\n /** As stored (0.20.0): what Me's \"Full name\" box is filled from, joined. */\n firstName: z.string(),\n lastName: z.string(),\n /** The sign-in account's. Changed there (Account settings), never here. */\n email: z.string().optional(),\n /** Ten digits as stored on the account mirror; display adds the `+91`. */\n phone: z.string().optional(),\n gender: genderSchema.optional(),\n /**\n * `YYYY-MM-DD`. READ ONLY: it is the 18+ check's input, given once at\n * onboarding. A date of birth that could be edited later would be an age\n * gate anyone could walk around.\n */\n dateOfBirth: z.string().optional(),\n /** Which of email, phone, gender and birthday the member shows on their page (0.11.0). */\n visibility: contactVisibilitySchema,\n});\nexport type MyPersonalDetails = z.infer<typeof myPersonalDetailsSchema>;\n\n/**\n * `PATCH /api/v1/profiles/me/personal` (0.10.0): name, phone and gender. Only\n * the keys the member changed; answers with `myPersonalDetailsSchema`.\n *\n * ONE RULE PER FIELD: the very schemas onboarding finishes with (the display\n * name, the ten-digit phone, the gender enum with prefer-not-to-say), so a\n * value one accepts the other can never refuse.\n *\n * ⚠ NO `.default()` and no `.partial()` of a read shape (see\n * `updateFounderProfileBodySchema`): absent means unchanged, and a default\n * would overwrite what is stored. No `dateOfBirth`: read only, above. No\n * `email`: the sign-in account owns it.\n *\n * Name and phone are PRODUCT-OWNED on Founder Circle's account mirror: the\n * sign-in service seeds them once and never overwrites them, so this edits\n * Founder Circle's copy and never calls the sign-in service.\n */\nexport const updateMyPersonalDetailsBodySchema = z.object({\n /**\n * The full name as typed (0.20.0; `displayName` until 0.19.0): the server\n * splits it at the first space into first and last name and derives the\n * display name from them (`splitFullName`, `joinFullName`).\n */\n fullName: fullNameSchema.optional(),\n phone: phoneSchema.optional(),\n gender: genderSchema.optional(),\n /**\n * The location, or `null` to remove it (0.11.0): it moved to the Personal\n * Details card, so its editor saves it here, with the rest, in one\n * transaction; only here since 0.18.0 (`PATCH /profiles/me` took it too).\n * Area ids from the drawer or GPS (0.19.0, `locationPickSchema`): the server\n * names the place and its public city from `master_db`.\n */\n location: locationPickSchema.nullable().optional(),\n /** Only the switches that changed (0.11.0). */\n visibility: contactVisibilitySchema.partial().optional(),\n});\nexport type UpdateMyPersonalDetailsBody = z.infer<typeof updateMyPersonalDetailsBodySchema>;\n\n// ─── The member's own photo ──────────────────────────────────────────────────\n\n/**\n * `PUT /api/v1/profiles/me/avatar`: use a completed upload (purpose `avatar`)\n * as the member's photo. Answers with the updated `founderProfileSchema`.\n *\n * The previous photo is deleted from storage, not merely unlinked, so its old\n * address stops working. `DELETE /api/v1/profiles/me/avatar` removes the photo\n * the same way and the member falls back to their sign-in provider's picture.\n */\nexport const setAvatarBodySchema = z.object({ mediaId: objectIdSchema });\nexport type SetAvatarBody = z.infer<typeof setAvatarBodySchema>;\n\n/**\n * `PATCH /api/v1/profiles/me/photo-settings` (0.20.0): show or hide the\n * sign-in provider's picture (Google's). Off, a member with no upload appears\n * with their initials everywhere. Answers with the updated `founderProfileSchema`.\n */\nexport const updatePhotoSettingsBodySchema = z.object({ useProviderPhoto: z.boolean() }).strict();\nexport type UpdatePhotoSettingsBody = z.infer<typeof updatePhotoSettingsBodySchema>;\n"]}
@@ -1,27 +1,38 @@
1
1
  /**
2
- * The member's own answers that NOBODY ELSE sees (0.16.0): their business's
3
- * type and registration, and their interests. The Me tab reads and writes
4
- * them on routes of their own, like the personal details, and they travel on
5
- * no other response: not on `founderProfileSchema` (the app shell reads that on
2
+ * The member's own answers, read and written on routes of their own in the
3
+ * Me tab, like the personal details (0.16.0): how their business is
4
+ * registered, and their interests (its type went, 2026-11-22).
5
+ *
6
+ * How their business is registered: NOBODY ELSE sees it. It travels on no
7
+ * other response: not on `founderProfileSchema` (the app shell reads that on
6
8
  * every page), not on a card, a member's page, a byline or Discover.
7
9
  *
10
+ * The interests: OTHERS SEE THEM on the member's People card (2026-11-22, the
11
+ * user's card: Discover > People and the followers and following lists,
12
+ * `personCardSchema.interests`). Nowhere else: not on `founderProfileSchema`,
13
+ * the founder card, the member's page or a byline.
14
+ *
8
15
  * GET /api/v1/profiles/me/business `myBusinessSchema`
9
16
  * PUT /api/v1/profiles/me/business `putMyBusinessBodySchema`, answers `myBusinessSchema`
10
17
  * GET /api/v1/profiles/me/interests `myInterestsSchema`
11
18
  * PUT /api/v1/profiles/me/interests `putMyInterestsBodySchema`, answers `myInterestsSchema`
12
19
  *
13
20
  * In its own file because it joins two domains: the profile's venture and
14
- * onboarding's vocabularies (business types, registrations, topics), and
15
- * onboarding already imports the profile.
21
+ * onboarding's vocabularies (registrations, topics), and onboarding already
22
+ * imports the profile.
16
23
  *
17
24
  * @module domains/profile/my-profile
18
25
  */
19
26
  import { z } from 'zod';
20
27
  /**
21
28
  * The member's venture as only they see it: what everyone sees
22
- * (`ventureSchema`) plus its business type and how it is registered, which are
23
- * PRIVATE (the Me tab marks them so). Stored together on the profile's
24
- * venture, so they live and go with it: no business, no type, no registration.
29
+ * (`ventureSchema`, its roles included) plus how it is registered, which is
30
+ * PRIVATE (the Me tab marks it so). Stored together on the profile's venture,
31
+ * so it lives and goes with it: no business, no registration.
32
+ *
33
+ * The business TYPE went (2026-11-22, the user: "remove busines type field").
34
+ * An older client still sending it is not refused: this is a plain object, so
35
+ * the key is dropped.
25
36
  *
26
37
  * ONE RULE PER FIELD: the very schemas onboarding finishes with.
27
38
  */
@@ -62,17 +73,83 @@ export declare const myVentureSchema: z.ZodObject<{
62
73
  profitable: "profitable";
63
74
  exited: "exited";
64
75
  }>;
76
+ roles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
77
+ founder: "founder";
78
+ other: "other";
79
+ co_founder: "co_founder";
80
+ ceo: "ceo";
81
+ cto: "cto";
82
+ coo: "coo";
83
+ cfo: "cfo";
84
+ cmo: "cmo";
85
+ cpo: "cpo";
86
+ }>>>;
65
87
  teamSize: z.ZodOptional<z.ZodNumber>;
66
88
  foundedYear: z.ZodOptional<z.ZodNumber>;
67
- businessType: z.ZodOptional<z.ZodEnum<{
68
- startup: "startup";
69
- sme: "sme";
70
- enterprise: "enterprise";
71
- freelancer: "freelancer";
72
- agency: "agency";
73
- social_enterprise: "social_enterprise";
74
- family_business: "family_business";
75
- franchise: "franchise";
89
+ legalStructure: z.ZodOptional<z.ZodEnum<{
90
+ not_registered: "not_registered";
91
+ sole_proprietorship: "sole_proprietorship";
92
+ partnership: "partnership";
93
+ llp: "llp";
94
+ opc: "opc";
95
+ private_limited: "private_limited";
96
+ public_limited: "public_limited";
97
+ section_8: "section_8";
98
+ trust_or_society: "trust_or_society";
99
+ cooperative: "cooperative";
100
+ registered_abroad: "registered_abroad";
101
+ }>>;
102
+ }, z.core.$strip>;
103
+ /** The business as Me's editor WRITES it: the roles required (`ventureWriteSchema`, 2026-11-22). */
104
+ export declare const myVentureWriteSchema: z.ZodObject<{
105
+ name: z.ZodString;
106
+ tagline: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<string | undefined, string>>>;
107
+ website: z.ZodOptional<z.ZodURL>;
108
+ industry: z.ZodEnum<{
109
+ agritech: "agritech";
110
+ ai_ml: "ai_ml";
111
+ b2b_saas: "b2b_saas";
112
+ consumer: "consumer";
113
+ climate: "climate";
114
+ d2c: "d2c";
115
+ deeptech: "deeptech";
116
+ edtech: "edtech";
117
+ fintech: "fintech";
118
+ gaming: "gaming";
119
+ healthtech: "healthtech";
120
+ logistics: "logistics";
121
+ manufacturing: "manufacturing";
122
+ marketplace: "marketplace";
123
+ media: "media";
124
+ mobility: "mobility";
125
+ proptech: "proptech";
126
+ robotics: "robotics";
127
+ services: "services";
128
+ space: "space";
129
+ other: "other";
130
+ }>;
131
+ stage: z.ZodEnum<{
132
+ idea: "idea";
133
+ validation: "validation";
134
+ mvp: "mvp";
135
+ pre_seed: "pre_seed";
136
+ seed: "seed";
137
+ series_a_plus: "series_a_plus";
138
+ profitable: "profitable";
139
+ exited: "exited";
140
+ }>;
141
+ teamSize: z.ZodOptional<z.ZodNumber>;
142
+ foundedYear: z.ZodOptional<z.ZodNumber>;
143
+ roles: z.ZodArray<z.ZodEnum<{
144
+ founder: "founder";
145
+ other: "other";
146
+ co_founder: "co_founder";
147
+ ceo: "ceo";
148
+ cto: "cto";
149
+ coo: "coo";
150
+ cfo: "cfo";
151
+ cmo: "cmo";
152
+ cpo: "cpo";
76
153
  }>>;
77
154
  legalStructure: z.ZodOptional<z.ZodEnum<{
78
155
  not_registered: "not_registered";
@@ -128,18 +205,19 @@ export declare const myBusinessSchema: z.ZodObject<{
128
205
  profitable: "profitable";
129
206
  exited: "exited";
130
207
  }>;
208
+ roles: z.ZodOptional<z.ZodArray<z.ZodEnum<{
209
+ founder: "founder";
210
+ other: "other";
211
+ co_founder: "co_founder";
212
+ ceo: "ceo";
213
+ cto: "cto";
214
+ coo: "coo";
215
+ cfo: "cfo";
216
+ cmo: "cmo";
217
+ cpo: "cpo";
218
+ }>>>;
131
219
  teamSize: z.ZodOptional<z.ZodNumber>;
132
220
  foundedYear: z.ZodOptional<z.ZodNumber>;
133
- businessType: z.ZodOptional<z.ZodEnum<{
134
- startup: "startup";
135
- sme: "sme";
136
- enterprise: "enterprise";
137
- freelancer: "freelancer";
138
- agency: "agency";
139
- social_enterprise: "social_enterprise";
140
- family_business: "family_business";
141
- franchise: "franchise";
142
- }>>;
143
221
  legalStructure: z.ZodOptional<z.ZodEnum<{
144
222
  not_registered: "not_registered";
145
223
  sole_proprietorship: "sole_proprietorship";
@@ -159,7 +237,7 @@ export type MyBusiness = z.infer<typeof myBusinessSchema>;
159
237
  /**
160
238
  * `PUT /api/v1/profiles/me/business`: the WHOLE business as the editor holds
161
239
  * it, or `null` to remove it. A key left out of the venture is removed (a
162
- * tagline, a website, the type, the registration): PUT, not a patch, because
240
+ * tagline, a website, the roles, the registration): PUT, not a patch, because
163
241
  * the editor always holds all of it.
164
242
  */
165
243
  export declare const putMyBusinessBodySchema: z.ZodObject<{
@@ -202,15 +280,16 @@ export declare const putMyBusinessBodySchema: z.ZodObject<{
202
280
  }>;
203
281
  teamSize: z.ZodOptional<z.ZodNumber>;
204
282
  foundedYear: z.ZodOptional<z.ZodNumber>;
205
- businessType: z.ZodOptional<z.ZodEnum<{
206
- startup: "startup";
207
- sme: "sme";
208
- enterprise: "enterprise";
209
- freelancer: "freelancer";
210
- agency: "agency";
211
- social_enterprise: "social_enterprise";
212
- family_business: "family_business";
213
- franchise: "franchise";
283
+ roles: z.ZodArray<z.ZodEnum<{
284
+ founder: "founder";
285
+ other: "other";
286
+ co_founder: "co_founder";
287
+ ceo: "ceo";
288
+ cto: "cto";
289
+ coo: "coo";
290
+ cfo: "cfo";
291
+ cmo: "cmo";
292
+ cpo: "cpo";
214
293
  }>>;
215
294
  legalStructure: z.ZodOptional<z.ZodEnum<{
216
295
  not_registered: "not_registered";
@@ -244,7 +323,6 @@ export declare const myInterestsSchema: z.ZodObject<{
244
323
  marketing: "marketing";
245
324
  supply_chain: "supply_chain";
246
325
  fundraising: "fundraising";
247
- social_enterprise: "social_enterprise";
248
326
  mentoring: "mentoring";
249
327
  leadership: "leadership";
250
328
  networking: "networking";
@@ -303,6 +381,7 @@ export declare const myInterestsSchema: z.ZodObject<{
303
381
  environmental: "environmental";
304
382
  women_empowerment: "women_empowerment";
305
383
  community_service: "community_service";
384
+ social_enterprise: "social_enterprise";
306
385
  education_access: "education_access";
307
386
  }>>;
308
387
  }, z.core.$strip>;
@@ -320,7 +399,6 @@ export declare const putMyInterestsBodySchema: z.ZodObject<{
320
399
  marketing: "marketing";
321
400
  supply_chain: "supply_chain";
322
401
  fundraising: "fundraising";
323
- social_enterprise: "social_enterprise";
324
402
  mentoring: "mentoring";
325
403
  leadership: "leadership";
326
404
  networking: "networking";
@@ -379,6 +457,7 @@ export declare const putMyInterestsBodySchema: z.ZodObject<{
379
457
  environmental: "environmental";
380
458
  women_empowerment: "women_empowerment";
381
459
  community_service: "community_service";
460
+ social_enterprise: "social_enterprise";
382
461
  education_access: "education_access";
383
462
  }>>;
384
463
  }, z.core.$strip>;
@@ -1 +1 @@
1
- {"version":3,"file":"my-profile.d.ts","sourceRoot":"","sources":["../../../src/domains/profile/my-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAWxB;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,gFAAgF;AAChF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAoD,CAAC;AAClF,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAoD,CAAC;AACzF,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAIxE;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgD,CAAC;AAC/E,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgD,CAAC;AAC/E,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,yGAAyG;AACzG,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAA2C,CAAC;AACjF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -1,35 +1,49 @@
1
1
  /**
2
- * The member's own answers that NOBODY ELSE sees (0.16.0): their business's
3
- * type and registration, and their interests. The Me tab reads and writes
4
- * them on routes of their own, like the personal details, and they travel on
5
- * no other response: not on `founderProfileSchema` (the app shell reads that on
2
+ * The member's own answers, read and written on routes of their own in the
3
+ * Me tab, like the personal details (0.16.0): how their business is
4
+ * registered, and their interests (its type went, 2026-11-22).
5
+ *
6
+ * How their business is registered: NOBODY ELSE sees it. It travels on no
7
+ * other response: not on `founderProfileSchema` (the app shell reads that on
6
8
  * every page), not on a card, a member's page, a byline or Discover.
7
9
  *
10
+ * The interests: OTHERS SEE THEM on the member's People card (2026-11-22, the
11
+ * user's card: Discover > People and the followers and following lists,
12
+ * `personCardSchema.interests`). Nowhere else: not on `founderProfileSchema`,
13
+ * the founder card, the member's page or a byline.
14
+ *
8
15
  * GET /api/v1/profiles/me/business `myBusinessSchema`
9
16
  * PUT /api/v1/profiles/me/business `putMyBusinessBodySchema`, answers `myBusinessSchema`
10
17
  * GET /api/v1/profiles/me/interests `myInterestsSchema`
11
18
  * PUT /api/v1/profiles/me/interests `putMyInterestsBodySchema`, answers `myInterestsSchema`
12
19
  *
13
20
  * In its own file because it joins two domains: the profile's venture and
14
- * onboarding's vocabularies (business types, registrations, topics), and
15
- * onboarding already imports the profile.
21
+ * onboarding's vocabularies (registrations, topics), and onboarding already
22
+ * imports the profile.
16
23
  *
17
24
  * @module domains/profile/my-profile
18
25
  */
19
26
  import { z } from 'zod';
20
- import { businessTypeSchema, interestsSchema, legalStructureSchema, topicSchema, } from '../onboarding/onboarding.js';
21
- import { ventureSchema } from './founder-profile.js';
27
+ import { interestsSchema, legalStructureSchema, topicSchema } from '../onboarding/onboarding.js';
28
+ import { ventureSchema, ventureWriteSchema } from './founder-profile.js';
22
29
  // ─── The business ────────────────────────────────────────────────────────────
23
30
  /**
24
31
  * The member's venture as only they see it: what everyone sees
25
- * (`ventureSchema`) plus its business type and how it is registered, which are
26
- * PRIVATE (the Me tab marks them so). Stored together on the profile's
27
- * venture, so they live and go with it: no business, no type, no registration.
32
+ * (`ventureSchema`, its roles included) plus how it is registered, which is
33
+ * PRIVATE (the Me tab marks it so). Stored together on the profile's venture,
34
+ * so it lives and goes with it: no business, no registration.
35
+ *
36
+ * The business TYPE went (2026-11-22, the user: "remove busines type field").
37
+ * An older client still sending it is not refused: this is a plain object, so
38
+ * the key is dropped.
28
39
  *
29
40
  * ONE RULE PER FIELD: the very schemas onboarding finishes with.
30
41
  */
31
42
  export const myVentureSchema = ventureSchema.extend({
32
- businessType: businessTypeSchema.optional(),
43
+ legalStructure: legalStructureSchema.optional(),
44
+ });
45
+ /** The business as Me's editor WRITES it: the roles required (`ventureWriteSchema`, 2026-11-22). */
46
+ export const myVentureWriteSchema = ventureWriteSchema.extend({
33
47
  legalStructure: legalStructureSchema.optional(),
34
48
  });
35
49
  /** `GET /api/v1/profiles/me/business`: absent `venture` = no business added. */
@@ -37,10 +51,10 @@ export const myBusinessSchema = z.object({ venture: myVentureSchema.optional() }
37
51
  /**
38
52
  * `PUT /api/v1/profiles/me/business`: the WHOLE business as the editor holds
39
53
  * it, or `null` to remove it. A key left out of the venture is removed (a
40
- * tagline, a website, the type, the registration): PUT, not a patch, because
54
+ * tagline, a website, the roles, the registration): PUT, not a patch, because
41
55
  * the editor always holds all of it.
42
56
  */
43
- export const putMyBusinessBodySchema = z.object({ venture: myVentureSchema.nullable() });
57
+ export const putMyBusinessBodySchema = z.object({ venture: myVentureWriteSchema.nullable() });
44
58
  // ─── The interests ───────────────────────────────────────────────────────────
45
59
  /**
46
60
  * `GET /api/v1/profiles/me/interests`: the topics the member wants to read
@@ -1 +1 @@
1
- {"version":3,"file":"my-profile.js","sourceRoot":"","sources":["../../../src/domains/profile/my-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,WAAW,GACZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,gFAAgF;AAEhF;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC;IAClD,YAAY,EAAE,kBAAkB,CAAC,QAAQ,EAAE;IAC3C,cAAc,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAGH,gFAAgF;AAChF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAGlF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAGzF,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;AAG/E,yGAAyG;AACzG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC","sourcesContent":["/**\n * The member's own answers that NOBODY ELSE sees (0.16.0): their business's\n * type and registration, and their interests. The Me tab reads and writes\n * them on routes of their own, like the personal details, and they travel on\n * no other response: not on `founderProfileSchema` (the app shell reads that on\n * every page), not on a card, a member's page, a byline or Discover.\n *\n * GET /api/v1/profiles/me/business `myBusinessSchema`\n * PUT /api/v1/profiles/me/business `putMyBusinessBodySchema`, answers `myBusinessSchema`\n * GET /api/v1/profiles/me/interests `myInterestsSchema`\n * PUT /api/v1/profiles/me/interests `putMyInterestsBodySchema`, answers `myInterestsSchema`\n *\n * In its own file because it joins two domains: the profile's venture and\n * onboarding's vocabularies (business types, registrations, topics), and\n * onboarding already imports the profile.\n *\n * @module domains/profile/my-profile\n */\n\nimport { z } from 'zod';\nimport {\n businessTypeSchema,\n interestsSchema,\n legalStructureSchema,\n topicSchema,\n} from '../onboarding/onboarding.js';\nimport { ventureSchema } from './founder-profile.js';\n\n// ─── The business ────────────────────────────────────────────────────────────\n\n/**\n * The member's venture as only they see it: what everyone sees\n * (`ventureSchema`) plus its business type and how it is registered, which are\n * PRIVATE (the Me tab marks them so). Stored together on the profile's\n * venture, so they live and go with it: no business, no type, no registration.\n *\n * ONE RULE PER FIELD: the very schemas onboarding finishes with.\n */\nexport const myVentureSchema = ventureSchema.extend({\n businessType: businessTypeSchema.optional(),\n legalStructure: legalStructureSchema.optional(),\n});\nexport type MyVenture = z.infer<typeof myVentureSchema>;\n\n/** `GET /api/v1/profiles/me/business`: absent `venture` = no business added. */\nexport const myBusinessSchema = z.object({ venture: myVentureSchema.optional() });\nexport type MyBusiness = z.infer<typeof myBusinessSchema>;\n\n/**\n * `PUT /api/v1/profiles/me/business`: the WHOLE business as the editor holds\n * it, or `null` to remove it. A key left out of the venture is removed (a\n * tagline, a website, the type, the registration): PUT, not a patch, because\n * the editor always holds all of it.\n */\nexport const putMyBusinessBodySchema = z.object({ venture: myVentureSchema.nullable() });\nexport type PutMyBusinessBody = z.infer<typeof putMyBusinessBodySchema>;\n\n// ─── The interests ───────────────────────────────────────────────────────────\n\n/**\n * `GET /api/v1/profiles/me/interests`: the topics the member wants to read\n * about. A read shape, plain: a list stored under an older rule still reads.\n */\nexport const myInterestsSchema = z.object({ interests: z.array(topicSchema) });\nexport type MyInterests = z.infer<typeof myInterestsSchema>;\n\n/** `PUT /api/v1/profiles/me/interests`: the whole list, by onboarding's own rule (`interestsSchema`). */\nexport const putMyInterestsBodySchema = z.object({ interests: interestsSchema });\nexport type PutMyInterestsBody = z.infer<typeof putMyInterestsBodySchema>;\n"]}
1
+ {"version":3,"file":"my-profile.js","sourceRoot":"","sources":["../../../src/domains/profile/my-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEzE,gFAAgF;AAEhF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,CAAC,MAAM,CAAC;IAClD,cAAc,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAEH,oGAAoG;AACpG,MAAM,CAAC,MAAM,oBAAoB,GAAG,kBAAkB,CAAC,MAAM,CAAC;IAC5D,cAAc,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAGH,gFAAgF;AAChF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,eAAe,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAGlF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,oBAAoB,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAG9F,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;AAG/E,yGAAyG;AACzG,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC,CAAC","sourcesContent":["/**\n * The member's own answers, read and written on routes of their own in the\n * Me tab, like the personal details (0.16.0): how their business is\n * registered, and their interests (its type went, 2026-11-22).\n *\n * How their business is registered: NOBODY ELSE sees it. It travels on no\n * other response: not on `founderProfileSchema` (the app shell reads that on\n * every page), not on a card, a member's page, a byline or Discover.\n *\n * The interests: OTHERS SEE THEM on the member's People card (2026-11-22, the\n * user's card: Discover > People and the followers and following lists,\n * `personCardSchema.interests`). Nowhere else: not on `founderProfileSchema`,\n * the founder card, the member's page or a byline.\n *\n * GET /api/v1/profiles/me/business `myBusinessSchema`\n * PUT /api/v1/profiles/me/business `putMyBusinessBodySchema`, answers `myBusinessSchema`\n * GET /api/v1/profiles/me/interests `myInterestsSchema`\n * PUT /api/v1/profiles/me/interests `putMyInterestsBodySchema`, answers `myInterestsSchema`\n *\n * In its own file because it joins two domains: the profile's venture and\n * onboarding's vocabularies (registrations, topics), and onboarding already\n * imports the profile.\n *\n * @module domains/profile/my-profile\n */\n\nimport { z } from 'zod';\nimport { interestsSchema, legalStructureSchema, topicSchema } from '../onboarding/onboarding.js';\nimport { ventureSchema, ventureWriteSchema } from './founder-profile.js';\n\n// ─── The business ────────────────────────────────────────────────────────────\n\n/**\n * The member's venture as only they see it: what everyone sees\n * (`ventureSchema`, its roles included) plus how it is registered, which is\n * PRIVATE (the Me tab marks it so). Stored together on the profile's venture,\n * so it lives and goes with it: no business, no registration.\n *\n * The business TYPE went (2026-11-22, the user: \"remove busines type field\").\n * An older client still sending it is not refused: this is a plain object, so\n * the key is dropped.\n *\n * ONE RULE PER FIELD: the very schemas onboarding finishes with.\n */\nexport const myVentureSchema = ventureSchema.extend({\n legalStructure: legalStructureSchema.optional(),\n});\n\n/** The business as Me's editor WRITES it: the roles required (`ventureWriteSchema`, 2026-11-22). */\nexport const myVentureWriteSchema = ventureWriteSchema.extend({\n legalStructure: legalStructureSchema.optional(),\n});\nexport type MyVenture = z.infer<typeof myVentureSchema>;\n\n/** `GET /api/v1/profiles/me/business`: absent `venture` = no business added. */\nexport const myBusinessSchema = z.object({ venture: myVentureSchema.optional() });\nexport type MyBusiness = z.infer<typeof myBusinessSchema>;\n\n/**\n * `PUT /api/v1/profiles/me/business`: the WHOLE business as the editor holds\n * it, or `null` to remove it. A key left out of the venture is removed (a\n * tagline, a website, the roles, the registration): PUT, not a patch, because\n * the editor always holds all of it.\n */\nexport const putMyBusinessBodySchema = z.object({ venture: myVentureWriteSchema.nullable() });\nexport type PutMyBusinessBody = z.infer<typeof putMyBusinessBodySchema>;\n\n// ─── The interests ───────────────────────────────────────────────────────────\n\n/**\n * `GET /api/v1/profiles/me/interests`: the topics the member wants to read\n * about. A read shape, plain: a list stored under an older rule still reads.\n */\nexport const myInterestsSchema = z.object({ interests: z.array(topicSchema) });\nexport type MyInterests = z.infer<typeof myInterestsSchema>;\n\n/** `PUT /api/v1/profiles/me/interests`: the whole list, by onboarding's own rule (`interestsSchema`). */\nexport const putMyInterestsBodySchema = z.object({ interests: interestsSchema });\nexport type PutMyInterestsBody = z.infer<typeof putMyInterestsBodySchema>;\n"]}