PageSourceSearch

https://www.renfrewshiregolfunion.co.uk/controls-vue/services/participation-service.js?v=1c09ac6248

js renfrewshiregolfunion.co.uk collected 2026-09-27 15:21:46 UTC 31,702 bytes, 654 lines download raw bytes

1/// <reference path="./base-service.ts" />
2var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4    return new (P || (P = Promise))(function (resolve, reject) {
5        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8        step((generator = generator.apply(thisArg, _arguments || [])).next());
9    });
10};
11var __generator = (this && this.__generator) || function (thisArg, body) {
12    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13    return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14    function verb(n) { return function (v) { return step([n, v]); }; }
15    function step(op) {
16        if (f) throw new TypeError("Generator is already executing.");
17        while (g && (g = 0, op[0] && (_ = 0)), _) try {
18            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19            if (y = 0, t) op = [op[0] & 2, t.value];
20            switch (op[0]) {
21                case 0: case 1: t = op; break;
22                case 4: _.label++; return { value: op[1], done: false };
23                case 5: _.label++; y = op[1]; op = [0]; continue;
24                case 7: op = _.ops.pop(); _.trys.pop(); continue;
25                default:
26                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30                    if (t[2]) _.ops.pop();
31                    _.trys.pop(); continue;
32            }
33            op = body.call(thisArg, _);
34        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36    }
37};
38//NOTE: Always CTRL F5 to clear the browser cache
39var AppServices;
40(function (AppServices) {
41    var ParticipationService = /** @class */ (function () {
42        function ParticipationService() {
43            this.baseUrl = '/api/Participation/';
44            this._api = null;
45            this._api = new BaseService.ApiService();
46        }
47        ParticipationService.prototype.GetProgramById = function (programUID) {
48            return __awaiter(this, void 0, void 0, function () {
49                var url, result, error_1;
50                return __generator(this, function (_a) {
51                    switch (_a.label) {
52                        case 0:
53                            url = this.baseUrl + "GetProgramById?programUID=".concat(programUID);
54                            _a.label = 1;
55                        case 1:
56                            _a.trys.push([1, 3, , 4]);
57                            return [4 /*yield*/, this._api.get(url)];
58                        case 2:
59                            result = _a.sent();
60                            return [2 /*return*/, result.data];
61                        case 3:
62                            error_1 = _a.sent();
63                            return [2 /*return*/, {
64                                    successful: false,
65                                    errorMessage: error_1.response,
66                                }];
67                        case 4: return [2 /*return*/];
68                    }
69                });
70            });
71        };
72        ParticipationService.prototype.GetProgramsByClubId = function (clubUID) {
73            return __awaiter(this, void 0, void 0, function () {
74                var url, result, error_2;
75                return __generator(this, function (_a) {
76                    switch (_a.label) {
77                        case 0:
78                            url = this.baseUrl + "GetProgramsByClubId?clubUID=".concat(clubUID);
79                            _a.label = 1;
80                        case 1:
81                            _a.trys.push([1, 3, , 4]);
82                            return [4 /*yield*/, this._api.get(url)];
83                        case 2:
84                            result = _a.sent();
85                            return [2 /*return*/, result.data];
86                        case 3:
87                            error_2 = _a.sent();
88                            return [2 /*return*/, {
89                                    successful: false,
90                                    errorMessage: error_2.response,
91                                }];
92                        case 4: return [2 /*return*/];
93                    }
94                });
95            });
96        };
97        ParticipationService.prototype.GetProgramsByClubIdOrAlias = function (clubUID, clubAlias, clubId) {
98            return __awaiter(this, void 0, void 0, function () {
99                var url, result, error_3;
100                return __generator(this, function (_a) {
101                    switch (_a.label) {
102                        case 0:
103                            url = this.baseUrl + "GetProgramsByClubIdOrAlias";
104                            _a.label = 1;
105                        case 1:
106                            _a.trys.push([1, 3, , 4]);
107                            return [4 /*yield*/, this._api.get(url, {
108                                    clubUID: clubUID,
109                                    clubAlias: clubAlias,
110                                    clubId: clubId,
111                                })];
112                        case 2:
113                            result = _a.sent();
114                            return [2 /*return*/, result.data];
115                        case 3:
116                            error_3 = _a.sent();
117                            return [2 /*return*/, {
118                                    successful: false,
119                                    errorMessage: error_3.response,
120                                }];
121                        case 4: return [2 /*return*/];
122                    }
123                });
124            });
125        };
126        ParticipationService.prototype.GetProgramTerms = function () {
127            return __awaiter(this, void 0, void 0, function () {
128                var url, result, error_4;
129                return __generator(this, function (_a) {
130                    switch (_a.label) {
131                        case 0:
132                            url = this.baseUrl + "GetProgramTerms";
133                            _a.label = 1;
134                        case 1:
135                            _a.trys.push([1, 3, , 4]);
136                            return [4 /*yield*/, this._api.get(url)];
137                        case 2:
138                            result = _a.sent();
139                            return [2 /*return*/, result.data];
140                        case 3:
141                            error_4 = _a.sent();
142                            return [2 /*return*/, {
143                                    successful: false,
144                                    errorMessage: error_4.response,
145                                }];
146                        case 4: return [2 /*return*/];
147                    }
148                });
149            });
150        };
151        ParticipationService.prototype.GetProgramCategories = function () {
152            return __awaiter(this, void 0, void 0, function () {
153                var url, result, error_5;
154                return __generator(this, function (_a) {
155                    switch (_a.label) {
156                        case 0:
157                            url = this.baseUrl + "GetProgramCategories";
158                            _a.label = 1;
159                        case 1:
160                            _a.trys.push([1, 3, , 4]);
161                            return [4 /*yield*/, this._api.get(url)];
162                        case 2:
163                            result = _a.sent();
164                            return [2 /*return*/, result.data];
165                        case 3:
166                            error_5 = _a.sent();
167                            return [2 /*return*/, {
168                                    successful: false,
169                                    errorMessage: error_5.response,
170                                }];
171                        case 4: return [2 /*return*/];
172                    }
173                });
174            });
175        };
176        ParticipationService.prototype.GetProgramTypes = function () {
177            return __awaiter(this, void 0, void 0, function () {
178                var url, result, error_6;
179                return __generator(this, function (_a) {
180                    switch (_a.label) {
181                        case 0:
182                            url = this.baseUrl + "GetProgramTypes";
183                            _a.label = 1;
184                        case 1:
185                            _a.trys.push([1, 3, , 4]);
186                            return [4 /*yield*/, this._api.get(url)];
187                        case 2:
188                            result = _a.sent();
189                            return [2 /*return*/, result.data];
190                        case 3:
191                            error_6 = _a.sent();
192                            return [2 /*return*/, {
193                                    successful: false,
194                                    errorMessage: error_6.response,
195                                }];
196                        case 4: return [2 /*return*/];
197                    }
198                });
199            });
200        };
201        ParticipationService.prototype.GetMemberByIdAndCategory = function (memberUID, programCategoryId) {
202            return __awaiter(this, void 0, void 0, function () {
203                var url, result, error_7;
204                return __generator(this, function (_a) {
205                    switch (_a.label) {
206                        case 0:
207                            url = this.baseUrl + "GetMemberByIdAndCategory?memberUID=".concat(memberUID).concat(programCategoryId ? '&programCategoryId=' + programCategoryId : '');
208                            _a.label = 1;
209                        case 1:
210                            _a.trys.push([1, 3, , 4]);
211                            return [4 /*yield*/, this._api.get(url)];
212                        case 2:
213                            result = _a.sent();
214                            return [2 /*return*/, result.data];
215                        case 3:
216                            error_7 = _a.sent();
217                            return [2 /*return*/, {
218                                    successful: false,
219                                    errorMessage: error_7.response,
220                                }];
221                        case 4: return [2 /*return*/];
222                    }
223                });
224            });
225        };
226        ParticipationService.prototype.GetParticipationHowFound = function () {
227            return __awaiter(this, void 0, void 0, function () {
228                var url, result, error_8;
229                return __generator(this, function (_a) {
230                    switch (_a.label) {
231                        case 0:
232                            url = this.baseUrl + "GetParticipationHowFound";
233                            _a.label = 1;
234                        case 1:
235                            _a.trys.push([1, 3, , 4]);
236                            return [4 /*yield*/, this._api.get(url)];
237                        case 2:
238                            result = _a.sent();
239                            return [2 /*return*/, result.data];
240                        case 3:
241                            error_8 = _a.sent();
242                            return [2 /*return*/, {
243                                    successful: false,
244                                    errorMessage: error_8.response,
245                                }];
246                        case 4: return [2 /*return*/];
247                    }
248                });
249            });
250        };
251        ParticipationService.prototype.GetDefaultCurrency = function () {
252            return __awaiter(this, void 0, void 0, function () {
253                var url, result, error_9;
254                return __generator(this, function (_a) {
255                    switch (_a.label) {
256                        case 0:
257                            url = this.baseUrl + "GetDefaultCurrencySymbol";
258                            _a.label = 1;
259                        case 1:
260                            _a.trys.push([1, 3, , 4]);
261                            return [4 /*yield*/, this._api.get(url)];
262                        case 2:
263                            result = _a.sent();
264                            return [2 /*return*/, result.data];
265                        case 3:
266                            error_9 = _a.sent();
267                            return [2 /*return*/, {
268                                    successful: false,
269                                    errorMessage: error_9.response,
270                                }];
271                        case 4: return [2 /*return*/];
272                    }
273                });
274            });
275        };
276        ParticipationService.prototype.GetParticipationHeight = function () {
277            return __awaiter(this, void 0, void 0, function () {
278                var url, result, error_10;
279                return __generator(this, function (_a) {
280                    switch (_a.label) {
281                        case 0:
282                            url = this.baseUrl + "GetParticipationHeight";
283                            _a.label = 1;
284                        case 1:
285                            _a.trys.push([1, 3, , 4]);
286                            return [4 /*yield*/, this._api.get(url)];
287                        case 2:
288                            result = _a.sent();
289                            return [2 /*return*/, result.data];
290                        case 3:
291                            error_10 = _a.sent();
292                            return [2 /*return*/, {
293                                    successful: false,
294                                    errorMessage: error_10.response,
295                                }];
296                        case 4: return [2 /*return*/];
297                    }
298                });
299            });
300        };
301        ParticipationService.prototype.GetRegions = function (regionId) {
302            return __awaiter(this, void 0, void 0, function () {
303                var url, result, error_11;
304                return __generator(this, function (_a) {
305                    switch (_a.label) {
306                        case 0:
307                            url = this.baseUrl + "GetRegions?regionId=".concat(regionId);
308                            _a.label = 1;
309                        case 1:
310                            _a.trys.push([1, 3, , 4]);
311                            return [4 /*yield*/, this._api.get(url)];
312                        case 2:
313                            result = _a.sent();
314                            return [2 /*return*/, result.data];
315                        case 3:
316                            error_11 = _a.sent();
317                            return [2 /*return*/, {
318                                    successful: false,
319                                    errorMessage: error_11.response,
320                                }];
321                        case 4: return [2 /*return*/];
322                    }
323                });
324            });
325        };
326        ParticipationService.prototype.CreateUpdateParticipationRegistration = function (registration) {
327            return __awaiter(this, void 0, void 0, function () {
328                var url, result, error_12;
329                return __generator(this, function (_a) {
330                    switch (_a.label) {
331                        case 0:
332                            url = th
332is.baseUrl + "CreateUpdateParticipationRegistration";
333                            _a.label = 1;
334                        case 1:
335                            _a.trys.push([1, 3, , 4]);
336                            return [4 /*yield*/, this._api.post(url, registration)];
337                        case 2:
338                            result = _a.sent();
339                            return [2 /*return*/, result.data];
340                        case 3:
341                            error_12 = _a.sent();
342                            return [2 /*return*/, {
343                                    successful: false,
344                                    errorMessage: error_12.response,
345                                }];
346                        case 4: return [2 /*return*/];
347                    }
348                });
349            });
350        };
351        ParticipationService.prototype.UpdateParticipationRegistrationDetail = function (payload) {
352            return __awaiter(this, void 0, void 0, function () {
353                var url, result, error_13;
354                return __generator(this, function (_a) {
355                    switch (_a.label) {
356                        case 0:
357                            url = this.baseUrl + "UpdateParticipationRegistrationDetail";
358                            _a.label = 1;
359                        case 1:
360                            _a.trys.push([1, 3, , 4]);
361                            return [4 /*yield*/, this._api.post(url, payload)];
362                        case 2:
363                            result = _a.sent();
364                            return [2 /*return*/, result.data];
365                        case 3:
366                            error_13 = _a.sent();
367                            return [2 /*return*/, {
368                                    successful: false,
369                                    errorMessage: error_13.response,
370                                }];
371                        case 4: return [2 /*return*/];
372                    }
373                });
374            });
375        };
376        ParticipationService.prototype.ValidatedExistingMember = function (firstName, lastName, email) {
377            return __awaiter(this, void 0, void 0, function () {
378                var url, result, error_14;
379                return __generator(this, function (_a) {
380                    switch (_a.label) {
381                        case 0:
382                            url = this.baseUrl + "ValidatedExistingMember?firstName=".concat(firstName, "&lastName=").concat(lastName, "&email=").concat(email);
383                            _a.label = 1;
384                        case 1:
385                            _a.trys.push([1, 3, , 4]);
386                            return [4 /*yield*/, this._api.get(url)];
387                        case 2:
388                            result = _a.sent();
389                            return [2 /*return*/, result.data];
390                        case 3:
391                            error_14 = _a.sent();
392                            return [2 /*return*/, {
393                                    successful: false,
394                                    errorMessage: error_14.response,
395                                }];
396                        case 4: return [2 /*return*/];
397                    }
398                });
399            });
400        };
401        ParticipationService.prototype.GetMemberRegisteredPrograms = function (memberUID) {
402            return __awaiter(this, void 0, void 0, function () {
403                var url, result, error_15;
404                return __generator(this, function (_a) {
405                    switch (_a.label) {
406                        case 0:
407                            url = this.baseUrl + "GetMemberRegisteredPrograms?memberUID=".concat(memberUID);
408                            _a.label = 1;
409                        case 1:
410                            _a.trys.push([1, 3, , 4]);
411                            return [4 /*yield*/, this._api.get(url)];
412                        case 2:
413                            result = _a.sent();
414                            return [2 /*return*/, result.data];
415                        case 3:
416                            error_15 = _a.sent();
417                            return [2 /*return*/, {
418                                    successful: false,
419                                    errorMessage: error_15.response,
420                                }];
421                        case 4: return [2 /*return*/];
422                    }
423                });
424            });
425        };
426        ParticipationService.prototype.GetParticipants = function (memberUID) {
427            return __awaiter(this, void 0, void 0, function () {
428                var url, result, error_16;
429                return __generator(this, function (_a) {
430                    switch (_a.label) {
431                        case 0:
432                            url = this.baseUrl + "GetParticipants?memberUID=".concat(memberUID);
433                            _a.label = 1;
434                        case 1:
435                            _a.trys.push([1, 3, , 4]);
436                            return [4 /*yield*/, this._api.get(url)];
437                        case 2:
438                            result = _a.sent();
439                            return [2 /*return*/, result.data];
440                        case 3:
441                            error_16 = _a.sent();
442                            return [2 /*return*/, {
443                                    successful: false,
444                                    errorMessage: error_16.response,
445                                }];
446                        case 4: return [2 /*return*/];
447                    }
448                });
449            });
450        };
451        ParticipationService.prototype.GetVoucherBalance = function (clubUID, voucherCode) {
452            return __awaiter(this, void 0, void 0, function () {
453                var url, result, error_17;
454                return __generator(this, function (_a) {
455                    switch (_a.label) {
456                        case 0:
457                            url = this.baseUrl + "CheckBalance?clubUID=".concat(clubUID, "&voucherCode=").concat(voucherCode);
458                            _a.label = 1;
459                        case 1:
460                            _a.trys.push([1, 3, , 4]);
461                            return [4 /*yield*/, this._api.get(url)];
462                        case 2:
463                            result = _a.sent();
464                            return [2 /*return*/, result.data];
465                        case 3:
466                            error_17 = _a.sent();
467                            return [2 /*return*/, {
468                                    successful: false,
469                                    errorMessage: error_17.response,
470                                }];
471                        case 4: return [2 /*return*/];
472                    }
473                });
474            });
475        };
476        ParticipationService.prototype.VerifyParticipationVoucher = function (voucherRequest) {
477            return __awaiter(this, void 0, void 0, function () {
478                var url, result, error_18;
479                return __generator(this, function (_a) {
480                    switch (_a.label) {
481                        case 0:
482                            url = "/api/Voucher/VerifyParticipationVoucher";
483                            _a.label = 1;
484                        case 1:
485                            _a.trys.push([1, 3, , 4]);
486                            return [4 /*yield*/, this._api.post(url, voucherRequest)];
487                        case 2:
488                            result = _a.sent();
489                            return [2 /*return*/, result.data];
490                        case 3:
491                            error_18 = _a.sent();
492                            return [2 /*return*/, {
493                                    successful: false,
494                                    errorMessage: error_18.response,
495                                }];
496                        case 4: return [2 /*return*/];
497                    }
498                });
499            });
500        };
501        ParticipationService.prototype.GetParticipationRegistrationById = function (id) {
502            return __awaiter(this, void 0, void 0, function () {
503                var url, result, error_19;
504                return __generator(this, function (_a) {
505                    switch (_a.label) {
506                        case 0:
507                            url = this.baseUrl + "GetParticipationRegistrationById?id=".concat(id);
508                            _a.label = 1;
509                        case 1:
510                            _a.trys.push([1, 3, , 4]);
511                            return [4 /*yield*/, this._api.get(url)];
512                        case 2:
513                            result = _a.sent();
514                            return [2 /*return*/, result.data];
515                        case 3:
516                            error_19 = _a.sent();
517                            return [2 /*return*/, {
518                                    successful: false,
519                                    errorMessage: error_19.response,
520                                }];
521                        case 4: return [2 /*return*/];
522                    }
523                });
524            });
525        };
526        ParticipationService.prototype.GetParticipationRegistrationStripeResult = function (clubUID, stripeAccountKey, stripeSession) {
527            return __awaiter(this, void 0, void 0, function () {
528                var url, result, error_20;
529                return __generator(this, function (_a) {
530                    switch (_a.label) {
531                        case 0:
532                            url = this.baseUrl + "GetParticipationRegistrationStripeResult?clubUID=".concat(clubUID, "&stracct=").concat(stripeAccountKey, "&session=").concat(stripeSession);
533                            _a.label = 1;
534                        case 1:
535                            _a.trys.push([1, 3, , 4]);
536                            return [4 /*yield*/, this._api.get(url)];
537                        case 2:
538                            result = _a.sent();
539                            return [2 /*return*/, result.data];
540                        case 3:
541                            error_20 = _a.sent();
542                            return [2 /*return*/, {
543                                    successful: false,
544                                    errorMessage: error_20.response,
545                                }];
546                        case 4: return [2 /*return*/];
547                    }
548                });
549            });
550        };
551        ParticipationService.prototype.RetryPayment = function (registration) {
552            return __awaiter(this, void 0, void 0, function () {
553                var url, result, error_21;
554                return __generator(this, function (_a) {
555                    switch (_a.label) {
556                        case 0:
557                            url = this.baseUrl + "RetryPayment";
558                            _a.label = 1;
559                        case 1:
560                            _a.trys.push([1, 3, , 4]);
561                            return [4 /*yield*/, this._api.post(url, registration)];
562                        case 2:
563                            result = _a.sent();
564                            return [2 /*return*/, result.data];
565                        case 3:
566                            error_21 = _a.sent();
567                            return [2 /*return*/, {
568                                    successful: false,
569                                    errorMessage: error_21.response,
570                                }];
571                        case 4: return [2 /*return*/];
572                    }
573                });
574            });
575        };
576        ParticipationService.prototype.UpdatePaymentTransaction = function (model) {
577            return __awaiter(this, void 0, void 0, function () {
578                var url, result, error_22;
579                return __generator(this, function (_a) {
580                    switch (_a.label) {
581                        case 0:
582                            url = this.baseUrl + "UpdatePaymentTransaction";
583                            _a.label = 1;
584                        case 1:
585                            _a.trys.push([1, 3, , 4]);
586                            return [4 /*yield*/, this._api.post(url, model)];
587                        case 2:
588                            result = _a.sent();
589                            return [2 /*return*/, result.data];
590                        case 3:
591                            error_22 = _a.sent();
592                            return [2 /*return*/, {
593                                    successful: false,
594                                    errorMessage: error_22.response,
595                                }];
596                        case 4: return [2 /*return*/];
597                    }
598                });
599            });
600        };
601        ParticipationService.prototype.GetConfig = function () {
602            return __awaiter(this, void 0, void 0, function () {
603                var url, result, error_23;
604                return __generator(this, function (_a) {
605                    switch (_a.label) {
606                        case 0:
607                            url = this.baseUrl + "GetConfig";
608                            _a.label = 1;
609                        case 1:
610                            _a.trys.push([1, 3, , 4]);
611                            return [4 /*yield*/, this._api.get(url)];
612                        case 2:
613                            result = _a.sent();
614                            return [2 /*return*/, result.data];
615                        case 3:
616                            error_23 = _a.sent();
617                            return [2 /*return*/, {
618                                    successful: false,
619                                    errorMessage: error_23.response,
620                                }];
621                        case 4: return [2 /*return*/];
622                    }
623                });
624            });
625        };
626        ParticipationService.prototype.GetEthnicities = function () {
627            return __awaiter(this, void 0, void 0, function () {
628                var url, result, error_24;
629                return __generator(this, function (_a) {
630                    switch (_a.label) {
631                        case 0:
632                            url = this.baseUrl + "GetEthnicities";
633                            _a.label = 1;
634                        case 1:
635                            _a.trys.push([1, 3, , 4]);
636                            return [4 /*yield*/, this._api.get(url)];
637                        case 2:
638                            result = _a.sent();
639                            return [2 /*return*/, result.data];
640                        case 3:
641                            error_24 = _a.sent();
642                            return [2 /*return*/, {
643                                    successful: false,
644                                    errorMessage: error_24.response,
645                                }];
646                        case 4: return [2 /*return*/];
647                    }
648                });
649            });
650        };
651        return ParticipationService;
652    }());
653    AppServices.ParticipationService = ParticipationService;
654})(AppServices || (AppServices = {}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.