tenniscommon 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/dist/cjs/common/player/interfaces.d.ts +4 -0
- package/dist/cjs/common/training/initialData.js +2 -1
- package/dist/cjs/common/training/interfaces.d.ts +17 -3
- package/dist/cjs/common/training/interfaces.js +15 -3
- package/dist/cjs/common/training/validation.d.ts +4 -1
- package/dist/cjs/common/training/validation.js +13 -4
- package/dist/cjs/common/trainingWeekly/initialData.js +3 -2
- package/dist/cjs/common/trainingWeekly/interfaces.d.ts +2 -1
- package/dist/cjs/common/trainingWeekly/validation.d.ts +4 -1
- package/dist/cjs/common/trainingWeekly/validation.js +9 -1
- package/dist/esm/common/player/interfaces.d.ts +4 -0
- package/dist/esm/common/training/initialData.js +2 -1
- package/dist/esm/common/training/interfaces.d.ts +17 -3
- package/dist/esm/common/training/interfaces.js +15 -3
- package/dist/esm/common/training/validation.d.ts +4 -1
- package/dist/esm/common/training/validation.js +13 -4
- package/dist/esm/common/trainingWeekly/initialData.js +3 -2
- package/dist/esm/common/trainingWeekly/interfaces.d.ts +2 -1
- package/dist/esm/common/trainingWeekly/validation.d.ts +4 -1
- package/dist/esm/common/trainingWeekly/validation.js +9 -1
- package/dist/types/common/player/interfaces.d.ts +4 -0
- package/dist/types/common/training/interfaces.d.ts +17 -3
- package/dist/types/common/training/validation.d.ts +4 -1
- package/dist/types/common/trainingWeekly/interfaces.d.ts +2 -1
- package/dist/types/common/trainingWeekly/validation.d.ts +4 -1
- package/package.json +1 -1
|
@@ -8,7 +8,8 @@ function createInitialTrainingItem(playerId, date) {
|
|
|
8
8
|
_id: '',
|
|
9
9
|
playerId: playerId,
|
|
10
10
|
date: date,
|
|
11
|
-
|
|
11
|
+
format: interfaces_1.TRAINING.FORMAT.Lesson,
|
|
12
|
+
type: interfaces_1.TRAINING.ACTIVITY.Forehand,
|
|
12
13
|
time: 1,
|
|
13
14
|
};
|
|
14
15
|
}
|
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
import { ValueOf } from '../general';
|
|
2
2
|
export declare const TRAINING: {
|
|
3
3
|
readonly ACTIVITY: {
|
|
4
|
+
readonly MatchPractice: "Match-Practice";
|
|
5
|
+
readonly Physical: "Physical";
|
|
6
|
+
readonly Serve: "Serve";
|
|
7
|
+
readonly Return: "Return";
|
|
8
|
+
readonly Forehand: "Forehand";
|
|
9
|
+
readonly Backhand: "Backhand";
|
|
10
|
+
readonly Slice: "Slice";
|
|
11
|
+
readonly Volley: "Volley";
|
|
12
|
+
readonly Overhead: "Overhead";
|
|
13
|
+
readonly DropShot: "Drop Shot";
|
|
14
|
+
readonly Tactical: "Tactical";
|
|
15
|
+
readonly Footwork: "Footwork";
|
|
16
|
+
};
|
|
17
|
+
readonly FORMAT: {
|
|
4
18
|
readonly Squad: "Squad";
|
|
5
19
|
readonly Individual: "Individual";
|
|
6
20
|
readonly Lesson: "Lesson";
|
|
7
21
|
readonly Hit: "Hit";
|
|
8
|
-
readonly MatchPractice: "Match-Practice";
|
|
9
|
-
readonly Physical: "Physical";
|
|
10
|
-
readonly OtherSports: "Other Sports";
|
|
11
22
|
};
|
|
12
23
|
};
|
|
13
24
|
export type TRAINING_ACTIVITY_UNION = ValueOf<typeof TRAINING.ACTIVITY>;
|
|
25
|
+
export type TRAINING_FORMAT_UNION = ValueOf<typeof TRAINING.FORMAT>;
|
|
14
26
|
export declare const TRAINING_ARRAYS: {
|
|
15
27
|
ACTIVITY: TRAINING_ACTIVITY_UNION[];
|
|
28
|
+
FORMAT: TRAINING_FORMAT_UNION[];
|
|
16
29
|
};
|
|
17
30
|
export interface TrainingItem {
|
|
18
31
|
_id: string;
|
|
19
32
|
playerId: string;
|
|
20
33
|
date: Date;
|
|
34
|
+
format: TRAINING_FORMAT_UNION;
|
|
21
35
|
type: TRAINING_ACTIVITY_UNION;
|
|
22
36
|
time: number;
|
|
23
37
|
spendingId?: string;
|
|
@@ -3,15 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.TRAINING_ARRAYS = exports.TRAINING = void 0;
|
|
4
4
|
exports.TRAINING = {
|
|
5
5
|
ACTIVITY: {
|
|
6
|
+
MatchPractice: 'Match-Practice',
|
|
7
|
+
Physical: 'Physical',
|
|
8
|
+
Serve: 'Serve',
|
|
9
|
+
Return: 'Return',
|
|
10
|
+
Forehand: 'Forehand',
|
|
11
|
+
Backhand: 'Backhand',
|
|
12
|
+
Slice: 'Slice',
|
|
13
|
+
Volley: 'Volley',
|
|
14
|
+
Overhead: 'Overhead',
|
|
15
|
+
DropShot: 'Drop Shot',
|
|
16
|
+
Tactical: 'Tactical',
|
|
17
|
+
Footwork: 'Footwork',
|
|
18
|
+
},
|
|
19
|
+
FORMAT: {
|
|
6
20
|
Squad: 'Squad',
|
|
7
21
|
Individual: 'Individual',
|
|
8
22
|
Lesson: 'Lesson',
|
|
9
23
|
Hit: 'Hit',
|
|
10
|
-
MatchPractice: 'Match-Practice',
|
|
11
|
-
Physical: 'Physical',
|
|
12
|
-
OtherSports: 'Other Sports',
|
|
13
24
|
},
|
|
14
25
|
};
|
|
15
26
|
exports.TRAINING_ARRAYS = {
|
|
16
27
|
ACTIVITY: Object.values(exports.TRAINING.ACTIVITY),
|
|
28
|
+
FORMAT: Object.values(exports.TRAINING.FORMAT),
|
|
17
29
|
};
|
|
@@ -2,7 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const trainingItemSchema: z.ZodObject<{
|
|
3
3
|
playerId: z.ZodString;
|
|
4
4
|
date: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, unknown>;
|
|
5
|
-
|
|
5
|
+
format: z.ZodEffects<z.ZodString, string, string>;
|
|
6
|
+
type: z.ZodEffects<z.ZodString, string, string>;
|
|
6
7
|
time: z.ZodNumber;
|
|
7
8
|
spendingId: z.ZodOptional<z.ZodString>;
|
|
8
9
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -10,11 +11,13 @@ export declare const trainingItemSchema: z.ZodObject<{
|
|
|
10
11
|
time: number;
|
|
11
12
|
date: Date;
|
|
12
13
|
playerId: string;
|
|
14
|
+
format: string;
|
|
13
15
|
spendingId?: string | undefined;
|
|
14
16
|
}, {
|
|
15
17
|
type: string;
|
|
16
18
|
time: number;
|
|
17
19
|
playerId: string;
|
|
20
|
+
format: string;
|
|
18
21
|
date?: unknown;
|
|
19
22
|
spendingId?: string | undefined;
|
|
20
23
|
}>;
|
|
@@ -2,10 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.trainingItemSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
|
|
5
|
+
const interfaces_1 = require("./interfaces");
|
|
6
|
+
exports.trainingItemSchema = zod_1.z
|
|
7
|
+
.object({
|
|
6
8
|
playerId: zod_1.z.string().min(1, 'PlayerId is required.'),
|
|
7
|
-
date: zod_1.z.preprocess((arg) => (typeof arg === 'string' || arg instanceof Date ? new Date(arg) : undefined), zod_1.z.date().refine(date => !isNaN(date.getTime()), 'Invalid date.')),
|
|
8
|
-
|
|
9
|
+
date: zod_1.z.preprocess((arg) => (typeof arg === 'string' || arg instanceof Date ? new Date(arg) : undefined), zod_1.z.date().refine((date) => !isNaN(date.getTime()), 'Invalid date.')),
|
|
10
|
+
format: zod_1.z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1, 'Format is required.')
|
|
13
|
+
.refine((val) => interfaces_1.TRAINING_ARRAYS.FORMAT.includes(val), 'Invalid training format.'),
|
|
14
|
+
type: zod_1.z
|
|
15
|
+
.string()
|
|
16
|
+
.min(1, 'Type is required.')
|
|
17
|
+
.refine((val) => interfaces_1.TRAINING_ARRAYS.ACTIVITY.includes(val), 'Invalid training type.'),
|
|
9
18
|
time: zod_1.z.number().nonnegative('Time must be a non-negative number.'),
|
|
10
|
-
spendingId: zod_1.z.string().optional()
|
|
19
|
+
spendingId: zod_1.z.string().optional(),
|
|
11
20
|
});
|
|
@@ -9,9 +9,10 @@ function createInitialTrainingWeeklyItem(playerId) {
|
|
|
9
9
|
_id: '',
|
|
10
10
|
playerId: playerId,
|
|
11
11
|
day: general_1.COMMONS.WEEKDAY.Monday,
|
|
12
|
-
|
|
12
|
+
format: training_1.TRAINING.FORMAT.Lesson,
|
|
13
|
+
type: training_1.TRAINING.ACTIVITY.Forehand,
|
|
13
14
|
time: 1,
|
|
14
|
-
spendingType: spending_1.SPENDING.TYPE.
|
|
15
|
+
spendingType: spending_1.SPENDING.TYPE.Lesson,
|
|
15
16
|
cost: 0,
|
|
16
17
|
};
|
|
17
18
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { TRAINING_ACTIVITY_UNION } from '../training';
|
|
1
|
+
import { TRAINING_ACTIVITY_UNION, TRAINING_FORMAT_UNION } from '../training';
|
|
2
2
|
import { SPENDING_TYPE_UNION } from '../spending';
|
|
3
3
|
import { WEEKDAY_UNION } from '../general';
|
|
4
4
|
export interface TrainingWeeklyItem {
|
|
5
5
|
_id: string;
|
|
6
6
|
playerId: string;
|
|
7
7
|
day: WEEKDAY_UNION;
|
|
8
|
+
format: TRAINING_FORMAT_UNION;
|
|
8
9
|
type: TRAINING_ACTIVITY_UNION;
|
|
9
10
|
time: number;
|
|
10
11
|
spendingType: SPENDING_TYPE_UNION;
|
|
@@ -2,7 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const trainingWeeklyItemSchema: z.ZodObject<{
|
|
3
3
|
playerId: z.ZodString;
|
|
4
4
|
day: z.ZodString;
|
|
5
|
-
|
|
5
|
+
format: z.ZodEffects<z.ZodString, string, string>;
|
|
6
|
+
type: z.ZodEffects<z.ZodString, string, string>;
|
|
6
7
|
time: z.ZodNumber;
|
|
7
8
|
spendingType: z.ZodString;
|
|
8
9
|
cost: z.ZodNumber;
|
|
@@ -12,6 +13,7 @@ export declare const trainingWeeklyItemSchema: z.ZodObject<{
|
|
|
12
13
|
day: string;
|
|
13
14
|
playerId: string;
|
|
14
15
|
cost: number;
|
|
16
|
+
format: string;
|
|
15
17
|
spendingType: string;
|
|
16
18
|
}, {
|
|
17
19
|
type: string;
|
|
@@ -19,5 +21,6 @@ export declare const trainingWeeklyItemSchema: z.ZodObject<{
|
|
|
19
21
|
day: string;
|
|
20
22
|
playerId: string;
|
|
21
23
|
cost: number;
|
|
24
|
+
format: string;
|
|
22
25
|
spendingType: string;
|
|
23
26
|
}>;
|
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.trainingWeeklyItemSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
+
const training_1 = require("../training");
|
|
5
6
|
exports.trainingWeeklyItemSchema = zod_1.z.object({
|
|
6
7
|
playerId: zod_1.z.string().min(1, 'PlayerId is required.'),
|
|
7
8
|
day: zod_1.z.string().min(1, 'Day is required.'),
|
|
8
|
-
|
|
9
|
+
format: zod_1.z
|
|
10
|
+
.string()
|
|
11
|
+
.min(1, 'Format is required.')
|
|
12
|
+
.refine((val) => training_1.TRAINING_ARRAYS.FORMAT.includes(val), 'Invalid training format.'),
|
|
13
|
+
type: zod_1.z
|
|
14
|
+
.string()
|
|
15
|
+
.min(1, 'Type is required.')
|
|
16
|
+
.refine((val) => training_1.TRAINING_ARRAYS.ACTIVITY.includes(val), 'Invalid training type.'),
|
|
9
17
|
time: zod_1.z.number().nonnegative('Time must be a non-negative number.'),
|
|
10
18
|
spendingType: zod_1.z.string().min(1, 'Spending Type is required.'),
|
|
11
19
|
cost: zod_1.z.number().nonnegative('Cost must be a non-negative number.')
|
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
import { ValueOf } from '../general';
|
|
2
2
|
export declare const TRAINING: {
|
|
3
3
|
readonly ACTIVITY: {
|
|
4
|
+
readonly MatchPractice: "Match-Practice";
|
|
5
|
+
readonly Physical: "Physical";
|
|
6
|
+
readonly Serve: "Serve";
|
|
7
|
+
readonly Return: "Return";
|
|
8
|
+
readonly Forehand: "Forehand";
|
|
9
|
+
readonly Backhand: "Backhand";
|
|
10
|
+
readonly Slice: "Slice";
|
|
11
|
+
readonly Volley: "Volley";
|
|
12
|
+
readonly Overhead: "Overhead";
|
|
13
|
+
readonly DropShot: "Drop Shot";
|
|
14
|
+
readonly Tactical: "Tactical";
|
|
15
|
+
readonly Footwork: "Footwork";
|
|
16
|
+
};
|
|
17
|
+
readonly FORMAT: {
|
|
4
18
|
readonly Squad: "Squad";
|
|
5
19
|
readonly Individual: "Individual";
|
|
6
20
|
readonly Lesson: "Lesson";
|
|
7
21
|
readonly Hit: "Hit";
|
|
8
|
-
readonly MatchPractice: "Match-Practice";
|
|
9
|
-
readonly Physical: "Physical";
|
|
10
|
-
readonly OtherSports: "Other Sports";
|
|
11
22
|
};
|
|
12
23
|
};
|
|
13
24
|
export type TRAINING_ACTIVITY_UNION = ValueOf<typeof TRAINING.ACTIVITY>;
|
|
25
|
+
export type TRAINING_FORMAT_UNION = ValueOf<typeof TRAINING.FORMAT>;
|
|
14
26
|
export declare const TRAINING_ARRAYS: {
|
|
15
27
|
ACTIVITY: TRAINING_ACTIVITY_UNION[];
|
|
28
|
+
FORMAT: TRAINING_FORMAT_UNION[];
|
|
16
29
|
};
|
|
17
30
|
export interface TrainingItem {
|
|
18
31
|
_id: string;
|
|
19
32
|
playerId: string;
|
|
20
33
|
date: Date;
|
|
34
|
+
format: TRAINING_FORMAT_UNION;
|
|
21
35
|
type: TRAINING_ACTIVITY_UNION;
|
|
22
36
|
time: number;
|
|
23
37
|
spendingId?: string;
|
|
@@ -1,14 +1,26 @@
|
|
|
1
1
|
export const TRAINING = {
|
|
2
2
|
ACTIVITY: {
|
|
3
|
+
MatchPractice: 'Match-Practice',
|
|
4
|
+
Physical: 'Physical',
|
|
5
|
+
Serve: 'Serve',
|
|
6
|
+
Return: 'Return',
|
|
7
|
+
Forehand: 'Forehand',
|
|
8
|
+
Backhand: 'Backhand',
|
|
9
|
+
Slice: 'Slice',
|
|
10
|
+
Volley: 'Volley',
|
|
11
|
+
Overhead: 'Overhead',
|
|
12
|
+
DropShot: 'Drop Shot',
|
|
13
|
+
Tactical: 'Tactical',
|
|
14
|
+
Footwork: 'Footwork',
|
|
15
|
+
},
|
|
16
|
+
FORMAT: {
|
|
3
17
|
Squad: 'Squad',
|
|
4
18
|
Individual: 'Individual',
|
|
5
19
|
Lesson: 'Lesson',
|
|
6
20
|
Hit: 'Hit',
|
|
7
|
-
MatchPractice: 'Match-Practice',
|
|
8
|
-
Physical: 'Physical',
|
|
9
|
-
OtherSports: 'Other Sports',
|
|
10
21
|
},
|
|
11
22
|
};
|
|
12
23
|
export const TRAINING_ARRAYS = {
|
|
13
24
|
ACTIVITY: Object.values(TRAINING.ACTIVITY),
|
|
25
|
+
FORMAT: Object.values(TRAINING.FORMAT),
|
|
14
26
|
};
|
|
@@ -2,7 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const trainingItemSchema: z.ZodObject<{
|
|
3
3
|
playerId: z.ZodString;
|
|
4
4
|
date: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, unknown>;
|
|
5
|
-
|
|
5
|
+
format: z.ZodEffects<z.ZodString, string, string>;
|
|
6
|
+
type: z.ZodEffects<z.ZodString, string, string>;
|
|
6
7
|
time: z.ZodNumber;
|
|
7
8
|
spendingId: z.ZodOptional<z.ZodString>;
|
|
8
9
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -10,11 +11,13 @@ export declare const trainingItemSchema: z.ZodObject<{
|
|
|
10
11
|
time: number;
|
|
11
12
|
date: Date;
|
|
12
13
|
playerId: string;
|
|
14
|
+
format: string;
|
|
13
15
|
spendingId?: string | undefined;
|
|
14
16
|
}, {
|
|
15
17
|
type: string;
|
|
16
18
|
time: number;
|
|
17
19
|
playerId: string;
|
|
20
|
+
format: string;
|
|
18
21
|
date?: unknown;
|
|
19
22
|
spendingId?: string | undefined;
|
|
20
23
|
}>;
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
|
|
2
|
+
import { TRAINING_ARRAYS } from './interfaces';
|
|
3
|
+
export const trainingItemSchema = z
|
|
4
|
+
.object({
|
|
3
5
|
playerId: z.string().min(1, 'PlayerId is required.'),
|
|
4
|
-
date: z.preprocess((arg) => (typeof arg === 'string' || arg instanceof Date ? new Date(arg) : undefined), z.date().refine(date => !isNaN(date.getTime()), 'Invalid date.')),
|
|
5
|
-
|
|
6
|
+
date: z.preprocess((arg) => (typeof arg === 'string' || arg instanceof Date ? new Date(arg) : undefined), z.date().refine((date) => !isNaN(date.getTime()), 'Invalid date.')),
|
|
7
|
+
format: z
|
|
8
|
+
.string()
|
|
9
|
+
.min(1, 'Format is required.')
|
|
10
|
+
.refine((val) => TRAINING_ARRAYS.FORMAT.includes(val), 'Invalid training format.'),
|
|
11
|
+
type: z
|
|
12
|
+
.string()
|
|
13
|
+
.min(1, 'Type is required.')
|
|
14
|
+
.refine((val) => TRAINING_ARRAYS.ACTIVITY.includes(val), 'Invalid training type.'),
|
|
6
15
|
time: z.number().nonnegative('Time must be a non-negative number.'),
|
|
7
|
-
spendingId: z.string().optional()
|
|
16
|
+
spendingId: z.string().optional(),
|
|
8
17
|
});
|
|
@@ -6,9 +6,10 @@ export function createInitialTrainingWeeklyItem(playerId) {
|
|
|
6
6
|
_id: '',
|
|
7
7
|
playerId: playerId,
|
|
8
8
|
day: COMMONS.WEEKDAY.Monday,
|
|
9
|
-
|
|
9
|
+
format: TRAINING.FORMAT.Lesson,
|
|
10
|
+
type: TRAINING.ACTIVITY.Forehand,
|
|
10
11
|
time: 1,
|
|
11
|
-
spendingType: SPENDING.TYPE.
|
|
12
|
+
spendingType: SPENDING.TYPE.Lesson,
|
|
12
13
|
cost: 0,
|
|
13
14
|
};
|
|
14
15
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { TRAINING_ACTIVITY_UNION } from '../training';
|
|
1
|
+
import { TRAINING_ACTIVITY_UNION, TRAINING_FORMAT_UNION } from '../training';
|
|
2
2
|
import { SPENDING_TYPE_UNION } from '../spending';
|
|
3
3
|
import { WEEKDAY_UNION } from '../general';
|
|
4
4
|
export interface TrainingWeeklyItem {
|
|
5
5
|
_id: string;
|
|
6
6
|
playerId: string;
|
|
7
7
|
day: WEEKDAY_UNION;
|
|
8
|
+
format: TRAINING_FORMAT_UNION;
|
|
8
9
|
type: TRAINING_ACTIVITY_UNION;
|
|
9
10
|
time: number;
|
|
10
11
|
spendingType: SPENDING_TYPE_UNION;
|
|
@@ -2,7 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const trainingWeeklyItemSchema: z.ZodObject<{
|
|
3
3
|
playerId: z.ZodString;
|
|
4
4
|
day: z.ZodString;
|
|
5
|
-
|
|
5
|
+
format: z.ZodEffects<z.ZodString, string, string>;
|
|
6
|
+
type: z.ZodEffects<z.ZodString, string, string>;
|
|
6
7
|
time: z.ZodNumber;
|
|
7
8
|
spendingType: z.ZodString;
|
|
8
9
|
cost: z.ZodNumber;
|
|
@@ -12,6 +13,7 @@ export declare const trainingWeeklyItemSchema: z.ZodObject<{
|
|
|
12
13
|
day: string;
|
|
13
14
|
playerId: string;
|
|
14
15
|
cost: number;
|
|
16
|
+
format: string;
|
|
15
17
|
spendingType: string;
|
|
16
18
|
}, {
|
|
17
19
|
type: string;
|
|
@@ -19,5 +21,6 @@ export declare const trainingWeeklyItemSchema: z.ZodObject<{
|
|
|
19
21
|
day: string;
|
|
20
22
|
playerId: string;
|
|
21
23
|
cost: number;
|
|
24
|
+
format: string;
|
|
22
25
|
spendingType: string;
|
|
23
26
|
}>;
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
import { TRAINING_ARRAYS } from '../training';
|
|
2
3
|
export const trainingWeeklyItemSchema = z.object({
|
|
3
4
|
playerId: z.string().min(1, 'PlayerId is required.'),
|
|
4
5
|
day: z.string().min(1, 'Day is required.'),
|
|
5
|
-
|
|
6
|
+
format: z
|
|
7
|
+
.string()
|
|
8
|
+
.min(1, 'Format is required.')
|
|
9
|
+
.refine((val) => TRAINING_ARRAYS.FORMAT.includes(val), 'Invalid training format.'),
|
|
10
|
+
type: z
|
|
11
|
+
.string()
|
|
12
|
+
.min(1, 'Type is required.')
|
|
13
|
+
.refine((val) => TRAINING_ARRAYS.ACTIVITY.includes(val), 'Invalid training type.'),
|
|
6
14
|
time: z.number().nonnegative('Time must be a non-negative number.'),
|
|
7
15
|
spendingType: z.string().min(1, 'Spending Type is required.'),
|
|
8
16
|
cost: z.number().nonnegative('Cost must be a non-negative number.')
|
|
@@ -1,23 +1,37 @@
|
|
|
1
1
|
import { ValueOf } from '../general';
|
|
2
2
|
export declare const TRAINING: {
|
|
3
3
|
readonly ACTIVITY: {
|
|
4
|
+
readonly MatchPractice: "Match-Practice";
|
|
5
|
+
readonly Physical: "Physical";
|
|
6
|
+
readonly Serve: "Serve";
|
|
7
|
+
readonly Return: "Return";
|
|
8
|
+
readonly Forehand: "Forehand";
|
|
9
|
+
readonly Backhand: "Backhand";
|
|
10
|
+
readonly Slice: "Slice";
|
|
11
|
+
readonly Volley: "Volley";
|
|
12
|
+
readonly Overhead: "Overhead";
|
|
13
|
+
readonly DropShot: "Drop Shot";
|
|
14
|
+
readonly Tactical: "Tactical";
|
|
15
|
+
readonly Footwork: "Footwork";
|
|
16
|
+
};
|
|
17
|
+
readonly FORMAT: {
|
|
4
18
|
readonly Squad: "Squad";
|
|
5
19
|
readonly Individual: "Individual";
|
|
6
20
|
readonly Lesson: "Lesson";
|
|
7
21
|
readonly Hit: "Hit";
|
|
8
|
-
readonly MatchPractice: "Match-Practice";
|
|
9
|
-
readonly Physical: "Physical";
|
|
10
|
-
readonly OtherSports: "Other Sports";
|
|
11
22
|
};
|
|
12
23
|
};
|
|
13
24
|
export type TRAINING_ACTIVITY_UNION = ValueOf<typeof TRAINING.ACTIVITY>;
|
|
25
|
+
export type TRAINING_FORMAT_UNION = ValueOf<typeof TRAINING.FORMAT>;
|
|
14
26
|
export declare const TRAINING_ARRAYS: {
|
|
15
27
|
ACTIVITY: TRAINING_ACTIVITY_UNION[];
|
|
28
|
+
FORMAT: TRAINING_FORMAT_UNION[];
|
|
16
29
|
};
|
|
17
30
|
export interface TrainingItem {
|
|
18
31
|
_id: string;
|
|
19
32
|
playerId: string;
|
|
20
33
|
date: Date;
|
|
34
|
+
format: TRAINING_FORMAT_UNION;
|
|
21
35
|
type: TRAINING_ACTIVITY_UNION;
|
|
22
36
|
time: number;
|
|
23
37
|
spendingId?: string;
|
|
@@ -2,7 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const trainingItemSchema: z.ZodObject<{
|
|
3
3
|
playerId: z.ZodString;
|
|
4
4
|
date: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, unknown>;
|
|
5
|
-
|
|
5
|
+
format: z.ZodEffects<z.ZodString, string, string>;
|
|
6
|
+
type: z.ZodEffects<z.ZodString, string, string>;
|
|
6
7
|
time: z.ZodNumber;
|
|
7
8
|
spendingId: z.ZodOptional<z.ZodString>;
|
|
8
9
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -10,11 +11,13 @@ export declare const trainingItemSchema: z.ZodObject<{
|
|
|
10
11
|
time: number;
|
|
11
12
|
date: Date;
|
|
12
13
|
playerId: string;
|
|
14
|
+
format: string;
|
|
13
15
|
spendingId?: string | undefined;
|
|
14
16
|
}, {
|
|
15
17
|
type: string;
|
|
16
18
|
time: number;
|
|
17
19
|
playerId: string;
|
|
20
|
+
format: string;
|
|
18
21
|
date?: unknown;
|
|
19
22
|
spendingId?: string | undefined;
|
|
20
23
|
}>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { TRAINING_ACTIVITY_UNION } from '../training';
|
|
1
|
+
import { TRAINING_ACTIVITY_UNION, TRAINING_FORMAT_UNION } from '../training';
|
|
2
2
|
import { SPENDING_TYPE_UNION } from '../spending';
|
|
3
3
|
import { WEEKDAY_UNION } from '../general';
|
|
4
4
|
export interface TrainingWeeklyItem {
|
|
5
5
|
_id: string;
|
|
6
6
|
playerId: string;
|
|
7
7
|
day: WEEKDAY_UNION;
|
|
8
|
+
format: TRAINING_FORMAT_UNION;
|
|
8
9
|
type: TRAINING_ACTIVITY_UNION;
|
|
9
10
|
time: number;
|
|
10
11
|
spendingType: SPENDING_TYPE_UNION;
|
|
@@ -2,7 +2,8 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const trainingWeeklyItemSchema: z.ZodObject<{
|
|
3
3
|
playerId: z.ZodString;
|
|
4
4
|
day: z.ZodString;
|
|
5
|
-
|
|
5
|
+
format: z.ZodEffects<z.ZodString, string, string>;
|
|
6
|
+
type: z.ZodEffects<z.ZodString, string, string>;
|
|
6
7
|
time: z.ZodNumber;
|
|
7
8
|
spendingType: z.ZodString;
|
|
8
9
|
cost: z.ZodNumber;
|
|
@@ -12,6 +13,7 @@ export declare const trainingWeeklyItemSchema: z.ZodObject<{
|
|
|
12
13
|
day: string;
|
|
13
14
|
playerId: string;
|
|
14
15
|
cost: number;
|
|
16
|
+
format: string;
|
|
15
17
|
spendingType: string;
|
|
16
18
|
}, {
|
|
17
19
|
type: string;
|
|
@@ -19,5 +21,6 @@ export declare const trainingWeeklyItemSchema: z.ZodObject<{
|
|
|
19
21
|
day: string;
|
|
20
22
|
playerId: string;
|
|
21
23
|
cost: number;
|
|
24
|
+
format: string;
|
|
22
25
|
spendingType: string;
|
|
23
26
|
}>;
|