@gymspace/shared 1.2.4 → 1.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,795 @@
1
+ import { z } from 'zod';
2
+
3
+ declare enum UserType {
4
+ OWNER = "owner",
5
+ COLLABORATOR = "collaborator"
6
+ }
7
+ declare enum SubscriptionStatus {
8
+ ACTIVE = "active",
9
+ INACTIVE = "inactive",
10
+ EXPIRED = "expired",
11
+ PAUSED = "paused",
12
+ PENDING_UPGRADE = "pending_upgrade"
13
+ }
14
+ declare enum CollaboratorStatus {
15
+ PENDING = "pending",
16
+ ACTIVE = "active",
17
+ INACTIVE = "inactive"
18
+ }
19
+ declare enum InvitationStatus {
20
+ PENDING = "pending",
21
+ ACCEPTED = "accepted",
22
+ CANCELLED = "cancelled",
23
+ EXPIRED = "expired"
24
+ }
25
+ declare enum ClientStatus {
26
+ ACTIVE = "active",
27
+ INACTIVE = "inactive"
28
+ }
29
+ declare enum PlanStatus {
30
+ ACTIVE = "active",
31
+ INACTIVE = "inactive",
32
+ ARCHIVED = "archived"
33
+ }
34
+ declare enum ContractStatus {
35
+ PENDING = "pending",
36
+ ACTIVE = "active",
37
+ EXPIRING_SOON = "expiring_soon",
38
+ EXPIRED = "expired",
39
+ CANCELLED = "cancelled",
40
+ FOR_RENEW = "for_renew"
41
+ }
42
+ declare enum PaymentFrequency {
43
+ MONTHLY = "monthly",
44
+ QUARTERLY = "quarterly",
45
+ ANNUAL = "annual"
46
+ }
47
+ declare enum AssetStatus {
48
+ ACTIVE = "active",
49
+ DELETED = "deleted"
50
+ }
51
+ declare enum EvaluationType {
52
+ INITIAL = "initial",
53
+ PROGRESS = "progress",
54
+ FINAL = "final"
55
+ }
56
+ declare enum EvaluationStatus {
57
+ OPEN = "open",
58
+ IN_PROGRESS = "in_progress",
59
+ COMPLETED = "completed",
60
+ CANCELLED = "cancelled"
61
+ }
62
+ declare enum CommentType {
63
+ PROGRESS_NOTE = "progress_note",
64
+ PHONE_CALL = "phone_call",
65
+ MEETING = "meeting",
66
+ REMINDER = "reminder",
67
+ OTHER = "other"
68
+ }
69
+ declare enum AssetCategory {
70
+ MEDICAL_DOCUMENT = "medical_document",
71
+ IDENTIFICATION = "identification",
72
+ INSURANCE = "insurance",
73
+ CONTRACT_COPY = "contract_copy",
74
+ OTHER = "other"
75
+ }
76
+ declare enum ContractAssetType {
77
+ PAYMENT_RECEIPT = "payment_receipt",
78
+ CONTRACT_DOCUMENT = "contract_document",
79
+ IDENTIFICATION = "identification",
80
+ OTHER = "other"
81
+ }
82
+ declare enum EvaluationAssetStage {
83
+ INITIAL = "initial",
84
+ PROGRESS = "progress",
85
+ FINAL = "final"
86
+ }
87
+ declare enum EvaluationAssetCategory {
88
+ BODY_PHOTO = "body_photo",
89
+ MEASUREMENT_PHOTO = "measurement_photo",
90
+ DOCUMENT = "document",
91
+ REPORT = "report",
92
+ OTHER = "other"
93
+ }
94
+ declare enum LeadStatus {
95
+ NEW = "NEW",
96
+ CONTACTED = "CONTACTED",
97
+ INTERESTED = "INTERESTED",
98
+ CONVERTED = "CONVERTED",
99
+ LOST = "LOST"
100
+ }
101
+
102
+ type TemplateCodeValue = (typeof TemplateCode)[keyof typeof TemplateCode];
103
+ /**
104
+ * Template codes for WhatsApp messages
105
+ */
106
+ declare const TemplateCode: {
107
+ readonly WELCOME: "WELCOME";
108
+ readonly MEMBERSHIP_PURCHASE: "MEMBERSHIP_PURCHASE";
109
+ readonly MEMBERSHIP_RENEWAL: "MEMBERSHIP_RENEWAL";
110
+ readonly MEMBERSHIP_EXPIRING: "MEMBERSHIP_EXPIRING";
111
+ readonly PAYMENT_REMINDER: "PAYMENT_REMINDER";
112
+ readonly BIRTHDAY: "BIRTHDAY";
113
+ readonly PAYMENT_RECEIPT: "PAYMENT_RECEIPT";
114
+ };
115
+ type TemplateCode = TemplateCodeValue;
116
+ type TemplateTypeValue = (typeof TemplateType)[keyof typeof TemplateType];
117
+ /**
118
+ * Template types
119
+ */
120
+ declare const TemplateType: {
121
+ readonly STATIC: "STATIC";
122
+ readonly PROMPT: "PROMPT";
123
+ };
124
+ type TemplateType = TemplateTypeValue;
125
+ /**
126
+ * Base interface for WhatsApp template data
127
+ */
128
+ interface WhatsAppTemplateData {
129
+ gymId: string;
130
+ clientId: string;
131
+ phoneNumber: string;
132
+ templateCode: TemplateCode;
133
+ variables: Record<string, any>;
134
+ metadata?: {
135
+ contractId?: string;
136
+ userId?: string;
137
+ source?: string;
138
+ instanceName?: string;
139
+ };
140
+ }
141
+ /**
142
+ * Welcome message template data
143
+ */
144
+ interface WelcomeTemplateData extends Omit<WhatsAppTemplateData, 'templateCode' | 'variables'> {
145
+ templateCode: typeof TemplateCode.WELCOME;
146
+ variables: {
147
+ clientName: string;
148
+ gymName: string;
149
+ registrationDate: string;
150
+ };
151
+ }
152
+ /**
153
+ * Membership purchase template data
154
+ */
155
+ interface MembershipPurchaseTemplateData extends Omit<WhatsAppTemplateData, 'templateCode' | 'variables'> {
156
+ templateCode: typeof TemplateCode.MEMBERSHIP_PURCHASE;
157
+ variables: {
158
+ clientName: string;
159
+ planName: string;
160
+ startDate: string;
161
+ endDate: string;
162
+ amount: string;
163
+ paymentFrequency: string;
164
+ };
165
+ }
166
+ /**
167
+ * Membership renewal template data
168
+ */
169
+ interface MembershipRenewalTemplateData extends Omit<WhatsAppTemplateData, 'templateCode' | 'variables'> {
170
+ templateCode: typeof TemplateCode.MEMBERSHIP_RENEWAL;
171
+ variables: {
172
+ clientName: string;
173
+ planName: string;
174
+ newEndDate: string;
175
+ amount: string;
176
+ };
177
+ }
178
+ /**
179
+ * Membership expiring template data
180
+ */
181
+ interface MembershipExpiringTemplateData extends Omit<WhatsAppTemplateData, 'templateCode' | 'variables'> {
182
+ templateCode: typeof TemplateCode.MEMBERSHIP_EXPIRING;
183
+ variables: {
184
+ clientName: string;
185
+ planName: string;
186
+ expirationDate: string;
187
+ daysRemaining: string;
188
+ };
189
+ }
190
+ /**
191
+ * Payment reminder template data
192
+ */
193
+ interface PaymentReminderTemplateData extends Omit<WhatsAppTemplateData, 'templateCode' | 'variables'> {
194
+ templateCode: typeof TemplateCode.PAYMENT_REMINDER;
195
+ variables: {
196
+ clientName: string;
197
+ amount: string;
198
+ dueDate: string;
199
+ planName: string;
200
+ };
201
+ }
202
+ /**
203
+ * Birthday template data
204
+ */
205
+ interface BirthdayTemplateData extends Omit<WhatsAppTemplateData, 'templateCode' | 'variables'> {
206
+ templateCode: typeof TemplateCode.BIRTHDAY;
207
+ variables: {
208
+ clientName: string;
209
+ gymName: string;
210
+ age: string;
211
+ };
212
+ }
213
+ /**
214
+ * Payment receipt template data
215
+ */
216
+ interface PaymentReceiptTemplateData extends Omit<WhatsAppTemplateData, 'templateCode' | 'variables'> {
217
+ templateCode: typeof TemplateCode.PAYMENT_RECEIPT;
218
+ variables: {
219
+ gymName: string;
220
+ receiptNumber: string;
221
+ date: string;
222
+ clientName: string;
223
+ items: string;
224
+ amount: string;
225
+ paymentMethod: string;
226
+ };
227
+ metadata?: {
228
+ saleId?: string;
229
+ userId?: string;
230
+ source?: string;
231
+ instanceName?: string;
232
+ };
233
+ }
234
+ /**
235
+ * Union type for all template data types
236
+ */
237
+ type WhatsAppTemplateEventData = WelcomeTemplateData | MembershipPurchaseTemplateData | MembershipRenewalTemplateData | MembershipExpiringTemplateData | PaymentReminderTemplateData | BirthdayTemplateData | PaymentReceiptTemplateData;
238
+ /**
239
+ * Template metadata interface
240
+ */
241
+ interface TemplateMetadata {
242
+ code: TemplateCode;
243
+ title: string;
244
+ description: string;
245
+ icon: string;
246
+ variables: string[];
247
+ exampleValues: Record<string, string>;
248
+ }
249
+
250
+ type UUID = string;
251
+ type Currency = 'USD' | 'EUR' | 'PEN' | 'MXN' | 'COP' | 'ARS' | 'CLP';
252
+ type EntityType = 'user' | 'organization' | 'gym' | 'collaborator' | 'client' | 'contract' | 'evaluation' | 'asset';
253
+ type Permission = 'SUPER_ADMIN' | 'OWNER' | 'ORGANIZATIONS_CREATE' | 'ORGANIZATIONS_READ' | 'ORGANIZATIONS_UPDATE' | 'ORGANIZATIONS_DELETE' | 'GYMS_CREATE' | 'GYMS_READ' | 'GYMS_UPDATE' | 'GYMS_DELETE' | 'COLLABORATORS_CREATE' | 'COLLABORATORS_READ' | 'COLLABORATORS_UPDATE' | 'COLLABORATORS_DELETE' | 'CLIENTS_CREATE' | 'CLIENTS_READ' | 'CLIENTS_UPDATE' | 'CLIENTS_DELETE' | 'CONTRACTS_CREATE' | 'CONTRACTS_READ' | 'CONTRACTS_UPDATE' | 'CONTRACTS_APPROVE' | 'CONTRACTS_CANCEL' | 'EVALUATIONS_CREATE' | 'EVALUATIONS_READ' | 'EVALUATIONS_UPDATE' | 'EVALUATIONS_DELETE' | 'CHECKINS_CREATE' | 'CHECKINS_READ' | 'LEADS_CREATE' | 'LEADS_READ' | 'LEADS_UPDATE' | 'LEADS_DELETE' | 'REPORTS_VIEW' | 'REPORTS_FINANCIAL' | 'SETTINGS_UPDATE' | 'ASSETS_CREATE' | 'ASSETS_READ' | 'ASSETS_DELETE' | 'FILES_CREATE' | 'FILES_READ' | 'FILES_DELETE' | 'PRODUCTS_CREATE' | 'PRODUCTS_READ' | 'PRODUCTS_UPDATE' | 'PRODUCTS_DELETE' | 'PRODUCT_CATEGORIES_CREATE' | 'PRODUCT_CATEGORIES_READ' | 'PRODUCT_CATEGORIES_UPDATE' | 'PRODUCT_CATEGORIES_DELETE' | 'SALES_CREATE' | 'SALES_READ' | 'SALES_UPDATE' | 'SALES_DELETE' | 'SUPPLIERS_CREATE' | 'SUPPLIERS_READ' | 'SUPPLIERS_UPDATE' | 'SUPPLIERS_DELETE' | 'PAYMENT_METHODS_CREATE' | 'PAYMENT_METHODS_READ' | 'PAYMENT_METHODS_UPDATE' | 'PAYMENT_METHODS_DELETE' | 'WHATSAPP_READ' | 'WHATSAPP_SEND' | 'WHATSAPP_MANAGE';
254
+ interface AuditFields {
255
+ createdByUserId: UUID;
256
+ updatedByUserId?: UUID;
257
+ createdAt: Date;
258
+ updatedAt: Date;
259
+ deletedAt?: Date;
260
+ }
261
+ interface PaginationParams {
262
+ page: number;
263
+ limit: number;
264
+ sortBy?: string;
265
+ sortOrder?: 'asc' | 'desc';
266
+ }
267
+ interface PaginationMeta {
268
+ total: number;
269
+ page: number;
270
+ limit: number;
271
+ totalPages: number;
272
+ hasNext: boolean;
273
+ hasPrevious: boolean;
274
+ }
275
+ interface PaginatedResponse<T> {
276
+ data: T[];
277
+ meta: PaginationMeta;
278
+ }
279
+ interface User {
280
+ id: UUID;
281
+ email: string;
282
+ name: string;
283
+ phone?: string;
284
+ birthDate?: Date;
285
+ userType: UserType;
286
+ }
287
+ interface Role {
288
+ id: UUID;
289
+ name: string;
290
+ permissions: Permission[];
291
+ description?: string;
292
+ canManageEvaluations: boolean;
293
+ }
294
+ interface Collaborator {
295
+ id: UUID;
296
+ userId: UUID;
297
+ gymId: UUID;
298
+ roleId: UUID;
299
+ status: CollaboratorStatus;
300
+ hiredDate?: Date;
301
+ profilePhotoId?: string;
302
+ coverPhotoId?: string;
303
+ description?: string;
304
+ specialties?: any;
305
+ user?: User;
306
+ role?: Role;
307
+ }
308
+ interface Invitation {
309
+ id: UUID;
310
+ gymId: UUID;
311
+ email: string;
312
+ roleId: UUID;
313
+ token: string;
314
+ code: string;
315
+ status: InvitationStatus;
316
+ expiresAt: Date;
317
+ invitedByUserId: UUID;
318
+ acceptedByUserId?: UUID;
319
+ acceptedAt?: Date;
320
+ role?: Role;
321
+ }
322
+ interface CreateInvitationDto {
323
+ gymId: UUID;
324
+ email: string;
325
+ roleId: UUID;
326
+ }
327
+ interface AcceptInvitationDto {
328
+ token?: string;
329
+ code?: string;
330
+ name: string;
331
+ phone: string;
332
+ password: string;
333
+ }
334
+ interface ValidateByCodeDto {
335
+ code: string;
336
+ }
337
+ interface UpdateCollaboratorDto {
338
+ hiredDate?: string;
339
+ profilePhotoId?: string;
340
+ coverPhotoId?: string;
341
+ description?: string;
342
+ specialties?: any;
343
+ }
344
+ interface UpdateCollaboratorStatusDto {
345
+ status: 'active' | 'inactive';
346
+ }
347
+ interface UpdateCollaboratorRoleDto {
348
+ roleId: UUID;
349
+ }
350
+ interface ListCollaboratorsParams extends PaginationParams {
351
+ status?: CollaboratorStatus;
352
+ roleId?: UUID;
353
+ search?: string;
354
+ }
355
+ interface ActivityQueryParams {
356
+ startDate?: string;
357
+ endDate?: string;
358
+ limit?: number;
359
+ type?: string;
360
+ }
361
+ interface StatsQueryParams {
362
+ startDate?: string;
363
+ endDate?: string;
364
+ }
365
+ interface CollaboratorStats {
366
+ contracts: {
367
+ total: number;
368
+ totalAmount: number;
369
+ averageAmount: number;
370
+ };
371
+ checkIns: {
372
+ total: number;
373
+ };
374
+ sales: {
375
+ total: number;
376
+ totalAmount: number;
377
+ };
378
+ clients: {
379
+ created: number;
380
+ };
381
+ }
382
+ interface ActivityItem {
383
+ type: string;
384
+ timestamp: Date;
385
+ description: string;
386
+ metadata: any;
387
+ }
388
+
389
+ interface IUser {
390
+ id: UUID;
391
+ email: string;
392
+ name: string;
393
+ phone?: string;
394
+ userType: UserType;
395
+ emailVerifiedAt?: Date;
396
+ }
397
+ interface IOrganization {
398
+ id: UUID;
399
+ ownerUserId: UUID;
400
+ name: string;
401
+ subscriptionPlanId: UUID;
402
+ subscriptionStatus: string;
403
+ subscriptionStart: Date;
404
+ subscriptionEnd: Date;
405
+ country: string;
406
+ currency: string;
407
+ timezone: string;
408
+ settings?: Record<string, any>;
409
+ }
410
+ interface IGym {
411
+ id: UUID;
412
+ organizationId: UUID;
413
+ name: string;
414
+ address?: string;
415
+ description?: string;
416
+ phone?: string;
417
+ gymCode: string;
418
+ profileAssetId?: UUID;
419
+ coverAssetId?: UUID;
420
+ evaluationStructure?: Record<string, any>;
421
+ }
422
+ interface ICollaborator {
423
+ id: UUID;
424
+ userId: UUID;
425
+ gymId: UUID;
426
+ roleId: UUID;
427
+ status: CollaboratorStatus;
428
+ hiredDate?: Date;
429
+ invitationId?: UUID;
430
+ profileAssetId?: UUID;
431
+ coverAssetId?: UUID;
432
+ description?: string;
433
+ specialties?: string[];
434
+ }
435
+ interface IRole {
436
+ id: UUID;
437
+ name: string;
438
+ permissions: Permission[];
439
+ description?: string;
440
+ canManageEvaluations: boolean;
441
+ }
442
+ interface ISubscriptionPlan {
443
+ id: UUID;
444
+ name: string;
445
+ price: any;
446
+ billingFrequency: string;
447
+ maxGyms: number;
448
+ maxClientsPerGym: number;
449
+ maxUsersPerGym: number;
450
+ features: any;
451
+ description?: string;
452
+ }
453
+ interface ISubscription {
454
+ id: UUID;
455
+ organizationId: UUID;
456
+ subscriptionPlanId: UUID;
457
+ subscriptionPlan?: ISubscriptionPlan;
458
+ status: string;
459
+ startDate: Date;
460
+ endDate: Date;
461
+ isActive: boolean;
462
+ }
463
+ interface IRequestContext {
464
+ user?: IUser;
465
+ gym?: IGym;
466
+ organization?: IOrganization;
467
+ subscription?: ISubscription;
468
+ permissions: Permission[];
469
+ hasPermission(permission: Permission): boolean;
470
+ canAccess(resource: string, action: string): boolean;
471
+ getGymId(): UUID | undefined;
472
+ getOrganizationId(): UUID | undefined;
473
+ getUserId(): UUID | undefined;
474
+ getTimezone(): string;
475
+ readonly isOwner: boolean;
476
+ readonly isCollaborator: boolean;
477
+ }
478
+
479
+ /**
480
+ * Template code constants
481
+ */
482
+ declare const TEMPLATE_CODES: {
483
+ readonly WELCOME: "WELCOME";
484
+ readonly MEMBERSHIP_PURCHASE: "MEMBERSHIP_PURCHASE";
485
+ readonly MEMBERSHIP_RENEWAL: "MEMBERSHIP_RENEWAL";
486
+ readonly MEMBERSHIP_EXPIRING: "MEMBERSHIP_EXPIRING";
487
+ readonly PAYMENT_REMINDER: "PAYMENT_REMINDER";
488
+ readonly BIRTHDAY: "BIRTHDAY";
489
+ readonly PAYMENT_RECEIPT: "PAYMENT_RECEIPT";
490
+ };
491
+ /**
492
+ * Event names for WhatsApp template events
493
+ */
494
+ declare const WHATSAPP_TEMPLATE_EVENTS: {
495
+ readonly SEND_TEMPLATE: "whatsapp/template.send";
496
+ readonly TEMPLATE_SENT: "whatsapp/template.sent";
497
+ readonly TEMPLATE_FAILED: "whatsapp/template.failed";
498
+ };
499
+ /**
500
+ * Template metadata mapping
501
+ */
502
+ declare const TEMPLATE_METADATA: {
503
+ readonly WELCOME: {
504
+ readonly code: "WELCOME";
505
+ readonly title: "Mensaje de Bienvenida";
506
+ readonly description: "Mensaje para nuevos clientes";
507
+ readonly icon: "UserPlus";
508
+ readonly variables: readonly ["clientName", "gymName", "registrationDate"];
509
+ readonly exampleValues: {
510
+ readonly clientName: "Juan Pérez";
511
+ readonly gymName: "GymSpace";
512
+ readonly registrationDate: "15/01/2024";
513
+ };
514
+ };
515
+ readonly MEMBERSHIP_PURCHASE: {
516
+ readonly code: "MEMBERSHIP_PURCHASE";
517
+ readonly title: "Compra de Membresía";
518
+ readonly description: "Confirmación de nueva membresía";
519
+ readonly icon: "ShoppingCart";
520
+ readonly variables: readonly ["clientName", "planName", "startDate", "endDate", "amount", "paymentFrequency"];
521
+ readonly exampleValues: {
522
+ readonly clientName: "María López";
523
+ readonly planName: "Premium";
524
+ readonly startDate: "01/02/2024";
525
+ readonly endDate: "01/03/2024";
526
+ readonly amount: "$50.00";
527
+ readonly paymentFrequency: "mensual";
528
+ };
529
+ };
530
+ readonly MEMBERSHIP_RENEWAL: {
531
+ readonly code: "MEMBERSHIP_RENEWAL";
532
+ readonly title: "Renovación de Membresía";
533
+ readonly description: "Confirmación de renovación";
534
+ readonly icon: "RefreshCw";
535
+ readonly variables: readonly ["clientName", "planName", "newEndDate", "amount"];
536
+ readonly exampleValues: {
537
+ readonly clientName: "Carlos Ruiz";
538
+ readonly planName: "Básico";
539
+ readonly newEndDate: "15/04/2024";
540
+ readonly amount: "$30.00";
541
+ };
542
+ };
543
+ readonly MEMBERSHIP_EXPIRING: {
544
+ readonly code: "MEMBERSHIP_EXPIRING";
545
+ readonly title: "Membresía Por Vencer";
546
+ readonly description: "Recordatorio de expiración próxima";
547
+ readonly icon: "AlertCircle";
548
+ readonly variables: readonly ["clientName", "planName", "expirationDate", "daysRemaining"];
549
+ readonly exampleValues: {
550
+ readonly clientName: "Ana García";
551
+ readonly planName: "Premium";
552
+ readonly expirationDate: "20/02/2024";
553
+ readonly daysRemaining: "3";
554
+ };
555
+ };
556
+ readonly PAYMENT_REMINDER: {
557
+ readonly code: "PAYMENT_REMINDER";
558
+ readonly title: "Recordatorio de Pago";
559
+ readonly description: "Recordatorio de pago pendiente";
560
+ readonly icon: "DollarSign";
561
+ readonly variables: readonly ["clientName", "amount", "dueDate", "planName"];
562
+ readonly exampleValues: {
563
+ readonly clientName: "Pedro Sánchez";
564
+ readonly amount: "$40.00";
565
+ readonly dueDate: "25/02/2024";
566
+ readonly planName: "Estándar";
567
+ };
568
+ };
569
+ readonly BIRTHDAY: {
570
+ readonly code: "BIRTHDAY";
571
+ readonly title: "Cumpleaños";
572
+ readonly description: "Felicitación de cumpleaños";
573
+ readonly icon: "Cake";
574
+ readonly variables: readonly ["clientName", "gymName", "age"];
575
+ readonly exampleValues: {
576
+ readonly clientName: "Laura Martínez";
577
+ readonly gymName: "GymSpace";
578
+ readonly age: "28";
579
+ };
580
+ };
581
+ readonly PAYMENT_RECEIPT: {
582
+ readonly code: "PAYMENT_RECEIPT";
583
+ readonly title: "Comprobante de Pago";
584
+ readonly description: "Comprobante de venta pagada";
585
+ readonly icon: "Receipt";
586
+ readonly variables: readonly ["gymName", "receiptNumber", "date", "clientName", "items", "amount", "paymentMethod"];
587
+ readonly exampleValues: {
588
+ readonly gymName: "GymSpace";
589
+ readonly receiptNumber: "V-001";
590
+ readonly date: "15/01/2024";
591
+ readonly clientName: "Juan Pérez";
592
+ readonly items: "• Proteína x2 = Q100.00\n• Creatina x1 = Q50.00";
593
+ readonly amount: "Q150.00";
594
+ readonly paymentMethod: "Efectivo";
595
+ };
596
+ };
597
+ };
598
+
599
+ declare const PERMISSIONS: {
600
+ readonly ORGANIZATIONS_CREATE: "ORGANIZATIONS_CREATE";
601
+ readonly ORGANIZATIONS_READ: "ORGANIZATIONS_READ";
602
+ readonly ORGANIZATIONS_UPDATE: "ORGANIZATIONS_UPDATE";
603
+ readonly ORGANIZATIONS_DELETE: "ORGANIZATIONS_DELETE";
604
+ readonly GYMS_CREATE: "GYMS_CREATE";
605
+ readonly GYMS_READ: "GYMS_READ";
606
+ readonly GYMS_UPDATE: "GYMS_UPDATE";
607
+ readonly GYMS_DELETE: "GYMS_DELETE";
608
+ readonly COLLABORATORS_CREATE: "COLLABORATORS_CREATE";
609
+ readonly COLLABORATORS_READ: "COLLABORATORS_READ";
610
+ readonly COLLABORATORS_UPDATE: "COLLABORATORS_UPDATE";
611
+ readonly COLLABORATORS_DELETE: "COLLABORATORS_DELETE";
612
+ readonly CLIENTS_CREATE: "CLIENTS_CREATE";
613
+ readonly CLIENTS_READ: "CLIENTS_READ";
614
+ readonly CLIENTS_UPDATE: "CLIENTS_UPDATE";
615
+ readonly CLIENTS_DELETE: "CLIENTS_DELETE";
616
+ readonly CONTRACTS_CREATE: "CONTRACTS_CREATE";
617
+ readonly CONTRACTS_READ: "CONTRACTS_READ";
618
+ readonly CONTRACTS_UPDATE: "CONTRACTS_UPDATE";
619
+ readonly CONTRACTS_APPROVE: "CONTRACTS_APPROVE";
620
+ readonly CONTRACTS_CANCEL: "CONTRACTS_CANCEL";
621
+ readonly EVALUATIONS_CREATE: "EVALUATIONS_CREATE";
622
+ readonly EVALUATIONS_READ: "EVALUATIONS_READ";
623
+ readonly EVALUATIONS_UPDATE: "EVALUATIONS_UPDATE";
624
+ readonly EVALUATIONS_DELETE: "EVALUATIONS_DELETE";
625
+ readonly CHECKINS_CREATE: "CHECKINS_CREATE";
626
+ readonly CHECKINS_READ: "CHECKINS_READ";
627
+ readonly LEADS_CREATE: "LEADS_CREATE";
628
+ readonly LEADS_READ: "LEADS_READ";
629
+ readonly LEADS_UPDATE: "LEADS_UPDATE";
630
+ readonly LEADS_DELETE: "LEADS_DELETE";
631
+ readonly REPORTS_VIEW: "REPORTS_VIEW";
632
+ readonly REPORTS_FINANCIAL: "REPORTS_FINANCIAL";
633
+ readonly SETTINGS_UPDATE: "SETTINGS_UPDATE";
634
+ readonly ASSETS_CREATE: "ASSETS_CREATE";
635
+ readonly ASSETS_READ: "ASSETS_READ";
636
+ readonly ASSETS_DELETE: "ASSETS_DELETE";
637
+ readonly FILES_CREATE: "FILES_CREATE";
638
+ readonly FILES_READ: "FILES_READ";
639
+ readonly FILES_DELETE: "FILES_DELETE";
640
+ readonly PRODUCTS_CREATE: "PRODUCTS_CREATE";
641
+ readonly PRODUCTS_READ: "PRODUCTS_READ";
642
+ readonly PRODUCTS_UPDATE: "PRODUCTS_UPDATE";
643
+ readonly PRODUCTS_DELETE: "PRODUCTS_DELETE";
644
+ readonly PRODUCT_CATEGORIES_CREATE: "PRODUCT_CATEGORIES_CREATE";
645
+ readonly PRODUCT_CATEGORIES_READ: "PRODUCT_CATEGORIES_READ";
646
+ readonly PRODUCT_CATEGORIES_UPDATE: "PRODUCT_CATEGORIES_UPDATE";
647
+ readonly PRODUCT_CATEGORIES_DELETE: "PRODUCT_CATEGORIES_DELETE";
648
+ readonly SALES_CREATE: "SALES_CREATE";
649
+ readonly SALES_READ: "SALES_READ";
650
+ readonly SALES_UPDATE: "SALES_UPDATE";
651
+ readonly SALES_DELETE: "SALES_DELETE";
652
+ readonly SUPPLIERS_CREATE: "SUPPLIERS_CREATE";
653
+ readonly SUPPLIERS_READ: "SUPPLIERS_READ";
654
+ readonly SUPPLIERS_UPDATE: "SUPPLIERS_UPDATE";
655
+ readonly SUPPLIERS_DELETE: "SUPPLIERS_DELETE";
656
+ readonly PAYMENT_METHODS_CREATE: "PAYMENT_METHODS_CREATE";
657
+ readonly PAYMENT_METHODS_READ: "PAYMENT_METHODS_READ";
658
+ readonly PAYMENT_METHODS_UPDATE: "PAYMENT_METHODS_UPDATE";
659
+ readonly PAYMENT_METHODS_DELETE: "PAYMENT_METHODS_DELETE";
660
+ readonly WHATSAPP_READ: "WHATSAPP_READ";
661
+ readonly WHATSAPP_SEND: "WHATSAPP_SEND";
662
+ readonly WHATSAPP_MANAGE: "WHATSAPP_MANAGE";
663
+ readonly SUPER_ADMIN: "SUPER_ADMIN";
664
+ readonly OWNER: "OWNER";
665
+ readonly All: "ALL";
666
+ };
667
+ declare const ROLE_PERMISSIONS: {
668
+ readonly ADMIN: ("SUPER_ADMIN" | "OWNER" | "ORGANIZATIONS_CREATE" | "ORGANIZATIONS_READ" | "ORGANIZATIONS_UPDATE" | "ORGANIZATIONS_DELETE" | "GYMS_CREATE" | "GYMS_READ" | "GYMS_UPDATE" | "GYMS_DELETE" | "COLLABORATORS_CREATE" | "COLLABORATORS_READ" | "COLLABORATORS_UPDATE" | "COLLABORATORS_DELETE" | "CLIENTS_CREATE" | "CLIENTS_READ" | "CLIENTS_UPDATE" | "CLIENTS_DELETE" | "CONTRACTS_CREATE" | "CONTRACTS_READ" | "CONTRACTS_UPDATE" | "CONTRACTS_APPROVE" | "CONTRACTS_CANCEL" | "EVALUATIONS_CREATE" | "EVALUATIONS_READ" | "EVALUATIONS_UPDATE" | "EVALUATIONS_DELETE" | "CHECKINS_CREATE" | "CHECKINS_READ" | "LEADS_CREATE" | "LEADS_READ" | "LEADS_UPDATE" | "LEADS_DELETE" | "REPORTS_VIEW" | "REPORTS_FINANCIAL" | "SETTINGS_UPDATE" | "ASSETS_CREATE" | "ASSETS_READ" | "ASSETS_DELETE" | "FILES_CREATE" | "FILES_READ" | "FILES_DELETE" | "PRODUCTS_CREATE" | "PRODUCTS_READ" | "PRODUCTS_UPDATE" | "PRODUCTS_DELETE" | "PRODUCT_CATEGORIES_CREATE" | "PRODUCT_CATEGORIES_READ" | "PRODUCT_CATEGORIES_UPDATE" | "PRODUCT_CATEGORIES_DELETE" | "SALES_CREATE" | "SALES_READ" | "SALES_UPDATE" | "SALES_DELETE" | "SUPPLIERS_CREATE" | "SUPPLIERS_READ" | "SUPPLIERS_UPDATE" | "SUPPLIERS_DELETE" | "PAYMENT_METHODS_CREATE" | "PAYMENT_METHODS_READ" | "PAYMENT_METHODS_UPDATE" | "PAYMENT_METHODS_DELETE" | "WHATSAPP_READ" | "WHATSAPP_SEND" | "WHATSAPP_MANAGE" | "ALL")[];
669
+ readonly MANAGER: readonly ["GYMS_READ", "COLLABORATORS_READ", "CLIENTS_CREATE", "CLIENTS_READ", "CLIENTS_UPDATE", "CONTRACTS_CREATE", "CONTRACTS_READ", "EVALUATIONS_CREATE", "EVALUATIONS_READ", "EVALUATIONS_UPDATE", "CHECKINS_CREATE", "CHECKINS_READ", "REPORTS_VIEW", "ASSETS_CREATE", "ASSETS_READ", "ASSETS_DELETE", "FILES_CREATE", "FILES_READ", "FILES_DELETE", "PRODUCTS_CREATE", "PRODUCTS_READ", "PRODUCTS_UPDATE", "PRODUCTS_DELETE", "PRODUCT_CATEGORIES_CREATE", "PRODUCT_CATEGORIES_READ", "PRODUCT_CATEGORIES_UPDATE", "PRODUCT_CATEGORIES_DELETE", "SALES_CREATE", "SALES_READ", "SALES_UPDATE", "SUPPLIERS_CREATE", "SUPPLIERS_READ", "SUPPLIERS_UPDATE", "SUPPLIERS_DELETE", "PAYMENT_METHODS_CREATE", "PAYMENT_METHODS_READ", "PAYMENT_METHODS_UPDATE", "PAYMENT_METHODS_DELETE"];
670
+ };
671
+ declare const CACHE_TTL: {
672
+ readonly USER_PERMISSIONS: 900;
673
+ readonly GYM_DATA: 1800;
674
+ readonly STATIC_DATA: 3600;
675
+ readonly REPORTS: 300;
676
+ readonly DASHBOARD: 180;
677
+ readonly WHATSAPP_MESSAGE_STATUS: 300;
678
+ };
679
+ declare const FILE_LIMITS: {
680
+ readonly MAX_FILE_SIZE: number;
681
+ readonly MAX_IMAGE_SIZE: number;
682
+ readonly MAX_DOCUMENT_SIZE: number;
683
+ };
684
+ declare const PAGINATION_DEFAULTS: {
685
+ readonly PAGE: 1;
686
+ readonly LIMIT: 20;
687
+ readonly MAX_LIMIT: 100;
688
+ };
689
+ declare const DATE_FORMATS: {
690
+ readonly DATE_ONLY: "YYYY-MM-DD";
691
+ readonly DATETIME: "YYYY-MM-DD HH:mm:ss";
692
+ readonly TIME_ONLY: "HH:mm:ss";
693
+ };
694
+ declare const HEADERS: {
695
+ readonly GYM_ID: "X-Gym-Id";
696
+ readonly REQUEST_ID: "X-Request-Id";
697
+ };
698
+
699
+ declare enum RoleNames {
700
+ ADMIN = "Admin",
701
+ ENCARGADO = "Encargado",
702
+ OWNER = "OWNER"
703
+ }
704
+ declare const ROLE_NAMES: typeof RoleNames;
705
+ type RoleName = RoleNames;
706
+ declare function isAdminRole(roleName: string | null | undefined): boolean;
707
+ declare function isEncargadoRole(roleName: string | null | undefined): boolean;
708
+ declare function canAccessFeature(userRole: string | null | undefined, allowedRoles: string[] | RoleNames[]): boolean;
709
+ declare function getRoleDisplayName(roleName: string | null | undefined): string;
710
+ declare function getRoleDescription(roleName: string | null | undefined): string;
711
+ declare function getRoleCapabilities(roleName: string | null | undefined): string[];
712
+
713
+ /**
714
+ * Evento para enviar un mensaje de WhatsApp
715
+ */
716
+ interface WhatsAppMessageSendEventData {
717
+ gymId: string;
718
+ instanceName: string;
719
+ phoneNumber: string;
720
+ content: string;
721
+ clientId?: string;
722
+ templateId?: string;
723
+ variables?: Record<string, any>;
724
+ userId?: string;
725
+ }
726
+ /**
727
+ * Nombres de eventos de WhatsApp
728
+ */
729
+ declare const WHATSAPP_EVENTS: {
730
+ readonly MESSAGE_SEND: "whatsapp/message.send";
731
+ readonly MESSAGE_RECEIVED: "whatsapp/message.received";
732
+ readonly CONNECTION_UPDATE: "whatsapp/connection.update";
733
+ };
734
+
735
+ declare const templateGenerationRequestSchema: z.ZodObject<{
736
+ templateCode: z.ZodString;
737
+ templateMetadata: z.ZodObject<{
738
+ title: z.ZodString;
739
+ description: z.ZodString;
740
+ variables: z.ZodArray<z.ZodString, "many">;
741
+ exampleValues: z.ZodRecord<z.ZodString, z.ZodString>;
742
+ }, "strip", z.ZodTypeAny, {
743
+ variables: string[];
744
+ title: string;
745
+ description: string;
746
+ exampleValues: Record<string, string>;
747
+ }, {
748
+ variables: string[];
749
+ title: string;
750
+ description: string;
751
+ exampleValues: Record<string, string>;
752
+ }>;
753
+ userPrompt: z.ZodOptional<z.ZodString>;
754
+ language: z.ZodDefault<z.ZodString>;
755
+ }, "strip", z.ZodTypeAny, {
756
+ templateCode: string;
757
+ templateMetadata: {
758
+ variables: string[];
759
+ title: string;
760
+ description: string;
761
+ exampleValues: Record<string, string>;
762
+ };
763
+ language: string;
764
+ userPrompt?: string | undefined;
765
+ }, {
766
+ templateCode: string;
767
+ templateMetadata: {
768
+ variables: string[];
769
+ title: string;
770
+ description: string;
771
+ exampleValues: Record<string, string>;
772
+ };
773
+ userPrompt?: string | undefined;
774
+ language?: string | undefined;
775
+ }>;
776
+ declare const aiGeneratedTemplateSchema: z.ZodObject<{
777
+ message: z.ZodString;
778
+ tone: z.ZodEnum<["professional", "friendly", "casual", "urgent"]>;
779
+ usedVariables: z.ZodArray<z.ZodString, "many">;
780
+ suggestions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
781
+ }, "strip", z.ZodTypeAny, {
782
+ message: string;
783
+ tone: "professional" | "friendly" | "casual" | "urgent";
784
+ usedVariables: string[];
785
+ suggestions?: string[] | undefined;
786
+ }, {
787
+ message: string;
788
+ tone: "professional" | "friendly" | "casual" | "urgent";
789
+ usedVariables: string[];
790
+ suggestions?: string[] | undefined;
791
+ }>;
792
+ type TemplateGenerationRequest = z.infer<typeof templateGenerationRequestSchema>;
793
+ type AIGeneratedTemplate = z.infer<typeof aiGeneratedTemplateSchema>;
794
+
795
+ export { type AIGeneratedTemplate, type AcceptInvitationDto, type ActivityItem, type ActivityQueryParams, AssetCategory, AssetStatus, type AuditFields, type BirthdayTemplateData, CACHE_TTL, ClientStatus, type Collaborator, type CollaboratorStats, CollaboratorStatus, CommentType, ContractAssetType, ContractStatus, type CreateInvitationDto, type Currency, DATE_FORMATS, type EntityType, EvaluationAssetCategory, EvaluationAssetStage, EvaluationStatus, EvaluationType, FILE_LIMITS, HEADERS, type ICollaborator, type IGym, type IOrganization, type IRequestContext, type IRole, type ISubscription, type ISubscriptionPlan, type IUser, type Invitation, InvitationStatus, LeadStatus, type ListCollaboratorsParams, type MembershipExpiringTemplateData, type MembershipPurchaseTemplateData, type MembershipRenewalTemplateData, PAGINATION_DEFAULTS, PERMISSIONS, type PaginatedResponse, type PaginationMeta, type PaginationParams, PaymentFrequency, type PaymentReceiptTemplateData, type PaymentReminderTemplateData, type Permission, PlanStatus, ROLE_NAMES, ROLE_PERMISSIONS, type Role, type RoleName, RoleNames, type StatsQueryParams, SubscriptionStatus, TEMPLATE_CODES, TEMPLATE_METADATA, TemplateCode, type TemplateGenerationRequest, type TemplateMetadata, TemplateType, type UUID, type UpdateCollaboratorDto, type UpdateCollaboratorRoleDto, type UpdateCollaboratorStatusDto, type User, UserType, type ValidateByCodeDto, WHATSAPP_EVENTS, WHATSAPP_TEMPLATE_EVENTS, type WelcomeTemplateData, type WhatsAppMessageSendEventData, type WhatsAppTemplateData, type WhatsAppTemplateEventData, aiGeneratedTemplateSchema, canAccessFeature, getRoleCapabilities, getRoleDescription, getRoleDisplayName, isAdminRole, isEncargadoRole, templateGenerationRequestSchema };