gymmonk-schema 0.2.0 → 0.3.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 (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 +361 -0
  58. package/dist/onboarding.d.ts.map +1 -0
  59. package/dist/onboarding.js +74 -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,59 @@
1
+ /**
2
+ * gymmonk-schema — Workout sessions, check-in & attendance
3
+ * ========================================================
4
+ * A member checks in to start a live session, marks exercises done, and checks
5
+ * out. Sessions roll up into attendance records the owner can review, and can
6
+ * also be recorded directly by an owner (manual attendance marking).
7
+ *
8
+ * @module gymmonk-schema/session
9
+ */
10
+ import { z } from 'zod';
11
+ import { isoDateSchema, isoDateTimeSchema, objectIdSchema, optionalTrimmedString, paginationSchema, } from './common.js';
12
+ import { weekdaySchema } from './shared.js';
13
+ // ─── Live session widget status ──────────────────────────────────────────────
14
+ export const sessionStatusSchema = z.enum(['idle', 'active', 'completed']);
15
+ // ─── Session entity ──────────────────────────────────────────────────────────
16
+ export const workoutSessionSchema = z.object({
17
+ id: objectIdSchema,
18
+ userId: objectIdSchema,
19
+ centerId: objectIdSchema,
20
+ status: sessionStatusSchema,
21
+ checkInAt: isoDateTimeSchema,
22
+ checkOutAt: isoDateTimeSchema.nullable(),
23
+ /** The plan weekday being trained, if the member is on a plan. */
24
+ planWeekday: weekdaySchema.nullable(),
25
+ completedExerciseIds: z.array(objectIdSchema),
26
+ totalExercises: z.number().int().nonnegative(),
27
+ });
28
+ // ─── Session mutations ───────────────────────────────────────────────────────
29
+ /** Check in — center resolved from the member's membership if omitted. */
30
+ export const checkInBodySchema = z.object({
31
+ centerId: objectIdSchema.optional(),
32
+ });
33
+ export const markExerciseDoneBodySchema = z.object({
34
+ exerciseId: objectIdSchema,
35
+ done: z.boolean(),
36
+ });
37
+ // ─── Attendance ──────────────────────────────────────────────────────────────
38
+ export const attendanceStatusSchema = z.enum(['present', 'absent', 'rest']);
39
+ export const attendanceEntrySchema = z.object({
40
+ date: isoDateSchema,
41
+ checkInAt: isoDateTimeSchema.nullable(),
42
+ checkOutAt: isoDateTimeSchema.nullable(),
43
+ status: attendanceStatusSchema,
44
+ });
45
+ export const attendanceQuerySchema = paginationSchema.extend({
46
+ userId: objectIdSchema.optional(),
47
+ from: isoDateSchema.optional(),
48
+ to: isoDateSchema.optional(),
49
+ });
50
+ /** Owner marking attendance for a member or staff member manually. */
51
+ export const markAttendanceBodySchema = z.object({
52
+ userId: objectIdSchema,
53
+ date: isoDateSchema.optional(),
54
+ status: attendanceStatusSchema.default('present'),
55
+ checkInAt: isoDateTimeSchema.optional(),
56
+ checkOutAt: isoDateTimeSchema.optional(),
57
+ note: optionalTrimmedString(160),
58
+ });
59
+ //# sourceMappingURL=session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session.js","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,gFAAgF;AAEhF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC;AAG3E,gFAAgF;AAEhF,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,EAAE,EAAE,cAAc;IAClB,MAAM,EAAE,cAAc;IACtB,QAAQ,EAAE,cAAc;IACxB,MAAM,EAAE,mBAAmB;IAC3B,SAAS,EAAE,iBAAiB;IAC5B,UAAU,EAAE,iBAAiB,CAAC,QAAQ,EAAE;IACxC,kEAAkE;IAClE,WAAW,EAAE,aAAa,CAAC,QAAQ,EAAE;IACrC,oBAAoB,EAAE,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC;IAC7C,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,G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AI,EAAE,qBAAqB,CAAC,GAAG,CAAC;CACjC,CAAC,CAAC","sourcesContent":["/**\n * gymmonk-schema — Workout sessions, check-in & attendance\n * ========================================================\n * A member checks in to start a live session, marks exercises done, and checks\n * out. Sessions roll up into attendance records the owner can review, and can\n * also be recorded directly by an owner (manual attendance marking).\n *\n * @module gymmonk-schema/session\n */\n\nimport { z } from 'zod';\nimport {\n isoDateSchema,\n isoDateTimeSchema,\n objectIdSchema,\n optionalTrimmedString,\n paginationSchema,\n} from './common.js';\nimport { weekdaySchema } from './shared.js';\n\n// ─── Live session widget status ──────────────────────────────────────────────\n\nexport const sessionStatusSchema = z.enum(['idle', 'active', 'completed']);\nexport type SessionStatus = z.infer<typeof sessionStatusSchema>;\n\n// ─── Session entity ──────────────────────────────────────────────────────────\n\nexport const workoutSessionSchema = z.object({\n id: objectIdSchema,\n userId: objectIdSchema,\n centerId: objectIdSchema,\n status: sessionStatusSchema,\n checkInAt: isoDateTimeSchema,\n checkOutAt: isoDateTimeSchema.nullable(),\n /** The plan weekday being trained, if the member is on a plan. */\n planWeekday: weekdaySchema.nullable(),\n completedExerciseIds: z.array(objectIdSchema),\n totalExercises: z.number().int().nonnegative(),\n});\nexport type WorkoutSession = z.infer<typeof workoutSessionSchema>;\n\n// ─── Session mutations ───────────────────────────────────────────────────────\n\n/** Check in — center resolved from the member's membership if omitted. */\nexport const checkInBodySchema = z.object({\n centerId: objectIdSchema.optional(),\n});\nexport type CheckInBody = z.infer<typeof checkInBodySchema>;\n\nexport const markExerciseDoneBodySchema = z.object({\n exerciseId: objectIdSchema,\n done: z.boolean(),\n});\nexport type MarkExerciseDoneBody = z.infer<typeof markExerciseDoneBodySchema>;\n\n// ─── Attendance ──────────────────────────────────────────────────────────────\n\nexport const attendanceStatusSchema = z.enum(['present', 'absent', 'rest']);\nexport type AttendanceStatus = z.infer<typeof attendanceStatusSchema>;\n\nexport const attendanceEntrySchema = z.object({\n date: isoDateSchema,\n checkInAt: isoDateTimeSchema.nullable(),\n checkOutAt: isoDateTimeSchema.nullable(),\n status: attendanceStatusSchema,\n});\nexport type AttendanceEntry = z.infer<typeof attendanceEntrySchema>;\n\nexport const attendanceQuerySchema = paginationSchema.extend({\n userId: objectIdSchema.optional(),\n from: isoDateSchema.optional(),\n to: isoDateSchema.optional(),\n});\nexport type AttendanceQuery = z.infer<typeof attendanceQuerySchema>;\n\n/** Owner marking attendance for a member or staff member manually. */\nexport const markAttendanceBodySchema = z.object({\n userId: objectIdSchema,\n date: isoDateSchema.optional(),\n status: attendanceStatusSchema.default('present'),\n checkInAt: isoDateTimeSchema.optional(),\n checkOutAt: isoDateTimeSchema.optional(),\n note: optionalTrimmedString(160),\n});\nexport type MarkAttendanceBody = z.infer<typeof markAttendanceBodySchema>;\n"]}
@@ -0,0 +1,199 @@
1
+ /**
2
+ * gymmonk-schema — Shared value objects & cross-domain enums
3
+ * ==========================================================
4
+ * The reusable domain vocabulary that more than one GymMonk module needs:
5
+ * gender, Indian states, blood groups, weekdays, plus the compound value
6
+ * objects (address, social links, opening hours) that appear on onboarding,
7
+ * organisation, center and member entities alike.
8
+ *
9
+ * Kept separate from `common.ts` (which holds domain-agnostic primitives) so a
10
+ * consumer can import the primitives without pulling India-specific vocab.
11
+ *
12
+ * @module gymmonk-schema/shared
13
+ */
14
+ import { z } from 'zod';
15
+ /** Gender, shared by member + owner onboarding and body-metric math. */
16
+ export declare const genderSchema: z.ZodEnum<{
17
+ male: "male";
18
+ female: "female";
19
+ other: "other";
20
+ }>;
21
+ export type Gender = z.infer<typeof genderSchema>;
22
+ /**
23
+ * ASCII-normalised blood groups. NOTE: the frontend mock rendered the negatives
24
+ * with a Unicode minus `−` (U+2212) — the canonical value is a plain `-`; the UI
25
+ * may pretty-print with the minus sign, but never persists it.
26
+ */
27
+ export declare const bloodGroupSchema: z.ZodEnum<{
28
+ "A+": "A+";
29
+ "A-": "A-";
30
+ "B+": "B+";
31
+ "B-": "B-";
32
+ "O+": "O+";
33
+ "O-": "O-";
34
+ "AB+": "AB+";
35
+ "AB-": "AB-";
36
+ }>;
37
+ export type BloodGroup = z.infer<typeof bloodGroupSchema>;
38
+ /** Three-letter weekday keys, Monday-first. */
39
+ export declare const WEEKDAYS: readonly ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
40
+ export declare const weekdaySchema: z.ZodEnum<{
41
+ mon: "mon";
42
+ tue: "tue";
43
+ wed: "wed";
44
+ thu: "thu";
45
+ fri: "fri";
46
+ sat: "sat";
47
+ sun: "sun";
48
+ }>;
49
+ export type Weekday = z.infer<typeof weekdaySchema>;
50
+ /** The 28 states + 8 union territories, as stored on any Address. */
51
+ export declare const INDIAN_STATES: readonly ["Andhra Pradesh", "Arunachal Pradesh", "Assam", "Bihar", "Chhattisgarh", "Goa", "Gujarat", "Haryana", "Himachal Pradesh", "Jharkhand", "Karnataka", "Kerala", "Madhya Pradesh", "Maharashtra", "Manipur", "Meghalaya", "Mizoram", "Nagaland", "Odisha", "Punjab", "Rajasthan", "Sikkim", "Tamil Nadu", "Telangana", "Tripura", "Uttar Pradesh", "Uttarakhand", "West Bengal", "Andaman and Nicobar Islands", "Chandigarh", "Dadra and Nagar Haveli and Daman and Diu", "Delhi", "Jammu and Kashmir", "Ladakh", "Lakshadweep", "Puducherry"];
52
+ export declare const indianStateSchema: z.ZodEnum<{
53
+ "Andhra Pradesh": "Andhra Pradesh";
54
+ "Arunachal Pradesh": "Arunachal Pradesh";
55
+ Assam: "Assam";
56
+ Bihar: "Bihar";
57
+ Chhattisgarh: "Chhattisgarh";
58
+ Goa: "Goa";
59
+ Gujarat: "Gujarat";
60
+ Haryana: "Haryana";
61
+ "Himachal Pradesh": "Himachal Pradesh";
62
+ Jharkhand: "Jharkhand";
63
+ Karnataka: "Karnataka";
64
+ Kerala: "Kerala";
65
+ "Madhya Pradesh": "Madhya Pradesh";
66
+ Maharashtra: "Maharashtra";
67
+ Manipur: "Manipur";
68
+ Meghalaya: "Meghalaya";
69
+ Mizoram: "Mizoram";
70
+ Nagaland: "Nagaland";
71
+ Odisha: "Odisha";
72
+ Punjab: "Punjab";
73
+ Rajasthan: "Rajasthan";
74
+ Sikkim: "Sikkim";
75
+ "Tamil Nadu": "Tamil Nadu";
76
+ Telangana: "Telangana";
77
+ Tripura: "Tripura";
78
+ "Uttar Pradesh": "Uttar Pradesh";
79
+ Uttarakhand: "Uttarakhand";
80
+ "West Bengal": "West Bengal";
81
+ "Andaman and Nicobar Islands": "Andaman and Nicobar Islands";
82
+ Chandigarh: "Chandigarh";
83
+ "Dadra and Nagar Haveli and Daman and Diu": "Dadra and Nagar Haveli and Daman and Diu";
84
+ Delhi: "Delhi";
85
+ "Jammu and Kashmir": "Jammu and Kashmir";
86
+ Ladakh: "Ladakh";
87
+ Lakshadweep: "Lakshadweep";
88
+ Puducherry: "Puducherry";
89
+ }>;
90
+ export type IndianState = z.infer<typeof indianStateSchema>;
91
+ /** A postal address used for members, organisations and centers. */
92
+ export declare const addressSchema: z.ZodObject<{
93
+ street: z.ZodString;
94
+ city: z.ZodString;
95
+ state: z.ZodEnum<{
96
+ "Andhra Pradesh": "Andhra Pradesh";
97
+ "Arunachal Pradesh": "Arunachal Pradesh";
98
+ Assam: "Assam";
99
+ Bihar: "Bihar";
100
+ Chhattisgarh: "Chhattisgarh";
101
+ Goa: "Goa";
102
+ Gujarat: "Gujarat";
103
+ Haryana: "Haryana";
104
+ "Himachal Pradesh": "Himachal Pradesh";
105
+ Jharkhand: "Jharkhand";
106
+ Karnataka: "Karnataka";
107
+ Kerala: "Kerala";
108
+ "Madhya Pradesh": "Madhya Pradesh";
109
+ Maharashtra: "Maharashtra";
110
+ Manipur: "Manipur";
111
+ Meghalaya: "Meghalaya";
112
+ Mizoram: "Mizoram";
113
+ Nagaland: "Nagaland";
114
+ Odisha: "Odisha";
115
+ Punjab: "Punjab";
116
+ Rajasthan: "Rajasthan";
117
+ Sikkim: "Sikkim";
118
+ "Tamil Nadu": "Tamil Nadu";
119
+ Telangana: "Telangana";
120
+ Tripura: "Tripura";
121
+ "Uttar Pradesh": "Uttar Pradesh";
122
+ Uttarakhand: "Uttarakhand";
123
+ "West Bengal": "West Bengal";
124
+ "Andaman and Nicobar Islands": "Andaman and Nicobar Islands";
125
+ Chandigarh: "Chandigarh";
126
+ "Dadra and Nagar Haveli and Daman and Diu": "Dadra and Nagar Haveli and Daman and Diu";
127
+ Delhi: "Delhi";
128
+ "Jammu and Kashmir": "Jammu and Kashmir";
129
+ Ladakh: "Ladakh";
130
+ Lakshadweep: "Lakshadweep";
131
+ Puducherry: "Puducherry";
132
+ }>;
133
+ pincode: z.ZodString;
134
+ }, z.core.$strip>;
135
+ export type Address = z.infer<typeof addressSchema>;
136
+ /** The social handles offered across GymMonk profiles/organisations. */
137
+ export declare const SOCIAL_PLATFORMS: readonly ["jansathi", "youtube", "instagram", "facebook"];
138
+ export declare const socialPlatformSchema: z.ZodEnum<{
139
+ jansathi: "jansathi";
140
+ youtube: "youtube";
141
+ instagram: "instagram";
142
+ facebook: "facebook";
143
+ }>;
144
+ export type SocialPlatform = z.infer<typeof socialPlatformSchema>;
145
+ /** Optional social handles/URLs (each empty string collapses to `undefined`). */
146
+ export declare const socialLinksSchema: z.ZodObject<{
147
+ jansathi: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
148
+ youtube: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
149
+ instagram: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
150
+ facebook: z.ZodPreprocess<z.ZodOptional<z.ZodString>>;
151
+ }, z.core.$strip>;
152
+ export type SocialLinks = z.infer<typeof socialLinksSchema>;
153
+ /** A single day's opening window. When `open` is false, `from`/`to` are ignored. */
154
+ export declare const dayHoursSchema: z.ZodObject<{
155
+ open: z.ZodBoolean;
156
+ from: z.ZodString;
157
+ to: z.ZodString;
158
+ }, z.core.$strip>;
159
+ export type DayHours = z.infer<typeof dayHoursSchema>;
160
+ /** A full weekly opening schedule, one window per weekday. */
161
+ export declare const weeklyHoursSchema: z.ZodObject<{
162
+ mon: z.ZodObject<{
163
+ open: z.ZodBoolean;
164
+ from: z.ZodString;
165
+ to: z.ZodString;
166
+ }, z.core.$strip>;
167
+ tue: z.ZodObject<{
168
+ open: z.ZodBoolean;
169
+ from: z.ZodString;
170
+ to: z.ZodString;
171
+ }, z.core.$strip>;
172
+ wed: z.ZodObject<{
173
+ open: z.ZodBoolean;
174
+ from: z.ZodString;
175
+ to: z.ZodString;
176
+ }, z.core.$strip>;
177
+ thu: z.ZodObject<{
178
+ open: z.ZodBoolean;
179
+ from: z.ZodString;
180
+ to: z.ZodString;
181
+ }, z.core.$strip>;
182
+ fri: z.ZodObject<{
183
+ open: z.ZodBoolean;
184
+ from: z.ZodString;
185
+ to: z.ZodString;
186
+ }, z.core.$strip>;
187
+ sat: z.ZodObject<{
188
+ open: z.ZodBoolean;
189
+ from: z.ZodString;
190
+ to: z.ZodString;
191
+ }, z.core.$strip>;
192
+ sun: z.ZodObject<{
193
+ open: z.ZodBoolean;
194
+ from: z.ZodString;
195
+ to: z.ZodString;
196
+ }, z.core.$strip>;
197
+ }, z.core.$strip>;
198
+ export type WeeklyHours = z.infer<typeof weeklyHoursSchema>;
199
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,wEAAwE;AACxE,eAAO,MAAM,YAAY;;;;EAAsC,CAAC;AAChE,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAIlD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;EAA6D,CAAC;AAC3F,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAI1D,+CAA+C;AAC/C,eAAO,MAAM,QAAQ,4DA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k-schema — Shared value objects & cross-domain enums
3
+ * ==========================================================
4
+ * The reusable domain vocabulary that more than one GymMonk module needs:
5
+ * gender, Indian states, blood groups, weekdays, plus the compound value
6
+ * objects (address, social links, opening hours) that appear on onboarding,
7
+ * organisation, center and member entities alike.
8
+ *
9
+ * Kept separate from `common.ts` (which holds domain-agnostic primitives) so a
10
+ * consumer can import the primitives without pulling India-specific vocab.
11
+ *
12
+ * @module gymmonk-schema/shared
13
+ */
14
+ import { z } from 'zod';
15
+ import { optionalTrimmedString, pincodeSchema, timeOfDaySchema } from './common.js';
16
+ // ─── Gender ──────────────────────────────────────────────────────────────────
17
+ /** Gender, shared by member + owner onboarding and body-metric math. */
18
+ export const genderSchema = z.enum(['male', 'female', 'other']);
19
+ // ─── Blood group ─────────────────────────────────────────────────────────────
20
+ /**
21
+ * ASCII-normalised blood groups. NOTE: the frontend mock rendered the negatives
22
+ * with a Unicode minus `−` (U+2212) — the canonical value is a plain `-`; the UI
23
+ * may pretty-print with the minus sign, but never persists it.
24
+ */
25
+ export const bloodGroupSchema = z.enum(['A+', 'A-', 'B+', 'B-', 'O+', 'O-', 'AB+', 'AB-']);
26
+ // ─── Weekdays ────────────────────────────────────────────────────────────────
27
+ /** Three-letter weekday keys, Monday-first. */
28
+ export const WEEKDAYS = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];
29
+ export const weekdaySchema = z.enum(WEEKDAYS);
30
+ // ─── Indian states & union territories ───────────────────────────────────────
31
+ /** The 28 states + 8 union territories, as stored on any Address. */
32
+ export const INDIAN_STATES = [
33
+ 'Andhra Pradesh',
34
+ 'Arunachal Pradesh',
35
+ 'Assam',
36
+ 'Bihar',
37
+ 'Chhattisgarh',
38
+ 'Goa',
39
+ 'Gujarat',
40
+ 'Haryana',
41
+ 'Himachal Pradesh',
42
+ 'Jharkhand',
43
+ 'Karnataka',
44
+ 'Kerala',
45
+ 'Madhya Pradesh',
46
+ 'Maharashtra',
47
+ 'Manipur',
48
+ 'Meghalaya',
49
+ 'Mizoram',
50
+ 'Nagaland',
51
+ 'Odisha',
52
+ 'Punjab',
53
+ 'Rajasthan',
54
+ 'Sikkim',
55
+ 'Tamil Nadu',
56
+ 'Telangana',
57
+ 'Tripura',
58
+ 'Uttar Pradesh',
59
+ 'Uttarakhand',
60
+ 'West Bengal',
61
+ 'Andaman and Nicobar Islands',
62
+ 'Chandigarh',
63
+ 'Dadra and Nagar Haveli and Daman and Diu',
64
+ 'Delhi',
65
+ 'Jammu and Kashmir',
66
+ 'Ladakh',
67
+ 'Lakshadweep',
68
+ 'Puducherry',
69
+ ];
70
+ export const indianStateSchema = z.enum(INDIAN_STATES);
71
+ // ─── Address ─────────────────────────────────────────────────────────────────
72
+ /** A postal address used for members, organisations and centers. */
73
+ export const addressSchema = z.object({
74
+ street: z.string().trim().min(1, 'Street address is required').max(200),
75
+ city: z.string().trim().min(1, 'City is required').max(100),
76
+ state: indianStateSchema,
77
+ pincode: pincodeSchema,
78
+ });
79
+ // ─── Social links ────────────────────────────────────────────────────────────
80
+ /** The social handles offered across GymMonk profiles/organisations. */
81
+ export const SOCIAL_PLATFORMS = ['jansathi', 'youtube', 'instagram', 'facebook'];
82
+ export const socialPlatformSchema = z.enum(SOCIAL_PLATFORMS);
83
+ /** Optional social handles/URLs (each empty string collapses to `undefined`). */
84
+ export const socialLinksSchema = z.object({
85
+ jansathi: optionalTrimmedString(200),
86
+ youtube: optionalTrimmedString(200),
87
+ instagram: optionalTrimmedString(200),
88
+ facebook: optionalTrimmedString(200),
89
+ });
90
+ // ─── Opening hours ───────────────────────────────────────────────────────────
91
+ /** A single day's opening window. When `open` is false, `from`/`to` are ignored. */
92
+ export const dayHoursSchema = z.object({
93
+ open: z.boolean(),
94
+ from: timeOfDaySchema,
95
+ to: timeOfDaySchema,
96
+ });
97
+ /** A full weekly opening schedule, one window per weekday. */
98
+ export const weeklyHoursSchema = z.object({
99
+ mon: dayHoursSchema,
100
+ tue: dayHoursSchema,
101
+ wed: dayHoursSchema,
102
+ thu: dayHoursSchema,
103
+ fri: dayHoursSchema,
104
+ sat: dayHoursSchema,
105
+ sun: dayHoursSchema,
106
+ });
107
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../src/shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEpF,gFAAgF;AAEhF,wEAAwE;AACxE,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAGhE,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AAG3F,gFAAgF;AAEhF,+CAA+C;AAC/C,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AACnF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAG9C,gFAAgF;AAEhF,qEAAqE;AACrE,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,gBAAgB;IAChB,mBAAmB;IACnB,OAAO;IACP,OAAO;IACP,cAAc;IACd,KAAK;IACL,SAAS;IACT,SAAS;IACT,kBAAkB;IAClB,WAAW;IACX,WAAW;IACX,QAAQ;IACR,gBAAgB;IAChB,aAAa;IACb,SAAS;IACT,WAAW;IACX,SAAS;IACT,UAAU;IACV,Q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gF;AAEhF,oFAAoF;AACpF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,IAAI,EAAE,CAAC,CAAC,OAAO,EAAE;IACjB,IAAI,EAAE,eAAe;IACrB,EAAE,EAAE,eAAe;CACpB,CAAC,CAAC;AAGH,8DAA8D;AAC9D,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,cAAc;CACpB,CAAC,CAAC","sourcesContent":["/**\n * gymmonk-schema — Shared value objects & cross-domain enums\n * ==========================================================\n * The reusable domain vocabulary that more than one GymMonk module needs:\n * gender, Indian states, blood groups, weekdays, plus the compound value\n * objects (address, social links, opening hours) that appear on onboarding,\n * organisation, center and member entities alike.\n *\n * Kept separate from `common.ts` (which holds domain-agnostic primitives) so a\n * consumer can import the primitives without pulling India-specific vocab.\n *\n * @module gymmonk-schema/shared\n */\n\nimport { z } from 'zod';\nimport { optionalTrimmedString, pincodeSchema, timeOfDaySchema } from './common.js';\n\n// ─── Gender ──────────────────────────────────────────────────────────────────\n\n/** Gender, shared by member + owner onboarding and body-metric math. */\nexport const genderSchema = z.enum(['male', 'female', 'other']);\nexport type Gender = z.infer<typeof genderSchema>;\n\n// ─── Blood group ─────────────────────────────────────────────────────────────\n\n/**\n * ASCII-normalised blood groups. NOTE: the frontend mock rendered the negatives\n * with a Unicode minus `−` (U+2212) — the canonical value is a plain `-`; the UI\n * may pretty-print with the minus sign, but never persists it.\n */\nexport const bloodGroupSchema = z.enum(['A+', 'A-', 'B+', 'B-', 'O+', 'O-', 'AB+', 'AB-']);\nexport type BloodGroup = z.infer<typeof bloodGroupSchema>;\n\n// ─── Weekdays ────────────────────────────────────────────────────────────────\n\n/** Three-letter weekday keys, Monday-first. */\nexport const WEEKDAYS = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'] as const;\nexport const weekdaySchema = z.enum(WEEKDAYS);\nexport type Weekday = z.infer<typeof weekdaySchema>;\n\n// ─── Indian states & union territories ───────────────────────────────────────\n\n/** The 28 states + 8 union territories, as stored on any Address. */\nexport const INDIAN_STATES = [\n 'Andhra Pradesh',\n 'Arunachal Pradesh',\n 'Assam',\n 'Bihar',\n 'Chhattisgarh',\n 'Goa',\n 'Gujarat',\n 'Haryana',\n 'Himachal Pradesh',\n 'Jharkhand',\n 'Karnataka',\n 'Kerala',\n 'Madhya Pradesh',\n 'Maharashtra',\n 'Manipur',\n 'Meghalaya',\n 'Mizoram',\n 'Nagaland',\n 'Odisha',\n 'Punjab',\n 'Rajasthan',\n 'Sikkim',\n 'Tamil Nadu',\n 'Telangana',\n 'Tripura',\n 'Uttar Pradesh',\n 'Uttarakhand',\n 'West Bengal',\n 'Andaman and Nicobar Islands',\n 'Chandigarh',\n 'Dadra and Nagar Haveli and Daman and Diu',\n 'Delhi',\n 'Jammu and Kashmir',\n 'Ladakh',\n 'Lakshadweep',\n 'Puducherry',\n] as const;\nexport const indianStateSchema = z.enum(INDIAN_STATES);\nexport type IndianState = z.infer<typeof indianStateSchema>;\n\n// ─── Address ─────────────────────────────────────────────────────────────────\n\n/** A postal address used for members, organisations and centers. */\nexport const addressSchema = z.object({\n street: z.string().trim().min(1, 'Street address is required').max(200),\n city: z.string().trim().min(1, 'City is required').max(100),\n state: indianStateSchema,\n pincode: pincodeSchema,\n});\nexport type Address = z.infer<typeof addressSchema>;\n\n// ─── Social links ────────────────────────────────────────────────────────────\n\n/** The social handles offered across GymMonk profiles/organisations. */\nexport const SOCIAL_PLATFORMS = ['jansathi', 'youtube', 'instagram', 'facebook'] as const;\nexport const socialPlatformSchema = z.enum(SOCIAL_PLATFORMS);\nexport type SocialPlatform = z.infer<typeof socialPlatformSchema>;\n\n/** Optional social handles/URLs (each empty string collapses to `undefined`). */\nexport const socialLinksSchema = z.object({\n jansathi: optionalTrimmedString(200),\n youtube: optionalTrimmedString(200),\n instagram: optionalTrimmedString(200),\n facebook: optionalTrimmedString(200),\n});\nexport type SocialLinks = z.infer<typeof socialLinksSchema>;\n\n// ─── Opening hours ───────────────────────────────────────────────────────────\n\n/** A single day's opening window. When `open` is false, `from`/`to` are ignored. */\nexport const dayHoursSchema = z.object({\n open: z.boolean(),\n from: timeOfDaySchema,\n to: timeOfDaySchema,\n});\nexport type DayHours = z.infer<typeof dayHoursSchema>;\n\n/** A full weekly opening schedule, one window per weekday. */\nexport const weeklyHoursSchema = z.object({\n mon: dayHoursSchema,\n tue: dayHoursSchema,\n wed: dayHoursSchema,\n thu: dayHoursSchema,\n fri: dayHoursSchema,\n sat: dayHoursSchema,\n sun: dayHoursSchema,\n});\nexport type WeeklyHours = z.infer<typeof weeklyHoursSchema>;\n"]}