gymmonk-schema 0.2.0 → 0.3.1

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 (97) hide show
  1. package/dist/announcement.d.ts +56 -0
  2. package/dist/announcement.d.ts.map +1 -0
  3. package/dist/announcement.js +40 -0
  4. package/dist/announcement.js.map +1 -0
  5. package/dist/center.d.ts +381 -0
  6. package/dist/center.d.ts.map +1 -0
  7. package/dist/center.js +96 -0
  8. package/dist/center.js.map +1 -0
  9. package/dist/common.d.ts +28 -0
  10. package/dist/common.d.ts.map +1 -1
  11. package/dist/common.js +37 -0
  12. package/dist/common.js.map +1 -1
  13. package/dist/equipment.d.ts +93 -0
  14. package/dist/equipment.d.ts.map +1 -0
  15. package/dist/equipment.js +54 -0
  16. package/dist/equipment.js.map +1 -0
  17. package/dist/exercise.d.ts +234 -0
  18. package/dist/exercise.d.ts.map +1 -0
  19. package/dist/exercise.js +93 -0
  20. package/dist/exercise.js.map +1 -0
  21. package/dist/feedback.d.ts +119 -0
  22. package/dist/feedback.d.ts.map +1 -0
  23. package/dist/feedback.js +77 -0
  24. package/dist/feedback.js.map +1 -0
  25. package/dist/home.d.ts +74 -0
  26. package/dist/home.d.ts.map +1 -0
  27. package/dist/home.js +28 -0
  28. package/dist/home.js.map +1 -0
  29. package/dist/index.d.ts +27 -4
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +33 -5
  32. package/dist/index.js.map +1 -1
  33. package/dist/insights.d.ts +143 -0
  34. package/dist/insights.d.ts.map +1 -0
  35. package/dist/insights.js +79 -0
  36. package/dist/insights.js.map +1 -0
  37. package/dist/member-profile.d.ts +312 -0
  38. package/dist/member-profile.d.ts.map +1 -0
  39. package/dist/member-profile.js +103 -0
  40. package/dist/member-profile.js.map +1 -0
  41. package/dist/member.d.ts +365 -0
  42. package/dist/member.d.ts.map +1 -0
  43. package/dist/member.js +169 -0
  44. package/dist/member.js.map +1 -0
  45. package/dist/membership-plan.d.ts +244 -0
  46. package/dist/membership-plan.d.ts.map +1 -0
  47. package/dist/membership-plan.js +80 -0
  48. package/dist/membership-plan.js.map +1 -0
  49. package/dist/membership.d.ts +154 -0
  50. package/dist/membership.d.ts.map +1 -0
  51. package/dist/membership.js +103 -0
  52. package/dist/membership.js.map +1 -0
  53. package/dist/notification.d.ts +59 -0
  54. package/dist/notification.d.ts.map +1 -0
  55. package/dist/notification.js +49 -0
  56. package/dist/notification.js.map +1 -0
  57. package/dist/onboarding.d.ts +421 -0
  58. package/dist/onboarding.d.ts.map +1 -0
  59. package/dist/onboarding.js +124 -0
  60. package/dist/onboarding.js.map +1 -0
  61. package/dist/organisation.d.ts +199 -0
  62. package/dist/organisation.d.ts.map +1 -0
  63. package/dist/organisation.js +51 -0
  64. package/dist/organisation.js.map +1 -0
  65. package/dist/owner-profile.d.ts +50 -0
  66. package/dist/owner-profile.d.ts.map +1 -0
  67. package/dist/owner-profile.js +34 -0
  68. package/dist/owner-profile.js.map +1 -0
  69. package/dist/pricing.d.ts +103 -0
  70. package/dist/pricing.d.ts.map +1 -0
  71. package/dist/pricing.js +73 -0
  72. package/dist/pricing.js.map +1 -0
  73. package/dist/session.d.ts +90 -0
  74. package/dist/session.d.ts.map +1 -0
  75. package/dist/session.js +59 -0
  76. package/dist/session.js.map +1 -0
  77. package/dist/shared.d.ts +199 -0
  78. package/dist/shared.d.ts.map +1 -0
  79. package/dist/shared.js +107 -0
  80. package/dist/shared.js.map +1 -0
  81. package/dist/staff.d.ts +288 -0
  82. package/dist/staff.d.ts.map +1 -0
  83. package/dist/staff.js +115 -0
  84. package/dist/staff.js.map +1 -0
  85. package/dist/subscription.d.ts +69 -0
  86. package/dist/subscription.d.ts.map +1 -0
  87. package/dist/subscription.js +47 -0
  88. package/dist/subscription.js.map +1 -0
  89. package/dist/user.d.ts +63 -0
  90. package/dist/user.d.ts.map +1 -0
  91. package/dist/user.js +44 -0
  92. package/dist/user.js.map +1 -0
  93. package/dist/workout-plan.d.ts +201 -0
  94. package/dist/workout-plan.d.ts.map +1 -0
  95. package/dist/workout-plan.js +71 -0
  96. package/dist/workout-plan.js.map +1 -0
  97. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../src/onboarding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACpE,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE/F,gFAAgF;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAGhE,gFAAgF;AAEhF,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC;KACxC,MAAM,CAAC;IACN,kEAAkE;IAClE,OAAO,EAAE,aAAa;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,wBAAwB,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACrE,QAAQ,EAAE,qBAAqB,CAAC,EAAE,CAAC;IACnC,MAAM,EAAE,YAAY;IACpB,GAAG,EAAE,aAAa;IAClB,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,iBAAiB;IACvB,gBAAgB,EAAE,sBAAsB;IACxC,UAAU,EAAE,gBAAgB;CAC7B,CAAC;KACD,MAAM,CAAC,CAAC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,IAAI,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IACrC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IACrC,OAAO,EAAE,aAAa;IACtB,WAAW,EAAE,qBAAqB;IAClC,UAAU,EAAE,qBAAqB;CAClC,CAAC;KACD,OAAO,EAAE,CAAC;AAGb;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,IAAI,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IACrC,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACrC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,WAAW,EAAE,qBAAqB,CAAC,QAAQ,EAAE;IAC7C,UAAU,EAAE,qBAAqB,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC","sourcesContent":["/**\n * gymmonk-schema — Onboarding submit payloads\n * ============================================\n * The end-of-flow POST bodies. The frontend forms stay flat (three-part DOB,\n * etc.); at submit they map to these structured payloads, which compose the\n * canonical create schemas so the backend can fan out to the right collections.\n *\n * member → member-profile + a pending membership (join a gym by code)\n * owner → organisation + first center + SaaS subscription selection\n *\n * @module gymmonk-schema/onboarding\n */\n\nimport { z } from 'zod';\nimport { createCenterBodySchema, gymCodeSchema } from './center.js';\nimport {\n isoDateSchema,\n optionalEmailSchema,\n optionalTrimmedString,\n phoneSchema,\n} from './common.js';\nimport { bodyMetricsSchema, emergencyContactSchema } from './member-profile.js';\nimport { createOrganisationBodySchema } from './organisation.js';\nimport { addressSchema, bloodGroupSchema, genderSchema, socialLinksSchema } from './shared.js';\n\n// ─── Role ────────────────────────────────────────────────────────────────────\n\nexport const onboardingRoleSchema = z.enum(['owner', 'member']);\nexport type OnboardingRole = z.infer<typeof onboardingRoleSchema>;\n\n// ─── Member onboarding ───────────────────────────────────────────────────────\n\nexport const memberOnboardingBodySchema = z\n .object({\n /** The gym code the member picked at the \"find your gym\" step. */\n gymCode: gymCodeSchema,\n firstName: z.string().trim().min(1, 'First name is required').max(80),\n lastName: optionalTrimmedString(80),\n gender: genderSchema,\n dob: isoDateSchema,\n phone: phoneSchema,\n body: bodyMetricsSchema,\n emergencyContact: emergencyContactSchema,\n bloodGroup: bloodGroupSchema,\n })\n .refine((v) => v.body.heightCm != null && v.body.weightKg != null, {\n message: 'Height and weight are required',\n path: ['body'],\n })\n .refine((v) => v.body.neckCm != null && v.body.waistCm != null, {\n message: 'Neck and waist are required',\n path: ['body'],\n })\n .refine((v) => v.gender !== 'female' || v.body.hipsCm != null, {\n message: 'Hips measurement is required',\n path: ['body', 'hipsCm'],\n });\nexport type MemberOnboardingBody = z.infer<typeof memberOnboardingBodySchema>;\n\n// ─── Owner onboarding ────────────────────────────────────────────────────────\n\n/** The owner's personal basics captured before the organisation/center. */\nexport const ownerBasicsSchema = z.object({\n firstName: z.string().trim().min(1, 'First name is required').max(80),\n lastName: optionalTrimmedString(80),\n gender: genderSchema,\n dob: isoDateSchema.optional(),\n phone: phoneSchema,\n altEmail: optionalEmailSchema,\n website: optionalTrimmedString(200),\n socials: socialLinksSchema,\n /** The owner's personal contact address (step-2 of owner onboarding). */\n address: addressSchema.optional(),\n /** Uploaded profile photo → stored on the shared `User.avatar`. */\n avatarUrl: optionalTrimmedString(2000),\n});\nexport type OwnerBasics = z.infer<typeof ownerBasicsSchema>;\n\n/** The SaaS plan an owner selects at the final onboarding step. */\nexport const onboardingPlanSelectionSchema = z.object({\n planId: z.string().trim().min(1),\n tenureId: z.string().trim().min(1).nullable(),\n});\nexport type OnboardingPlanSelection = z.infer<typeof onboardingPlanSelectionSchema>;\n\nexport const ownerOnboardingBodySchema = z.object({\n owner: ownerBasicsSchema,\n organisation: createOrganisationBodySchema,\n center: createCenterBodySchema,\n subscription: onboardingPlanSelectionSchema,\n});\nexport type OwnerOnboardingBody = z.infer<typeof ownerOnboardingBodySchema>;\n\n// ─── Onboarding progress & resume ─────────────────────────────────────────────\n\n/**\n * In-progress onboarding draft: the UI-shaped, partially-filled form the client\n * persists so a returning user resumes with their typed data intact. Opaque to\n * the backend by design — the client owns the form shape, and the data is\n * re-validated strictly by the member/owner body schemas at finalize. Keys are\n * form field names; the backend caps the stored size.\n */\nexport const onboardingDraftSchema = z.record(z.string(), z.unknown());\nexport type OnboardingDraft = z.infer<typeof onboardingDraftSchema>;\n\n/**\n * The server-persisted onboarding cursor: which role the user picked, how far\n * they reached (`step`, the 1-indexed sub-step of the current form), the gym a\n * member chose, and the drafts. Read on app entry to resume to the exact step.\n * `welcomed` records that the one-time welcome carousel has been seen.\n */\nexport const onboardingProgressSchema = z.object({\n welcomed: z.boolean(),\n role: onboardingRoleSchema.nullable(),\n step: z.number().int().min(0).max(20),\n gymCode: gymCodeSchema.optional(),\n memberDraft: onboardingDraftSchema.optional(),\n ownerDraft: onboardingDraftSchema.optional(),\n});\nexport type OnboardingProgress = z.infer<typeof onboardingProgressSchema>;\n\n/** `PUT /onboarding/progress` body — any subset of the cursor, merged server-side. */\nexport const onboardingProgressUpdateSchema = z\n .object({\n welcomed: z.boolean(),\n role: onboardingRoleSchema.nullable(),\n step: z.number().int().min(0).max(20),\n gymCode: gymCodeSchema,\n memberDraft: onboardingDraftSchema,\n ownerDraft: onboardingDraftSchema,\n })\n .partial();\nexport type OnboardingProgressUpdate = z.infer<typeof onboardingProgressUpdateSchema>;\n\n/**\n * `GET /onboarding/status` response: completion truth (derived from the user's\n * domain data) plus the resume cursor. `onboarded` is authoritative — an owner\n * with an organisation, or a member with a profile, is onboarded regardless of\n * the cursor.\n */\nexport const onboardingStatusSchema = z.object({\n onboarded: z.boolean(),\n role: onboardingRoleSchema.nullable(),\n organisationId: z.string().optional(),\n welcomed: z.boolean(),\n step: z.number().int().min(0),\n gymCode: z.string().optional(),\n memberDraft: onboardingDraftSchema.optional(),\n ownerDraft: onboardingDraftSchema.optional(),\n});\nexport type OnboardingStatus = z.infer<typeof onboardingStatusSchema>;\n"]}
