tenniscommon 1.0.5 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/dist/cjs/common/matchplay/validation.d.ts +28 -28
  2. package/dist/cjs/common/player/initialData.d.ts +10 -2
  3. package/dist/cjs/common/player/initialData.js +1 -0
  4. package/dist/cjs/common/player/interfaces.d.ts +1 -2
  5. package/dist/cjs/common/player/validation.d.ts +8 -8
  6. package/dist/cjs/common/spending/initialStats.d.ts +4 -2
  7. package/dist/cjs/common/spending/initialStats.js +36 -12
  8. package/dist/cjs/common/spending/interfaces.d.ts +28 -5
  9. package/dist/cjs/common/tournament/interfaces.d.ts +1 -1
  10. package/dist/cjs/common/tournament/interfaces.js +1 -1
  11. package/dist/cjs/common/tournament/validation.d.ts +2 -2
  12. package/dist/esm/common/matchplay/validation.d.ts +28 -28
  13. package/dist/esm/common/player/initialData.d.ts +10 -2
  14. package/dist/esm/common/player/initialData.js +1 -0
  15. package/dist/esm/common/player/interfaces.d.ts +1 -2
  16. package/dist/esm/common/player/validation.d.ts +8 -8
  17. package/dist/esm/common/spending/initialStats.d.ts +4 -2
  18. package/dist/esm/common/spending/initialStats.js +32 -10
  19. package/dist/esm/common/spending/interfaces.d.ts +28 -5
  20. package/dist/esm/common/tournament/interfaces.d.ts +1 -1
  21. package/dist/esm/common/tournament/interfaces.js +1 -1
  22. package/dist/esm/common/tournament/validation.d.ts +2 -2
  23. package/dist/types/common/matchplay/validation.d.ts +28 -28
  24. package/dist/types/common/player/initialData.d.ts +10 -2
  25. package/dist/types/common/player/interfaces.d.ts +1 -2
  26. package/dist/types/common/player/validation.d.ts +8 -8
  27. package/dist/types/common/spending/initialStats.d.ts +4 -2
  28. package/dist/types/common/spending/interfaces.d.ts +28 -5
  29. package/dist/types/common/tournament/interfaces.d.ts +1 -1
  30. package/dist/types/common/tournament/validation.d.ts +2 -2
  31. package/package.json +1 -1
@@ -42,7 +42,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
42
42
  secondSetWon: string;
43
43
  firstSet: string;
44
44
  secondSet: string;
45
- comment?: string | undefined;
46
45
  partnerId?: string | undefined;
47
46
  opponentIdTeo?: string | undefined;
48
47
  decidingSetFormat?: string | undefined;
@@ -51,6 +50,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
51
50
  secondSetTieBreak?: string | undefined;
52
51
  decidingSet?: string | undefined;
53
52
  decidingSetTieBreak?: string | undefined;
