@jugarhoy/api 1.1.32 → 1.1.34
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/apis/CoachApi.ts +1199 -42
- package/apis/CoachWorkspaceApi.ts +93 -0
- package/apis/MyActivitiesApi.ts +72 -0
- package/apis/PlayerCoachBookingApi.ts +92 -7
- package/apis/PublicCoachDiscoveryApi.ts +292 -0
- package/apis/SubscriptionsApi.ts +64 -0
- package/apis/index.ts +3 -0
- package/models/AddCoachSubscriptionMemberRequest.ts +97 -0
- package/models/AddShiftWithLocationDto.ts +231 -0
- package/models/AgendaSlotDto.ts +142 -0
- package/models/ClubPlaceRegistrationStatus.ts +9 -0
- package/models/CoachClassDetailDto.ts +88 -0
- package/models/CoachClassFilters.ts +3 -3
- package/models/CoachClassLocationDto.ts +89 -0
- package/models/CoachLocationRegistrationDto.ts +149 -0
- package/models/CoachPaymentsDto.ts +81 -0
- package/models/CoachProfileDto.ts +104 -0
- package/models/CoachPublicSubscriptionDto.ts +183 -0
- package/models/CoachSearchParams.ts +42 -2
- package/models/CoachShiftInputDto.ts +170 -0
- package/models/CoachShiftRegistrationDto.ts +176 -0
- package/models/CoachTeamPlayerDto.ts +97 -0
- package/models/CoachTrainingTeamDto.ts +121 -0
- package/models/CoachWorkspaceLocationDto.ts +137 -0
- package/models/CoachWorkspaceProfileDto.ts +225 -0
- package/models/CoachWorkspaceShiftDto.ts +201 -0
- package/models/CreatePreReservationDto.ts +110 -0
- package/models/CreateRecurringGameRequest.ts +27 -0
- package/models/DayAgendaDto.ts +89 -0
- package/models/GenerateCoachSubscriptionBillsRequest.ts +74 -0
- package/models/GetCoachMercadoPagoAuthUrl200Response.ts +65 -0
- package/models/GetCoachSubscriptionMemberDebt200ResponseInner.ts +81 -0
- package/models/LinkCoachMercadoPagoRequest.ts +66 -0
- package/models/LinkPreview.ts +97 -0
- package/models/LinkShiftToTeamRequest.ts +65 -0
- package/models/MarkCoachSubscriptionBillPaid200Response.ts +65 -0
- package/models/PlaySubscription.ts +8 -0
- package/models/PublicAgendaSlotDto.ts +102 -0
- package/models/PublicDayAgendaDto.ts +92 -0
- package/models/PublicWeeklyAgendaDto.ts +83 -0
- package/models/RecurringGame.ts +27 -0
- package/models/RecurringGameResponse.ts +29 -0
- package/models/RegisterCoachProfileDto.ts +213 -0
- package/models/RegisterCoachProfileResponseDto.ts +89 -0
- package/models/ReserveStatus.ts +1 -0
- package/models/SubscriptionRequestResponseDto.ts +96 -0
- package/models/TeamResponse.ts +16 -0
- package/models/TrainingSubscriptionDto.ts +167 -0
- package/models/UpcomingActivityDto.ts +217 -0
- package/models/UpdateCoachProfileDto.ts +161 -0
- package/models/UpdateRecurringGameRequest.ts +27 -0
- package/models/UserDto.ts +31 -0
- package/models/UserReserveDto.ts +41 -0
- package/models/WeeklyAgendaDto.ts +81 -0
- package/models/index.ts +34 -0
- package/package.json +1 -1
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
|
+
CoachClassDetailDto,
|
|
18
19
|
Location,
|
|
19
20
|
PlaySpotShift,
|
|
20
21
|
Reserve,
|
|
@@ -22,6 +23,8 @@ import type {
|
|
|
22
23
|
TrainerFeedDto,
|
|
23
24
|
} from '../models/index';
|
|
24
25
|
import {
|
|
26
|
+
CoachClassDetailDtoFromJSON,
|
|
27
|
+
CoachClassDetailDtoToJSON,
|
|
25
28
|
LocationFromJSON,
|
|
26
29
|
LocationToJSON,
|
|
27
30
|
PlaySpotShiftFromJSON,
|
|
@@ -49,6 +52,14 @@ export interface ApiAppCoachWorkspaceShiftsGetRequest {
|
|
|
49
52
|
locationId?: string;
|
|
50
53
|
}
|
|
51
54
|
|
|
55
|
+
export interface ConfirmCoachClassRequest {
|
|
56
|
+
reserveId: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface GetCoachClassByIdRequest {
|
|
60
|
+
reserveId: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
52
63
|
/**
|
|
53
64
|
*
|
|
54
65
|
*/
|
|
@@ -251,4 +262,86 @@ export class CoachWorkspaceApi extends runtime.BaseAPI {
|
|
|
251
262
|
return await response.value();
|
|
252
263
|
}
|
|
253
264
|
|
|
265
|
+
/**
|
|
266
|
+
* Confirm a pre-reservation
|
|
267
|
+
*/
|
|
268
|
+
async confirmCoachClassRaw(requestParameters: ConfirmCoachClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Reserve>> {
|
|
269
|
+
if (requestParameters['reserveId'] == null) {
|
|
270
|
+
throw new runtime.RequiredError(
|
|
271
|
+
'reserveId',
|
|
272
|
+
'Required parameter "reserveId" was null or undefined when calling confirmCoachClass().'
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const queryParameters: any = {};
|
|
277
|
+
|
|
278
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
279
|
+
|
|
280
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
281
|
+
const token = this.configuration.accessToken;
|
|
282
|
+
const tokenString = await token("bearerAuth", []);
|
|
283
|
+
|
|
284
|
+
if (tokenString) {
|
|
285
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
const response = await this.request({
|
|
289
|
+
path: `/api/app/coach/workspace/classes/{reserveId}/confirm`.replace(`{${"reserveId"}}`, encodeURIComponent(String(requestParameters['reserveId']))),
|
|
290
|
+
method: 'PATCH',
|
|
291
|
+
headers: headerParameters,
|
|
292
|
+
query: queryParameters,
|
|
293
|
+
}, initOverrides);
|
|
294
|
+
|
|
295
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => ReserveFromJSON(jsonValue));
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* Confirm a pre-reservation
|
|
300
|
+
*/
|
|
301
|
+
async confirmCoachClass(requestParameters: ConfirmCoachClassRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Reserve> {
|
|
302
|
+
const response = await this.confirmCoachClassRaw(requestParameters, initOverrides);
|
|
303
|
+
return await response.value();
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Get a single class (reserve) by ID
|
|
308
|
+
*/
|
|
309
|
+
async getCoachClassByIdRaw(requestParameters: GetCoachClassByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CoachClassDetailDto>> {
|
|
310
|
+
if (requestParameters['reserveId'] == null) {
|
|
311
|
+
throw new runtime.RequiredError(
|
|
312
|
+
'reserveId',
|
|
313
|
+
'Required parameter "reserveId" was null or undefined when calling getCoachClassById().'
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
const queryParameters: any = {};
|
|
318
|
+
|
|
319
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
320
|
+
|
|
321
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
322
|
+
const token = this.configuration.accessToken;
|
|
323
|
+
const tokenString = await token("bearerAuth", []);
|
|
324
|
+
|
|
325
|
+
if (tokenString) {
|
|
326
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
const response = await this.request({
|
|
330
|
+
path: `/api/app/coach/workspace/classes/{reserveId}`.replace(`{${"reserveId"}}`, encodeURIComponent(String(requestParameters['reserveId']))),
|
|
331
|
+
method: 'GET',
|
|
332
|
+
headers: headerParameters,
|
|
333
|
+
query: queryParameters,
|
|
334
|
+
}, initOverrides);
|
|
335
|
+
|
|
336
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CoachClassDetailDtoFromJSON(jsonValue));
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Get a single class (reserve) by ID
|
|
341
|
+
*/
|
|
342
|
+
async getCoachClassById(requestParameters: GetCoachClassByIdRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CoachClassDetailDto> {
|
|
343
|
+
const response = await this.getCoachClassByIdRaw(requestParameters, initOverrides);
|
|
344
|
+
return await response.value();
|
|
345
|
+
}
|
|
346
|
+
|
|
254
347
|
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Jugar Hoy - API
|
|
5
|
+
* API documentation for Jugar Hoy application
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.5.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
UpcomingActivityDto,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
import {
|
|
21
|
+
UpcomingActivityDtoFromJSON,
|
|
22
|
+
UpcomingActivityDtoToJSON,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
|
|
25
|
+
export interface GetMyActivitiesRequest {
|
|
26
|
+
limit?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
export class MyActivitiesApi extends runtime.BaseAPI {
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get upcoming activities (reserves, coach classes, play registrations)
|
|
36
|
+
*/
|
|
37
|
+
async getMyActivitiesRaw(requestParameters: GetMyActivitiesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<UpcomingActivityDto>>> {
|
|
38
|
+
const queryParameters: any = {};
|
|
39
|
+
|
|
40
|
+
if (requestParameters['limit'] != null) {
|
|
41
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
45
|
+
|
|
46
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
47
|
+
const token = this.configuration.accessToken;
|
|
48
|
+
const tokenString = await token("bearerAuth", []);
|
|
49
|
+
|
|
50
|
+
if (tokenString) {
|
|
51
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
const response = await this.request({
|
|
55
|
+
path: `/api/app/my-activities`,
|
|
56
|
+
method: 'GET',
|
|
57
|
+
headers: headerParameters,
|
|
58
|
+
query: queryParameters,
|
|
59
|
+
}, initOverrides);
|
|
60
|
+
|
|
61
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(UpcomingActivityDtoFromJSON));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get upcoming activities (reserves, coach classes, play registrations)
|
|
66
|
+
*/
|
|
67
|
+
async getMyActivities(requestParameters: GetMyActivitiesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<UpcomingActivityDto>> {
|
|
68
|
+
const response = await this.getMyActivitiesRaw(requestParameters, initOverrides);
|
|
69
|
+
return await response.value();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
}
|
|
@@ -20,6 +20,7 @@ import type {
|
|
|
20
20
|
CoachProfileDto,
|
|
21
21
|
Reserve,
|
|
22
22
|
Sport,
|
|
23
|
+
SubscriptionRequestResponseDto,
|
|
23
24
|
} from '../models/index';
|
|
24
25
|
import {
|
|
25
26
|
BookCoachClassDtoFromJSON,
|
|
@@ -32,6 +33,8 @@ import {
|
|
|
32
33
|
ReserveToJSON,
|
|
33
34
|
SportFromJSON,
|
|
34
35
|
SportToJSON,
|
|
36
|
+
SubscriptionRequestResponseDtoFromJSON,
|
|
37
|
+
SubscriptionRequestResponseDtoToJSON,
|
|
35
38
|
} from '../models/index';
|
|
36
39
|
|
|
37
40
|
export interface ApiAppCoachesBookPostRequest {
|
|
@@ -47,10 +50,20 @@ export interface ApiAppCoachesCoachUserIdProfileGetRequest {
|
|
|
47
50
|
coachUserId: string;
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
export interface
|
|
53
|
+
export interface RequestCoachSubscriptionRequest {
|
|
54
|
+
coachUserId: string;
|
|
55
|
+
subId: string;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface SearchCoachesRequest {
|
|
51
59
|
sport?: Sport;
|
|
52
|
-
locationId?: string;
|
|
53
60
|
category?: string;
|
|
61
|
+
locationId?: string;
|
|
62
|
+
latitude?: number;
|
|
63
|
+
longitude?: number;
|
|
64
|
+
radiusKm?: number;
|
|
65
|
+
page?: number;
|
|
66
|
+
size?: number;
|
|
54
67
|
}
|
|
55
68
|
|
|
56
69
|
/**
|
|
@@ -196,21 +209,92 @@ export class PlayerCoachBookingApi extends runtime.BaseAPI {
|
|
|
196
209
|
}
|
|
197
210
|
|
|
198
211
|
/**
|
|
212
|
+
* Creates a PENDING subscription request. Does NOT add the user as a confirmed member. The coach must approve the request separately.
|
|
213
|
+
* Request to join a coach\'s subscription
|
|
214
|
+
*/
|
|
215
|
+
async requestCoachSubscriptionRaw(requestParameters: RequestCoachSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<SubscriptionRequestResponseDto>> {
|
|
216
|
+
if (requestParameters['coachUserId'] == null) {
|
|
217
|
+
throw new runtime.RequiredError(
|
|
218
|
+
'coachUserId',
|
|
219
|
+
'Required parameter "coachUserId" was null or undefined when calling requestCoachSubscription().'
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (requestParameters['subId'] == null) {
|
|
224
|
+
throw new runtime.RequiredError(
|
|
225
|
+
'subId',
|
|
226
|
+
'Required parameter "subId" was null or undefined when calling requestCoachSubscription().'
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
const queryParameters: any = {};
|
|
231
|
+
|
|
232
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
233
|
+
|
|
234
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
235
|
+
const token = this.configuration.accessToken;
|
|
236
|
+
const tokenString = await token("bearerAuth", []);
|
|
237
|
+
|
|
238
|
+
if (tokenString) {
|
|
239
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
const response = await this.request({
|
|
243
|
+
path: `/api/app/coaches/{coachUserId}/subscriptions/{subId}/request`.replace(`{${"coachUserId"}}`, encodeURIComponent(String(requestParameters['coachUserId']))).replace(`{${"subId"}}`, encodeURIComponent(String(requestParameters['subId']))),
|
|
244
|
+
method: 'POST',
|
|
245
|
+
headers: headerParameters,
|
|
246
|
+
query: queryParameters,
|
|
247
|
+
}, initOverrides);
|
|
248
|
+
|
|
249
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => SubscriptionRequestResponseDtoFromJSON(jsonValue));
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Creates a PENDING subscription request. Does NOT add the user as a confirmed member. The coach must approve the request separately.
|
|
254
|
+
* Request to join a coach\'s subscription
|
|
255
|
+
*/
|
|
256
|
+
async requestCoachSubscription(requestParameters: RequestCoachSubscriptionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SubscriptionRequestResponseDto> {
|
|
257
|
+
const response = await this.requestCoachSubscriptionRaw(requestParameters, initOverrides);
|
|
258
|
+
return await response.value();
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Returns active coaches filtered by sport, category, or location. When **latitude + longitude** are provided, uses PostGIS geo-search sorted by distance. Without geo params, returns all matching coaches (basic filter).
|
|
199
263
|
* Search for active coaches
|
|
200
264
|
*/
|
|
201
|
-
async
|
|
265
|
+
async searchCoachesRaw(requestParameters: SearchCoachesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CoachProfileDto>>> {
|
|
202
266
|
const queryParameters: any = {};
|
|
203
267
|
|
|
204
268
|
if (requestParameters['sport'] != null) {
|
|
205
269
|
queryParameters['sport'] = requestParameters['sport'];
|
|
206
270
|
}
|
|
207
271
|
|
|
272
|
+
if (requestParameters['category'] != null) {
|
|
273
|
+
queryParameters['category'] = requestParameters['category'];
|
|
274
|
+
}
|
|
275
|
+
|
|
208
276
|
if (requestParameters['locationId'] != null) {
|
|
209
277
|
queryParameters['locationId'] = requestParameters['locationId'];
|
|
210
278
|
}
|
|
211
279
|
|
|
212
|
-
if (requestParameters['
|
|
213
|
-
queryParameters['
|
|
280
|
+
if (requestParameters['latitude'] != null) {
|
|
281
|
+
queryParameters['latitude'] = requestParameters['latitude'];
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (requestParameters['longitude'] != null) {
|
|
285
|
+
queryParameters['longitude'] = requestParameters['longitude'];
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (requestParameters['radiusKm'] != null) {
|
|
289
|
+
queryParameters['radiusKm'] = requestParameters['radiusKm'];
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (requestParameters['page'] != null) {
|
|
293
|
+
queryParameters['page'] = requestParameters['page'];
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (requestParameters['size'] != null) {
|
|
297
|
+
queryParameters['size'] = requestParameters['size'];
|
|
214
298
|
}
|
|
215
299
|
|
|
216
300
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
@@ -234,10 +318,11 @@ export class PlayerCoachBookingApi extends runtime.BaseAPI {
|
|
|
234
318
|
}
|
|
235
319
|
|
|
236
320
|
/**
|
|
321
|
+
* Returns active coaches filtered by sport, category, or location. When **latitude + longitude** are provided, uses PostGIS geo-search sorted by distance. Without geo params, returns all matching coaches (basic filter).
|
|
237
322
|
* Search for active coaches
|
|
238
323
|
*/
|
|
239
|
-
async
|
|
240
|
-
const response = await this.
|
|
324
|
+
async searchCoaches(requestParameters: SearchCoachesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CoachProfileDto>> {
|
|
325
|
+
const response = await this.searchCoachesRaw(requestParameters, initOverrides);
|
|
241
326
|
return await response.value();
|
|
242
327
|
}
|
|
243
328
|
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Jugar Hoy - API
|
|
5
|
+
* API documentation for Jugar Hoy application
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.5.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
CoachAvailabilityDto,
|
|
19
|
+
CoachProfileDto,
|
|
20
|
+
CoachPublicSubscriptionDto,
|
|
21
|
+
PublicWeeklyAgendaDto,
|
|
22
|
+
Sport,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
import {
|
|
25
|
+
CoachAvailabilityDtoFromJSON,
|
|
26
|
+
CoachAvailabilityDtoToJSON,
|
|
27
|
+
CoachProfileDtoFromJSON,
|
|
28
|
+
CoachProfileDtoToJSON,
|
|
29
|
+
CoachPublicSubscriptionDtoFromJSON,
|
|
30
|
+
CoachPublicSubscriptionDtoToJSON,
|
|
31
|
+
PublicWeeklyAgendaDtoFromJSON,
|
|
32
|
+
PublicWeeklyAgendaDtoToJSON,
|
|
33
|
+
SportFromJSON,
|
|
34
|
+
SportToJSON,
|
|
35
|
+
} from '../models/index';
|
|
36
|
+
|
|
37
|
+
export interface PublicGetCoachAvailabilityRequest {
|
|
38
|
+
coachUserId: string;
|
|
39
|
+
locationId: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface PublicGetCoachProfileRequest {
|
|
43
|
+
coachUserId: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface PublicGetCoachSubscriptionsRequest {
|
|
47
|
+
coachUserId: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface PublicGetCoachWeeklyAgendaRequest {
|
|
51
|
+
coachUserId: string;
|
|
52
|
+
weekStart: Date;
|
|
53
|
+
locationId?: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface PublicSearchCoachesRequest {
|
|
57
|
+
sport?: Sport;
|
|
58
|
+
category?: string;
|
|
59
|
+
locationId?: string;
|
|
60
|
+
latitude?: number;
|
|
61
|
+
longitude?: number;
|
|
62
|
+
radiusKm?: number;
|
|
63
|
+
page?: number;
|
|
64
|
+
size?: number;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
export class PublicCoachDiscoveryApi extends runtime.BaseAPI {
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Get coach availability (shifts and prices) for a location (no auth required)
|
|
74
|
+
*/
|
|
75
|
+
async publicGetCoachAvailabilityRaw(requestParameters: PublicGetCoachAvailabilityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CoachAvailabilityDto>> {
|
|
76
|
+
if (requestParameters['coachUserId'] == null) {
|
|
77
|
+
throw new runtime.RequiredError(
|
|
78
|
+
'coachUserId',
|
|
79
|
+
'Required parameter "coachUserId" was null or undefined when calling publicGetCoachAvailability().'
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
if (requestParameters['locationId'] == null) {
|
|
84
|
+
throw new runtime.RequiredError(
|
|
85
|
+
'locationId',
|
|
86
|
+
'Required parameter "locationId" was null or undefined when calling publicGetCoachAvailability().'
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const queryParameters: any = {};
|
|
91
|
+
|
|
92
|
+
if (requestParameters['locationId'] != null) {
|
|
93
|
+
queryParameters['locationId'] = requestParameters['locationId'];
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
97
|
+
|
|
98
|
+
const response = await this.request({
|
|
99
|
+
path: `/api/public/coaches/{coachUserId}/availability`.replace(`{${"coachUserId"}}`, encodeURIComponent(String(requestParameters['coachUserId']))),
|
|
100
|
+
method: 'GET',
|
|
101
|
+
headers: headerParameters,
|
|
102
|
+
query: queryParameters,
|
|
103
|
+
}, initOverrides);
|
|
104
|
+
|
|
105
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CoachAvailabilityDtoFromJSON(jsonValue));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Get coach availability (shifts and prices) for a location (no auth required)
|
|
110
|
+
*/
|
|
111
|
+
async publicGetCoachAvailability(requestParameters: PublicGetCoachAvailabilityRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CoachAvailabilityDto> {
|
|
112
|
+
const response = await this.publicGetCoachAvailabilityRaw(requestParameters, initOverrides);
|
|
113
|
+
return await response.value();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Get coach public profile (no auth required)
|
|
118
|
+
*/
|
|
119
|
+
async publicGetCoachProfileRaw(requestParameters: PublicGetCoachProfileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CoachProfileDto>> {
|
|
120
|
+
if (requestParameters['coachUserId'] == null) {
|
|
121
|
+
throw new runtime.RequiredError(
|
|
122
|
+
'coachUserId',
|
|
123
|
+
'Required parameter "coachUserId" was null or undefined when calling publicGetCoachProfile().'
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const queryParameters: any = {};
|
|
128
|
+
|
|
129
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
130
|
+
|
|
131
|
+
const response = await this.request({
|
|
132
|
+
path: `/api/public/coaches/{coachUserId}/profile`.replace(`{${"coachUserId"}}`, encodeURIComponent(String(requestParameters['coachUserId']))),
|
|
133
|
+
method: 'GET',
|
|
134
|
+
headers: headerParameters,
|
|
135
|
+
query: queryParameters,
|
|
136
|
+
}, initOverrides);
|
|
137
|
+
|
|
138
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CoachProfileDtoFromJSON(jsonValue));
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Get coach public profile (no auth required)
|
|
143
|
+
*/
|
|
144
|
+
async publicGetCoachProfile(requestParameters: PublicGetCoachProfileRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CoachProfileDto> {
|
|
145
|
+
const response = await this.publicGetCoachProfileRaw(requestParameters, initOverrides);
|
|
146
|
+
return await response.value();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Get coach\'s active subscriptions (no auth required)
|
|
151
|
+
*/
|
|
152
|
+
async publicGetCoachSubscriptionsRaw(requestParameters: PublicGetCoachSubscriptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CoachPublicSubscriptionDto>>> {
|
|
153
|
+
if (requestParameters['coachUserId'] == null) {
|
|
154
|
+
throw new runtime.RequiredError(
|
|
155
|
+
'coachUserId',
|
|
156
|
+
'Required parameter "coachUserId" was null or undefined when calling publicGetCoachSubscriptions().'
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
const queryParameters: any = {};
|
|
161
|
+
|
|
162
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
163
|
+
|
|
164
|
+
const response = await this.request({
|
|
165
|
+
path: `/api/public/coaches/{coachUserId}/subscriptions`.replace(`{${"coachUserId"}}`, encodeURIComponent(String(requestParameters['coachUserId']))),
|
|
166
|
+
method: 'GET',
|
|
167
|
+
headers: headerParameters,
|
|
168
|
+
query: queryParameters,
|
|
169
|
+
}, initOverrides);
|
|
170
|
+
|
|
171
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CoachPublicSubscriptionDtoFromJSON));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Get coach\'s active subscriptions (no auth required)
|
|
176
|
+
*/
|
|
177
|
+
async publicGetCoachSubscriptions(requestParameters: PublicGetCoachSubscriptionsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CoachPublicSubscriptionDto>> {
|
|
178
|
+
const response = await this.publicGetCoachSubscriptionsRaw(requestParameters, initOverrides);
|
|
179
|
+
return await response.value();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Returns the week grid showing only truly available individual slots. Booked, group, and out-of-shift slots appear as disabled. No authentication required.
|
|
184
|
+
* Get coach\'s public weekly agenda (only available individual slots)
|
|
185
|
+
*/
|
|
186
|
+
async publicGetCoachWeeklyAgendaRaw(requestParameters: PublicGetCoachWeeklyAgendaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PublicWeeklyAgendaDto>> {
|
|
187
|
+
if (requestParameters['coachUserId'] == null) {
|
|
188
|
+
throw new runtime.RequiredError(
|
|
189
|
+
'coachUserId',
|
|
190
|
+
'Required parameter "coachUserId" was null or undefined when calling publicGetCoachWeeklyAgenda().'
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if (requestParameters['weekStart'] == null) {
|
|
195
|
+
throw new runtime.RequiredError(
|
|
196
|
+
'weekStart',
|
|
197
|
+
'Required parameter "weekStart" was null or undefined when calling publicGetCoachWeeklyAgenda().'
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const queryParameters: any = {};
|
|
202
|
+
|
|
203
|
+
if (requestParameters['weekStart'] != null) {
|
|
204
|
+
queryParameters['weekStart'] = (requestParameters['weekStart'] as any).toISOString().substring(0,10);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if (requestParameters['locationId'] != null) {
|
|
208
|
+
queryParameters['locationId'] = requestParameters['locationId'];
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
212
|
+
|
|
213
|
+
const response = await this.request({
|
|
214
|
+
path: `/api/public/coaches/{coachUserId}/agenda`.replace(`{${"coachUserId"}}`, encodeURIComponent(String(requestParameters['coachUserId']))),
|
|
215
|
+
method: 'GET',
|
|
216
|
+
headers: headerParameters,
|
|
217
|
+
query: queryParameters,
|
|
218
|
+
}, initOverrides);
|
|
219
|
+
|
|
220
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PublicWeeklyAgendaDtoFromJSON(jsonValue));
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Returns the week grid showing only truly available individual slots. Booked, group, and out-of-shift slots appear as disabled. No authentication required.
|
|
225
|
+
* Get coach\'s public weekly agenda (only available individual slots)
|
|
226
|
+
*/
|
|
227
|
+
async publicGetCoachWeeklyAgenda(requestParameters: PublicGetCoachWeeklyAgendaRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PublicWeeklyAgendaDto> {
|
|
228
|
+
const response = await this.publicGetCoachWeeklyAgendaRaw(requestParameters, initOverrides);
|
|
229
|
+
return await response.value();
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Returns active coaches filtered by sport, category, or location. When **latitude + longitude** are provided, uses PostGIS geo-search sorted by distance. Without geo params, returns all matching coaches (basic filter). No authentication required.
|
|
234
|
+
* Search for active coaches (public, no auth required)
|
|
235
|
+
*/
|
|
236
|
+
async publicSearchCoachesRaw(requestParameters: PublicSearchCoachesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CoachProfileDto>>> {
|
|
237
|
+
const queryParameters: any = {};
|
|
238
|
+
|
|
239
|
+
if (requestParameters['sport'] != null) {
|
|
240
|
+
queryParameters['sport'] = requestParameters['sport'];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if (requestParameters['category'] != null) {
|
|
244
|
+
queryParameters['category'] = requestParameters['category'];
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (requestParameters['locationId'] != null) {
|
|
248
|
+
queryParameters['locationId'] = requestParameters['locationId'];
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (requestParameters['latitude'] != null) {
|
|
252
|
+
queryParameters['latitude'] = requestParameters['latitude'];
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (requestParameters['longitude'] != null) {
|
|
256
|
+
queryParameters['longitude'] = requestParameters['longitude'];
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
if (requestParameters['radiusKm'] != null) {
|
|
260
|
+
queryParameters['radiusKm'] = requestParameters['radiusKm'];
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
if (requestParameters['page'] != null) {
|
|
264
|
+
queryParameters['page'] = requestParameters['page'];
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
if (requestParameters['size'] != null) {
|
|
268
|
+
queryParameters['size'] = requestParameters['size'];
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
272
|
+
|
|
273
|
+
const response = await this.request({
|
|
274
|
+
path: `/api/public/coaches/search`,
|
|
275
|
+
method: 'GET',
|
|
276
|
+
headers: headerParameters,
|
|
277
|
+
query: queryParameters,
|
|
278
|
+
}, initOverrides);
|
|
279
|
+
|
|
280
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CoachProfileDtoFromJSON));
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Returns active coaches filtered by sport, category, or location. When **latitude + longitude** are provided, uses PostGIS geo-search sorted by distance. Without geo params, returns all matching coaches (basic filter). No authentication required.
|
|
285
|
+
* Search for active coaches (public, no auth required)
|
|
286
|
+
*/
|
|
287
|
+
async publicSearchCoaches(requestParameters: PublicSearchCoachesRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CoachProfileDto>> {
|
|
288
|
+
const response = await this.publicSearchCoachesRaw(requestParameters, initOverrides);
|
|
289
|
+
return await response.value();
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* Jugar Hoy - API
|
|
5
|
+
* API documentation for Jugar Hoy application
|
|
6
|
+
*
|
|
7
|
+
* The version of the OpenAPI document: 1.5.0
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
11
|
+
* https://openapi-generator.tech
|
|
12
|
+
* Do not edit the class manually.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
import * as runtime from '../runtime';
|
|
17
|
+
import type {
|
|
18
|
+
TrainingSubscriptionDto,
|
|
19
|
+
} from '../models/index';
|
|
20
|
+
import {
|
|
21
|
+
TrainingSubscriptionDtoFromJSON,
|
|
22
|
+
TrainingSubscriptionDtoToJSON,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export class SubscriptionsApi extends runtime.BaseAPI {
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Get coach-led training subscriptions for the authenticated user
|
|
32
|
+
*/
|
|
33
|
+
async getMyTrainingSubscriptionsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TrainingSubscriptionDto>>> {
|
|
34
|
+
const queryParameters: any = {};
|
|
35
|
+
|
|
36
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
37
|
+
|
|
38
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
39
|
+
const token = this.configuration.accessToken;
|
|
40
|
+
const tokenString = await token("bearerAuth", []);
|
|
41
|
+
|
|
42
|
+
if (tokenString) {
|
|
43
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const response = await this.request({
|
|
47
|
+
path: `/api/app/subscriptions/training`,
|
|
48
|
+
method: 'GET',
|
|
49
|
+
headers: headerParameters,
|
|
50
|
+
query: queryParameters,
|
|
51
|
+
}, initOverrides);
|
|
52
|
+
|
|
53
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TrainingSubscriptionDtoFromJSON));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Get coach-led training subscriptions for the authenticated user
|
|
58
|
+
*/
|
|
59
|
+
async getMyTrainingSubscriptions(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<TrainingSubscriptionDto>> {
|
|
60
|
+
const response = await this.getMyTrainingSubscriptionsRaw(initOverrides);
|
|
61
|
+
return await response.value();
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
}
|