@@ -0,0 +1,199 @@
1
+ /**
2
+ * gymmonk-schema — Organisation
3
+ * =============================
4
+ * The gym business an owner runs. One owner → one organisation → many centers
5
+ * (branches). Created at owner onboarding; edited from the owner console.
6
+ *
7
+ * @module gymmonk-schema/organisation
8
+ */
9
+ import { z } from 'zod';
10
+ export declare const organisationStatusSchema: z.ZodEnum<{
11
+ active: "active";
12
+ inactive: "inactive";
13
+ }>;
14
+ export type OrganisationStatus = z.infer<typeof organisationStatusSchema>;
15
+ /** GSTIN — 15 chars; optional (many small gyms are unregistered). */
16
+ export declare const gstNumberSchema: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
17
+ export declare const createOrganisationBodySchema: z.ZodObject<{
18
+ name: z.ZodString;
19
+ description: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
20
+ address: z.ZodObject<{
21
+ street: z.ZodString;
22
+ city: z.ZodString;
23
+ state: z.ZodEnum<{
24
+ "Andhra Pradesh": "Andhra Pradesh";
25
+ "Arunachal Pradesh": "Arunachal Pradesh";
26
+ Assam: "Assam";
27
+ Bihar: "Bihar";
28
+ Chhattisgarh: "Chhattisgarh";
29
+ Goa: "Goa";
30
+ Gujarat: "Gujarat";
31
+ Haryana: "Haryana";
32
+ "Himachal Pradesh": "Himachal Pradesh";
33
+ Jharkhand: "Jharkhand";
34
+ Karnataka: "Karnataka";
35
+ Kerala: "Kerala";
36
+ "Madhya Pradesh": "Madhya Pradesh";
37
+ Maharashtra: "Maharashtra";
38
+ Manipur: "Manipur";
39
+ Meghalaya: "Meghalaya";
40
+ Mizoram: "Mizoram";
41
+ Nagaland: "Nagaland";
42
+ Odisha: "Odisha";
43
+ Punjab: "Punjab";
44
+ Rajasthan: "Rajasthan";
45
+ Sikkim: "Sikkim";
46
+ "Tamil Nadu": "Tamil Nadu";
47
+ Telangana: "Telangana";
48
+ Tripura: "Tripura";
49
+ "Uttar Pradesh": "Uttar Pradesh";
50
+ Uttarakhand: "Uttarakhand";
51
+ "West Bengal": "West Bengal";
52
+ "Andaman and Nicobar Islands": "Andaman and Nicobar Islands";
53
+ Chandigarh: "Chandigarh";
54
+ "Dadra and Nagar Haveli and Daman and Diu": "Dadra and Nagar Haveli and Daman and Diu";
55
+ Delhi: "Delhi";
56
+ "Jammu and Kashmir": "Jammu and Kashmir";
57
+ Ladakh: "Ladakh";
58
+ Lakshadweep: "Lakshadweep";
59
+ Puducherry: "Puducherry";
60
+ }>;
61
+ pincode: z.ZodString;
62
+ }, z.core.$strip>;
63
+ gstNumber: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
64
+ registrationNumber: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
65
+ website: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
66
+ socials: z.ZodObject<{
67
+ jansathi: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
68
+ youtube: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
69
+ instagram: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
70
+ facebook: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
71
+ }, z.core.$strip>;
72
+ numberOfCenters: z.ZodNumber;
73
+ }, z.core.$strip>;
74
+ export type CreateOrganisationBody = z.infer<typeof createOrganisationBodySchema>;
75
+ export declare const updateOrganisationBodySchema: z.ZodObject<{
76
+ name: z.ZodOptional<z.ZodString>;
77
+ description: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodString>>>;
78
+ address: z.ZodOptional<z.ZodObject<{
79
+ street: z.ZodString;
80
+ city: z.ZodString;
81
+ state: z.ZodEnum<{
82
+ "Andhra Pradesh": "Andhra Pradesh";
83
+ "Arunachal Pradesh": "Arunachal Pradesh";
84
+ Assam: "Assam";
85
+ Bihar: "Bihar";
86
+ Chhattisgarh: "Chhattisgarh";
87
+ Goa: "Goa";
88
+ Gujarat: "Gujarat";
89
+ Haryana: "Haryana";
90
+ "Himachal Pradesh": "Himachal Pradesh";
91
+ Jharkhand: "Jharkhand";
92
+ Karnataka: "Karnataka";
93
+ Kerala: "Kerala";
94
+ "Madhya Pradesh": "Madhya Pradesh";
95
+ Maharashtra: "Maharashtra";
96
+ Manipur: "Manipur";
97
+ Meghalaya: "Meghalaya";
98
+ Mizoram: "Mizoram";
99
+ Nagaland: "Nagaland";
100
+ Odisha: "Odisha";
101
+ Punjab: "Punjab";
102
+ Rajasthan: "Rajasthan";
103
+ Sikkim: "Sikkim";
104
+ "Tamil Nadu": "Tamil Nadu";
105
+ Telangana: "Telangana";
106
+ Tripura: "Tripura";
107
+ "Uttar Pradesh": "Uttar Pradesh";
108
+ Uttarakhand: "Uttarakhand";
109
+ "West Bengal": "West Bengal";
110
+ "Andaman and Nicobar Islands": "Andaman and Nicobar Islands";
111
+ Chandigarh: "Chandigarh";
112
+ "Dadra and Nagar Haveli and Daman and Diu": "Dadra and Nagar Haveli and Daman and Diu";
113
+ Delhi: "Delhi";
114
+ "Jammu and Kashmir": "Jammu and Kashmir";
115
+ Ladakh: "Ladakh";
116
+ Lakshadweep: "Lakshadweep";
117
+ Puducherry: "Puducherry";
118
+ }>;
119
+ pincode: z.ZodString;
120
+ }, z.core.$strip>>;
121
+ gstNumber: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodString>>>;
122
+ registrationNumber: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodString>>>;
123
+ website: z.ZodOptional<z.ZodPreprocess<z.ZodOptional<z.ZodString>>>;
124
+ socials: z.ZodOptional<z.ZodObject<{
125
+ jansathi: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
126
+ youtube: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
127
+ instagram: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
128
+ facebook: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
129
+ }, z.core.$strip>>;
130
+ numberOfCenters: z.ZodOptional<z.ZodNumber>;
131
+ }, z.core.$strip>;
132
+ export type UpdateOrganisationBody = z.infer<typeof updateOrganisationBodySchema>;
133
+ export declare const organisationSchema: z.ZodObject<{
134
+ id: z.ZodString;
135
+ ownerId: z.ZodString;
136
+ name: z.ZodString;
137
+ description: z.ZodNullable<z.ZodString>;
138
+ address: z.ZodObject<{
139
+ street: z.ZodString;
140
+ city: z.ZodString;
141
+ state: z.ZodEnum<{
142
+ "Andhra Pradesh": "Andhra Pradesh";
143
+ "Arunachal Pradesh": "Arunachal Pradesh";
144
+ Assam: "Assam";
145
+ Bihar: "Bihar";
146
+ Chhattisgarh: "Chhattisgarh";
147
+ Goa: "Goa";
148
+ Gujarat: "Gujarat";
149
+ Haryana: "Haryana";
150
+ "Himachal Pradesh": "Himachal Pradesh";
151
+ Jharkhand: "Jharkhand";
152
+ Karnataka: "Karnataka";
153
+ Kerala: "Kerala";
154
+ "Madhya Pradesh": "Madhya Pradesh";
155
+ Maharashtra: "Maharashtra";
156
+ Manipur: "Manipur";
157
+ Meghalaya: "Meghalaya";
158
+ Mizoram: "Mizoram";
159
+ Nagaland: "Nagaland";
160
+ Odisha: "Odisha";
161
+ Punjab: "Punjab";
162
+ Rajasthan: "Rajasthan";
163
+ Sikkim: "Sikkim";
164
+ "Tamil Nadu": "Tamil Nadu";
165
+ Telangana: "Telangana";
166
+ Tripura: "Tripura";
167
+ "Uttar Pradesh": "Uttar Pradesh";
168
+ Uttarakhand: "Uttarakhand";
169
+ "West Bengal": "West Bengal";
170
+ "Andaman and Nicobar Islands": "Andaman and Nicobar Islands";
171
+ Chandigarh: "Chandigarh";
172
+ "Dadra and Nagar Haveli and Daman and Diu": "Dadra and Nagar Haveli and Daman and Diu";
173
+ Delhi: "Delhi";
174
+ "Jammu and Kashmir": "Jammu and Kashmir";
175
+ Ladakh: "Ladakh";
176
+ Lakshadweep: "Lakshadweep";
177
+ Puducherry: "Puducherry";
178
+ }>;
179
+ pincode: z.ZodString;
180
+ }, z.core.$strip>;
181
+ gstNumber: z.ZodNullable<z.ZodString>;
182
+ registrationNumber: z.ZodNullable<z.ZodString>;
183
+ website: z.ZodNullable<z.ZodString>;
184
+ socials: z.ZodObject<{
185
+ jansathi: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
186
+ youtube: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
187
+ instagram: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
188
+ facebook: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
189
+ }, z.core.$strip>;
190
+ numberOfCenters: z.ZodNumber;
191
+ status: z.ZodEnum<{
192
+ active: "active";
193
+ inactive: "inactive";
194
+ }>;
195
+ createdAt: z.ZodISODateTime;
196
+ updatedAt: z.ZodISODateTime;
197
+ }, z.core.$strip>;
198
+ export type Organisation = z.infer<typeof organisationSchema>;
199
+ //# sourceMappingURL=organisation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organisation.d.ts","sourceRoot":"","sources":["../src/organisation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,wBAAwB;;;EAAiC,CAAC;AACvE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAI1E,qEAAqE;AACrE,eAAO,MAAM,eAAe,6CAO3B,CAAC;AAIF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAElF,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAyC,CAAC;AACnF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC;AAIlF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAc7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -0,0 +1,51 @@
1
+ /**
2
+ * gymmonk-schema — Organisation
3
+ * =============================
4
+ * The gym business an owner runs. One owner → one organisation → many centers
5
+ * (branches). Created at owner onboarding; edited from the owner console.
6
+ *
7
+ * @module gymmonk-schema/organisation
8
+ */
9
+ import { z } from 'zod';
10
+ import { isoDateTimeSchema, objectIdSchema, optionalTrimmedString } from './common.js';
11
+ import { addressSchema, socialLinksSchema } from './shared.js';
12
+ // ─── Status ──────────────────────────────────────────────────────────────────
13
+ export const organisationStatusSchema = z.enum(['active', 'inactive']);
14
+ // ─── Registration identifiers ────────────────────────────────────────────────
15
+ /** GSTIN — 15 chars; optional (many small gyms are unregistered). */
16
+ export const gstNumberSchema = z.preprocess((v) => (typeof v === 'string' && v.trim() === '' ? undefined : v), z
17
+ .string()
18
+ .trim()
19
+ .regex(/^[0-9A-Z]{15}$/, 'Enter a valid 15-character GSTIN')
20
+ .optional());
21
+ // ─── Create / update bodies ──────────────────────────────────────────────────
22
+ export const createOrganisationBodySchema = z.object({
23
+ name: z.string().trim().min(1, 'Organisation name is required').max(160),
24
+ description: optionalTrimmedString(2000),
25
+ address: addressSchema,
26
+ gstNumber: gstNumberSchema,
27
+ /** Company Identification Number (CIN) or other registration id. */
28
+ registrationNumber: optionalTrimmedString(40),
29
+ website: optionalTrimmedString(200),
30
+ socials: socialLinksSchema,
31
+ /** Owner-declared number of centers (for planning; actual centers are docs). */
32
+ numberOfCenters: z.number().int().min(1).max(500),
33
+ });
34
+ export const updateOrganisationBodySchema = createOrganisationBodySchema.partial();
35
+ // ─── Entity (API response) ───────────────────────────────────────────────────
36
+ export const organisationSchema = z.object({
37
+ id: objectIdSchema,
38
+ ownerId: objectIdSchema,
39
+ name: z.string(),
40
+ description: z.string().nullable(),
41
+ address: addressSchema,
42
+ gstNumber: z.string().nullable(),
43
+ registrationNumber: z.string().nullable(),
44
+ website: z.string().nullable(),
45
+ socials: socialLinksSchema,
46
+ numberOfCenters: z.number().int(),
47
+ status: organisationStatusSchema,
48
+ createdAt: isoDateTimeSchema,
49
+ updatedAt: isoDateTimeSchema,
50
+ });
51
+ //# sourceMappingURL=organisation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organisation.js","sourceRoot":"","sources":["../src/organisation.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE/D,gFAAgF;AAEhF,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC;AAGvE,gFAAgF;AAEhF,qEAAqE;AACrE,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,UAAU,CACzC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EACjE,CAAC;KACE,MAAM,EAAE;KACR,IAAI,EAAE;KACN,KAAK,CAAC,gBAAgB,EAAE,kCAAkC,CAAC;KAC3D,Q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AAE,wBAAwB;IAChC,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAE,iBAAiB;CAC7B,CAAC,CAAC","sourcesContent":["/**\n * gymmonk-schema — Organisation\n * =============================\n * The gym business an owner runs. One owner → one organisation → many centers\n * (branches). Created at owner onboarding; edited from the owner console.\n *\n * @module gymmonk-schema/organisation\n */\n\nimport { z } from 'zod';\nimport { isoDateTimeSchema, objectIdSchema, optionalTrimmedString } from './common.js';\nimport { addressSchema, socialLinksSchema } from './shared.js';\n\n// ─── Status ──────────────────────────────────────────────────────────────────\n\nexport const organisationStatusSchema = z.enum(['active', 'inactive']);\nexport type OrganisationStatus = z.infer<typeof organisationStatusSchema>;\n\n// ─── Registration identifiers ────────────────────────────────────────────────\n\n/** GSTIN — 15 chars; optional (many small gyms are unregistered). */\nexport const gstNumberSchema = z.preprocess(\n (v) => (typeof v === 'string' && v.trim() === '' ? undefined : v),\n z\n .string()\n .trim()\n .regex(/^[0-9A-Z]{15}$/, 'Enter a valid 15-character GSTIN')\n .optional(),\n);\n\n// ─── Create / update bodies ──────────────────────────────────────────────────\n\nexport const createOrganisationBodySchema = z.object({\n name: z.string().trim().min(1, 'Organisation name is required').max(160),\n description: optionalTrimmedString(2000),\n address: addressSchema,\n gstNumber: gstNumberSchema,\n /** Company Identification Number (CIN) or other registration id. */\n registrationNumber: optionalTrimmedString(40),\n website: optionalTrimmedString(200),\n socials: socialLinksSchema,\n /** Owner-declared number of centers (for planning; actual centers are docs). */\n numberOfCenters: z.number().int().min(1).max(500),\n});\nexport type CreateOrganisationBody = z.infer<typeof createOrganisationBodySchema>;\n\nexport const updateOrganisationBodySchema = createOrganisationBodySchema.partial();\nexport type UpdateOrganisationBody = z.infer<typeof updateOrganisationBodySchema>;\n\n// ─── Entity (API response) ───────────────────────────────────────────────────\n\nexport const organisationSchema = z.object({\n id: objectIdSchema,\n ownerId: objectIdSchema,\n name: z.string(),\n description: z.string().nullable(),\n address: addressSchema,\n gstNumber: z.string().nullable(),\n registrationNumber: z.string().nullable(),\n website: z.string().nullable(),\n socials: socialLinksSchema,\n numberOfCenters: z.number().int(),\n status: organisationStatusSchema,\n createdAt: isoDateTimeSchema,\n updatedAt: isoDateTimeSchema,\n});\nexport type Organisation = z.infer<typeof organisationSchema>;\n"]}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * gymmonk-schema — Owner personal profile
3
+ * =======================================
4
+ * The gym owner's own personal data (gender, DOB, alt-email, website, socials),
5
+ * the owner-side analogue of `member-profile`. Name / email / phone / avatar live
6
+ * on the shared `user` (`me`) identity; this holds the rest, which onboarding
7
+ * captures and the owner profile screen edits.
8
+ *
9
+ * @module gymmonk-schema/owner-profile
10
+ */
11
+ import { z } from 'zod';
12
+ export declare const ownerProfileSchema: z.ZodObject<{
13
+ id: z.ZodString;
14
+ userId: z.ZodString;
15
+ gender: z.ZodNullable<z.ZodEnum<{
16
+ male: "male";
17
+ female: "female";
18
+ other: "other";
19
+ }>>;
20
+ dob: z.ZodNullable<z.ZodString>;
21
+ altEmail: z.ZodNullable<z.ZodString>;
22
+ website: z.ZodNullable<z.ZodString>;
23
+ socials: z.ZodObject<{
24
+ jansathi: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
25
+ youtube: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
26
+ instagram: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
27
+ facebook: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
28
+ }, z.core.$strip>;
29
+ createdAt: z.ZodISODateTime;
30
+ updatedAt: z.ZodISODateTime;
31
+ }, z.core.$strip>;
32
+ export type OwnerProfile = z.infer<typeof ownerProfileSchema>;
33
+ export declare const updateOwnerProfileBodySchema: z.ZodObject<{
34
+ gender: z.ZodOptional<z.ZodEnum<{
35
+ male: "male";
36
+ female: "female";
37
+ other: "other";
38
+ }>>;
39
+ dob: z.ZodOptional<z.ZodString>;
40
+ altEmail: z.ZodPreprocess<z.ZodOptional<z.ZodEmail>>;
41
+ website: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
42
+ socials: z.ZodOptional<z.ZodObject<{
43
+ jansathi: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
44
+ youtube: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
45
+ instagram: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
46
+ facebook: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
47
+ }, z.core.$strip>>;
48
+ }, z.core.$strip>;
49
+ export type UpdateOwnerProfileBody = z.infer<typeof updateOwnerProfileBodySchema>;
50
+ //# sourceMappingURL=owner-profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"owner-profile.d.ts","sourceRoot":"","sources":["../src/owner-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;iBAU7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;iBAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAC"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * gymmonk-schema — Owner personal profile
3
+ * =======================================
4
+ * The gym owner's own personal data (gender, DOB, alt-email, website, socials),
5
+ * the owner-side analogue of `member-profile`. Name / email / phone / avatar live
6
+ * on the shared `user` (`me`) identity; this holds the rest, which onboarding
7
+ * captures and the owner profile screen edits.
8
+ *
9
+ * @module gymmonk-schema/owner-profile
10
+ */
11
+ import { z } from 'zod';
12
+ import { isoDateSchema, isoDateTimeSchema, objectIdSchema, optionalEmailSchema, optionalTrimmedString, } from './common.js';
13
+ import { genderSchema, socialLinksSchema } from './shared.js';
14
+ // ─── Entity ──────────────────────────────────────────────────────────────────
15
+ export const ownerProfileSchema = z.object({
16
+ id: objectIdSchema,
17
+ userId: objectIdSchema,
18
+ gender: genderSchema.nullable(),
19
+ dob: isoDateSchema.nullable(),
20
+ altEmail: z.string().nullable(),
21
+ website: z.string().nullable(),
22
+ socials: socialLinksSchema,
23
+ createdAt: isoDateTimeSchema,
24
+ updatedAt: isoDateTimeSchema,
25
+ });
26
+ // ─── Update body ─────────────────────────────────────────────────────────────
27
+ export const updateOwnerProfileBodySchema = z.object({
28
+ gender: genderSchema.optional(),
29
+ dob: isoDateSchema.optional(),
30
+ altEmail: optionalEmailSchema,
31
+ website: optionalTrimmedString(200),
32
+ socials: socialLinksSchema.optional(),
33
+ });
34
+ //# sourceMappingURL=owner-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"owner-profile.js","sourceRoot":"","sources":["../src/owner-profile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE9D,gFAAgF;AAEhF,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,cAAc;IAClB,MAAM,EAAE,cAAc;IACtB,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B,GAAG,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC7B,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,OAAO,EAAE,iBAAiB;IAC1B,SAAS,EAAE,iBAAiB;IAC5B,SAAS,EAAE,iBAAiB;CAC7B,CAAC,CAAC;AAGH,gFAAgF;AAEhF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IACnD,MAAM,EAAE,YAAY,CAAC,QAAQ,EAAE;IAC/B,GAAG,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC7B,QAAQ,EAAE,mBAAmB;IAC7B,OAAO,EAAE,qBAAqB,CAAC,GAAG,CAAC;IACnC,OAAO,EAAE,iBAAiB,CAAC,QAAQ,EAAE;CACtC,CAAC,CAAC","sourcesContent":["/**\n * gymmonk-schema — Owner personal profile\n * =======================================\n * The gym owner's own personal data (gender, DOB, alt-email, website, socials),\n * the owner-side analogue of `member-profile`. Name / email / phone / avatar live\n * on the shared `user` (`me`) identity; this holds the rest, which onboarding\n * captures and the owner profile screen edits.\n *\n * @module gymmonk-schema/owner-profile\n */\n\nimport { z } from 'zod';\nimport {\n isoDateSchema,\n isoDateTimeSchema,\n objectIdSchema,\n optionalEmailSchema,\n optionalTrimmedString,\n} from './common.js';\nimport { genderSchema, socialLinksSchema } from './shared.js';\n\n// ─── Entity ──────────────────────────────────────────────────────────────────\n\nexport const ownerProfileSchema = z.object({\n id: objectIdSchema,\n userId: objectIdSchema,\n gender: genderSchema.nullable(),\n dob: isoDateSchema.nullable(),\n altEmail: z.string().nullable(),\n website: z.string().nullable(),\n socials: socialLinksSchema,\n createdAt: isoDateTimeSchema,\n updatedAt: isoDateTimeSchema,\n});\nexport type OwnerProfile = z.infer<typeof ownerProfileSchema>;\n\n// ─── Update body ─────────────────────────────────────────────────────────────\n\nexport const updateOwnerProfileBodySchema = z.object({\n gender: genderSchema.optional(),\n dob: isoDateSchema.optional(),\n altEmail: optionalEmailSchema,\n website: optionalTrimmedString(200),\n socials: socialLinksSchema.optional(),\n});\nexport type UpdateOwnerProfileBody = z.infer<typeof updateOwnerProfileBodySchema>;\n"]}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * gymmonk-schema — Generic pricing primitives
3
+ * ============================================
4
+ * The reusable "pricing plan + tenure + launch offer + feature chip" shapes,
5
+ * mirroring the jansathi find-partner pricing kit. Two GymMonk surfaces reuse
6
+ * them verbatim:
7
+ * 1. owner-defined **membership plans** sold to gym members (`membership-plan`)
8
+ * 2. the GymMonk **SaaS subscription** an owner buys (`subscription`)
9
+ *
10
+ * Purely serializable data — the frontend `PlanVisual` (a Lucide icon) is a UI
11
+ * concern and intentionally NOT modelled here.
12
+ *
13
+ * @module gymmonk-schema/pricing
14
+ */
15
+ import { z } from 'zod';
16
+ /**
17
+ * A billing duration for a plan. `finalPrice` is the total charged for the whole
18
+ * tenure after `discountPct` — denormalised so the client renders without math.
19
+ */
20
+ export declare const genericTenureSchema: z.ZodObject<{
21
+ tenureId: z.ZodString;
22
+ label: z.ZodString;
23
+ basePrice: z.ZodNumber;
24
+ discountPct: z.ZodNumber;
25
+ finalPrice: z.ZodNumber;
26
+ enabled: z.ZodBoolean;
27
+ razorpayPlanId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
28
+ }, z.core.$strip>;
29
+ export type GenericTenure = z.infer<typeof genericTenureSchema>;
30
+ /** A time-boxed / capped promotional price attached to a plan. */
31
+ export declare const genericLaunchOfferSchema: z.ZodObject<{
32
+ enabled: z.ZodBoolean;
33
+ price: z.ZodNumber;
34
+ tenure: z.ZodString;
35
+ label: z.ZodString;
36
+ badge: z.ZodString;
37
+ validUntil: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
38
+ maxRedemptions: z.ZodOptional<z.ZodNumber>;
39
+ redemptionCount: z.ZodNumber;
40
+ oncePerUser: z.ZodBoolean;
41
+ }, z.core.$strip>;
42
+ export type GenericLaunchOffer = z.infer<typeof genericLaunchOfferSchema>;
43
+ /** One capability line on a plan. `value` is `null` when locked for that plan. */
44
+ export declare const genericFeatureChipSchema: z.ZodObject<{
45
+ key: z.ZodString;
46
+ label: z.ZodString;
47
+ helpText: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
48
+ value: z.ZodNullable<z.ZodString>;
49
+ included: z.ZodBoolean;
50
+ }, z.core.$strip>;
51
+ export type GenericFeatureChip = z.infer<typeof genericFeatureChipSchema>;
52
+ /** The included / locked split of a plan's feature chips. */
53
+ export declare const genericPlanFeaturesSchema: z.ZodObject<{
54
+ included: z.ZodArray<z.ZodObject<{
55
+ key: z.ZodString;
56
+ label: z.ZodString;
57
+ helpText: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
58
+ value: z.ZodNullable<z.ZodString>;
59
+ included: z.ZodBoolean;
60
+ }, z.core.$strip>>;
61
+ locked: z.ZodArray<z.ZodObject<{
62
+ key: z.ZodString;
63
+ label: z.ZodString;
64
+ helpText: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
65
+ value: z.ZodNullable<z.ZodString>;
66
+ included: z.ZodBoolean;
67
+ }, z.core.$strip>>;
68
+ }, z.core.$strip>;
69
+ export type GenericPlanFeatures = z.infer<typeof genericPlanFeaturesSchema>;
70
+ /** A full pricing plan with its tenures and (optional) launch offer. */
71
+ export declare const genericPricingPlanSchema: z.ZodObject<{
72
+ planId: z.ZodString;
73
+ name: z.ZodString;
74
+ tagline: z.ZodString;
75
+ accentColor: z.ZodString;
76
+ bgColor: z.ZodString;
77
+ isPopular: z.ZodBoolean;
78
+ sortOrder: z.ZodNumber;
79
+ baseMonthlyPrice: z.ZodNumber;
80
+ isActive: z.ZodBoolean;
81
+ tenures: z.ZodArray<z.ZodObject<{
82
+ tenureId: z.ZodString;
83
+ label: z.ZodString;
84
+ basePrice: z.ZodNumber;
85
+ discountPct: z.ZodNumber;
86
+ finalPrice: z.ZodNumber;
87
+ enabled: z.ZodBoolean;
88
+ razorpayPlanId: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
89
+ }, z.core.$strip>>;
90
+ launchOffer: z.ZodOptional<z.ZodObject<{
91
+ enabled: z.ZodBoolean;
92
+ price: z.ZodNumber;
93
+ tenure: z.ZodString;
94
+ label: z.ZodString;
95
+ badge: z.ZodString;
96
+ validUntil: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
97
+ maxRedemptions: z.ZodOptional<z.ZodNumber>;
98
+ redemptionCount: z.ZodNumber;
99
+ oncePerUser: z.ZodBoolean;
100
+ }, z.core.$strip>>;
101
+ }, z.core.$strip>;
102
+ export type GenericPricingPlan = z.infer<typeof genericPricingPlanSchema>;
103
+ //# sourceMappingURL=pricing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../src/pricing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;GAGG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;iBAQ9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAIhE,kEAAkE;AAClE,eAAO,MAAM,wBAAwB;;;;;;;;;;iBAUnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAI1E,kFAAkF;AAClF,eAAO,MAAM,wBAAwB;;;;;;iBAMnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,6DAA6D;AAC7D,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;iBAGpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAI5E,wEAAwE;AACxE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * gymmonk-schema — Generic pricing primitives
3
+ * ============================================
4
+ * The reusable "pricing plan + tenure + launch offer + feature chip" shapes,
5
+ * mirroring the jansathi find-partner pricing kit. Two GymMonk surfaces reuse
6
+ * them verbatim:
7
+ * 1. owner-defined **membership plans** sold to gym members (`membership-plan`)
8
+ * 2. the GymMonk **SaaS subscription** an owner buys (`subscription`)
9
+ *
10
+ * Purely serializable data — the frontend `PlanVisual` (a Lucide icon) is a UI
11
+ * concern and intentionally NOT modelled here.
12
+ *
13
+ * @module gymmonk-schema/pricing
14
+ */
15
+ import { z } from 'zod';
16
+ import { optionalTrimmedString, priceInrSchema } from './common.js';
17
+ // ─── Tenure ──────────────────────────────────────────────────────────────────
18
+ /**
19
+ * A billing duration for a plan. `finalPrice` is the total charged for the whole
20
+ * tenure after `discountPct` — denormalised so the client renders without math.
21
+ */
22
+ export const genericTenureSchema = z.object({
23
+ tenureId: z.string().trim().min(1),
24
+ label: z.string().trim().min(1),
25
+ basePrice: priceInrSchema,
26
+ discountPct: z.number().min(0).max(100),
27
+ finalPrice: priceInrSchema,
28
+ enabled: z.boolean(),
29
+ razorpayPlanId: optionalTrimmedString(120),
30
+ });
31
+ // ─── Launch offer ────────────────────────────────────────────────────────────
32
+ /** A time-boxed / capped promotional price attached to a plan. */
33
+ export const genericLaunchOfferSchema = z.object({
34
+ enabled: z.boolean(),
35
+ price: priceInrSchema,
36
+ tenure: z.string().trim().min(1),
37
+ label: z.string().trim(),
38
+ badge: z.string().trim(),
39
+ validUntil: optionalTrimmedString(40),
40
+ maxRedemptions: z.number().int().min(0).optional(),
41
+ redemptionCount: z.number().int().min(0),
42
+ oncePerUser: z.boolean(),
43
+ });
44
+ // ─── Feature chips ───────────────────────────────────────────────────────────
45
+ /** One capability line on a plan. `value` is `null` when locked for that plan. */
46
+ export const genericFeatureChipSchema = z.object({
47
+ key: z.string().trim().min(1),
48
+ label: z.string().trim().min(1),
49
+ helpText: optionalTrimmedString(240),
50
+ value: z.string().trim().nullable(),
51
+ included: z.boolean(),
52
+ });
53
+ /** The included / locked split of a plan's feature chips. */
54
+ export const genericPlanFeaturesSchema = z.object({
55
+ included: z.array(genericFeatureChipSchema),
56
+ locked: z.array(genericFeatureChipSchema),
57
+ });
58
+ // ─── Plan ────────────────────────────────────────────────────────────────────
59
+ /** A full pricing plan with its tenures and (optional) launch offer. */
60
+ export const genericPricingPlanSchema = z.object({
61
+ planId: z.string().trim().min(1),
62
+ name: z.string().trim().min(1),
63
+ tagline: z.string().trim(),
64
+ accentColor: z.string().trim(),
65
+ bgColor: z.string().trim(),
66
+ isPopular: z.boolean(),
67
+ sortOrder: z.number().int(),
68
+ baseMonthlyPrice: priceInrSchema,
69
+ isActive: z.boolean(),
70
+ tenures: z.array(genericTenureSchema),
71
+ launchOffer: genericLaunchOfferSchema.optional(),
72
+ });
73
+ //# sourceMappingURL=pricing.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pricing.js","sourceRoot":"","sources":["../src/pricing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEpE,gFAAgF;AAEhF;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/B,SAAS,EAAE,cAAc;IACzB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACvC,UAAU,EAAE,cAAc;IAC1B,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,cAAc,EAAE,qBAAqB,CAAC,GAAG,CAAC;CAC3C,CAAC,CAAC;AAGH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AAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;IAC3C,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,wBAAwB,CAAC;CAC1C,CAAC,CAAC;AAGH,gFAAgF;AAEhF,wEAAwE;AACxE,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAChC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC1B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC9B,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE;IAC1B,SAAS,EAAE,CAAC,CAAC,OAAO,EAAE;IACtB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC3B,gBAAgB,EAAE,cAAc;IAChC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC;IACrC,WAAW,EAAE,wBAAwB,CAAC,QAAQ,EAAE;CACjD,CAAC,CAAC","sourcesContent":["/**\n * gymmonk-schema — Generic pricing primitives\n * ============================================\n * The reusable \"pricing plan + tenure + launch offer + feature chip\" shapes,\n * mirroring the jansathi find-partner pricing kit. Two GymMonk surfaces reuse\n * them verbatim:\n * 1. owner-defined **membership plans** sold to gym members (`membership-plan`)\n * 2. the GymMonk **SaaS subscription** an owner buys (`subscription`)\n *\n * Purely serializable data — the frontend `PlanVisual` (a Lucide icon) is a UI\n * concern and intentionally NOT modelled here.\n *\n * @module gymmonk-schema/pricing\n */\n\nimport { z } from 'zod';\nimport { optionalTrimmedString, priceInrSchema } from './common.js';\n\n// ─── Tenure ──────────────────────────────────────────────────────────────────\n\n/**\n * A billing duration for a plan. `finalPrice` is the total charged for the whole\n * tenure after `discountPct` — denormalised so the client renders without math.\n */\nexport const genericTenureSchema = z.object({\n tenureId: z.string().trim().min(1),\n label: z.string().trim().min(1),\n basePrice: priceInrSchema,\n discountPct: z.number().min(0).max(100),\n finalPrice: priceInrSchema,\n enabled: z.boolean(),\n razorpayPlanId: optionalTrimmedString(120),\n});\nexport type GenericTenure = z.infer<typeof genericTenureSchema>;\n\n// ─── Launch offer ────────────────────────────────────────────────────────────\n\n/** A time-boxed / capped promotional price attached to a plan. */\nexport const genericLaunchOfferSchema = z.object({\n enabled: z.boolean(),\n price: priceInrSchema,\n tenure: z.string().trim().min(1),\n label: z.string().trim(),\n badge: z.string().trim(),\n validUntil: optionalTrimmedString(40),\n maxRedemptions: z.number().int().min(0).optional(),\n redemptionCount: z.number().int().min(0),\n oncePerUser: z.boolean(),\n});\nexport type GenericLaunchOffer = z.infer<typeof genericLaunchOfferSchema>;\n\n// ─── Feature chips ───────────────────────────────────────────────────────────\n\n/** One capability line on a plan. `value` is `null` when locked for that plan. */\nexport const genericFeatureChipSchema = z.object({\n key: z.string().trim().min(1),\n label: z.string().trim().min(1),\n helpText: optionalTrimmedString(240),\n value: z.string().trim().nullable(),\n included: z.boolean(),\n});\nexport type GenericFeatureChip = z.infer<typeof genericFeatureChipSchema>;\n\n/** The included / locked split of a plan's feature chips. */\nexport const genericPlanFeaturesSchema = z.object({\n included: z.array(genericFeatureChipSchema),\n locked: z.array(genericFeatureChipSchema),\n});\nexport type GenericPlanFeatures = z.infer<typeof genericPlanFeaturesSchema>;\n\n// ─── Plan ────────────────────────────────────────────────────────────────────\n\n/** A full pricing plan with its tenures and (optional) launch offer. */\nexport const genericPricingPlanSchema = z.object({\n planId: z.string().trim().min(1),\n name: z.string().trim().min(1),\n tagline: z.string().trim(),\n accentColor: z.string().trim(),\n bgColor: z.string().trim(),\n isPopular: z.boolean(),\n sortOrder: z.number().int(),\n baseMonthlyPrice: priceInrSchema,\n isActive: z.boolean(),\n tenures: z.array(genericTenureSchema),\n launchOffer: genericLaunchOfferSchema.optional(),\n});\nexport type GenericPricingPlan = z.infer<typeof genericPricingPlanSchema>;\n"]}