53
+ comment?: string | undefined;
54
54
  }, {
55
55
  playerId: string;
56
56
  tournamentId: string;
@@ -68,7 +68,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
68
68
  firstSet: string;
69
69
  secondSet: string;
70
70
  date?: unknown;
71
- comment?: string | undefined;
72
71
  partnerId?: string | undefined;
73
72
  opponentIdTeo?: string | undefined;
74
73
  decidingSetFormat?: string | undefined;
@@ -77,6 +76,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
77
76
  secondSetTieBreak?: string | undefined;
78
77
  decidingSet?: string | undefined;
79
78
  decidingSetTieBreak?: string | undefined;
79
+ comment?: string | undefined;
80
80
  }>, {
81
81
  date: Date;
82
82
  playerId: string;
@@ -94,7 +94,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
94
94
  secondSetWon: string;
95
95
  firstSet: string;
96
96
  secondSet: string;
97
- comment?: string | undefined;
98
97
  partnerId?: string | undefined;
99
98
  opponentIdTeo?: string | undefined;
100
99
  decidingSetFormat?: string | undefined;
@@ -103,6 +102,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
103
102
  secondSetTieBreak?: string | undefined;
104
103
  decidingSet?: string | undefined;
105
104
  decidingSetTieBreak?: string | undefined;
105
+ comment?: string | undefined;
106
106
  }, {
107
107
  playerId: string;
108
108
  tournamentId: string;
@@ -120,7 +120,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
120
120
  firstSet: string;
121
121
  secondSet: string;
122
122
  date?: unknown;
123
- comment?: string | undefined;
124
123
  partnerId?: string | undefined;
125
124
  opponentIdTeo?: string | undefined;
126
125
  decidingSetFormat?: string | undefined;
@@ -129,6 +128,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
129
128
  secondSetTieBreak?: string | undefined;
130
129
  decidingSet?: string | undefined;
131
130
  decidingSetTieBreak?: string | undefined;
131
+ comment?: string | undefined;
132
132
  }>, {
133
133
  date: Date;
134
134
  playerId: string;
@@ -146,7 +146,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
146
146
  secondSetWon: string;
147
147
  firstSet: string;
148
148
  secondSet: string;
149
- comment?: string | undefined;
150
149
  partnerId?: string | undefined;
151
150
  opponentIdTeo?: string | undefined;
152
151
  decidingSetFormat?: string | undefined;
@@ -155,6 +154,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
155
154
  secondSetTieBreak?: string | undefined;
156
155
  decidingSet?: string | undefined;
157
156
  decidingSetTieBreak?: string | undefined;
157
+ comment?: string | undefined;
158
158
  }, {
159
159
  playerId: string;
160
160
  tournamentId: string;
@@ -172,7 +172,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
172
172
  firstSet: string;
173
173
  secondSet: string;
174
174
  date?: unknown;
175
- comment?: string | undefined;
176
175
  partnerId?: string | undefined;
177
176
  opponentIdTeo?: string | undefined;
178
177
  decidingSetFormat?: string | undefined;
@@ -181,6 +180,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
181
180
  secondSetTieBreak?: string | undefined;
182
181
  decidingSet?: string | undefined;
183
182
  decidingSetTieBreak?: string | undefined;
183
+ comment?: string | undefined;
184
184
  }>, {
185
185
  date: Date;
186
186
  playerId: string;
@@ -198,7 +198,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
198
198
  secondSetWon: string;
199
199
  firstSet: string;
200
200
  secondSet: string;
201
- comment?: string | undefined;
202
201
  partnerId?: string | undefined;
203
202
  opponentIdTeo?: string | undefined;
204
203
  decidingSetFormat?: string | undefined;
@@ -207,6 +206,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
207
206
  secondSetTieBreak?: string | undefined;
208
207
  decidingSet?: string | undefined;
209
208
  decidingSetTieBreak?: string | undefined;
209
+ comment?: string | undefined;
210
210
  }, {
211
211
  playerId: string;
212
212
  tournamentId: string;
@@ -224,7 +224,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
224
224
  firstSet: string;
225
225
  secondSet: string;
226
226
  date?: unknown;
227
- comment?: string | undefined;
228
227
  partnerId?: string | undefined;
229
228
  opponentIdTeo?: string | undefined;
230
229
  decidingSetFormat?: string | undefined;
@@ -233,6 +232,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
233
232
  secondSetTieBreak?: string | undefined;
234
233
  decidingSet?: string | undefined;
235
234
  decidingSetTieBreak?: string | undefined;
235
+ comment?: string | undefined;
236
236
  }>, {
237
237
  date: Date;
238
238
  playerId: string;
@@ -250,7 +250,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
250
250
  secondSetWon: string;
251
251
  firstSet: string;
252
252
  secondSet: string;
253
- comment?: string | undefined;
254
253
  partnerId?: string | undefined;
255
254
  opponentIdTeo?: string | undefined;
256
255
  decidingSetFormat?: string | undefined;
@@ -259,6 +258,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
259
258
  secondSetTieBreak?: string | undefined;
260
259
  decidingSet?: string | undefined;
261
260
  decidingSetTieBreak?: string | undefined;
261
+ comment?: string | undefined;
262
262
  }, {
263
263
  playerId: string;
264
264
  tournamentId: string;
@@ -276,7 +276,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
276
276
  firstSet: string;
277
277
  secondSet: string;
278
278
  date?: unknown;
279
- comment?: string | undefined;
280
279
  partnerId?: string | undefined;
281
280
  opponentIdTeo?: string | undefined;
282
281
  decidingSetFormat?: string | undefined;
@@ -285,6 +284,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
285
284
  secondSetTieBreak?: string | undefined;
286
285
  decidingSet?: string | undefined;
287
286
  decidingSetTieBreak?: string | undefined;
287
+ comment?: string | undefined;
288
288
  }>, {
289
289
  date: Date;
290
290
  playerId: string;
@@ -302,7 +302,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
302
302
  secondSetWon: string;
303
303
  firstSet: string;
304
304
  secondSet: string;
305
- comment?: string | undefined;
306
305
  partnerId?: string | undefined;
307
306
  opponentIdTeo?: string | undefined;
308
307
  decidingSetFormat?: string | undefined;
@@ -311,6 +310,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
311
310
  secondSetTieBreak?: string | undefined;
312
311
  decidingSet?: string | undefined;
313
312
  decidingSetTieBreak?: string | undefined;
313
+ comment?: string | undefined;
314
314
  }, {
315
315
  playerId: string;
316
316
  tournamentId: string;
@@ -328,7 +328,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
328
328
  firstSet: string;
329
329
  secondSet: string;
330
330
  date?: unknown;
331
- comment?: string | undefined;
332
331
  partnerId?: string | undefined;
333
332
  opponentIdTeo?: string | undefined;
334
333
  decidingSetFormat?: string | undefined;
@@ -337,6 +336,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
337
336
  secondSetTieBreak?: string | undefined;
338
337
  decidingSet?: string | undefined;
339
338
  decidingSetTieBreak?: string | undefined;
339
+ comment?: string | undefined;
340
340
  }>, {
341
341
  date: Date;
342
342
  playerId: string;
@@ -354,7 +354,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
354
354
  secondSetWon: string;
355
355
  firstSet: string;
356
356
  secondSet: string;
357
- comment?: string | undefined;
358
357
  partnerId?: string | undefined;
359
358
  opponentIdTeo?: string | undefined;
360
359
  decidingSetFormat?: string | undefined;
@@ -363,6 +362,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
363
362
  secondSetTieBreak?: string | undefined;
364
363
  decidingSet?: string | undefined;
365
364
  decidingSetTieBreak?: string | undefined;
365
+ comment?: string | undefined;
366
366
  }, {
367
367
  playerId: string;
368
368
  tournamentId: string;
@@ -380,7 +380,6 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
380
380
  firstSet: string;
381
381
  secondSet: string;
382
382
  date?: unknown;
383
- comment?: string | undefined;
384
383
  partnerId?: string | undefined;
385
384
  opponentIdTeo?: string | undefined;
386
385
  decidingSetFormat?: string | undefined;
@@ -389,6 +388,7 @@ export declare const singlesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
389
388
  secondSetTieBreak?: string | undefined;
390
389
  decidingSet?: string | undefined;
391
390
  decidingSetTieBreak?: string | undefined;
391
+ comment?: string | undefined;
392
392
  }>;
