@gymspace/sdk 1.0.2 → 1.1.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.
- package/dist/index.d.mts +2065 -0
- package/dist/index.d.ts +2065 -0
- package/dist/index.js +25 -73
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -73
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +3 -87
- package/src/models/auth.ts +3 -14
- package/src/models/organizations.ts +16 -0
- package/src/resources/auth.ts +1 -1
- package/src/resources/onboarding.ts +2 -2
- package/src/resources/organizations.ts +5 -1
- package/src/sdk.ts +0 -6
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,2065 @@
|
|
|
1
|
+
import { AxiosRequestConfig } from 'axios';
|
|
2
|
+
import { PaginationParams as PaginationParams$1, ContractStatus, LeadStatus } from '@gymspace/shared';
|
|
3
|
+
export * from '@gymspace/shared';
|
|
4
|
+
|
|
5
|
+
interface GymSpaceConfig {
|
|
6
|
+
baseURL: string;
|
|
7
|
+
apiKey?: string;
|
|
8
|
+
refreshToken?: string;
|
|
9
|
+
timeout?: number;
|
|
10
|
+
headers?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
interface RequestOptions {
|
|
13
|
+
gymId?: string;
|
|
14
|
+
headers?: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
interface PaginationParams {
|
|
17
|
+
limit?: number;
|
|
18
|
+
offset?: number;
|
|
19
|
+
}
|
|
20
|
+
interface PaginatedResponse<T> {
|
|
21
|
+
data: T[];
|
|
22
|
+
meta: {
|
|
23
|
+
total: number;
|
|
24
|
+
page: number;
|
|
25
|
+
limit: number;
|
|
26
|
+
totalPages: number;
|
|
27
|
+
hasNext: boolean;
|
|
28
|
+
hasPrevious: boolean;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
type PaginatedResponseDto<T> = PaginatedResponse<T>;
|
|
32
|
+
|
|
33
|
+
type PaginationQueryDto = PaginationParams$1;
|
|
34
|
+
|
|
35
|
+
declare class ApiClient {
|
|
36
|
+
private axiosInstance;
|
|
37
|
+
private config;
|
|
38
|
+
constructor(config: GymSpaceConfig);
|
|
39
|
+
private setupInterceptors;
|
|
40
|
+
private handleError;
|
|
41
|
+
private mergeOptions;
|
|
42
|
+
request<T>(method: string, path: string, data?: any, options?: RequestOptions & AxiosRequestConfig): Promise<T>;
|
|
43
|
+
get<T>(path: string, params?: any, options?: RequestOptions): Promise<T>;
|
|
44
|
+
post<T>(path: string, data?: any, options?: RequestOptions): Promise<T>;
|
|
45
|
+
put<T>(path: string, data?: any, options?: RequestOptions): Promise<T>;
|
|
46
|
+
patch<T>(path: string, data?: any, options?: RequestOptions): Promise<T>;
|
|
47
|
+
delete<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
48
|
+
setAuthToken(token: string): void;
|
|
49
|
+
setGymId(gymId: string): void;
|
|
50
|
+
clearAuth(): void;
|
|
51
|
+
getBaseUrl(): string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface RegisterOwnerDto {
|
|
55
|
+
name: string;
|
|
56
|
+
email: string;
|
|
57
|
+
phone: string;
|
|
58
|
+
password: string;
|
|
59
|
+
organizationName: string;
|
|
60
|
+
subscriptionPlanId: string;
|
|
61
|
+
country?: string;
|
|
62
|
+
currency?: string;
|
|
63
|
+
timezone?: string;
|
|
64
|
+
}
|
|
65
|
+
interface LoginDto {
|
|
66
|
+
email: string;
|
|
67
|
+
password: string;
|
|
68
|
+
}
|
|
69
|
+
interface LoginResponseDto {
|
|
70
|
+
access_token: string;
|
|
71
|
+
refresh_token: string;
|
|
72
|
+
user: any;
|
|
73
|
+
redirectPath: string;
|
|
74
|
+
}
|
|
75
|
+
interface VerifyEmailDto {
|
|
76
|
+
email: string;
|
|
77
|
+
code: string;
|
|
78
|
+
}
|
|
79
|
+
interface ResendVerificationDto {
|
|
80
|
+
email: string;
|
|
81
|
+
}
|
|
82
|
+
interface ChangePasswordDto {
|
|
83
|
+
currentPassword: string;
|
|
84
|
+
newPassword: string;
|
|
85
|
+
}
|
|
86
|
+
interface ChangePasswordResponseDto {
|
|
87
|
+
success: boolean;
|
|
88
|
+
message: string;
|
|
89
|
+
}
|
|
90
|
+
interface RequestPasswordResetDto {
|
|
91
|
+
email: string;
|
|
92
|
+
}
|
|
93
|
+
interface RequestPasswordResetResponseDto {
|
|
94
|
+
success: boolean;
|
|
95
|
+
message: string;
|
|
96
|
+
}
|
|
97
|
+
interface VerifyResetCodeDto {
|
|
98
|
+
email: string;
|
|
99
|
+
code: string;
|
|
100
|
+
}
|
|
101
|
+
interface VerifyResetCodeResponseDto {
|
|
102
|
+
resetToken: string;
|
|
103
|
+
expiresIn: number;
|
|
104
|
+
}
|
|
105
|
+
interface ResetPasswordDto {
|
|
106
|
+
resetToken: string;
|
|
107
|
+
newPassword: string;
|
|
108
|
+
}
|
|
109
|
+
interface ResetPasswordResponseDto {
|
|
110
|
+
success: boolean;
|
|
111
|
+
message: string;
|
|
112
|
+
}
|
|
113
|
+
interface ResendResetCodeDto {
|
|
114
|
+
email: string;
|
|
115
|
+
}
|
|
116
|
+
interface ResendResetCodeResponseDto {
|
|
117
|
+
success: boolean;
|
|
118
|
+
message: string;
|
|
119
|
+
}
|
|
120
|
+
interface RegisterCollaboratorDto {
|
|
121
|
+
invitationToken: string;
|
|
122
|
+
name: string;
|
|
123
|
+
phone: string;
|
|
124
|
+
password: string;
|
|
125
|
+
}
|
|
126
|
+
interface InvitationValidationResponse {
|
|
127
|
+
valid: boolean;
|
|
128
|
+
invitation: {
|
|
129
|
+
id: string;
|
|
130
|
+
gymName: string;
|
|
131
|
+
gymLogo?: string;
|
|
132
|
+
gymAddress: string;
|
|
133
|
+
inviterName: string;
|
|
134
|
+
inviterRole: string;
|
|
135
|
+
role: string;
|
|
136
|
+
permissions: string[];
|
|
137
|
+
expiresAt: Date;
|
|
138
|
+
email: string;
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
interface CurrentSessionResponse {
|
|
142
|
+
accessToken: string;
|
|
143
|
+
user: {
|
|
144
|
+
id: string;
|
|
145
|
+
email: string;
|
|
146
|
+
name: string;
|
|
147
|
+
phone?: string;
|
|
148
|
+
userType: string;
|
|
149
|
+
emailVerifiedAt?: Date;
|
|
150
|
+
};
|
|
151
|
+
gym?: {
|
|
152
|
+
id: string;
|
|
153
|
+
organizationId: string;
|
|
154
|
+
name: string;
|
|
155
|
+
address?: string;
|
|
156
|
+
description?: string;
|
|
157
|
+
phone?: string;
|
|
158
|
+
gymCode: string;
|
|
159
|
+
profileAssetId?: string;
|
|
160
|
+
coverAssetId?: string;
|
|
161
|
+
evaluationStructure?: Record<string, any>;
|
|
162
|
+
};
|
|
163
|
+
organization?: {
|
|
164
|
+
id: string;
|
|
165
|
+
ownerUserId: string;
|
|
166
|
+
name: string;
|
|
167
|
+
subscriptionPlanId: string;
|
|
168
|
+
subscriptionStatus: string;
|
|
169
|
+
subscriptionStart: Date;
|
|
170
|
+
subscriptionEnd: Date;
|
|
171
|
+
country: string;
|
|
172
|
+
currency: string;
|
|
173
|
+
timezone: string;
|
|
174
|
+
settings?: Record<string, any>;
|
|
175
|
+
};
|
|
176
|
+
subscription?: {
|
|
177
|
+
id: string;
|
|
178
|
+
organizationId: string;
|
|
179
|
+
subscriptionPlanId: string;
|
|
180
|
+
subscriptionPlan?: {
|
|
181
|
+
id: string;
|
|
182
|
+
name: string;
|
|
183
|
+
price: any;
|
|
184
|
+
billingFrequency: string;
|
|
185
|
+
maxGyms: number;
|
|
186
|
+
maxClientsPerGym: number;
|
|
187
|
+
maxUsersPerGym: number;
|
|
188
|
+
features: any;
|
|
189
|
+
description?: string;
|
|
190
|
+
};
|
|
191
|
+
status: string;
|
|
192
|
+
startDate: Date;
|
|
193
|
+
endDate: Date;
|
|
194
|
+
isActive: boolean;
|
|
195
|
+
};
|
|
196
|
+
permissions: string[];
|
|
197
|
+
isAuthenticated: boolean;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
interface SubscriptionPlan {
|
|
201
|
+
id: string;
|
|
202
|
+
name: string;
|
|
203
|
+
price: any;
|
|
204
|
+
billingFrequency: string;
|
|
205
|
+
maxGyms: number;
|
|
206
|
+
maxClientsPerGym: number;
|
|
207
|
+
maxUsersPerGym: number;
|
|
208
|
+
features: any;
|
|
209
|
+
description?: string;
|
|
210
|
+
}
|
|
211
|
+
interface Subscription {
|
|
212
|
+
id: string;
|
|
213
|
+
organizationId: string;
|
|
214
|
+
subscriptionPlanId: string;
|
|
215
|
+
subscriptionPlan?: SubscriptionPlan;
|
|
216
|
+
status: string;
|
|
217
|
+
startDate: Date;
|
|
218
|
+
endDate: Date;
|
|
219
|
+
isActive: boolean;
|
|
220
|
+
}
|
|
221
|
+
interface AvailablePlanDto {
|
|
222
|
+
id: string;
|
|
223
|
+
name: string;
|
|
224
|
+
description?: string;
|
|
225
|
+
price: any;
|
|
226
|
+
billingFrequency: string;
|
|
227
|
+
maxGyms: number;
|
|
228
|
+
maxClientsPerGym: number;
|
|
229
|
+
maxUsersPerGym: number;
|
|
230
|
+
features: any;
|
|
231
|
+
isFreePlan: boolean;
|
|
232
|
+
}
|
|
233
|
+
interface SubscriptionStatusDto {
|
|
234
|
+
organizationId: string;
|
|
235
|
+
currentPlan: SubscriptionPlan | null;
|
|
236
|
+
status: string;
|
|
237
|
+
startDate: Date | null;
|
|
238
|
+
endDate: Date | null;
|
|
239
|
+
usage: {
|
|
240
|
+
gyms: {
|
|
241
|
+
current: number;
|
|
242
|
+
limit: number;
|
|
243
|
+
};
|
|
244
|
+
clientsPerGym: {
|
|
245
|
+
[gymId: string]: {
|
|
246
|
+
current: number;
|
|
247
|
+
limit: number;
|
|
248
|
+
};
|
|
249
|
+
};
|
|
250
|
+
usersPerGym: {
|
|
251
|
+
[gymId: string]: {
|
|
252
|
+
current: number;
|
|
253
|
+
limit: number;
|
|
254
|
+
};
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
canUpgrade: boolean;
|
|
258
|
+
canDowngrade: boolean;
|
|
259
|
+
}
|
|
260
|
+
interface AffiliateOrganizationDto {
|
|
261
|
+
subscriptionPlanId: string;
|
|
262
|
+
}
|
|
263
|
+
interface CheckLimitResponse {
|
|
264
|
+
canPerform: boolean;
|
|
265
|
+
currentUsage: number;
|
|
266
|
+
limit: number;
|
|
267
|
+
message?: string;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
declare abstract class BaseResource {
|
|
271
|
+
protected client: ApiClient;
|
|
272
|
+
constructor(client: ApiClient);
|
|
273
|
+
protected request<T>(path: string, options: {
|
|
274
|
+
method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
|
|
275
|
+
body?: string;
|
|
276
|
+
headers?: Record<string, string>;
|
|
277
|
+
}): Promise<T>;
|
|
278
|
+
protected buildPath(base: string, ...segments: (string | undefined)[]): string;
|
|
279
|
+
protected paginate<T>(path: string, params?: PaginationQueryDto & Record<string, any>, options?: RequestOptions): Promise<PaginatedResponseDto<T>>;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
declare class AuthResource extends BaseResource {
|
|
283
|
+
private basePath;
|
|
284
|
+
registerOwner(data: RegisterOwnerDto, options?: RequestOptions): Promise<void>;
|
|
285
|
+
login(data: LoginDto, options?: RequestOptions): Promise<LoginResponseDto>;
|
|
286
|
+
refreshToken(refreshToken: string, options?: RequestOptions): Promise<LoginResponseDto>;
|
|
287
|
+
verifyEmail(data: VerifyEmailDto, options?: RequestOptions): Promise<{
|
|
288
|
+
success: boolean;
|
|
289
|
+
message: string;
|
|
290
|
+
}>;
|
|
291
|
+
resendVerification(data: ResendVerificationDto, options?: RequestOptions): Promise<{
|
|
292
|
+
success: boolean;
|
|
293
|
+
message: string;
|
|
294
|
+
}>;
|
|
295
|
+
getSubscriptionPlans(options?: RequestOptions): Promise<{
|
|
296
|
+
data: SubscriptionPlan[];
|
|
297
|
+
}>;
|
|
298
|
+
validateInvitation(token: string, options?: RequestOptions): Promise<InvitationValidationResponse>;
|
|
299
|
+
registerCollaborator(data: RegisterCollaboratorDto, options?: RequestOptions): Promise<LoginResponseDto>;
|
|
300
|
+
getCurrentSession(options?: RequestOptions): Promise<CurrentSessionResponse>;
|
|
301
|
+
changePassword(data: ChangePasswordDto, options?: RequestOptions): Promise<ChangePasswordResponseDto>;
|
|
302
|
+
requestPasswordReset(data: RequestPasswordResetDto, options?: RequestOptions): Promise<RequestPasswordResetResponseDto>;
|
|
303
|
+
verifyResetCode(data: VerifyResetCodeDto, options?: RequestOptions): Promise<VerifyResetCodeResponseDto>;
|
|
304
|
+
resetPassword(data: ResetPasswordDto, options?: RequestOptions): Promise<ResetPasswordResponseDto>;
|
|
305
|
+
resendResetCode(data: ResendResetCodeDto, options?: RequestOptions): Promise<ResendResetCodeResponseDto>;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
interface UpdateOrganizationDto {
|
|
309
|
+
name: string;
|
|
310
|
+
}
|
|
311
|
+
interface Organization {
|
|
312
|
+
id: string;
|
|
313
|
+
name: string;
|
|
314
|
+
country?: string;
|
|
315
|
+
currency?: string;
|
|
316
|
+
timezone?: string;
|
|
317
|
+
settings?: Record<string, any>;
|
|
318
|
+
createdAt: string;
|
|
319
|
+
updatedAt: string;
|
|
320
|
+
}
|
|
321
|
+
interface OrganizationStats {
|
|
322
|
+
totalGyms: number;
|
|
323
|
+
totalClients: number;
|
|
324
|
+
totalContracts: number;
|
|
325
|
+
activeContracts: number;
|
|
326
|
+
totalRevenue: number;
|
|
327
|
+
}
|
|
328
|
+
interface OrganizationWithDetails {
|
|
329
|
+
id: string;
|
|
330
|
+
name: string;
|
|
331
|
+
owner: {
|
|
332
|
+
id: string;
|
|
333
|
+
email: string;
|
|
334
|
+
fullName: string;
|
|
335
|
+
};
|
|
336
|
+
gyms: Array<{
|
|
337
|
+
id: string;
|
|
338
|
+
name: string;
|
|
339
|
+
address: string;
|
|
340
|
+
}>;
|
|
341
|
+
createdAt: Date;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
declare class OrganizationsResource extends BaseResource {
|
|
345
|
+
private basePath;
|
|
346
|
+
getOrganization(id: string, options?: RequestOptions): Promise<Organization>;
|
|
347
|
+
updateOrganization(id: string, data: UpdateOrganizationDto, options?: RequestOptions): Promise<Organization>;
|
|
348
|
+
getOrganizationStats(id: string, options?: RequestOptions): Promise<OrganizationStats>;
|
|
349
|
+
listOrganizations(options?: RequestOptions): Promise<OrganizationWithDetails[]>;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
interface CreateGymDto {
|
|
353
|
+
name: string;
|
|
354
|
+
address?: string;
|
|
355
|
+
city?: string;
|
|
356
|
+
state?: string;
|
|
357
|
+
postalCode?: string;
|
|
358
|
+
phone?: string;
|
|
359
|
+
email?: string;
|
|
360
|
+
openingTime?: string;
|
|
361
|
+
closingTime?: string;
|
|
362
|
+
capacity?: number;
|
|
363
|
+
amenities?: GymAmenities;
|
|
364
|
+
settings?: GymSettings;
|
|
365
|
+
}
|
|
366
|
+
interface UpdateGymDto {
|
|
367
|
+
name?: string;
|
|
368
|
+
address?: string;
|
|
369
|
+
city?: string;
|
|
370
|
+
state?: string;
|
|
371
|
+
postalCode?: string;
|
|
372
|
+
phone?: string;
|
|
373
|
+
email?: string;
|
|
374
|
+
openingTime?: string;
|
|
375
|
+
closingTime?: string;
|
|
376
|
+
capacity?: number;
|
|
377
|
+
amenities?: GymAmenities;
|
|
378
|
+
settings?: GymSettings;
|
|
379
|
+
}
|
|
380
|
+
interface GymAmenities {
|
|
381
|
+
hasParking?: boolean;
|
|
382
|
+
hasShowers?: boolean;
|
|
383
|
+
hasLockers?: boolean;
|
|
384
|
+
[key: string]: any;
|
|
385
|
+
}
|
|
386
|
+
interface GymSettings {
|
|
387
|
+
logo?: string;
|
|
388
|
+
primaryColor?: string;
|
|
389
|
+
[key: string]: any;
|
|
390
|
+
}
|
|
391
|
+
interface Gym {
|
|
392
|
+
id: string;
|
|
393
|
+
organizationId: string;
|
|
394
|
+
name: string;
|
|
395
|
+
slug: string;
|
|
396
|
+
address?: string;
|
|
397
|
+
city?: string;
|
|
398
|
+
state?: string;
|
|
399
|
+
postalCode?: string;
|
|
400
|
+
phone?: string;
|
|
401
|
+
email?: string;
|
|
402
|
+
openingTime?: string;
|
|
403
|
+
closingTime?: string;
|
|
404
|
+
capacity?: number;
|
|
405
|
+
amenities?: GymAmenities;
|
|
406
|
+
settings?: GymSettings;
|
|
407
|
+
schedule?: GymSchedule;
|
|
408
|
+
socialMedia?: GymSocialMedia;
|
|
409
|
+
isActive: boolean;
|
|
410
|
+
createdAt: string;
|
|
411
|
+
updatedAt: string;
|
|
412
|
+
}
|
|
413
|
+
interface TimeSlot {
|
|
414
|
+
open: string;
|
|
415
|
+
close: string;
|
|
416
|
+
}
|
|
417
|
+
interface DaySchedule {
|
|
418
|
+
isOpen: boolean;
|
|
419
|
+
slots?: TimeSlot[];
|
|
420
|
+
}
|
|
421
|
+
interface GymSchedule {
|
|
422
|
+
monday?: DaySchedule;
|
|
423
|
+
tuesday?: DaySchedule;
|
|
424
|
+
wednesday?: DaySchedule;
|
|
425
|
+
thursday?: DaySchedule;
|
|
426
|
+
friday?: DaySchedule;
|
|
427
|
+
saturday?: DaySchedule;
|
|
428
|
+
sunday?: DaySchedule;
|
|
429
|
+
}
|
|
430
|
+
interface GymSocialMedia {
|
|
431
|
+
facebook?: string;
|
|
432
|
+
instagram?: string;
|
|
433
|
+
whatsapp?: string;
|
|
434
|
+
twitter?: string;
|
|
435
|
+
linkedin?: string;
|
|
436
|
+
youtube?: string;
|
|
437
|
+
tiktok?: string;
|
|
438
|
+
}
|
|
439
|
+
interface UpdateGymScheduleDto {
|
|
440
|
+
monday?: DaySchedule;
|
|
441
|
+
tuesday?: DaySchedule;
|
|
442
|
+
wednesday?: DaySchedule;
|
|
443
|
+
thursday?: DaySchedule;
|
|
444
|
+
friday?: DaySchedule;
|
|
445
|
+
saturday?: DaySchedule;
|
|
446
|
+
sunday?: DaySchedule;
|
|
447
|
+
}
|
|
448
|
+
interface UpdateGymSocialMediaDto {
|
|
449
|
+
facebook?: string;
|
|
450
|
+
instagram?: string;
|
|
451
|
+
whatsapp?: string;
|
|
452
|
+
twitter?: string;
|
|
453
|
+
linkedin?: string;
|
|
454
|
+
youtube?: string;
|
|
455
|
+
tiktok?: string;
|
|
456
|
+
}
|
|
457
|
+
interface GymStats {
|
|
458
|
+
totalClients: number;
|
|
459
|
+
activeClients: number;
|
|
460
|
+
totalContracts: number;
|
|
461
|
+
activeContracts: number;
|
|
462
|
+
monthlyRevenue: number;
|
|
463
|
+
checkInsToday: number;
|
|
464
|
+
checkInsMonth: number;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
declare class GymsResource extends BaseResource {
|
|
468
|
+
private basePath;
|
|
469
|
+
createGym(data: CreateGymDto, options?: RequestOptions): Promise<Gym>;
|
|
470
|
+
getOrganizationGyms(options?: RequestOptions): Promise<Gym[]>;
|
|
471
|
+
getGym(id: string, options?: RequestOptions): Promise<Gym>;
|
|
472
|
+
updateGym(id: string, data: UpdateGymDto, options?: RequestOptions): Promise<Gym>;
|
|
473
|
+
getGymStats(id: string, options?: RequestOptions): Promise<GymStats>;
|
|
474
|
+
toggleGymStatus(id: string, options?: RequestOptions): Promise<Gym>;
|
|
475
|
+
updateCurrentGym(data: Partial<{
|
|
476
|
+
name?: string;
|
|
477
|
+
address?: string;
|
|
478
|
+
phone?: string;
|
|
479
|
+
email?: string;
|
|
480
|
+
assetId?: string;
|
|
481
|
+
}>, options?: RequestOptions): Promise<Gym>;
|
|
482
|
+
updateGymSchedule(id: string, data: UpdateGymScheduleDto, options?: RequestOptions): Promise<Gym>;
|
|
483
|
+
updateGymSocialMedia(id: string, data: UpdateGymSocialMediaDto, options?: RequestOptions): Promise<Gym>;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
interface CreateClientDto {
|
|
487
|
+
name: string;
|
|
488
|
+
email?: string;
|
|
489
|
+
phone?: string;
|
|
490
|
+
documentValue?: string;
|
|
491
|
+
documentType?: string;
|
|
492
|
+
birthDate?: string;
|
|
493
|
+
gender?: string;
|
|
494
|
+
maritalStatus?: string;
|
|
495
|
+
address: string;
|
|
496
|
+
city?: string;
|
|
497
|
+
state?: string;
|
|
498
|
+
postalCode?: string;
|
|
499
|
+
occupation?: string;
|
|
500
|
+
notes?: string;
|
|
501
|
+
profilePhotoId?: string;
|
|
502
|
+
customData?: Record<string, any>;
|
|
503
|
+
}
|
|
504
|
+
interface UpdateClientDto {
|
|
505
|
+
name?: string;
|
|
506
|
+
email?: string;
|
|
507
|
+
phone?: string;
|
|
508
|
+
documentValue?: string;
|
|
509
|
+
documentType?: string;
|
|
510
|
+
birthDate?: string;
|
|
511
|
+
gender?: string;
|
|
512
|
+
maritalStatus?: string;
|
|
513
|
+
address?: string;
|
|
514
|
+
city?: string;
|
|
515
|
+
state?: string;
|
|
516
|
+
postalCode?: string;
|
|
517
|
+
occupation?: string;
|
|
518
|
+
notes?: string;
|
|
519
|
+
profilePhotoId?: string;
|
|
520
|
+
customData?: Record<string, any>;
|
|
521
|
+
}
|
|
522
|
+
interface Client {
|
|
523
|
+
id: string;
|
|
524
|
+
gymId: string;
|
|
525
|
+
clientNumber: string;
|
|
526
|
+
name: string;
|
|
527
|
+
email?: string;
|
|
528
|
+
phone?: string;
|
|
529
|
+
documentValue?: string;
|
|
530
|
+
documentType?: string;
|
|
531
|
+
birthDate?: string;
|
|
532
|
+
gender?: string;
|
|
533
|
+
maritalStatus?: string;
|
|
534
|
+
address?: string;
|
|
535
|
+
city?: string;
|
|
536
|
+
state?: string;
|
|
537
|
+
postalCode?: string;
|
|
538
|
+
occupation?: string;
|
|
539
|
+
notes?: string;
|
|
540
|
+
customData?: Record<string, any>;
|
|
541
|
+
status: 'active' | 'inactive';
|
|
542
|
+
profilePhotoId?: string;
|
|
543
|
+
emergencyContactName?: string;
|
|
544
|
+
emergencyContactPhone?: string;
|
|
545
|
+
medicalConditions?: string;
|
|
546
|
+
createdAt: string;
|
|
547
|
+
updatedAt: string;
|
|
548
|
+
contracts?: Array<{
|
|
549
|
+
id: string;
|
|
550
|
+
status: string;
|
|
551
|
+
startDate: string;
|
|
552
|
+
endDate: string;
|
|
553
|
+
gymMembershipPlan?: {
|
|
554
|
+
id: string;
|
|
555
|
+
name: string;
|
|
556
|
+
};
|
|
557
|
+
}>;
|
|
558
|
+
_count?: {
|
|
559
|
+
evaluations: number;
|
|
560
|
+
checkIns: number;
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
interface ClientStat {
|
|
564
|
+
key: string;
|
|
565
|
+
name: string;
|
|
566
|
+
description: string;
|
|
567
|
+
category: 'activity' | 'contracts' | 'general';
|
|
568
|
+
value: any;
|
|
569
|
+
}
|
|
570
|
+
interface ClientStats {
|
|
571
|
+
client: {
|
|
572
|
+
id: string;
|
|
573
|
+
name: string;
|
|
574
|
+
email: string | null;
|
|
575
|
+
status: string;
|
|
576
|
+
registrationDate: string;
|
|
577
|
+
};
|
|
578
|
+
activity: {
|
|
579
|
+
totalCheckIns: number;
|
|
580
|
+
monthlyCheckIns: number;
|
|
581
|
+
lastCheckIn: string | null;
|
|
582
|
+
};
|
|
583
|
+
contracts: {
|
|
584
|
+
active: number;
|
|
585
|
+
totalSpent: number;
|
|
586
|
+
};
|
|
587
|
+
membershipHistory: Array<{
|
|
588
|
+
id: string;
|
|
589
|
+
status: string;
|
|
590
|
+
startDate: string;
|
|
591
|
+
endDate: string | null;
|
|
592
|
+
gymMembershipPlan: {
|
|
593
|
+
id: string;
|
|
594
|
+
name: string;
|
|
595
|
+
basePrice: number;
|
|
596
|
+
};
|
|
597
|
+
}>;
|
|
598
|
+
}
|
|
599
|
+
interface SearchClientsParams extends PaginationQueryDto {
|
|
600
|
+
search?: string;
|
|
601
|
+
activeOnly?: boolean;
|
|
602
|
+
clientNumber?: string;
|
|
603
|
+
documentId?: string;
|
|
604
|
+
includeContractStatus?: boolean;
|
|
605
|
+
}
|
|
606
|
+
interface ClientSearchForCheckInResponse {
|
|
607
|
+
data: Client[];
|
|
608
|
+
pagination: {
|
|
609
|
+
total: number;
|
|
610
|
+
page: number;
|
|
611
|
+
limit: number;
|
|
612
|
+
totalPages: number;
|
|
613
|
+
};
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
declare class ClientsResource extends BaseResource {
|
|
617
|
+
private basePath;
|
|
618
|
+
createClient(data: CreateClientDto, options?: RequestOptions): Promise<Client>;
|
|
619
|
+
searchClients(params?: SearchClientsParams, options?: RequestOptions): Promise<PaginatedResponseDto<Client>>;
|
|
620
|
+
getClient(id: string, options?: RequestOptions): Promise<Client>;
|
|
621
|
+
updateClient(id: string, data: UpdateClientDto, options?: RequestOptions): Promise<Client>;
|
|
622
|
+
toggleClientStatus(id: string, options?: RequestOptions): Promise<Client>;
|
|
623
|
+
getClientStats(id: string, options?: RequestOptions): Promise<ClientStats>;
|
|
624
|
+
getClientStat(id: string, statKey: string, options?: RequestOptions): Promise<ClientStat>;
|
|
625
|
+
getClientStatsByCategory(id: string, category: string, options?: RequestOptions): Promise<ClientStat[]>;
|
|
626
|
+
getAvailableStats(options?: RequestOptions): Promise<ClientStat[]>;
|
|
627
|
+
searchClientsForCheckIn(params?: SearchClientsParams, options?: RequestOptions): Promise<ClientSearchForCheckInResponse>;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
interface CreateMembershipPlanDto {
|
|
631
|
+
name: string;
|
|
632
|
+
description?: string;
|
|
633
|
+
basePrice: number;
|
|
634
|
+
durationMonths?: number;
|
|
635
|
+
durationDays?: number;
|
|
636
|
+
termsAndConditions?: string;
|
|
637
|
+
allowsCustomPricing?: boolean;
|
|
638
|
+
maxEvaluations?: number;
|
|
639
|
+
includesAdvisor?: boolean;
|
|
640
|
+
showInCatalog?: boolean;
|
|
641
|
+
features?: string[];
|
|
642
|
+
status?: 'active' | 'inactive' | 'archived';
|
|
643
|
+
assetsIds?: string[];
|
|
644
|
+
}
|
|
645
|
+
interface UpdateMembershipPlanDto {
|
|
646
|
+
name?: string;
|
|
647
|
+
description?: string;
|
|
648
|
+
basePrice?: number;
|
|
649
|
+
durationMonths?: number;
|
|
650
|
+
durationDays?: number;
|
|
651
|
+
termsAndConditions?: string;
|
|
652
|
+
allowsCustomPricing?: boolean;
|
|
653
|
+
maxEvaluations?: number;
|
|
654
|
+
includesAdvisor?: boolean;
|
|
655
|
+
showInCatalog?: boolean;
|
|
656
|
+
features?: string[];
|
|
657
|
+
status?: 'active' | 'inactive' | 'archived';
|
|
658
|
+
isActive?: boolean;
|
|
659
|
+
assetsIds?: string[];
|
|
660
|
+
}
|
|
661
|
+
interface MembershipPlan {
|
|
662
|
+
id: string;
|
|
663
|
+
gymId: string;
|
|
664
|
+
name: string;
|
|
665
|
+
description?: string;
|
|
666
|
+
basePrice: number;
|
|
667
|
+
durationMonths?: number;
|
|
668
|
+
durationDays?: number;
|
|
669
|
+
gym?: {
|
|
670
|
+
id: string;
|
|
671
|
+
name: string;
|
|
672
|
+
organization: {
|
|
673
|
+
currency: string;
|
|
674
|
+
};
|
|
675
|
+
};
|
|
676
|
+
termsAndConditions?: string;
|
|
677
|
+
allowsCustomPricing: boolean;
|
|
678
|
+
maxEvaluations: number;
|
|
679
|
+
includesAdvisor: boolean;
|
|
680
|
+
showInCatalog: boolean;
|
|
681
|
+
features: string[];
|
|
682
|
+
status: 'active' | 'inactive' | 'archived';
|
|
683
|
+
isActive: boolean;
|
|
684
|
+
assetsIds?: string[];
|
|
685
|
+
createdAt: string;
|
|
686
|
+
updatedAt: string;
|
|
687
|
+
}
|
|
688
|
+
interface MembershipPlanStats {
|
|
689
|
+
totalContracts: number;
|
|
690
|
+
activeContracts: number;
|
|
691
|
+
totalRevenue: number;
|
|
692
|
+
monthlyRevenue: number;
|
|
693
|
+
}
|
|
694
|
+
interface GetMembershipPlansParams {
|
|
695
|
+
activeOnly?: boolean;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
declare class MembershipPlansResource extends BaseResource {
|
|
699
|
+
private basePath;
|
|
700
|
+
createMembershipPlan(data: CreateMembershipPlanDto, options?: RequestOptions): Promise<MembershipPlan>;
|
|
701
|
+
getGymMembershipPlans(params?: GetMembershipPlansParams, options?: RequestOptions): Promise<MembershipPlan[]>;
|
|
702
|
+
getMembershipPlan(id: string, options?: RequestOptions): Promise<MembershipPlan>;
|
|
703
|
+
updateMembershipPlan(id: string, data: UpdateMembershipPlanDto, options?: RequestOptions): Promise<MembershipPlan>;
|
|
704
|
+
deleteMembershipPlan(id: string, options?: RequestOptions): Promise<void>;
|
|
705
|
+
getMembershipPlanStats(id: string, options?: RequestOptions): Promise<MembershipPlanStats>;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
interface CreateContractDto {
|
|
709
|
+
gymClientId: string;
|
|
710
|
+
gymMembershipPlanId: string;
|
|
711
|
+
paymentMethodId: string;
|
|
712
|
+
startDate: string;
|
|
713
|
+
discountPercentage?: number;
|
|
714
|
+
customPrice?: number;
|
|
715
|
+
receiptIds?: string[];
|
|
716
|
+
metadata?: Record<string, any>;
|
|
717
|
+
}
|
|
718
|
+
interface RenewContractDto {
|
|
719
|
+
startDate?: string;
|
|
720
|
+
discountPercentage?: number;
|
|
721
|
+
customPrice?: number;
|
|
722
|
+
paymentMethodId?: string;
|
|
723
|
+
applyAtEndOfContract?: boolean;
|
|
724
|
+
notes?: string;
|
|
725
|
+
contractDocumentId?: string;
|
|
726
|
+
receiptIds?: string[];
|
|
727
|
+
}
|
|
728
|
+
interface FreezeContractDto {
|
|
729
|
+
freezeStartDate: string;
|
|
730
|
+
freezeEndDate: string;
|
|
731
|
+
reason?: string;
|
|
732
|
+
}
|
|
733
|
+
interface Contract {
|
|
734
|
+
id: string;
|
|
735
|
+
gymId: string;
|
|
736
|
+
contractNumber: string;
|
|
737
|
+
gymClientId: string;
|
|
738
|
+
gymMembershipPlanId: string;
|
|
739
|
+
paymentMethodId?: string;
|
|
740
|
+
parentId?: string;
|
|
741
|
+
startDate: string;
|
|
742
|
+
endDate: string;
|
|
743
|
+
status: ContractStatus;
|
|
744
|
+
price: number;
|
|
745
|
+
discountPercentage?: number;
|
|
746
|
+
finalPrice: number;
|
|
747
|
+
freezeStartDate?: string;
|
|
748
|
+
freezeEndDate?: string;
|
|
749
|
+
receiptIds?: string[];
|
|
750
|
+
metadata?: Record<string, any>;
|
|
751
|
+
createdAt: string;
|
|
752
|
+
updatedAt: string;
|
|
753
|
+
gymClient?: {
|
|
754
|
+
id: string;
|
|
755
|
+
name: string;
|
|
756
|
+
email: string;
|
|
757
|
+
};
|
|
758
|
+
gymMembershipPlan?: {
|
|
759
|
+
id: string;
|
|
760
|
+
name: string;
|
|
761
|
+
basePrice?: number;
|
|
762
|
+
durationMonths?: number;
|
|
763
|
+
};
|
|
764
|
+
paymentMethod?: {
|
|
765
|
+
id: string;
|
|
766
|
+
name: string;
|
|
767
|
+
description?: string;
|
|
768
|
+
code: string;
|
|
769
|
+
enabled: boolean;
|
|
770
|
+
};
|
|
771
|
+
renewals?: Contract[];
|
|
772
|
+
}
|
|
773
|
+
interface GetContractsParams extends PaginationQueryDto {
|
|
774
|
+
status?: ContractStatus;
|
|
775
|
+
clientName?: string;
|
|
776
|
+
clientId?: string;
|
|
777
|
+
startDateFrom?: string;
|
|
778
|
+
startDateTo?: string;
|
|
779
|
+
endDateFrom?: string;
|
|
780
|
+
endDateTo?: string;
|
|
781
|
+
}
|
|
782
|
+
|
|
783
|
+
declare class ContractsResource extends BaseResource {
|
|
784
|
+
private basePath;
|
|
785
|
+
createContract(data: CreateContractDto, options?: RequestOptions): Promise<Contract>;
|
|
786
|
+
getGymContracts(params?: GetContractsParams, options?: RequestOptions): Promise<PaginatedResponseDto<Contract>>;
|
|
787
|
+
getContract(id: string, options?: RequestOptions): Promise<Contract>;
|
|
788
|
+
getClientContracts(clientId: string, options?: RequestOptions): Promise<Contract[]>;
|
|
789
|
+
renewContract(id: string, data: RenewContractDto, options?: RequestOptions): Promise<Contract>;
|
|
790
|
+
freezeContract(id: string, data: FreezeContractDto, options?: RequestOptions): Promise<Contract>;
|
|
791
|
+
cancelContract(id: string, data: {
|
|
792
|
+
reason: string;
|
|
793
|
+
}, options?: RequestOptions): Promise<Contract>;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
interface DashboardStats {
|
|
797
|
+
totalClients: number;
|
|
798
|
+
activeClients: number;
|
|
799
|
+
totalContracts: number;
|
|
800
|
+
activeContracts: number;
|
|
801
|
+
monthlyRevenue: number;
|
|
802
|
+
todayCheckIns: number;
|
|
803
|
+
expiringContractsCount: number;
|
|
804
|
+
newClientsThisMonth: number;
|
|
805
|
+
}
|
|
806
|
+
interface ContractsRevenue {
|
|
807
|
+
totalRevenue: number;
|
|
808
|
+
contractCount: number;
|
|
809
|
+
averageRevenue: number;
|
|
810
|
+
startDate: string;
|
|
811
|
+
endDate: string;
|
|
812
|
+
}
|
|
813
|
+
interface SalesRevenue {
|
|
814
|
+
totalRevenue: number;
|
|
815
|
+
salesCount: number;
|
|
816
|
+
averageRevenue: number;
|
|
817
|
+
startDate: string;
|
|
818
|
+
endDate: string;
|
|
819
|
+
}
|
|
820
|
+
interface Debts {
|
|
821
|
+
totalDebt: number;
|
|
822
|
+
clientsWithDebt: number;
|
|
823
|
+
averageDebt: number;
|
|
824
|
+
startDate: string;
|
|
825
|
+
endDate: string;
|
|
826
|
+
}
|
|
827
|
+
interface CheckIns {
|
|
828
|
+
totalCheckIns: number;
|
|
829
|
+
uniqueClients: number;
|
|
830
|
+
averagePerDay: number;
|
|
831
|
+
startDate: string;
|
|
832
|
+
endDate: string;
|
|
833
|
+
}
|
|
834
|
+
interface NewClients {
|
|
835
|
+
totalNewClients: number;
|
|
836
|
+
averagePerDay: number;
|
|
837
|
+
startDate: string;
|
|
838
|
+
endDate: string;
|
|
839
|
+
}
|
|
840
|
+
interface ExpiringContract {
|
|
841
|
+
id: string;
|
|
842
|
+
clientName: string;
|
|
843
|
+
clientId: string;
|
|
844
|
+
planName: string;
|
|
845
|
+
endDate: string;
|
|
846
|
+
daysRemaining: number;
|
|
847
|
+
}
|
|
848
|
+
interface DateRangeParams {
|
|
849
|
+
startDate?: string;
|
|
850
|
+
endDate?: string;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
declare class DashboardResource extends BaseResource {
|
|
854
|
+
/**
|
|
855
|
+
* Get dashboard statistics (lightweight counts only)
|
|
856
|
+
* @returns Dashboard statistics including client and contract counts
|
|
857
|
+
*/
|
|
858
|
+
getStats(): Promise<DashboardStats>;
|
|
859
|
+
/**
|
|
860
|
+
* Get contracts revenue within date range
|
|
861
|
+
* @param params Optional date range parameters
|
|
862
|
+
* @returns Contracts revenue data for the specified period
|
|
863
|
+
*/
|
|
864
|
+
getContractsRevenue(params?: DateRangeParams): Promise<ContractsRevenue>;
|
|
865
|
+
/**
|
|
866
|
+
* Get sales revenue within date range
|
|
867
|
+
* @param params Optional date range parameters
|
|
868
|
+
* @returns Sales revenue data for the specified period
|
|
869
|
+
*/
|
|
870
|
+
getSalesRevenue(params?: DateRangeParams): Promise<SalesRevenue>;
|
|
871
|
+
/**
|
|
872
|
+
* Get total debts within date range
|
|
873
|
+
* @param params Optional date range parameters
|
|
874
|
+
* @returns Outstanding debts data for the specified period
|
|
875
|
+
*/
|
|
876
|
+
getDebts(params?: DateRangeParams): Promise<Debts>;
|
|
877
|
+
/**
|
|
878
|
+
* Get check-ins count within date range
|
|
879
|
+
* @param params Optional date range parameters
|
|
880
|
+
* @returns Check-ins data for the specified period
|
|
881
|
+
*/
|
|
882
|
+
getCheckIns(params?: DateRangeParams): Promise<CheckIns>;
|
|
883
|
+
/**
|
|
884
|
+
* Get new clients count within date range
|
|
885
|
+
* @param params Optional date range parameters
|
|
886
|
+
* @returns New clients data for the specified period
|
|
887
|
+
*/
|
|
888
|
+
getNewClients(params?: DateRangeParams): Promise<NewClients>;
|
|
889
|
+
/**
|
|
890
|
+
* Get expiring contracts within date range
|
|
891
|
+
* @param limit Maximum number of contracts to return (default: 10)
|
|
892
|
+
* @param params Optional date range parameters
|
|
893
|
+
* @returns List of contracts expiring in the specified period
|
|
894
|
+
*/
|
|
895
|
+
getExpiringContracts(limit?: number, params?: DateRangeParams): Promise<ExpiringContract[]>;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
interface CreateEvaluationDto {
|
|
899
|
+
gymClientId: string;
|
|
900
|
+
weight: number;
|
|
901
|
+
height: number;
|
|
902
|
+
bodyFatPercentage?: number;
|
|
903
|
+
muscleMassPercentage?: number;
|
|
904
|
+
measurements?: EvaluationMeasurements;
|
|
905
|
+
healthMetrics?: EvaluationHealthMetrics;
|
|
906
|
+
performanceMetrics?: EvaluationPerformanceMetrics;
|
|
907
|
+
notes?: string;
|
|
908
|
+
goals?: string;
|
|
909
|
+
recommendations?: string;
|
|
910
|
+
}
|
|
911
|
+
interface UpdateEvaluationDto {
|
|
912
|
+
gymClientId?: string;
|
|
913
|
+
weight?: number;
|
|
914
|
+
height?: number;
|
|
915
|
+
bodyFatPercentage?: number;
|
|
916
|
+
muscleMassPercentage?: number;
|
|
917
|
+
measurements?: EvaluationMeasurements;
|
|
918
|
+
healthMetrics?: EvaluationHealthMetrics;
|
|
919
|
+
performanceMetrics?: EvaluationPerformanceMetrics;
|
|
920
|
+
notes?: string;
|
|
921
|
+
goals?: string;
|
|
922
|
+
recommendations?: string;
|
|
923
|
+
}
|
|
924
|
+
interface EvaluationMeasurements {
|
|
925
|
+
chest?: number;
|
|
926
|
+
waist?: number;
|
|
927
|
+
hips?: number;
|
|
928
|
+
leftArm?: number;
|
|
929
|
+
rightArm?: number;
|
|
930
|
+
leftThigh?: number;
|
|
931
|
+
rightThigh?: number;
|
|
932
|
+
[key: string]: number | undefined;
|
|
933
|
+
}
|
|
934
|
+
interface EvaluationHealthMetrics {
|
|
935
|
+
bloodPressure?: string;
|
|
936
|
+
restingHeartRate?: number;
|
|
937
|
+
vo2Max?: number;
|
|
938
|
+
[key: string]: any;
|
|
939
|
+
}
|
|
940
|
+
interface EvaluationPerformanceMetrics {
|
|
941
|
+
benchPress?: number;
|
|
942
|
+
squat?: number;
|
|
943
|
+
deadlift?: number;
|
|
944
|
+
[key: string]: number | undefined;
|
|
945
|
+
}
|
|
946
|
+
interface Evaluation {
|
|
947
|
+
id: string;
|
|
948
|
+
gymId: string;
|
|
949
|
+
gymClientId: string;
|
|
950
|
+
evaluatorId: string;
|
|
951
|
+
evaluationDate: string;
|
|
952
|
+
weight: number;
|
|
953
|
+
height: number;
|
|
954
|
+
bmi: number;
|
|
955
|
+
bodyFatPercentage?: number;
|
|
956
|
+
muscleMassPercentage?: number;
|
|
957
|
+
measurements?: EvaluationMeasurements;
|
|
958
|
+
healthMetrics?: EvaluationHealthMetrics;
|
|
959
|
+
performanceMetrics?: EvaluationPerformanceMetrics;
|
|
960
|
+
notes?: string;
|
|
961
|
+
goals?: string;
|
|
962
|
+
recommendations?: string;
|
|
963
|
+
createdAt: string;
|
|
964
|
+
updatedAt: string;
|
|
965
|
+
}
|
|
966
|
+
interface GetClientEvaluationsParams extends PaginationQueryDto {
|
|
967
|
+
}
|
|
968
|
+
interface EvaluationReport {
|
|
969
|
+
evaluation: Evaluation;
|
|
970
|
+
client: any;
|
|
971
|
+
previousEvaluation?: Evaluation;
|
|
972
|
+
evolution?: {
|
|
973
|
+
weight: number;
|
|
974
|
+
bodyFat: number;
|
|
975
|
+
muscleMass: number;
|
|
976
|
+
measurements: Record<string, number>;
|
|
977
|
+
};
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
declare class EvaluationsResource extends BaseResource {
|
|
981
|
+
private basePath;
|
|
982
|
+
createEvaluation(data: CreateEvaluationDto, options?: RequestOptions): Promise<Evaluation>;
|
|
983
|
+
getEvaluation(id: string, options?: RequestOptions): Promise<Evaluation>;
|
|
984
|
+
updateEvaluation(id: string, data: UpdateEvaluationDto, options?: RequestOptions): Promise<Evaluation>;
|
|
985
|
+
deleteEvaluation(id: string, options?: RequestOptions): Promise<void>;
|
|
986
|
+
getClientEvaluations(clientId: string, params?: GetClientEvaluationsParams, options?: RequestOptions): Promise<PaginatedResponseDto<Evaluation>>;
|
|
987
|
+
getGymEvaluationStats(options?: RequestOptions): Promise<any>;
|
|
988
|
+
generateEvaluationReport(id: string, options?: RequestOptions): Promise<EvaluationReport>;
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
interface CreateCheckInDto {
|
|
992
|
+
gymClientId: string;
|
|
993
|
+
notes?: string;
|
|
994
|
+
}
|
|
995
|
+
interface CheckIn {
|
|
996
|
+
id: string;
|
|
997
|
+
gymId: string;
|
|
998
|
+
gymClientId: string;
|
|
999
|
+
timestamp: string;
|
|
1000
|
+
notes?: string;
|
|
1001
|
+
registeredByUserId: string;
|
|
1002
|
+
createdAt: string;
|
|
1003
|
+
updatedAt: string;
|
|
1004
|
+
gymClient?: {
|
|
1005
|
+
id: string;
|
|
1006
|
+
name: string;
|
|
1007
|
+
email?: string;
|
|
1008
|
+
clientNumber: string;
|
|
1009
|
+
status: string;
|
|
1010
|
+
};
|
|
1011
|
+
registeredBy?: {
|
|
1012
|
+
id: string;
|
|
1013
|
+
name: string;
|
|
1014
|
+
};
|
|
1015
|
+
}
|
|
1016
|
+
interface SearchCheckInsParams extends PaginationQueryDto {
|
|
1017
|
+
clientId?: string;
|
|
1018
|
+
startDate?: string;
|
|
1019
|
+
endDate?: string;
|
|
1020
|
+
}
|
|
1021
|
+
interface GetCheckInStatsParams {
|
|
1022
|
+
period: 'day' | 'week' | 'month';
|
|
1023
|
+
}
|
|
1024
|
+
interface CheckInStats {
|
|
1025
|
+
period: string;
|
|
1026
|
+
totalCheckIns: number;
|
|
1027
|
+
uniqueClients: number;
|
|
1028
|
+
averagePerDay: number;
|
|
1029
|
+
peakHours: Record<string, number>;
|
|
1030
|
+
dayDistribution: Record<string, number>;
|
|
1031
|
+
}
|
|
1032
|
+
interface GetClientCheckInHistoryParams extends PaginationQueryDto {
|
|
1033
|
+
}
|
|
1034
|
+
interface CurrentlyInGymResponse {
|
|
1035
|
+
total: number;
|
|
1036
|
+
clients: CheckIn[];
|
|
1037
|
+
}
|
|
1038
|
+
interface CheckInListResponse {
|
|
1039
|
+
checkIns: CheckIn[];
|
|
1040
|
+
pagination: {
|
|
1041
|
+
total: number;
|
|
1042
|
+
limit: number;
|
|
1043
|
+
offset: number;
|
|
1044
|
+
};
|
|
1045
|
+
}
|
|
1046
|
+
interface ClientCheckInHistory {
|
|
1047
|
+
checkIns: CheckIn[];
|
|
1048
|
+
metrics: {
|
|
1049
|
+
totalCheckIns: number;
|
|
1050
|
+
last30Days: number;
|
|
1051
|
+
attendanceRate: number;
|
|
1052
|
+
lastCheckIn: string | null;
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
declare class CheckInsResource extends BaseResource {
|
|
1057
|
+
private basePath;
|
|
1058
|
+
createCheckIn(data: CreateCheckInDto, options?: RequestOptions): Promise<CheckIn>;
|
|
1059
|
+
searchCheckIns(params?: SearchCheckInsParams, options?: RequestOptions): Promise<CheckInListResponse>;
|
|
1060
|
+
getCurrentlyInGym(options?: RequestOptions): Promise<CurrentlyInGymResponse>;
|
|
1061
|
+
getCheckIn(id: string, options?: RequestOptions): Promise<CheckIn>;
|
|
1062
|
+
deleteCheckIn(id: string, options?: RequestOptions): Promise<void>;
|
|
1063
|
+
getGymCheckInStats(params: GetCheckInStatsParams, options?: RequestOptions): Promise<CheckInStats>;
|
|
1064
|
+
getClientCheckInHistory(clientId: string, params?: GetClientCheckInHistoryParams, options?: RequestOptions): Promise<ClientCheckInHistory>;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
interface CreateInvitationDto {
|
|
1068
|
+
email: string;
|
|
1069
|
+
gymId: string;
|
|
1070
|
+
roleId: string;
|
|
1071
|
+
}
|
|
1072
|
+
interface AcceptInvitationDto {
|
|
1073
|
+
name: string;
|
|
1074
|
+
phone: string;
|
|
1075
|
+
password: string;
|
|
1076
|
+
}
|
|
1077
|
+
interface Invitation {
|
|
1078
|
+
id: string;
|
|
1079
|
+
email: string;
|
|
1080
|
+
gymId: string;
|
|
1081
|
+
roleId: string;
|
|
1082
|
+
token: string;
|
|
1083
|
+
status: 'pending' | 'accepted' | 'cancelled' | 'expired';
|
|
1084
|
+
invitedById: string;
|
|
1085
|
+
acceptedAt?: string;
|
|
1086
|
+
expiresAt: string;
|
|
1087
|
+
createdAt: string;
|
|
1088
|
+
updatedAt: string;
|
|
1089
|
+
}
|
|
1090
|
+
interface GetGymInvitationsParams {
|
|
1091
|
+
gymId: string;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
declare class InvitationsResource extends BaseResource {
|
|
1095
|
+
private basePath;
|
|
1096
|
+
createInvitation(data: CreateInvitationDto, options?: RequestOptions): Promise<Invitation>;
|
|
1097
|
+
getGymInvitations(params: GetGymInvitationsParams, options?: RequestOptions): Promise<Invitation[]>;
|
|
1098
|
+
acceptInvitation(token: string, data: AcceptInvitationDto, options?: RequestOptions): Promise<void>;
|
|
1099
|
+
cancelInvitation(id: string, options?: RequestOptions): Promise<void>;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
interface CreateLeadDto {
|
|
1103
|
+
name: string;
|
|
1104
|
+
email: string;
|
|
1105
|
+
phone: string;
|
|
1106
|
+
gymId: string;
|
|
1107
|
+
message?: string;
|
|
1108
|
+
source?: string;
|
|
1109
|
+
metadata?: Record<string, any>;
|
|
1110
|
+
}
|
|
1111
|
+
interface UpdateLeadDto {
|
|
1112
|
+
status?: LeadStatus;
|
|
1113
|
+
notes?: string;
|
|
1114
|
+
assignedToUserId?: string;
|
|
1115
|
+
metadata?: Record<string, any>;
|
|
1116
|
+
}
|
|
1117
|
+
interface Lead {
|
|
1118
|
+
id: string;
|
|
1119
|
+
gymId: string;
|
|
1120
|
+
name: string;
|
|
1121
|
+
email: string;
|
|
1122
|
+
phone: string;
|
|
1123
|
+
status: LeadStatus;
|
|
1124
|
+
source?: string;
|
|
1125
|
+
message?: string;
|
|
1126
|
+
notes?: string;
|
|
1127
|
+
assignedToUserId?: string;
|
|
1128
|
+
convertedToClientId?: string;
|
|
1129
|
+
metadata?: Record<string, any>;
|
|
1130
|
+
createdAt: string;
|
|
1131
|
+
updatedAt: string;
|
|
1132
|
+
}
|
|
1133
|
+
interface SearchLeadsParams extends PaginationQueryDto {
|
|
1134
|
+
status?: LeadStatus;
|
|
1135
|
+
search?: string;
|
|
1136
|
+
assignedToUserId?: string;
|
|
1137
|
+
startDate?: string;
|
|
1138
|
+
endDate?: string;
|
|
1139
|
+
}
|
|
1140
|
+
interface LeadStats {
|
|
1141
|
+
total: number;
|
|
1142
|
+
byStatus: Record<LeadStatus, number>;
|
|
1143
|
+
conversionRate: number;
|
|
1144
|
+
averageResponseTime: number;
|
|
1145
|
+
bySource: Record<string, number>;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
declare class LeadsResource extends BaseResource {
|
|
1149
|
+
private basePath;
|
|
1150
|
+
createLead(data: CreateLeadDto, options?: RequestOptions): Promise<Lead>;
|
|
1151
|
+
searchLeads(params?: SearchLeadsParams, options?: RequestOptions): Promise<PaginatedResponseDto<Lead>>;
|
|
1152
|
+
getLead(id: string, options?: RequestOptions): Promise<Lead>;
|
|
1153
|
+
updateLead(id: string, data: UpdateLeadDto, options?: RequestOptions): Promise<Lead>;
|
|
1154
|
+
getLeadStats(options?: RequestOptions): Promise<LeadStats>;
|
|
1155
|
+
convertLead(id: string, options?: RequestOptions): Promise<{
|
|
1156
|
+
clientId: string;
|
|
1157
|
+
}>;
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
/**
|
|
1161
|
+
* Asset models for file management
|
|
1162
|
+
*/
|
|
1163
|
+
interface UploadAssetDto {
|
|
1164
|
+
file: File;
|
|
1165
|
+
description?: string;
|
|
1166
|
+
metadata?: Record<string, any>;
|
|
1167
|
+
}
|
|
1168
|
+
interface AssetResponseDto {
|
|
1169
|
+
id: string;
|
|
1170
|
+
filename: string;
|
|
1171
|
+
originalName: string;
|
|
1172
|
+
fileSize: number;
|
|
1173
|
+
mimeType: string;
|
|
1174
|
+
status: 'active' | 'deleted';
|
|
1175
|
+
description?: string;
|
|
1176
|
+
metadata?: Record<string, any>;
|
|
1177
|
+
previewUrl?: string;
|
|
1178
|
+
uploadedBy: string;
|
|
1179
|
+
createdAt: string;
|
|
1180
|
+
updatedAt: string;
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
declare class AssetsResource extends BaseResource {
|
|
1184
|
+
/**
|
|
1185
|
+
* Upload a new asset
|
|
1186
|
+
*/
|
|
1187
|
+
upload(data: {
|
|
1188
|
+
file: File;
|
|
1189
|
+
description?: string;
|
|
1190
|
+
metadata?: Record<string, any>;
|
|
1191
|
+
}): Promise<AssetResponseDto>;
|
|
1192
|
+
/**
|
|
1193
|
+
* Get a single asset by ID
|
|
1194
|
+
*/
|
|
1195
|
+
findOne(id: string): Promise<AssetResponseDto>;
|
|
1196
|
+
/**
|
|
1197
|
+
* Get multiple assets by IDs
|
|
1198
|
+
*/
|
|
1199
|
+
findByIds(ids: string[]): Promise<AssetResponseDto[]>;
|
|
1200
|
+
/**
|
|
1201
|
+
* Get all assets for the current gym
|
|
1202
|
+
*/
|
|
1203
|
+
findAll(): Promise<AssetResponseDto[]>;
|
|
1204
|
+
/**
|
|
1205
|
+
* Delete an asset
|
|
1206
|
+
*/
|
|
1207
|
+
delete(id: string): Promise<void>;
|
|
1208
|
+
/**
|
|
1209
|
+
* Get a signed download URL for an asset
|
|
1210
|
+
*/
|
|
1211
|
+
getDownloadUrl(id: string): Promise<{
|
|
1212
|
+
url: string;
|
|
1213
|
+
filename: string;
|
|
1214
|
+
}>;
|
|
1215
|
+
/**
|
|
1216
|
+
* Download an asset as a blob
|
|
1217
|
+
*/
|
|
1218
|
+
download(id: string): Promise<Blob>;
|
|
1219
|
+
/**
|
|
1220
|
+
* Get the render URL for an asset (for inline display)
|
|
1221
|
+
* This returns the URL directly without making an API call
|
|
1222
|
+
*/
|
|
1223
|
+
getRenderUrl(id: string): string;
|
|
1224
|
+
/**
|
|
1225
|
+
* Get asset blob for rendering/preview
|
|
1226
|
+
*/
|
|
1227
|
+
render(id: string): Promise<Blob>;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
interface FileResponseDto {
|
|
1231
|
+
id: string;
|
|
1232
|
+
filename: string;
|
|
1233
|
+
originalName: string;
|
|
1234
|
+
filePath: string;
|
|
1235
|
+
fileSize: number;
|
|
1236
|
+
mimeType: string;
|
|
1237
|
+
status: 'active' | 'deleted';
|
|
1238
|
+
metadata?: Record<string, any>;
|
|
1239
|
+
description?: string;
|
|
1240
|
+
createdAt: string;
|
|
1241
|
+
updatedAt: string;
|
|
1242
|
+
userId: string;
|
|
1243
|
+
previewUrl: string | null;
|
|
1244
|
+
}
|
|
1245
|
+
interface UploadFileDto {
|
|
1246
|
+
file: File;
|
|
1247
|
+
description?: string;
|
|
1248
|
+
metadata?: Record<string, any>;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
declare class FilesResource extends BaseResource {
|
|
1252
|
+
/**
|
|
1253
|
+
* Upload a new file
|
|
1254
|
+
*/
|
|
1255
|
+
upload(data: {
|
|
1256
|
+
file: File;
|
|
1257
|
+
description?: string;
|
|
1258
|
+
metadata?: Record<string, any>;
|
|
1259
|
+
}): Promise<FileResponseDto>;
|
|
1260
|
+
/**
|
|
1261
|
+
* Get all files for the current user
|
|
1262
|
+
*/
|
|
1263
|
+
findAll(): Promise<FileResponseDto[]>;
|
|
1264
|
+
/**
|
|
1265
|
+
* Get a single file by ID
|
|
1266
|
+
*/
|
|
1267
|
+
findOne(id: string): Promise<FileResponseDto>;
|
|
1268
|
+
/**
|
|
1269
|
+
* Get multiple files by IDs
|
|
1270
|
+
*/
|
|
1271
|
+
findByIds(ids: string[]): Promise<FileResponseDto[]>;
|
|
1272
|
+
/**
|
|
1273
|
+
* Delete a file
|
|
1274
|
+
*/
|
|
1275
|
+
delete(id: string): Promise<void>;
|
|
1276
|
+
/**
|
|
1277
|
+
* Download a file as a blob
|
|
1278
|
+
*/
|
|
1279
|
+
download(id: string): Promise<Blob>;
|
|
1280
|
+
/**
|
|
1281
|
+
* Get the render URL for a file (for inline display)
|
|
1282
|
+
* This returns the URL directly without making an API call
|
|
1283
|
+
*/
|
|
1284
|
+
getRenderUrl(id: string): string;
|
|
1285
|
+
/**
|
|
1286
|
+
* Get file blob for rendering/preview
|
|
1287
|
+
*/
|
|
1288
|
+
render(id: string): Promise<Blob>;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
interface SearchCatalogParams extends PaginationQueryDto {
|
|
1292
|
+
search?: string;
|
|
1293
|
+
city?: string;
|
|
1294
|
+
state?: string;
|
|
1295
|
+
latitude?: string;
|
|
1296
|
+
longitude?: string;
|
|
1297
|
+
radius?: string;
|
|
1298
|
+
}
|
|
1299
|
+
interface GetFeaturedGymsParams {
|
|
1300
|
+
limit: string;
|
|
1301
|
+
}
|
|
1302
|
+
interface CatalogGym {
|
|
1303
|
+
id: string;
|
|
1304
|
+
name: string;
|
|
1305
|
+
slug: string;
|
|
1306
|
+
address?: string;
|
|
1307
|
+
city?: string;
|
|
1308
|
+
state?: string;
|
|
1309
|
+
phone?: string;
|
|
1310
|
+
email?: string;
|
|
1311
|
+
amenities?: any;
|
|
1312
|
+
settings?: any;
|
|
1313
|
+
}
|
|
1314
|
+
interface CityWithGyms {
|
|
1315
|
+
city: string;
|
|
1316
|
+
state: string;
|
|
1317
|
+
count: number;
|
|
1318
|
+
}
|
|
1319
|
+
declare class PublicCatalogResource extends BaseResource {
|
|
1320
|
+
private basePath;
|
|
1321
|
+
searchCatalog(params?: SearchCatalogParams, options?: RequestOptions): Promise<PaginatedResponseDto<CatalogGym>>;
|
|
1322
|
+
getFeaturedGyms(params: GetFeaturedGymsParams, options?: RequestOptions): Promise<CatalogGym[]>;
|
|
1323
|
+
getCitiesWithGyms(options?: RequestOptions): Promise<CityWithGyms[]>;
|
|
1324
|
+
getGymBySlug(slug: string, options?: RequestOptions): Promise<CatalogGym>;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
interface HealthResponse {
|
|
1328
|
+
status: string;
|
|
1329
|
+
timestamp: string;
|
|
1330
|
+
}
|
|
1331
|
+
interface ReadyResponse {
|
|
1332
|
+
status: string;
|
|
1333
|
+
services: {
|
|
1334
|
+
database: boolean;
|
|
1335
|
+
cache: boolean;
|
|
1336
|
+
storage: boolean;
|
|
1337
|
+
};
|
|
1338
|
+
}
|
|
1339
|
+
declare class HealthResource extends BaseResource {
|
|
1340
|
+
private basePath;
|
|
1341
|
+
health(options?: RequestOptions): Promise<HealthResponse>;
|
|
1342
|
+
ready(options?: RequestOptions): Promise<ReadyResponse>;
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
interface StartOnboardingData {
|
|
1346
|
+
name: string;
|
|
1347
|
+
email: string;
|
|
1348
|
+
phone: string;
|
|
1349
|
+
password: string;
|
|
1350
|
+
organizationName: string;
|
|
1351
|
+
country: string;
|
|
1352
|
+
currency: string;
|
|
1353
|
+
timezone: string;
|
|
1354
|
+
}
|
|
1355
|
+
interface StartOnboardingResponse {
|
|
1356
|
+
success: boolean;
|
|
1357
|
+
access_token: string;
|
|
1358
|
+
refresh_token: string;
|
|
1359
|
+
user: {
|
|
1360
|
+
id: string;
|
|
1361
|
+
email: string;
|
|
1362
|
+
name: string;
|
|
1363
|
+
userType: string;
|
|
1364
|
+
};
|
|
1365
|
+
organization: {
|
|
1366
|
+
id: string;
|
|
1367
|
+
name: string;
|
|
1368
|
+
organizationCode: string;
|
|
1369
|
+
};
|
|
1370
|
+
gym: {
|
|
1371
|
+
id: string;
|
|
1372
|
+
name: string;
|
|
1373
|
+
};
|
|
1374
|
+
onboardingStatus: OnboardingStatus;
|
|
1375
|
+
}
|
|
1376
|
+
interface BusinessHours {
|
|
1377
|
+
open: string;
|
|
1378
|
+
close: string;
|
|
1379
|
+
closed: boolean;
|
|
1380
|
+
}
|
|
1381
|
+
interface WeeklySchedule {
|
|
1382
|
+
monday: BusinessHours;
|
|
1383
|
+
tuesday: BusinessHours;
|
|
1384
|
+
wednesday: BusinessHours;
|
|
1385
|
+
thursday: BusinessHours;
|
|
1386
|
+
friday: BusinessHours;
|
|
1387
|
+
saturday: BusinessHours;
|
|
1388
|
+
sunday: BusinessHours;
|
|
1389
|
+
}
|
|
1390
|
+
interface Amenities {
|
|
1391
|
+
hasParking: boolean;
|
|
1392
|
+
hasShowers: boolean;
|
|
1393
|
+
hasLockers: boolean;
|
|
1394
|
+
hasPool: boolean;
|
|
1395
|
+
hasSauna: boolean;
|
|
1396
|
+
hasWifi: boolean;
|
|
1397
|
+
hasChildcare: boolean;
|
|
1398
|
+
hasCafeteria: boolean;
|
|
1399
|
+
}
|
|
1400
|
+
interface SocialMedia {
|
|
1401
|
+
facebook?: string;
|
|
1402
|
+
instagram?: string;
|
|
1403
|
+
twitter?: string;
|
|
1404
|
+
website?: string;
|
|
1405
|
+
}
|
|
1406
|
+
interface UpdateGymSettingsData {
|
|
1407
|
+
gymId: string;
|
|
1408
|
+
name: string;
|
|
1409
|
+
address: string;
|
|
1410
|
+
city: string;
|
|
1411
|
+
state: string;
|
|
1412
|
+
postalCode: string;
|
|
1413
|
+
phone: string;
|
|
1414
|
+
email: string;
|
|
1415
|
+
businessHours: WeeklySchedule;
|
|
1416
|
+
capacity: number;
|
|
1417
|
+
description?: string;
|
|
1418
|
+
amenities: Amenities;
|
|
1419
|
+
socialMedia?: SocialMedia;
|
|
1420
|
+
logo?: string;
|
|
1421
|
+
coverPhoto?: string;
|
|
1422
|
+
primaryColor?: string;
|
|
1423
|
+
}
|
|
1424
|
+
interface ClientManagementFeatures {
|
|
1425
|
+
enabled: boolean;
|
|
1426
|
+
requireDocumentId: boolean;
|
|
1427
|
+
enablePhotos: boolean;
|
|
1428
|
+
trackEmergencyContacts: boolean;
|
|
1429
|
+
trackMedicalConditions: boolean;
|
|
1430
|
+
}
|
|
1431
|
+
interface MembershipManagementFeatures {
|
|
1432
|
+
enabled: boolean;
|
|
1433
|
+
allowCustomPricing: boolean;
|
|
1434
|
+
allowContractFreezing: boolean;
|
|
1435
|
+
expiryWarningDays: number;
|
|
1436
|
+
autoRenewalReminders: boolean;
|
|
1437
|
+
}
|
|
1438
|
+
interface CheckInSystemFeatures {
|
|
1439
|
+
enabled: boolean;
|
|
1440
|
+
requireActiveContract: boolean;
|
|
1441
|
+
trackCheckInTime: boolean;
|
|
1442
|
+
allowMultiplePerDay: boolean;
|
|
1443
|
+
}
|
|
1444
|
+
interface EvaluationSystemFeatures {
|
|
1445
|
+
enabled: boolean;
|
|
1446
|
+
trackMeasurements: boolean;
|
|
1447
|
+
trackBodyComposition: boolean;
|
|
1448
|
+
trackPerformance: boolean;
|
|
1449
|
+
defaultFrequencyDays: number;
|
|
1450
|
+
}
|
|
1451
|
+
interface LeadManagementFeatures {
|
|
1452
|
+
enabled: boolean;
|
|
1453
|
+
publicCatalogListing: boolean;
|
|
1454
|
+
enableOnlineForm: boolean;
|
|
1455
|
+
autoAssignLeads: boolean;
|
|
1456
|
+
}
|
|
1457
|
+
interface NotificationSettings {
|
|
1458
|
+
emailEnabled: boolean;
|
|
1459
|
+
smsEnabled: boolean;
|
|
1460
|
+
welcomeEmails: boolean;
|
|
1461
|
+
contractExpiryAlerts: boolean;
|
|
1462
|
+
evaluationReminders: boolean;
|
|
1463
|
+
}
|
|
1464
|
+
interface ConfigureFeaturesData {
|
|
1465
|
+
gymId: string;
|
|
1466
|
+
clientManagement: ClientManagementFeatures;
|
|
1467
|
+
membershipManagement: MembershipManagementFeatures;
|
|
1468
|
+
checkInSystem: CheckInSystemFeatures;
|
|
1469
|
+
evaluationSystem: EvaluationSystemFeatures;
|
|
1470
|
+
leadManagement: LeadManagementFeatures;
|
|
1471
|
+
notifications: NotificationSettings;
|
|
1472
|
+
}
|
|
1473
|
+
interface CompleteGuidedSetupData {
|
|
1474
|
+
gymId: string;
|
|
1475
|
+
}
|
|
1476
|
+
declare enum OnboardingStep {
|
|
1477
|
+
ACCOUNT_CREATED = "account_created",
|
|
1478
|
+
GYM_SETTINGS = "gym_settings",
|
|
1479
|
+
FEATURES_CONFIGURED = "features_configured",
|
|
1480
|
+
COMPLETED = "completed"
|
|
1481
|
+
}
|
|
1482
|
+
interface OnboardingStatus {
|
|
1483
|
+
organizationId: string;
|
|
1484
|
+
gymId: string;
|
|
1485
|
+
currentStep: OnboardingStep;
|
|
1486
|
+
accountCreated: boolean;
|
|
1487
|
+
gymSettingsCompleted: boolean;
|
|
1488
|
+
featuresConfigured: boolean;
|
|
1489
|
+
isCompleted: boolean;
|
|
1490
|
+
nextAction: string;
|
|
1491
|
+
completionPercentage: number;
|
|
1492
|
+
}
|
|
1493
|
+
interface OnboardingResponse {
|
|
1494
|
+
success: boolean;
|
|
1495
|
+
gym?: any;
|
|
1496
|
+
onboardingStatus: OnboardingStatus;
|
|
1497
|
+
message?: string;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
declare class OnboardingResource extends BaseResource {
|
|
1501
|
+
/**
|
|
1502
|
+
* Creates owner account, organization, and initial gym
|
|
1503
|
+
* Now also sends verification and organization codes via email
|
|
1504
|
+
*/
|
|
1505
|
+
start(data: StartOnboardingData): Promise<StartOnboardingResponse>;
|
|
1506
|
+
/**
|
|
1507
|
+
* Updates basic gym settings (step 2 of onboarding)
|
|
1508
|
+
* Configure basic gym information like name, address, etc.
|
|
1509
|
+
*/
|
|
1510
|
+
updateGymSettings(data: UpdateGymSettingsData): Promise<OnboardingResponse>;
|
|
1511
|
+
/**
|
|
1512
|
+
* Configure gym features (step 3 of onboarding)
|
|
1513
|
+
* Enable/disable various management features
|
|
1514
|
+
*/
|
|
1515
|
+
configureFeatures(data: ConfigureFeaturesData): Promise<OnboardingResponse>;
|
|
1516
|
+
/**
|
|
1517
|
+
* Mark onboarding as complete
|
|
1518
|
+
*/
|
|
1519
|
+
completeSetup(data: CompleteGuidedSetupData): Promise<OnboardingResponse>;
|
|
1520
|
+
/**
|
|
1521
|
+
* Get current onboarding status
|
|
1522
|
+
* Check progress and next steps
|
|
1523
|
+
*/
|
|
1524
|
+
getStatus(gymId: string): Promise<OnboardingStatus>;
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
interface CreateProductCategoryDto {
|
|
1528
|
+
name: string;
|
|
1529
|
+
description?: string;
|
|
1530
|
+
color?: string;
|
|
1531
|
+
}
|
|
1532
|
+
interface UpdateProductCategoryDto {
|
|
1533
|
+
name?: string;
|
|
1534
|
+
description?: string;
|
|
1535
|
+
color?: string;
|
|
1536
|
+
}
|
|
1537
|
+
interface ProductCategory {
|
|
1538
|
+
id: string;
|
|
1539
|
+
gymId: string;
|
|
1540
|
+
name: string;
|
|
1541
|
+
description?: string;
|
|
1542
|
+
color?: string;
|
|
1543
|
+
createdAt: string;
|
|
1544
|
+
updatedAt: string;
|
|
1545
|
+
createdBy?: {
|
|
1546
|
+
id: string;
|
|
1547
|
+
name: string;
|
|
1548
|
+
email: string;
|
|
1549
|
+
};
|
|
1550
|
+
updatedBy?: {
|
|
1551
|
+
id: string;
|
|
1552
|
+
name: string;
|
|
1553
|
+
email: string;
|
|
1554
|
+
};
|
|
1555
|
+
_count?: {
|
|
1556
|
+
products: number;
|
|
1557
|
+
};
|
|
1558
|
+
}
|
|
1559
|
+
interface CreateProductDto {
|
|
1560
|
+
name: string;
|
|
1561
|
+
description?: string;
|
|
1562
|
+
price: number;
|
|
1563
|
+
stock?: number;
|
|
1564
|
+
minStock?: number;
|
|
1565
|
+
maxStock?: number;
|
|
1566
|
+
categoryId?: string;
|
|
1567
|
+
imageId?: string;
|
|
1568
|
+
status?: 'active' | 'inactive';
|
|
1569
|
+
trackInventory?: 'none' | 'simple' | 'advanced' | 'capacity';
|
|
1570
|
+
}
|
|
1571
|
+
interface CreateServiceDto {
|
|
1572
|
+
name: string;
|
|
1573
|
+
description?: string;
|
|
1574
|
+
price: number;
|
|
1575
|
+
categoryId?: string;
|
|
1576
|
+
imageId?: string;
|
|
1577
|
+
}
|
|
1578
|
+
interface UpdateProductDto {
|
|
1579
|
+
name?: string;
|
|
1580
|
+
description?: string;
|
|
1581
|
+
price?: number;
|
|
1582
|
+
stock?: number;
|
|
1583
|
+
minStock?: number;
|
|
1584
|
+
maxStock?: number;
|
|
1585
|
+
categoryId?: string;
|
|
1586
|
+
imageId?: string;
|
|
1587
|
+
status?: 'active' | 'inactive';
|
|
1588
|
+
trackInventory?: 'none' | 'simple' | 'advanced' | 'capacity';
|
|
1589
|
+
}
|
|
1590
|
+
interface UpdateStockDto {
|
|
1591
|
+
quantity: number;
|
|
1592
|
+
notes?: string;
|
|
1593
|
+
supplierId?: string;
|
|
1594
|
+
fileId?: string;
|
|
1595
|
+
}
|
|
1596
|
+
interface Product {
|
|
1597
|
+
id: string;
|
|
1598
|
+
gymId: string;
|
|
1599
|
+
categoryId?: string;
|
|
1600
|
+
name: string;
|
|
1601
|
+
description?: string;
|
|
1602
|
+
price: number;
|
|
1603
|
+
stock: number | null;
|
|
1604
|
+
minStock?: number | null;
|
|
1605
|
+
maxStock?: number | null;
|
|
1606
|
+
imageId?: string;
|
|
1607
|
+
status: 'active' | 'inactive';
|
|
1608
|
+
type?: 'Product' | 'Service';
|
|
1609
|
+
trackInventory?: 'none' | 'simple' | 'advanced' | 'capacity';
|
|
1610
|
+
createdAt: string;
|
|
1611
|
+
updatedAt: string;
|
|
1612
|
+
category?: ProductCategory;
|
|
1613
|
+
createdBy?: {
|
|
1614
|
+
id: string;
|
|
1615
|
+
name: string;
|
|
1616
|
+
email: string;
|
|
1617
|
+
};
|
|
1618
|
+
updatedBy?: {
|
|
1619
|
+
id: string;
|
|
1620
|
+
name: string;
|
|
1621
|
+
email: string;
|
|
1622
|
+
};
|
|
1623
|
+
_count?: {
|
|
1624
|
+
saleItems: number;
|
|
1625
|
+
};
|
|
1626
|
+
}
|
|
1627
|
+
interface SearchProductsParams extends PaginationQueryDto {
|
|
1628
|
+
search?: string;
|
|
1629
|
+
categoryId?: string;
|
|
1630
|
+
type?: 'Product' | 'Service';
|
|
1631
|
+
status?: 'active' | 'inactive';
|
|
1632
|
+
inStock?: boolean;
|
|
1633
|
+
minPrice?: number;
|
|
1634
|
+
maxPrice?: number;
|
|
1635
|
+
}
|
|
1636
|
+
interface StockMovement {
|
|
1637
|
+
id: string;
|
|
1638
|
+
productId: string;
|
|
1639
|
+
gymId: string;
|
|
1640
|
+
type: 'manual_entry' | 'sale' | 'return' | 'adjustment' | 'initial_stock';
|
|
1641
|
+
quantity: number;
|
|
1642
|
+
previousStock?: number;
|
|
1643
|
+
newStock?: number;
|
|
1644
|
+
notes?: string;
|
|
1645
|
+
supplierId?: string;
|
|
1646
|
+
fileId?: string;
|
|
1647
|
+
createdByUserId: string;
|
|
1648
|
+
createdAt: string;
|
|
1649
|
+
product?: Product;
|
|
1650
|
+
supplier?: {
|
|
1651
|
+
id: string;
|
|
1652
|
+
name: string;
|
|
1653
|
+
};
|
|
1654
|
+
createdBy?: {
|
|
1655
|
+
id: string;
|
|
1656
|
+
name: string;
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1659
|
+
|
|
1660
|
+
declare class ProductsResource extends BaseResource {
|
|
1661
|
+
private basePath;
|
|
1662
|
+
createCategory(data: CreateProductCategoryDto, options?: RequestOptions): Promise<ProductCategory>;
|
|
1663
|
+
getCategories(options?: RequestOptions): Promise<ProductCategory[]>;
|
|
1664
|
+
updateCategory(id: string, data: UpdateProductCategoryDto, options?: RequestOptions): Promise<ProductCategory>;
|
|
1665
|
+
deleteCategory(id: string, options?: RequestOptions): Promise<void>;
|
|
1666
|
+
createProduct(data: CreateProductDto, options?: RequestOptions): Promise<Product>;
|
|
1667
|
+
createService(data: CreateServiceDto, options?: RequestOptions): Promise<Product>;
|
|
1668
|
+
searchProducts(params?: SearchProductsParams, options?: RequestOptions): Promise<PaginatedResponseDto<Product>>;
|
|
1669
|
+
getProduct(id: string, options?: RequestOptions): Promise<Product>;
|
|
1670
|
+
updateProduct(id: string, data: UpdateProductDto, options?: RequestOptions): Promise<Product>;
|
|
1671
|
+
deleteProduct(id: string, options?: RequestOptions): Promise<void>;
|
|
1672
|
+
toggleProductStatus(id: string, options?: RequestOptions): Promise<Product>;
|
|
1673
|
+
updateStock(id: string, data: UpdateStockDto, options?: RequestOptions): Promise<Product>;
|
|
1674
|
+
getLowStockProducts(threshold?: number, options?: RequestOptions): Promise<Product[]>;
|
|
1675
|
+
getProductStockMovements(id: string, options?: RequestOptions): Promise<StockMovement[]>;
|
|
1676
|
+
}
|
|
1677
|
+
|
|
1678
|
+
interface SaleItemDto {
|
|
1679
|
+
productId: string;
|
|
1680
|
+
quantity: number;
|
|
1681
|
+
unitPrice: number;
|
|
1682
|
+
}
|
|
1683
|
+
interface SaleItem {
|
|
1684
|
+
id: string;
|
|
1685
|
+
saleId: string;
|
|
1686
|
+
productId: string;
|
|
1687
|
+
quantity: number;
|
|
1688
|
+
unitPrice: number;
|
|
1689
|
+
total: number;
|
|
1690
|
+
createdAt: string;
|
|
1691
|
+
updatedAt: string;
|
|
1692
|
+
product?: {
|
|
1693
|
+
id: string;
|
|
1694
|
+
name: string;
|
|
1695
|
+
imageId?: string;
|
|
1696
|
+
category?: {
|
|
1697
|
+
id: string;
|
|
1698
|
+
name: string;
|
|
1699
|
+
color?: string;
|
|
1700
|
+
};
|
|
1701
|
+
};
|
|
1702
|
+
}
|
|
1703
|
+
interface CreateSaleDto {
|
|
1704
|
+
items: SaleItemDto[];
|
|
1705
|
+
customerId?: string;
|
|
1706
|
+
customerName?: string;
|
|
1707
|
+
notes?: string;
|
|
1708
|
+
fileIds?: string[];
|
|
1709
|
+
paymentStatus?: 'paid' | 'unpaid';
|
|
1710
|
+
paymentMethodId?: string;
|
|
1711
|
+
}
|
|
1712
|
+
interface UpdateSaleDto {
|
|
1713
|
+
customerId?: string;
|
|
1714
|
+
customerName?: string;
|
|
1715
|
+
notes?: string;
|
|
1716
|
+
fileIds?: string[];
|
|
1717
|
+
paymentStatus?: 'paid' | 'unpaid';
|
|
1718
|
+
paymentMethodId?: string;
|
|
1719
|
+
}
|
|
1720
|
+
interface UpdatePaymentStatusDto {
|
|
1721
|
+
paymentStatus: 'paid' | 'unpaid';
|
|
1722
|
+
}
|
|
1723
|
+
interface Sale {
|
|
1724
|
+
id: string;
|
|
1725
|
+
gymId: string;
|
|
1726
|
+
customerId?: string;
|
|
1727
|
+
saleNumber: string;
|
|
1728
|
+
total: number;
|
|
1729
|
+
paymentStatus: 'paid' | 'unpaid';
|
|
1730
|
+
paymentMethodId?: string;
|
|
1731
|
+
saleDate: string;
|
|
1732
|
+
customerName?: string;
|
|
1733
|
+
notes?: string;
|
|
1734
|
+
fileIds?: string[];
|
|
1735
|
+
createdAt: string;
|
|
1736
|
+
updatedAt: string;
|
|
1737
|
+
saleItems?: SaleItem[];
|
|
1738
|
+
customer?: {
|
|
1739
|
+
id: string;
|
|
1740
|
+
clientNumber: string;
|
|
1741
|
+
name: string;
|
|
1742
|
+
phone?: string;
|
|
1743
|
+
email?: string;
|
|
1744
|
+
};
|
|
1745
|
+
paymentMethod?: {
|
|
1746
|
+
id: string;
|
|
1747
|
+
name: string;
|
|
1748
|
+
code: string;
|
|
1749
|
+
description?: string;
|
|
1750
|
+
};
|
|
1751
|
+
createdBy?: {
|
|
1752
|
+
id: string;
|
|
1753
|
+
name: string;
|
|
1754
|
+
email: string;
|
|
1755
|
+
};
|
|
1756
|
+
updatedBy?: {
|
|
1757
|
+
id: string;
|
|
1758
|
+
name: string;
|
|
1759
|
+
email: string;
|
|
1760
|
+
};
|
|
1761
|
+
_count?: {
|
|
1762
|
+
saleItems: number;
|
|
1763
|
+
};
|
|
1764
|
+
}
|
|
1765
|
+
interface SearchSalesParams extends PaginationQueryDto {
|
|
1766
|
+
customerName?: string;
|
|
1767
|
+
customerId?: string;
|
|
1768
|
+
paymentStatus?: 'paid' | 'unpaid';
|
|
1769
|
+
startDate?: string;
|
|
1770
|
+
endDate?: string;
|
|
1771
|
+
minTotal?: number;
|
|
1772
|
+
maxTotal?: number;
|
|
1773
|
+
}
|
|
1774
|
+
interface SalesStats {
|
|
1775
|
+
totalSales: number;
|
|
1776
|
+
totalRevenue: number;
|
|
1777
|
+
paidSales: number;
|
|
1778
|
+
unpaidSales: number;
|
|
1779
|
+
paymentRate: number;
|
|
1780
|
+
}
|
|
1781
|
+
interface TopSellingProduct {
|
|
1782
|
+
product?: {
|
|
1783
|
+
id: string;
|
|
1784
|
+
name: string;
|
|
1785
|
+
price: number;
|
|
1786
|
+
imageId?: string;
|
|
1787
|
+
category?: {
|
|
1788
|
+
id: string;
|
|
1789
|
+
name: string;
|
|
1790
|
+
color?: string;
|
|
1791
|
+
};
|
|
1792
|
+
};
|
|
1793
|
+
totalQuantity: number;
|
|
1794
|
+
totalRevenue: number;
|
|
1795
|
+
}
|
|
1796
|
+
interface CustomerSalesReport {
|
|
1797
|
+
summary: {
|
|
1798
|
+
totalCustomers: number;
|
|
1799
|
+
totalSales: number;
|
|
1800
|
+
totalRevenue: number;
|
|
1801
|
+
};
|
|
1802
|
+
customers: Array<{
|
|
1803
|
+
customer: {
|
|
1804
|
+
id: string | null;
|
|
1805
|
+
clientNumber?: string;
|
|
1806
|
+
name: string;
|
|
1807
|
+
phone?: string;
|
|
1808
|
+
email?: string;
|
|
1809
|
+
};
|
|
1810
|
+
totalSales: number;
|
|
1811
|
+
totalRevenue: number;
|
|
1812
|
+
sales: Array<{
|
|
1813
|
+
id: string;
|
|
1814
|
+
total: number;
|
|
1815
|
+
saleDate: string;
|
|
1816
|
+
}>;
|
|
1817
|
+
}>;
|
|
1818
|
+
}
|
|
1819
|
+
|
|
1820
|
+
declare class SalesResource extends BaseResource {
|
|
1821
|
+
private basePath;
|
|
1822
|
+
createSale(data: CreateSaleDto, options?: RequestOptions): Promise<Sale>;
|
|
1823
|
+
searchSales(params?: SearchSalesParams, options?: RequestOptions): Promise<PaginatedResponseDto<Sale>>;
|
|
1824
|
+
getSale(id: string, options?: RequestOptions): Promise<Sale>;
|
|
1825
|
+
updateSale(id: string, data: UpdateSaleDto, options?: RequestOptions): Promise<Sale>;
|
|
1826
|
+
updatePaymentStatus(id: string, paymentStatus: 'paid' | 'unpaid', options?: RequestOptions): Promise<Sale>;
|
|
1827
|
+
deleteSale(id: string, options?: RequestOptions): Promise<void>;
|
|
1828
|
+
getSalesStats(startDate?: string, endDate?: string, options?: RequestOptions): Promise<SalesStats>;
|
|
1829
|
+
getTopSellingProducts(limit?: number, startDate?: string, endDate?: string, options?: RequestOptions): Promise<TopSellingProduct[]>;
|
|
1830
|
+
getSalesByCustomer(startDate?: string, endDate?: string, options?: RequestOptions): Promise<CustomerSalesReport>;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
interface CreateSupplierDto {
|
|
1834
|
+
name: string;
|
|
1835
|
+
contactInfo?: string;
|
|
1836
|
+
phone?: string;
|
|
1837
|
+
email?: string;
|
|
1838
|
+
address?: string;
|
|
1839
|
+
}
|
|
1840
|
+
interface UpdateSupplierDto {
|
|
1841
|
+
name?: string;
|
|
1842
|
+
contactInfo?: string;
|
|
1843
|
+
phone?: string;
|
|
1844
|
+
email?: string;
|
|
1845
|
+
address?: string;
|
|
1846
|
+
}
|
|
1847
|
+
interface Supplier {
|
|
1848
|
+
id: string;
|
|
1849
|
+
gymId: string;
|
|
1850
|
+
name: string;
|
|
1851
|
+
contactInfo?: string;
|
|
1852
|
+
phone?: string;
|
|
1853
|
+
email?: string;
|
|
1854
|
+
address?: string;
|
|
1855
|
+
createdAt: string;
|
|
1856
|
+
updatedAt: string;
|
|
1857
|
+
createdBy?: {
|
|
1858
|
+
id: string;
|
|
1859
|
+
name: string;
|
|
1860
|
+
email: string;
|
|
1861
|
+
};
|
|
1862
|
+
updatedBy?: {
|
|
1863
|
+
id: string;
|
|
1864
|
+
name: string;
|
|
1865
|
+
email: string;
|
|
1866
|
+
};
|
|
1867
|
+
}
|
|
1868
|
+
interface SearchSuppliersParams extends PaginationQueryDto {
|
|
1869
|
+
search?: string;
|
|
1870
|
+
}
|
|
1871
|
+
interface SuppliersStats {
|
|
1872
|
+
totalSuppliers: number;
|
|
1873
|
+
suppliersWithEmail: number;
|
|
1874
|
+
suppliersWithPhone: number;
|
|
1875
|
+
suppliersWithAddress: number;
|
|
1876
|
+
contactCompleteness: {
|
|
1877
|
+
email: number;
|
|
1878
|
+
phone: number;
|
|
1879
|
+
address: number;
|
|
1880
|
+
};
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
declare class SuppliersResource extends BaseResource {
|
|
1884
|
+
private basePath;
|
|
1885
|
+
createSupplier(data: CreateSupplierDto, options?: RequestOptions): Promise<Supplier>;
|
|
1886
|
+
searchSuppliers(params?: SearchSuppliersParams, options?: RequestOptions): Promise<PaginatedResponseDto<Supplier>>;
|
|
1887
|
+
getSupplier(id: string, options?: RequestOptions): Promise<Supplier>;
|
|
1888
|
+
updateSupplier(id: string, data: UpdateSupplierDto, options?: RequestOptions): Promise<Supplier>;
|
|
1889
|
+
deleteSupplier(id: string, options?: RequestOptions): Promise<void>;
|
|
1890
|
+
getSuppliersStats(options?: RequestOptions): Promise<SuppliersStats>;
|
|
1891
|
+
}
|
|
1892
|
+
|
|
1893
|
+
interface UpdateProfileDto {
|
|
1894
|
+
name?: string;
|
|
1895
|
+
phone?: string;
|
|
1896
|
+
birthDate?: string;
|
|
1897
|
+
}
|
|
1898
|
+
interface UserProfileDto {
|
|
1899
|
+
id: string;
|
|
1900
|
+
email: string;
|
|
1901
|
+
name: string;
|
|
1902
|
+
phone?: string | null;
|
|
1903
|
+
birthDate?: Date | string | null;
|
|
1904
|
+
userType: 'owner' | 'collaborator';
|
|
1905
|
+
emailVerified: boolean;
|
|
1906
|
+
createdAt: Date | string;
|
|
1907
|
+
updatedAt: Date | string;
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
declare class UsersResource extends BaseResource {
|
|
1911
|
+
/**
|
|
1912
|
+
* Get the current user's profile
|
|
1913
|
+
* @param options - Request options
|
|
1914
|
+
* @returns User profile data
|
|
1915
|
+
*/
|
|
1916
|
+
getProfile(options?: RequestOptions): Promise<UserProfileDto>;
|
|
1917
|
+
/**
|
|
1918
|
+
* Update the current user's profile
|
|
1919
|
+
* @param data - Profile update data
|
|
1920
|
+
* @param options - Request options
|
|
1921
|
+
* @returns Updated user profile
|
|
1922
|
+
*/
|
|
1923
|
+
updateProfile(data: UpdateProfileDto, options?: RequestOptions): Promise<UserProfileDto>;
|
|
1924
|
+
}
|
|
1925
|
+
|
|
1926
|
+
declare class SubscriptionsResource extends BaseResource {
|
|
1927
|
+
private basePath;
|
|
1928
|
+
/**
|
|
1929
|
+
* Get available subscription plans (currently only free plans)
|
|
1930
|
+
*/
|
|
1931
|
+
getAvailablePlans(options?: RequestOptions): Promise<AvailablePlanDto[]>;
|
|
1932
|
+
/**
|
|
1933
|
+
* Get subscription status for an organization
|
|
1934
|
+
*/
|
|
1935
|
+
getSubscriptionStatus(organizationId: string, options?: RequestOptions): Promise<SubscriptionStatusDto>;
|
|
1936
|
+
/**
|
|
1937
|
+
* Affiliate organization to a subscription plan
|
|
1938
|
+
*/
|
|
1939
|
+
affiliateOrganization(organizationId: string, data: AffiliateOrganizationDto, options?: RequestOptions): Promise<SubscriptionStatusDto>;
|
|
1940
|
+
/**
|
|
1941
|
+
* Check subscription limits
|
|
1942
|
+
* @param organizationId Organization ID
|
|
1943
|
+
* @param limitType Type of limit to check: 'gyms', 'clients', or 'users'
|
|
1944
|
+
*/
|
|
1945
|
+
checkSubscriptionLimit(organizationId: string, limitType: 'gyms' | 'clients' | 'users', options?: RequestOptions): Promise<CheckLimitResponse>;
|
|
1946
|
+
}
|
|
1947
|
+
|
|
1948
|
+
interface CreatePaymentMethodDto {
|
|
1949
|
+
name: string;
|
|
1950
|
+
description?: string;
|
|
1951
|
+
code: string;
|
|
1952
|
+
enabled?: boolean;
|
|
1953
|
+
metadata?: Record<string, any>;
|
|
1954
|
+
}
|
|
1955
|
+
interface UpdatePaymentMethodDto {
|
|
1956
|
+
name?: string;
|
|
1957
|
+
description?: string;
|
|
1958
|
+
code?: string;
|
|
1959
|
+
enabled?: boolean;
|
|
1960
|
+
metadata?: Record<string, any>;
|
|
1961
|
+
}
|
|
1962
|
+
interface PaymentMethod {
|
|
1963
|
+
id: string;
|
|
1964
|
+
gymId: string;
|
|
1965
|
+
name: string;
|
|
1966
|
+
description?: string;
|
|
1967
|
+
code: string;
|
|
1968
|
+
enabled: boolean;
|
|
1969
|
+
metadata?: Record<string, any>;
|
|
1970
|
+
createdAt: string;
|
|
1971
|
+
updatedAt: string;
|
|
1972
|
+
}
|
|
1973
|
+
interface SearchPaymentMethodsParams extends PaginationQueryDto {
|
|
1974
|
+
search?: string;
|
|
1975
|
+
enabledOnly?: boolean;
|
|
1976
|
+
code?: string;
|
|
1977
|
+
}
|
|
1978
|
+
interface PaymentMethodStats {
|
|
1979
|
+
totalPaymentMethods: number;
|
|
1980
|
+
enabledPaymentMethods: number;
|
|
1981
|
+
disabledPaymentMethods: number;
|
|
1982
|
+
}
|
|
1983
|
+
|
|
1984
|
+
declare class PaymentMethodsResource extends BaseResource {
|
|
1985
|
+
private basePath;
|
|
1986
|
+
createPaymentMethod(data: CreatePaymentMethodDto, options?: RequestOptions): Promise<PaymentMethod>;
|
|
1987
|
+
searchPaymentMethods(params?: SearchPaymentMethodsParams, options?: RequestOptions): Promise<PaginatedResponseDto<PaymentMethod>>;
|
|
1988
|
+
getPaymentMethod(id: string, options?: RequestOptions): Promise<PaymentMethod>;
|
|
1989
|
+
updatePaymentMethod(id: string, data: UpdatePaymentMethodDto, options?: RequestOptions): Promise<PaymentMethod>;
|
|
1990
|
+
deletePaymentMethod(id: string, options?: RequestOptions): Promise<void>;
|
|
1991
|
+
togglePaymentMethod(id: string, options?: RequestOptions): Promise<PaymentMethod>;
|
|
1992
|
+
getPaymentMethodStats(options?: RequestOptions): Promise<PaymentMethodStats>;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
declare class GymSpaceSdk {
|
|
1996
|
+
private client;
|
|
1997
|
+
auth: AuthResource;
|
|
1998
|
+
organizations: OrganizationsResource;
|
|
1999
|
+
gyms: GymsResource;
|
|
2000
|
+
clients: ClientsResource;
|
|
2001
|
+
membershipPlans: MembershipPlansResource;
|
|
2002
|
+
contracts: ContractsResource;
|
|
2003
|
+
dashboard: DashboardResource;
|
|
2004
|
+
evaluations: EvaluationsResource;
|
|
2005
|
+
checkIns: CheckInsResource;
|
|
2006
|
+
invitations: InvitationsResource;
|
|
2007
|
+
leads: LeadsResource;
|
|
2008
|
+
assets: AssetsResource;
|
|
2009
|
+
files: FilesResource;
|
|
2010
|
+
publicCatalog: PublicCatalogResource;
|
|
2011
|
+
health: HealthResource;
|
|
2012
|
+
onboarding: OnboardingResource;
|
|
2013
|
+
products: ProductsResource;
|
|
2014
|
+
sales: SalesResource;
|
|
2015
|
+
suppliers: SuppliersResource;
|
|
2016
|
+
users: UsersResource;
|
|
2017
|
+
subscriptions: SubscriptionsResource;
|
|
2018
|
+
paymentMethods: PaymentMethodsResource;
|
|
2019
|
+
constructor(config: GymSpaceConfig);
|
|
2020
|
+
/**
|
|
2021
|
+
* Set the authentication token
|
|
2022
|
+
*/
|
|
2023
|
+
setAuthToken(token: string): void;
|
|
2024
|
+
/**
|
|
2025
|
+
* Set the current gym context
|
|
2026
|
+
*/
|
|
2027
|
+
setGymId(gymId: string): void;
|
|
2028
|
+
/**
|
|
2029
|
+
* Clear authentication
|
|
2030
|
+
*/
|
|
2031
|
+
clearAuth(): void;
|
|
2032
|
+
/**
|
|
2033
|
+
* Get the underlying API client
|
|
2034
|
+
*/
|
|
2035
|
+
getClient(): ApiClient;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
2038
|
+
interface ApiResponse<T> {
|
|
2039
|
+
data: T;
|
|
2040
|
+
meta?: any;
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
declare class GymSpaceError extends Error {
|
|
2044
|
+
statusCode?: number;
|
|
2045
|
+
code?: string;
|
|
2046
|
+
details?: any;
|
|
2047
|
+
constructor(message: string, statusCode?: number, code?: string, details?: any);
|
|
2048
|
+
}
|
|
2049
|
+
declare class AuthenticationError extends GymSpaceError {
|
|
2050
|
+
constructor(message?: string);
|
|
2051
|
+
}
|
|
2052
|
+
declare class AuthorizationError extends GymSpaceError {
|
|
2053
|
+
constructor(message?: string);
|
|
2054
|
+
}
|
|
2055
|
+
declare class NotFoundError extends GymSpaceError {
|
|
2056
|
+
constructor(resource: string, id?: string);
|
|
2057
|
+
}
|
|
2058
|
+
declare class ValidationError extends GymSpaceError {
|
|
2059
|
+
constructor(message: string, errors?: any);
|
|
2060
|
+
}
|
|
2061
|
+
declare class NetworkError extends GymSpaceError {
|
|
2062
|
+
constructor(message?: string);
|
|
2063
|
+
}
|
|
2064
|
+
|
|
2065
|
+
export { type AcceptInvitationDto, type AffiliateOrganizationDto, type Amenities, ApiClient, type ApiResponse, type AssetResponseDto, AssetsResource, AuthResource, AuthenticationError, AuthorizationError, type AvailablePlanDto, type BusinessHours, type CatalogGym, type ChangePasswordDto, type ChangePasswordResponseDto, type CheckIn, type CheckInListResponse, type CheckInStats, type CheckInSystemFeatures, type CheckIns, CheckInsResource, type CheckLimitResponse, type CityWithGyms, type Client, type ClientCheckInHistory, type ClientManagementFeatures, type ClientSearchForCheckInResponse, type ClientStat, type ClientStats, ClientsResource, type CompleteGuidedSetupData, type ConfigureFeaturesData, type Contract, ContractsResource, type ContractsRevenue, type CreateCheckInDto, type CreateClientDto, type CreateContractDto, type CreateEvaluationDto, type CreateGymDto, type CreateInvitationDto, type CreateLeadDto, type CreateMembershipPlanDto, type CreatePaymentMethodDto, type CreateProductCategoryDto, type CreateProductDto, type CreateSaleDto, type CreateServiceDto, type CreateSupplierDto, type CurrentSessionResponse, type CurrentlyInGymResponse, type CustomerSalesReport, DashboardResource, type DashboardStats, type DateRangeParams, type DaySchedule, type Debts, type Evaluation, type EvaluationHealthMetrics, type EvaluationMeasurements, type EvaluationPerformanceMetrics, type EvaluationReport, type EvaluationSystemFeatures, EvaluationsResource, type ExpiringContract, type FileResponseDto, FilesResource, type FreezeContractDto, type GetCheckInStatsParams, type GetClientCheckInHistoryParams, type GetClientEvaluationsParams, type GetContractsParams, type GetFeaturedGymsParams, type GetGymInvitationsParams, type GetMembershipPlansParams, type Gym, type GymAmenities, type GymSchedule, type GymSettings, type GymSocialMedia, type GymSpaceConfig, GymSpaceError, GymSpaceSdk, type GymStats, GymsResource, HealthResource, type HealthResponse, type Invitation, type InvitationValidationResponse, InvitationsResource, type Lead, type LeadManagementFeatures, type LeadStats, LeadsResource, type LoginDto, type LoginResponseDto, type MembershipManagementFeatures, type MembershipPlan, type MembershipPlanStats, MembershipPlansResource, NetworkError, type NewClients, NotFoundError, type NotificationSettings, OnboardingResource, type OnboardingResponse, type OnboardingStatus, OnboardingStep, type Organization, type OrganizationStats, type OrganizationWithDetails, OrganizationsResource, type PaginatedResponse, type PaginatedResponseDto, type PaginationParams, type PaginationQueryDto, type PaymentMethod, type PaymentMethodStats, PaymentMethodsResource, type Product, type ProductCategory, ProductsResource, PublicCatalogResource, type ReadyResponse, type RegisterCollaboratorDto, type RegisterOwnerDto, type RenewContractDto, type RequestOptions, type RequestPasswordResetDto, type RequestPasswordResetResponseDto, type ResendResetCodeDto, type ResendResetCodeResponseDto, type ResendVerificationDto, type ResetPasswordDto, type ResetPasswordResponseDto, type Sale, type SaleItem, type SaleItemDto, SalesResource, type SalesRevenue, type SalesStats, type SearchCatalogParams, type SearchCheckInsParams, type SearchClientsParams, type SearchLeadsParams, type SearchPaymentMethodsParams, type SearchProductsParams, type SearchSalesParams, type SearchSuppliersParams, type SocialMedia, type StartOnboardingData, type StartOnboardingResponse, type StockMovement, type Subscription, type SubscriptionPlan, type SubscriptionStatusDto, SubscriptionsResource, type Supplier, SuppliersResource, type SuppliersStats, type TimeSlot, type TopSellingProduct, type UpdateClientDto, type UpdateEvaluationDto, type UpdateGymDto, type UpdateGymScheduleDto, type UpdateGymSettingsData, type UpdateGymSocialMediaDto, type UpdateLeadDto, type UpdateMembershipPlanDto, type UpdateOrganizationDto, type UpdatePaymentMethodDto, type UpdatePaymentStatusDto, type UpdateProductCategoryDto, type UpdateProductDto, type UpdateProfileDto, type UpdateSaleDto, type UpdateStockDto, type UpdateSupplierDto, type UploadAssetDto, type UploadFileDto, type UserProfileDto, UsersResource, ValidationError, type VerifyEmailDto, type VerifyResetCodeDto, type VerifyResetCodeResponseDto, type WeeklySchedule };
|