393
393
  export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
394
394
  playerId: z.ZodString;
@@ -435,13 +435,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
435
435
  firstSet: string;
436
436
  secondSet: string;
437
437
  opponentIdTwo: string;
438
- comment?: string | undefined;
439
438
  decidingSetFormat?: string | undefined;
440
439
  decidingSetWon?: string | undefined;
441
440
  firstSetTieBreak?: string | undefined;
442
441
  secondSetTieBreak?: string | undefined;
443
442
  decidingSet?: string | undefined;
444
443
  decidingSetTieBreak?: string | undefined;
444
+ comment?: string | undefined;
445
445
  }, {
446
446
  playerId: string;
447
447
  tournamentId: string;
@@ -461,13 +461,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
461
461
  secondSet: string;
462
462
  opponentIdTwo: string;
463
463
  date?: unknown;
464
- comment?: string | undefined;
465
464
  decidingSetFormat?: string | undefined;
466
465
  decidingSetWon?: string | undefined;
467
466
  firstSetTieBreak?: string | undefined;
468
467
  secondSetTieBreak?: string | undefined;
469
468
  decidingSet?: string | undefined;
470
469
  decidingSetTieBreak?: string | undefined;
470
+ comment?: string | undefined;
471
471
  }>, {
472
472
  date: Date;
473
473
  playerId: string;
@@ -487,13 +487,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
487
487
  firstSet: string;
488
488
  secondSet: string;
489
489
  opponentIdTwo: string;
490
- comment?: string | undefined;
491
490
  decidingSetFormat?: string | undefined;
492
491
  decidingSetWon?: string | undefined;
493
492
  firstSetTieBreak?: string | undefined;
494
493
  secondSetTieBreak?: string | undefined;
495
494
  decidingSet?: string | undefined;
496
495
  decidingSetTieBreak?: string | undefined;
496
+ comment?: string | undefined;
497
497
  }, {
498
498
  playerId: string;
499
499
  tournamentId: string;
@@ -513,13 +513,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
513
513
  secondSet: string;
514
514
  opponentIdTwo: string;
515
515
  date?: unknown;
516
- comment?: string | undefined;
517
516
  decidingSetFormat?: string | undefined;
518
517
  decidingSetWon?: string | undefined;
519
518
  firstSetTieBreak?: string | undefined;
520
519
  secondSetTieBreak?: string | undefined;
521
520
  decidingSet?: string | undefined;
522
521
  decidingSetTieBreak?: string | undefined;
522
+ comment?: string | undefined;
523
523
  }>, {
524
524
  date: Date;
525
525
  playerId: string;
@@ -539,13 +539,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
539
539
  firstSet: string;
540
540
  secondSet: string;
541
541
  opponentIdTwo: string;
542
- comment?: string | undefined;
543
542
  decidingSetFormat?: string | undefined;
544
543
  decidingSetWon?: string | undefined;
545
544
  firstSetTieBreak?: string | undefined;
546
545
  secondSetTieBreak?: string | undefined;
547
546
  decidingSet?: string | undefined;
548
547
  decidingSetTieBreak?: string | undefined;
548
+ comment?: string | undefined;
549
549
  }, {
550
550
  playerId: string;
551
551
  tournamentId: string;
@@ -565,13 +565,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
565
565
  secondSet: string;
566
566
  opponentIdTwo: string;
567
567
  date?: unknown;
568
- comment?: string | undefined;
569
568
  decidingSetFormat?: string | undefined;
570
569
  decidingSetWon?: string | undefined;
571
570
  firstSetTieBreak?: string | undefined;
572
571
  secondSetTieBreak?: string | undefined;
573
572
  decidingSet?: string | undefined;
574
573
  decidingSetTieBreak?: string | undefined;
574
+ comment?: string | undefined;
575
575
  }>, {
576
576
  date: Date;
577
577
  playerId: string;
@@ -591,13 +591,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
591
591
  firstSet: string;
592
592
  secondSet: string;
593
593
  opponentIdTwo: string;
594
- comment?: string | undefined;
595
594
  decidingSetFormat?: string | undefined;
596
595
  decidingSetWon?: string | undefined;
597
596
  firstSetTieBreak?: string | undefined;
598
597
  secondSetTieBreak?: string | undefined;
599
598
  decidingSet?: string | undefined;
600
599
  decidingSetTieBreak?: string | undefined;
600
+ comment?: string | undefined;
601
601
  }, {
602
602
  playerId: string;
603
603
  tournamentId: string;
@@ -617,13 +617,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
617
617
  secondSet: string;
618
618
  opponentIdTwo: string;
619
619
  date?: unknown;
620
- comment?: string | undefined;
621
620
  decidingSetFormat?: string | undefined;
622
621
  decidingSetWon?: string | undefined;
623
622
  firstSetTieBreak?: string | undefined;
624
623
  secondSetTieBreak?: string | undefined;
625
624
  decidingSet?: string | undefined;
626
625
  decidingSetTieBreak?: string | undefined;
626
+ comment?: string | undefined;
627
627
  }>, {
628
628
  date: Date;
629
629
  playerId: string;
@@ -643,13 +643,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
643
643
  firstSet: string;
644
644
  secondSet: string;
645
645
  opponentIdTwo: string;
646
- comment?: string | undefined;
647
646
  decidingSetFormat?: string | undefined;
648
647
  decidingSetWon?: string | undefined;
649
648
  firstSetTieBreak?: string | undefined;
650
649
  secondSetTieBreak?: string | undefined;
651
650
  decidingSet?: string | undefined;
652
651
  decidingSetTieBreak?: string | undefined;
652
+ comment?: string | undefined;
653
653
  }, {
654
654
  playerId: string;
655
655
  tournamentId: string;
@@ -669,13 +669,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
669
669
  secondSet: string;
670
670
  opponentIdTwo: string;
671
671
  date?: unknown;
672
- comment?: string | undefined;
673
672
  decidingSetFormat?: string | undefined;
674
673
  decidingSetWon?: string | undefined;
675
674
  firstSetTieBreak?: string | undefined;
676
675
  secondSetTieBreak?: string | undefined;
677
676
  decidingSet?: string | undefined;
678
677
  decidingSetTieBreak?: string | undefined;
678
+ comment?: string | undefined;
679
679
  }>, {
680
680
  date: Date;
681
681
  playerId: string;
@@ -695,13 +695,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
695
695
  firstSet: string;
696
696
  secondSet: string;
697
697
  opponentIdTwo: string;
698
- comment?: string | undefined;
699
698
  decidingSetFormat?: string | undefined;
700
699
  decidingSetWon?: string | undefined;
701
700
  firstSetTieBreak?: string | undefined;
702
701
  secondSetTieBreak?: string | undefined;
703
702
  decidingSet?: string | undefined;
704
703
  decidingSetTieBreak?: string | undefined;
704
+ comment?: string | undefined;
705
705
  }, {
706
706
  playerId: string;
707
707
  tournamentId: string;
@@ -721,13 +721,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
721
721
  secondSet: string;
722
722
  opponentIdTwo: string;
723
723
  date?: unknown;
724
- comment?: string | undefined;
725
724
  decidingSetFormat?: string | undefined;
726
725
  decidingSetWon?: string | undefined;
727
726
  firstSetTieBreak?: string | undefined;
728
727
  secondSetTieBreak?: string | undefined;
729
728
  decidingSet?: string | undefined;
730
729
  decidingSetTieBreak?: string | undefined;
730
+ comment?: string | undefined;
731
731
  }>, {
732
732
  date: Date;
733
733
  playerId: string;
@@ -747,13 +747,13 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
747
747
  firstSet: string;
748
748
  secondSet: string;
749
749
  opponentIdTwo: string;
750
- comment?: string | undefined;
751
750
  decidingSetFormat?: string | undefined;
752
751
  decidingSetWon?: string | undefined;
753
752
  firstSetTieBreak?: string | undefined;
754
753
  secondSetTieBreak?: string | undefined;
755
754
  decidingSet?: string | undefined;
756
755
  decidingSetTieBreak?: string | undefined;
756
+ comment?: string | undefined;
757
757
  }, {
758
758
  playerId: string;
759
759
  tournamentId: string;
@@ -773,11 +773,11 @@ export declare const doublesMatchplayItemSchema: z.ZodEffects<z.ZodEffects<z.Zod
773
773
  secondSet: string;
774
774
  opponentIdTwo: string;
775
775
  date?: unknown;
776
- comment?: string | undefined;
777
776
  decidingSetFormat?: string | undefined;
778
777
  decidingSetWon?: string | undefined;
779
778
  firstSetTieBreak?: string | undefined;
780
779
  secondSetTieBreak?: string | undefined;
781
780
  decidingSet?: string | undefined;
782
781
  decidingSetTieBreak?: string | undefined;
782
+ comment?: string | undefined;
783
783
  }>;
@@ -1,4 +1,4 @@
1
- import { PlayerConfig, PlayerData } from './interfaces';
1
+ import { PlayerConfig } from './interfaces';
2
2
  import { ValueOf } from '../general';
3
3
  export declare const GLOBAL: {
4
4
  TIME: {
@@ -34,4 +34,12 @@ export declare const GLOBAL_ARRAYS: {
34
34
  AGE: GLOBAL_SET_UNION[];
35
35
  };
36
36
  export declare const createInitialPlayerConfig: (born: number) => PlayerConfig;
37
- export declare const createInitialPlayerData: () => Omit<PlayerData, "_id">;
37
+ export declare const createInitialPlayerData: () => {
38
+ _id: string;
39
+ firstname: string;
40
+ lastname: string;
41
+ born: number;
42
+ password: string;
43
+ email: string;
44
+ config: PlayerConfig;
45
+ };
@@ -50,6 +50,7 @@ const createInitialPlayerConfig = (born) => ({
50
50
  exports.createInitialPlayerConfig = createInitialPlayerConfig;
51
51
  // Factory function for PlayerData
52
52
  const createInitialPlayerData = () => ({
53
+ _id: '',
53
54
  firstname: '',
54
55
  lastname: '',
55
56
  born: new Date().getFullYear() - 18,
@@ -1,7 +1,6 @@
1
- import { ObjectId } from 'mongodb';
2
1
  import { SpendingCosts } from '../spending';
3
2
  export interface PlayerData {
4
- _id?: ObjectId;
3
+ _id: string;
5
4
  firstname: string;
6
5
  lastname: string;
7
6
  born: number;
@@ -27,7 +27,6 @@ export declare const playerConfigSchema: z.ZodObject<{
27
27
  globalFilterSetFormat: z.ZodString;
28
28
  globalFilterAgeGroup: z.ZodString;
29
29
  }, "strip", z.ZodTypeAny, {
30
- born: number;
31
30
  theme: string;
32
31
  dataTableRows: number;
33
32
  budget: number;
@@ -39,6 +38,7 @@ export declare const playerConfigSchema: z.ZodObject<{
39
38
  error: string;
40
39
  };
41
40
  calendarDefaultDate: Date;
41
+ born: number;
42
42
  spendingCosts: [{
43
43
  cost: number;
44
44
  category: string;
@@ -51,11 +51,11 @@ export declare const playerConfigSchema: z.ZodObject<{
51
51
  globalFilterSetFormat: string;
52
52
  globalFilterAgeGroup: string;
53
53
  }, {
54
- born: number;
55
54
  theme: string;
56
55
  dataTableRows: number;
57
56
  budget: number;
58
57
  calendarUseToday: string;
58
+ born: number;
59
59
  spendingCosts: [{
60
60
  cost: number;
61
61
  category: string;
@@ -103,7 +103,6 @@ export declare const playerDataSchema: z.ZodObject<{
103
103
  globalFilterSetFormat: z.ZodString;
104
104
  globalFilterAgeGroup: z.ZodString;
105
105
  }, "strip", z.ZodTypeAny, {
106
- born: number;
107
106
  theme: string;
108
107
  dataTableRows: number;
109
108
  budget: number;
@@ -115,6 +114,7 @@ export declare const playerDataSchema: z.ZodObject<{
115
114
  error: string;
116
115
  };
117
116
  calendarDefaultDate: Date;
117
+ born: number;
118
118
  spendingCosts: [{
119
119
  cost: number;
120
120
  category: string;
@@ -127,11 +127,11 @@ export declare const playerDataSchema: z.ZodObject<{
127
127
  globalFilterSetFormat: string;
128
128
  globalFilterAgeGroup: string;
129
129
  }, {
130
- born: number;
131
130
  theme: string;
132
131
  dataTableRows: number;
133
132
  budget: number;
134
133
  calendarUseToday: string;
134
+ born: number;
135
135
  spendingCosts: [{
136
136
  cost: number;
137
137
  category: string;
@@ -147,11 +147,10 @@ export declare const playerDataSchema: z.ZodObject<{
147
147
  }>;
148
148
  }, "strip", z.ZodTypeAny, {
149
149
  email: string;
150
+ born: number;
150
151
  firstname: string;
151
152
  lastname: string;
152
- born: number;
153
153
  config: {
154
- born: number;
155
154
  theme: string;
156
155
  dataTableRows: number;
157
156
  budget: number;
@@ -163,6 +162,7 @@ export declare const playerDataSchema: z.ZodObject<{
163
162
  error: string;
164
163
  };
165
164
  calendarDefaultDate: Date;
165
+ born: number;
166
166
  spendingCosts: [{
167
167
  cost: number;
168
168
  category: string;
@@ -178,15 +178,15 @@ export declare const playerDataSchema: z.ZodObject<{
178
178
  password?: string | undefined;
179
179
  }, {
180
180
  email: string;
181
+ born: number;
181
182
  firstname: string;
182
183
  lastname: string;
183
- born: number;
184
184
  config: {
185
- born: number;
186
185
  theme: string;
187
186
  dataTableRows: number;
188
187
  budget: number;
189
188
  calendarUseToday: string;
189
+ born: number;
190
190
  spendingCosts: [{
191
191
  cost: number;
192
192
  category: string;
@@ -1,2 +1,4 @@
1
- import { SpendingTotals } from './interfaces';
2
- export declare const createDefaultSpendingTotal: (budget?: number) => SpendingTotals;
1
+ import { SpendingGroups, SpendingStats, SpendingType } from './interfaces';
2
+ export declare const createDefaultSpendingStats: (budget?: number) => SpendingStats;
3
+ export declare const createSpendingType: () => SpendingType;
4
+ export declare const createSpendingGroups: () => SpendingGroups;
@@ -1,29 +1,53 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createDefaultSpendingTotal = void 0;
3
+ exports.createSpendingGroups = exports.createSpendingType = exports.createDefaultSpendingStats = void 0;
4
4
  const interfaces_1 = require("./interfaces");
5
5
  const general_1 = require("../general");
6
- const createDefaultSpendingTotal = (budget = 0) => {
6
+ const createDefaultSpendingStats = (budget = 0) => {
7
7
  const costPerType = {};
8
8
  const costPerMonth = {};
9
- const costPerMonthPerType = {};
9
+ // Initialize costPerType with 0 for each spending type
10
10
  interfaces_1.SPENDING_ARRAYS.TYPE.forEach(type => (costPerType[type] = 0));
11
+ // Initialize costPerMonth with 0 for each month
11
12
  general_1.COMMONS_ARRAYS.MONTH.forEach(month => {
12
13
  costPerMonth[month] = 0;
13
- costPerMonthPerType[month] = {};
14
- interfaces_1.SPENDING_ARRAYS.TYPE.forEach(type => {
15
- costPerMonthPerType[month][type] = 0;
16
- });
17
14
  });
15
+ // Initialize the new costPerTypePerMonth structure
16
+ const costPerTypePerMonth = Object.fromEntries(interfaces_1.SPENDING_ARRAYS.TYPE.map(type => [type, Object.fromEntries(general_1.COMMONS_ARRAYS.MONTH.map(month => [month, 0]))]));
18
17
  return {
19
18
  totalCost: 0,
19
+ averageSpendingPerMonth: 0,
20
20
  budget,
21
21
  budgetRemaining: budget,
22
- costPerType,
22
+ mostExpensiveType: (0, exports.createSpendingType)(),
23
+ spendingGroups: (0, exports.createSpendingGroups)(),
23
24
  costPerMonth,
24
- costPerMonthPerType,
25
- totalCostLastMonth: 0,
26
- averageSpendingPerMonth: 0
25
+ costPerType,
26
+ costPerTypePerMonth, // The new and correct structure
27
+ };
28
+ };
29
+ exports.createDefaultSpendingStats = createDefaultSpendingStats;
30
+ const createSpendingType = () => {
31
+ return {
32
+ type: '',
33
+ cost: 0,
34
+ percentage: 0,
35
+ perMonth: {},
27
36
  };
28
37
  };
29
- exports.createDefaultSpendingTotal = createDefaultSpendingTotal;
38
+ exports.createSpendingType = createSpendingType;
39
+ const createSpendingGroups = () => ({
40
+ direct: 0,
41
+ training: 0,
42
+ directPercentage: 0,
43
+ trainingPercentage: 0,
44
+ onCourt: 0,
45
+ onCourtPercentage: 0,
46
+ tournament: 0,
47
+ tournamentPercentage: 0,
48
+ equipment: 0,
49
+ equipmentPercentage: 0,
50
+ other: 0,
51
+ otherPercentage: 0,
52
+ });
53
+ exports.createSpendingGroups = createSpendingGroups;
@@ -32,21 +32,44 @@ export interface SpendingItem {
32
32
  cost: number;
33
33
  linkedToTraining: boolean;
34
34
  }
35
- export interface SpendingTotals {
35
+ export interface SpendingType {
36
+ type: string;
37
+ cost: number;
38
+ percentage: number;
39
+ perMonth: {
40
+ [month: string]: number;
41
+ };
42
+ }
43
+ export interface SpendingGroups {
44
+ direct: number;
45
+ training: number;
46
+ directPercentage: number;
47
+ trainingPercentage: number;
48
+ onCourt: number;
49
+ onCourtPercentage: number;
50
+ tournament: number;
51
+ tournamentPercentage: number;
52
+ equipment: number;
53
+ equipmentPercentage: number;
54
+ other: number;
55
+ otherPercentage: number;
56
+ }
57
+ export interface SpendingStats {
36
58
  totalCost: number;
37
- totalCostLastMonth: number;
38
59
  averageSpendingPerMonth: number;
39
60
  budget: number;
40
61
  budgetRemaining: number;
62
+ mostExpensiveType: SpendingType;
63
+ spendingGroups: SpendingGroups;
41
64
  costPerType: {
42
65
  [type: string]: number;
43
66
  };
44
67
  costPerMonth: {
45
68
  [month: string]: number;
46
69
  };
47
- costPerMonthPerType: {
48
- [month: string]: {
49
- [type: string]: number;
70
+ costPerTypePerMonth: {
71
+ [type: string]: {
72
+ [month: string]: number;
50
73
  };
51
74
  };
52
75
  }
@@ -8,7 +8,7 @@ export declare const TOURNAMENT: {
8
8
  readonly BelfastAndDistrictLeague: "Belfast And District League";
9
9
  };
10
10
  readonly CATEGORY: {
11
- readonly WTN: "WTN Only";
11
+ readonly WTN: "WTN";
12
12
  readonly T100: "T100";
13
13
  readonly T200: "T200";
14
14
  readonly T500: "T500";
@@ -8,7 +8,7 @@ exports.TOURNAMENT = {
8
8
  BelfastAndDistrictLeague: 'Belfast And District League',
9
9
  },
10
10
  CATEGORY: {
11
- WTN: 'WTN Only',
11
+ WTN: 'WTN',
12
12
  T100: 'T100',
13
13
  T200: 'T200',
14
14
  T500: 'T500',