volleyballsimtypes 0.0.398 → 0.0.399

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.
@@ -56,14 +56,21 @@ export interface StartingLineup {
56
56
  [CourtPosition.LIBERO_ZONE]?: string;
57
57
  bench: string[];
58
58
  }
59
+ export interface ApiSetSubConfig {
60
+ mode: SubMode;
61
+ benchId?: string;
62
+ fatigueBand?: EnergyBand;
63
+ conditions?: PinchCondition[];
64
+ conditionLogic?: ConditionLogic;
65
+ }
59
66
  export interface ApiDesignatedSub {
60
67
  starterId: string;
61
68
  benchId?: string;
62
69
  mode: SubMode;
63
70
  fatigueBand?: EnergyBand;
64
- fatigueBandsBySet?: EnergyBand[];
65
71
  conditions?: PinchCondition[];
66
72
  conditionLogic?: ConditionLogic;
73
+ sets?: ApiSetSubConfig[];
67
74
  }
68
75
  export interface ApiOffensivePreference {
69
76
  rotation: number;
@@ -13,15 +13,22 @@ export interface TacticsLineupAttributes {
13
13
  bench: PlayerId[];
14
14
  }
15
15
  export type PinchServerSubsAttributes = Record<PlayerId, PlayerId>;
16
+ export interface SetSubConfigAttributes {
17
+ mode: SubMode;
18
+ benchId?: PlayerId;
19
+ fatigueBand?: EnergyBand;
20
+ conditions?: PinchCondition[];
21
+ conditionLogic?: ConditionLogic;
22
+ }
16
23
  export interface DesignatedSubAttributes {
17
24
  starterId: PlayerId;
18
25
  benchId?: PlayerId;
19
26
  mode?: SubMode;
20
27
  isPinchServer?: boolean;
21
28
  fatigueBand?: SubBand;
22
- fatigueBandsBySet?: EnergyBand[];
23
29
  conditions?: PinchCondition[];
24
30
  conditionLogic?: ConditionLogic;
31
+ sets?: SetSubConfigAttributes[];
25
32
  }
26
33
  export interface OffensivePreferenceAttributes {
27
34
  rotation: number;
@@ -59,9 +59,15 @@ function transformToAttributes(tactics, teamId) {
59
59
  benchId: ds.bench?.id,
60
60
  mode: ds.mode,
61
61
  fatigueBand: ds.fatigueBand,
62
- fatigueBandsBySet: ds.fatigueBandsBySet,
63
62
  conditions: ds.conditions,
64
- conditionLogic: ds.conditionLogic
63
+ conditionLogic: ds.conditionLogic,
64
+ sets: ds.sets?.map(s => ({
65
+ mode: s.mode,
66
+ benchId: s.bench?.id,
67
+ fatigueBand: s.fatigueBand,
68
+ conditions: s.conditions,
69
+ conditionLogic: s.conditionLogic
70
+ }))
65
71
  })),
66
72
  rotation_system: tactics.rotationSystem,
67
73
  designated_setters: tactics.designatedSetters.map((s) => s.id),
@@ -91,9 +97,15 @@ function transformToObject(model, roster) {
91
97
  bench: d.benchId != null ? findPlayer(d.benchId, roster) : undefined,
92
98
  mode: subModeFromAttributes(d),
93
99
  fatigueBand: d.fatigueBand === 'NEVER' ? undefined : d.fatigueBand,
94
- fatigueBandsBySet: d.fatigueBandsBySet,
95
100
  conditions: d.conditions,
96
- conditionLogic: d.conditionLogic
101
+ conditionLogic: d.conditionLogic,
102
+ sets: d.sets?.map(s => ({
103
+ mode: s.mode,
104
+ bench: s.benchId != null ? findPlayer(s.benchId, roster) : undefined,
105
+ fatigueBand: s.fatigueBand,
106
+ conditions: s.conditions,
107
+ conditionLogic: s.conditionLogic
108
+ }))
97
109
  })),
98
110
  rotationSystem: model.rotation_system,
99
111
  designatedSetters: (model.designated_setters ?? []).map((id) => findPlayer(id, roster)),
@@ -1,12 +1,14 @@
1
1
  import { Player } from '../player';
2
2
  import { EnergyBand, SubMode } from './energy-band';
3
3
  import { ConditionLogic, PinchCondition } from './pinch-condition';
4
- export interface DesignatedSub {
5
- readonly starter: Player;
6
- readonly bench?: Player;
4
+ export interface SetSubConfig {
7
5
  readonly mode: SubMode;
6
+ readonly bench?: Player;
8
7
  readonly fatigueBand?: EnergyBand;
9
- readonly fatigueBandsBySet?: EnergyBand[];
10
8
  readonly conditions?: PinchCondition[];
11
9
  readonly conditionLogic?: ConditionLogic;
12
10
  }
11
+ export interface DesignatedSub extends SetSubConfig {
12
+ readonly starter: Player;
13
+ readonly sets?: SetSubConfig[];
14
+ }
@@ -35,16 +35,86 @@ export declare const SubModeSchema: z.ZodEnum<{
35
35
  FATIGUE: "FATIGUE";
36
36
  PINCH: "PINCH";
37
37
  }>;
38
- export declare const DesignatedSubSchema: z.ZodObject<{
39
- starter: z.ZodCustom<Player, Player>;
38
+ export declare const SetSubConfigSchema: z.ZodObject<{
39
+ mode: z.ZodEnum<{
40
+ NEVER: "NEVER";
41
+ FATIGUE: "FATIGUE";
42
+ PINCH: "PINCH";
43
+ }>;
40
44
  bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
45
+ fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
46
+ conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
47
+ type: z.ZodLiteral<PinchConditionType.ASAP>;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ type: z.ZodLiteral<PinchConditionType.TEAM_SET_POINT>;
50
+ margin: z.ZodNumber;
51
+ opponent: z.ZodEnum<typeof OpponentRelation>;
52
+ }, z.core.$strip>, z.ZodObject<{
53
+ type: z.ZodLiteral<PinchConditionType.OPPONENT_SET_POINT>;
54
+ margin: z.ZodNumber;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ type: z.ZodLiteral<PinchConditionType.SCORE_DIFF>;
57
+ direction: z.ZodEnum<typeof ScoreDirection>;
58
+ points: z.ZodNumber;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ type: z.ZodLiteral<PinchConditionType.AFTER_ROTATIONS>;
61
+ rotations: z.ZodNumber;
62
+ }, z.core.$strip>, z.ZodObject<{
63
+ type: z.ZodLiteral<PinchConditionType.FROM_SET>;
64
+ set: z.ZodNumber;
65
+ }, z.core.$strip>, z.ZodObject<{
66
+ type: z.ZodLiteral<PinchConditionType.MIN_OWN_SCORE>;
67
+ score: z.ZodNumber;
68
+ }, z.core.$strip>, z.ZodObject<{
69
+ type: z.ZodLiteral<PinchConditionType.MIN_OPPONENT_SCORE>;
70
+ score: z.ZodNumber;
71
+ }, z.core.$strip>], "type">>>;
72
+ conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
73
+ }, z.core.$strip>;
74
+ export declare const DesignatedSubSchema: z.ZodObject<{
75
+ sets: z.ZodOptional<z.ZodArray<z.ZodObject<{
76
+ mode: z.ZodEnum<{
77
+ NEVER: "NEVER";
78
+ FATIGUE: "FATIGUE";
79
+ PINCH: "PINCH";
80
+ }>;
81
+ bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
82
+ fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
83
+ conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
84
+ type: z.ZodLiteral<PinchConditionType.ASAP>;
85
+ }, z.core.$strip>, z.ZodObject<{
86
+ type: z.ZodLiteral<PinchConditionType.TEAM_SET_POINT>;
87
+ margin: z.ZodNumber;
88
+ opponent: z.ZodEnum<typeof OpponentRelation>;
89
+ }, z.core.$strip>, z.ZodObject<{
90
+ type: z.ZodLiteral<PinchConditionType.OPPONENT_SET_POINT>;
91
+ margin: z.ZodNumber;
92
+ }, z.core.$strip>, z.ZodObject<{
93
+ type: z.ZodLiteral<PinchConditionType.SCORE_DIFF>;
94
+ direction: z.ZodEnum<typeof ScoreDirection>;
95
+ points: z.ZodNumber;
96
+ }, z.core.$strip>, z.ZodObject<{
97
+ type: z.ZodLiteral<PinchConditionType.AFTER_ROTATIONS>;
98
+ rotations: z.ZodNumber;
99
+ }, z.core.$strip>, z.ZodObject<{
100
+ type: z.ZodLiteral<PinchConditionType.FROM_SET>;
101
+ set: z.ZodNumber;
102
+ }, z.core.$strip>, z.ZodObject<{
103
+ type: z.ZodLiteral<PinchConditionType.MIN_OWN_SCORE>;
104
+ score: z.ZodNumber;
105
+ }, z.core.$strip>, z.ZodObject<{
106
+ type: z.ZodLiteral<PinchConditionType.MIN_OPPONENT_SCORE>;
107
+ score: z.ZodNumber;
108
+ }, z.core.$strip>], "type">>>;
109
+ conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
110
+ }, z.core.$strip>>>;
41
111
  mode: z.ZodEnum<{
42
112
  NEVER: "NEVER";
43
113
  FATIGUE: "FATIGUE";
44
114
  PINCH: "PINCH";
45
115
  }>;
116
+ bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
46
117
  fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
47
- fatigueBandsBySet: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof EnergyBand>>>;
48
118
  conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
49
119
  type: z.ZodLiteral<PinchConditionType.ASAP>;
50
120
  }, z.core.$strip>, z.ZodObject<{
@@ -72,4 +142,5 @@ export declare const DesignatedSubSchema: z.ZodObject<{
72
142
  score: z.ZodNumber;
73
143
  }, z.core.$strip>], "type">>>;
74
144
  conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
145
+ starter: z.ZodCustom<Player, Player>;
75
146
  }, z.core.$strip>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DesignatedSubSchema = exports.SubModeSchema = exports.ConditionLogicSchema = exports.PinchConditionSchema = exports.SubBandSchema = void 0;
3
+ exports.DesignatedSubSchema = exports.SetSubConfigSchema = exports.SubModeSchema = exports.ConditionLogicSchema = exports.PinchConditionSchema = exports.SubBandSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const player_1 = require("../../player");
6
6
  const energy_band_1 = require("../energy-band");
@@ -21,22 +21,33 @@ exports.PinchConditionSchema = zod_1.z.discriminatedUnion('type', [
21
21
  ]);
22
22
  exports.ConditionLogicSchema = zod_1.z.union([zod_1.z.literal('ALL'), zod_1.z.literal('ANY')]);
23
23
  exports.SubModeSchema = zod_1.z.enum(['FATIGUE', 'PINCH', 'NEVER']);
24
- exports.DesignatedSubSchema = zod_1.z.object({
25
- starter: playerInstanceSchema,
26
- bench: playerInstanceSchema.optional(),
24
+ // Fields shared by the all-sets config and each per-set config.
25
+ const setSubConfigShape = {
27
26
  mode: exports.SubModeSchema,
27
+ bench: playerInstanceSchema.optional(),
28
28
  fatigueBand: zod_1.z.nativeEnum(energy_band_1.EnergyBand).optional(),
29
- fatigueBandsBySet: zod_1.z.array(zod_1.z.nativeEnum(energy_band_1.EnergyBand)).max(5).optional(),
30
29
  conditions: zod_1.z.array(exports.PinchConditionSchema).optional(),
31
30
  conditionLogic: exports.ConditionLogicSchema.optional()
32
- }).superRefine((data, ctx) => {
33
- if (data.mode === 'PINCH') {
34
- // Pinch mode needs a designated bench player (the server) and at least one condition.
35
- if (data.bench == null) {
36
- ctx.addIssue({ code: 'custom', message: 'PINCH_SERVER_REQUIRES_BENCH', path: ['bench'] });
37
- }
38
- if (data.conditions == null || data.conditions.length === 0) {
39
- ctx.addIssue({ code: 'custom', message: 'PINCH_SERVER_REQUIRES_CONDITIONS', path: ['conditions'] });
40
- }
31
+ };
32
+ // Pinch mode needs a designated bench player (the server) and at least one condition.
33
+ function refinePinch(data, ctx) {
34
+ if (data.mode !== 'PINCH')
35
+ return;
36
+ if (data.bench == null) {
37
+ ctx.addIssue({ code: 'custom', message: 'PINCH_SERVER_REQUIRES_BENCH', path: ['bench'] });
41
38
  }
39
+ if (data.conditions == null || data.conditions.length === 0) {
40
+ ctx.addIssue({ code: 'custom', message: 'PINCH_SERVER_REQUIRES_CONDITIONS', path: ['conditions'] });
41
+ }
42
+ }
43
+ exports.SetSubConfigSchema = zod_1.z.object(setSubConfigShape).superRefine(refinePinch);
44
+ exports.DesignatedSubSchema = zod_1.z.object({
45
+ starter: playerInstanceSchema,
46
+ ...setSubConfigShape,
47
+ // Optional per-set overrides (index 0 = set 1 ... index 4 = set 5); absent => the flat config for all sets.
48
+ sets: zod_1.z.array(exports.SetSubConfigSchema).max(5).optional()
49
+ }).superRefine((data, ctx) => {
50
+ // Per-set configs are each validated by SetSubConfigSchema; only validate the flat config when none are set.
51
+ if (data.sets == null)
52
+ refinePinch(data, ctx);
42
53
  });
@@ -133,4 +133,59 @@ const test_helpers_1 = require("../../test-helpers");
133
133
  });
134
134
  (0, globals_1.expect)(res.success).toBe(false);
135
135
  });
136
+ (0, globals_1.it)('accepts an entry with per-set configs (mode/bench/band/conditions vary per set)', () => {
137
+ const res = designated_sub_z_1.DesignatedSubSchema.safeParse({
138
+ starter,
139
+ mode: 'FATIGUE',
140
+ fatigueBand: energy_band_1.EnergyBand.TIRED,
141
+ sets: [
142
+ { mode: 'FATIGUE', fatigueBand: energy_band_1.EnergyBand.WORN },
143
+ { mode: 'NEVER' },
144
+ { mode: 'PINCH', bench, conditions: [{ type: pinch_condition_1.PinchConditionType.ASAP }] },
145
+ { mode: 'FATIGUE', fatigueBand: energy_band_1.EnergyBand.EXHAUSTED },
146
+ { mode: 'FATIGUE' }
147
+ ]
148
+ });
149
+ (0, globals_1.expect)(res.success).toBe(true);
150
+ });
151
+ (0, globals_1.it)('rejects a per-set pinch config without a bench server', () => {
152
+ const res = designated_sub_z_1.DesignatedSubSchema.safeParse({
153
+ starter,
154
+ mode: 'FATIGUE',
155
+ sets: [{ mode: 'PINCH', conditions: [{ type: pinch_condition_1.PinchConditionType.ASAP }] }]
156
+ });
157
+ (0, globals_1.expect)(res.success).toBe(false);
158
+ if (!res.success) {
159
+ (0, globals_1.expect)(res.error.issues.some(issue => issue.message === 'PINCH_SERVER_REQUIRES_BENCH')).toBe(true);
160
+ }
161
+ });
162
+ (0, globals_1.it)('rejects a per-set pinch config with no conditions', () => {
163
+ const res = designated_sub_z_1.DesignatedSubSchema.safeParse({
164
+ starter,
165
+ mode: 'FATIGUE',
166
+ sets: [{ mode: 'PINCH', bench, conditions: [] }]
167
+ });
168
+ (0, globals_1.expect)(res.success).toBe(false);
169
+ if (!res.success) {
170
+ (0, globals_1.expect)(res.error.issues.some(issue => issue.message === 'PINCH_SERVER_REQUIRES_CONDITIONS')).toBe(true);
171
+ }
172
+ });
173
+ (0, globals_1.it)('does not pinch-validate the flat config when per-set configs are present', () => {
174
+ // Flat mode is PINCH but missing bench/conditions; because `sets` is present, only each set is
175
+ // validated, so the flat config is ignored and this passes.
176
+ const res = designated_sub_z_1.DesignatedSubSchema.safeParse({
177
+ starter,
178
+ mode: 'PINCH',
179
+ sets: [{ mode: 'FATIGUE', fatigueBand: energy_band_1.EnergyBand.TIRED }]
180
+ });
181
+ (0, globals_1.expect)(res.success).toBe(true);
182
+ });
183
+ (0, globals_1.it)('rejects more than five per-set configs', () => {
184
+ const res = designated_sub_z_1.DesignatedSubSchema.safeParse({
185
+ starter,
186
+ mode: 'FATIGUE',
187
+ sets: Array.from({ length: 6 }, () => ({ mode: 'FATIGUE' }))
188
+ });
189
+ (0, globals_1.expect)(res.success).toBe(false);
190
+ });
136
191
  });
@@ -18,15 +18,49 @@ export declare const TacticsInputSchema: z.ZodObject<{
18
18
  receiveRotationOffset: z.ZodDefault<z.ZodBoolean>;
19
19
  pinchServerSubs: z.ZodCustom<Map<Player, Player>, Map<Player, Player>>;
20
20
  designatedSubs: z.ZodDefault<z.ZodArray<z.ZodObject<{
21
- starter: z.ZodCustom<Player, Player>;
22
- bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
21
+ sets: z.ZodOptional<z.ZodArray<z.ZodObject<{
22
+ mode: z.ZodEnum<{
23
+ NEVER: "NEVER";
24
+ FATIGUE: "FATIGUE";
25
+ PINCH: "PINCH";
26
+ }>;
27
+ bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
28
+ fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
29
+ conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
30
+ type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
31
+ }, z.core.$strip>, z.ZodObject<{
32
+ type: z.ZodLiteral<import("..").PinchConditionType.TEAM_SET_POINT>;
33
+ margin: z.ZodNumber;
34
+ opponent: z.ZodEnum<typeof import("..").OpponentRelation>;
35
+ }, z.core.$strip>, z.ZodObject<{
36
+ type: z.ZodLiteral<import("..").PinchConditionType.OPPONENT_SET_POINT>;
37
+ margin: z.ZodNumber;
38
+ }, z.core.$strip>, z.ZodObject<{
39
+ type: z.ZodLiteral<import("..").PinchConditionType.SCORE_DIFF>;
40
+ direction: z.ZodEnum<typeof import("..").ScoreDirection>;
41
+ points: z.ZodNumber;
42
+ }, z.core.$strip>, z.ZodObject<{
43
+ type: z.ZodLiteral<import("..").PinchConditionType.AFTER_ROTATIONS>;
44
+ rotations: z.ZodNumber;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ type: z.ZodLiteral<import("..").PinchConditionType.FROM_SET>;
47
+ set: z.ZodNumber;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ type: z.ZodLiteral<import("..").PinchConditionType.MIN_OWN_SCORE>;
50
+ score: z.ZodNumber;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ type: z.ZodLiteral<import("..").PinchConditionType.MIN_OPPONENT_SCORE>;
53
+ score: z.ZodNumber;
54
+ }, z.core.$strip>], "type">>>;
55
+ conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
56
+ }, z.core.$strip>>>;
23
57
  mode: z.ZodEnum<{
24
58
  NEVER: "NEVER";
25
59
  FATIGUE: "FATIGUE";
26
60
  PINCH: "PINCH";
27
61
  }>;
62
+ bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
28
63
  fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
29
- fatigueBandsBySet: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof EnergyBand>>>;
30
64
  conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
31
65
  type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
32
66
  }, z.core.$strip>, z.ZodObject<{
@@ -54,6 +88,7 @@ export declare const TacticsInputSchema: z.ZodObject<{
54
88
  score: z.ZodNumber;
55
89
  }, z.core.$strip>], "type">>>;
56
90
  conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
91
+ starter: z.ZodCustom<Player, Player>;
57
92
  }, z.core.$strip>>>;
58
93
  substitutionBand: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<typeof EnergyBand>, z.ZodLiteral<"NEVER">]>>;
59
94
  rotationSystem: z.ZodDefault<z.ZodEnum<typeof RotationSystemEnum>>;
@@ -26,15 +26,49 @@ export declare const TeamInputSchema: z.ZodObject<{
26
26
  receiveRotationOffset: z.ZodDefault<z.ZodBoolean>;
27
27
  pinchServerSubs: z.ZodCustom<Map<Player, Player>, Map<Player, Player>>;
28
28
  designatedSubs: z.ZodDefault<z.ZodArray<z.ZodObject<{
29
- starter: z.ZodCustom<Player, Player>;
30
- bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
29
+ sets: z.ZodOptional<z.ZodArray<z.ZodObject<{
30
+ mode: z.ZodEnum<{
31
+ NEVER: "NEVER";
32
+ FATIGUE: "FATIGUE";
33
+ PINCH: "PINCH";
34
+ }>;
35
+ bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
36
+ fatigueBand: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
37
+ conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
38
+ type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
39
+ }, z.core.$strip>, z.ZodObject<{
40
+ type: z.ZodLiteral<import("..").PinchConditionType.TEAM_SET_POINT>;
41
+ margin: z.ZodNumber;
42
+ opponent: z.ZodEnum<typeof import("..").OpponentRelation>;
43
+ }, z.core.$strip>, z.ZodObject<{
44
+ type: z.ZodLiteral<import("..").PinchConditionType.OPPONENT_SET_POINT>;
45
+ margin: z.ZodNumber;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ type: z.ZodLiteral<import("..").PinchConditionType.SCORE_DIFF>;
48
+ direction: z.ZodEnum<typeof import("..").ScoreDirection>;
49
+ points: z.ZodNumber;
50
+ }, z.core.$strip>, z.ZodObject<{
51
+ type: z.ZodLiteral<import("..").PinchConditionType.AFTER_ROTATIONS>;
52
+ rotations: z.ZodNumber;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ type: z.ZodLiteral<import("..").PinchConditionType.FROM_SET>;
55
+ set: z.ZodNumber;
56
+ }, z.core.$strip>, z.ZodObject<{
57
+ type: z.ZodLiteral<import("..").PinchConditionType.MIN_OWN_SCORE>;
58
+ score: z.ZodNumber;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ type: z.ZodLiteral<import("..").PinchConditionType.MIN_OPPONENT_SCORE>;
61
+ score: z.ZodNumber;
62
+ }, z.core.$strip>], "type">>>;
63
+ conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
64
+ }, z.core.$strip>>>;
31
65
  mode: z.ZodEnum<{
32
66
  NEVER: "NEVER";
33
67
  FATIGUE: "FATIGUE";
34
68
  PINCH: "PINCH";
35
69
  }>;
70
+ bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
36
71
  fatigueBand: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
37
- fatigueBandsBySet: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("..").EnergyBand>>>;
38
72
  conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
39
73
  type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
40
74
  }, z.core.$strip>, z.ZodObject<{
@@ -62,6 +96,7 @@ export declare const TeamInputSchema: z.ZodObject<{
62
96
  score: z.ZodNumber;
63
97
  }, z.core.$strip>], "type">>>;
64
98
  conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
99
+ starter: z.ZodCustom<Player, Player>;
65
100
  }, z.core.$strip>>>;
66
101
  substitutionBand: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<typeof import("..").EnergyBand>, z.ZodLiteral<"NEVER">]>>;
67
102
  rotationSystem: z.ZodDefault<z.ZodEnum<typeof import("..").RotationSystemEnum>>;
@@ -56,14 +56,21 @@ export interface StartingLineup {
56
56
  [CourtPosition.LIBERO_ZONE]?: string;
57
57
  bench: string[];
58
58
  }
59
+ export interface ApiSetSubConfig {
60
+ mode: SubMode;
61
+ benchId?: string;
62
+ fatigueBand?: EnergyBand;
63
+ conditions?: PinchCondition[];
64
+ conditionLogic?: ConditionLogic;
65
+ }
59
66
  export interface ApiDesignatedSub {
60
67
  starterId: string;
61
68
  benchId?: string;
62
69
  mode: SubMode;
63
70
  fatigueBand?: EnergyBand;
64
- fatigueBandsBySet?: EnergyBand[];
65
71
  conditions?: PinchCondition[];
66
72
  conditionLogic?: ConditionLogic;
73
+ sets?: ApiSetSubConfig[];
67
74
  }
68
75
  export interface ApiOffensivePreference {
69
76
  rotation: number;
@@ -13,15 +13,22 @@ export interface TacticsLineupAttributes {
13
13
  bench: PlayerId[];
14
14
  }
15
15
  export type PinchServerSubsAttributes = Record<PlayerId, PlayerId>;
16
+ export interface SetSubConfigAttributes {
17
+ mode: SubMode;
18
+ benchId?: PlayerId;
19
+ fatigueBand?: EnergyBand;
20
+ conditions?: PinchCondition[];
21
+ conditionLogic?: ConditionLogic;
22
+ }
16
23
  export interface DesignatedSubAttributes {
17
24
  starterId: PlayerId;
18
25
  benchId?: PlayerId;
19
26
  mode?: SubMode;
20
27
  isPinchServer?: boolean;
21
28
  fatigueBand?: SubBand;
22
- fatigueBandsBySet?: EnergyBand[];
23
29
  conditions?: PinchCondition[];
24
30
  conditionLogic?: ConditionLogic;
31
+ sets?: SetSubConfigAttributes[];
25
32
  }
26
33
  export interface OffensivePreferenceAttributes {
27
34
  rotation: number;
@@ -55,9 +55,15 @@ function transformToAttributes(tactics, teamId) {
55
55
  benchId: ds.bench?.id,
56
56
  mode: ds.mode,
57
57
  fatigueBand: ds.fatigueBand,
58
- fatigueBandsBySet: ds.fatigueBandsBySet,
59
58
  conditions: ds.conditions,
60
- conditionLogic: ds.conditionLogic
59
+ conditionLogic: ds.conditionLogic,
60
+ sets: ds.sets?.map(s => ({
61
+ mode: s.mode,
62
+ benchId: s.bench?.id,
63
+ fatigueBand: s.fatigueBand,
64
+ conditions: s.conditions,
65
+ conditionLogic: s.conditionLogic
66
+ }))
61
67
  })),
62
68
  rotation_system: tactics.rotationSystem,
63
69
  designated_setters: tactics.designatedSetters.map((s) => s.id),
@@ -87,9 +93,15 @@ function transformToObject(model, roster) {
87
93
  bench: d.benchId != null ? findPlayer(d.benchId, roster) : undefined,
88
94
  mode: subModeFromAttributes(d),
89
95
  fatigueBand: d.fatigueBand === 'NEVER' ? undefined : d.fatigueBand,
90
- fatigueBandsBySet: d.fatigueBandsBySet,
91
96
  conditions: d.conditions,
92
- conditionLogic: d.conditionLogic
97
+ conditionLogic: d.conditionLogic,
98
+ sets: d.sets?.map(s => ({
99
+ mode: s.mode,
100
+ bench: s.benchId != null ? findPlayer(s.benchId, roster) : undefined,
101
+ fatigueBand: s.fatigueBand,
102
+ conditions: s.conditions,
103
+ conditionLogic: s.conditionLogic
104
+ }))
93
105
  })),
94
106
  rotationSystem: model.rotation_system,
95
107
  designatedSetters: (model.designated_setters ?? []).map((id) => findPlayer(id, roster)),
@@ -1,12 +1,14 @@
1
1
  import { Player } from '../player';
2
2
  import { EnergyBand, SubMode } from './energy-band';
3
3
  import { ConditionLogic, PinchCondition } from './pinch-condition';
4
- export interface DesignatedSub {
5
- readonly starter: Player;
6
- readonly bench?: Player;
4
+ export interface SetSubConfig {
7
5
  readonly mode: SubMode;
6
+ readonly bench?: Player;
8
7
  readonly fatigueBand?: EnergyBand;
9
- readonly fatigueBandsBySet?: EnergyBand[];
10
8
  readonly conditions?: PinchCondition[];
11
9
  readonly conditionLogic?: ConditionLogic;
12
10
  }
11
+ export interface DesignatedSub extends SetSubConfig {
12
+ readonly starter: Player;
13
+ readonly sets?: SetSubConfig[];
14
+ }
@@ -35,16 +35,86 @@ export declare const SubModeSchema: z.ZodEnum<{
35
35
  FATIGUE: "FATIGUE";
36
36
  PINCH: "PINCH";
37
37
  }>;
38
- export declare const DesignatedSubSchema: z.ZodObject<{
39
- starter: z.ZodCustom<Player, Player>;
38
+ export declare const SetSubConfigSchema: z.ZodObject<{
39
+ mode: z.ZodEnum<{
40
+ NEVER: "NEVER";
41
+ FATIGUE: "FATIGUE";
42
+ PINCH: "PINCH";
43
+ }>;
40
44
  bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
45
+ fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
46
+ conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
47
+ type: z.ZodLiteral<PinchConditionType.ASAP>;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ type: z.ZodLiteral<PinchConditionType.TEAM_SET_POINT>;
50
+ margin: z.ZodNumber;
51
+ opponent: z.ZodEnum<typeof OpponentRelation>;
52
+ }, z.core.$strip>, z.ZodObject<{
53
+ type: z.ZodLiteral<PinchConditionType.OPPONENT_SET_POINT>;
54
+ margin: z.ZodNumber;
55
+ }, z.core.$strip>, z.ZodObject<{
56
+ type: z.ZodLiteral<PinchConditionType.SCORE_DIFF>;
57
+ direction: z.ZodEnum<typeof ScoreDirection>;
58
+ points: z.ZodNumber;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ type: z.ZodLiteral<PinchConditionType.AFTER_ROTATIONS>;
61
+ rotations: z.ZodNumber;
62
+ }, z.core.$strip>, z.ZodObject<{
63
+ type: z.ZodLiteral<PinchConditionType.FROM_SET>;
64
+ set: z.ZodNumber;
65
+ }, z.core.$strip>, z.ZodObject<{
66
+ type: z.ZodLiteral<PinchConditionType.MIN_OWN_SCORE>;
67
+ score: z.ZodNumber;
68
+ }, z.core.$strip>, z.ZodObject<{
69
+ type: z.ZodLiteral<PinchConditionType.MIN_OPPONENT_SCORE>;
70
+ score: z.ZodNumber;
71
+ }, z.core.$strip>], "type">>>;
72
+ conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
73
+ }, z.core.$strip>;
74
+ export declare const DesignatedSubSchema: z.ZodObject<{
75
+ sets: z.ZodOptional<z.ZodArray<z.ZodObject<{
76
+ mode: z.ZodEnum<{
77
+ NEVER: "NEVER";
78
+ FATIGUE: "FATIGUE";
79
+ PINCH: "PINCH";
80
+ }>;
81
+ bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
82
+ fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
83
+ conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
84
+ type: z.ZodLiteral<PinchConditionType.ASAP>;
85
+ }, z.core.$strip>, z.ZodObject<{
86
+ type: z.ZodLiteral<PinchConditionType.TEAM_SET_POINT>;
87
+ margin: z.ZodNumber;
88
+ opponent: z.ZodEnum<typeof OpponentRelation>;
89
+ }, z.core.$strip>, z.ZodObject<{
90
+ type: z.ZodLiteral<PinchConditionType.OPPONENT_SET_POINT>;
91
+ margin: z.ZodNumber;
92
+ }, z.core.$strip>, z.ZodObject<{
93
+ type: z.ZodLiteral<PinchConditionType.SCORE_DIFF>;
94
+ direction: z.ZodEnum<typeof ScoreDirection>;
95
+ points: z.ZodNumber;
96
+ }, z.core.$strip>, z.ZodObject<{
97
+ type: z.ZodLiteral<PinchConditionType.AFTER_ROTATIONS>;
98
+ rotations: z.ZodNumber;
99
+ }, z.core.$strip>, z.ZodObject<{
100
+ type: z.ZodLiteral<PinchConditionType.FROM_SET>;
101
+ set: z.ZodNumber;
102
+ }, z.core.$strip>, z.ZodObject<{
103
+ type: z.ZodLiteral<PinchConditionType.MIN_OWN_SCORE>;
104
+ score: z.ZodNumber;
105
+ }, z.core.$strip>, z.ZodObject<{
106
+ type: z.ZodLiteral<PinchConditionType.MIN_OPPONENT_SCORE>;
107
+ score: z.ZodNumber;
108
+ }, z.core.$strip>], "type">>>;
109
+ conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
110
+ }, z.core.$strip>>>;
41
111
  mode: z.ZodEnum<{
42
112
  NEVER: "NEVER";
43
113
  FATIGUE: "FATIGUE";
44
114
  PINCH: "PINCH";
45
115
  }>;
116
+ bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
46
117
  fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
47
- fatigueBandsBySet: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof EnergyBand>>>;
48
118
  conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
49
119
  type: z.ZodLiteral<PinchConditionType.ASAP>;
50
120
  }, z.core.$strip>, z.ZodObject<{
@@ -72,4 +142,5 @@ export declare const DesignatedSubSchema: z.ZodObject<{
72
142
  score: z.ZodNumber;
73
143
  }, z.core.$strip>], "type">>>;
74
144
  conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
145
+ starter: z.ZodCustom<Player, Player>;
75
146
  }, z.core.$strip>;
@@ -18,22 +18,33 @@ export const PinchConditionSchema = z.discriminatedUnion('type', [
18
18
  ]);
19
19
  export const ConditionLogicSchema = z.union([z.literal('ALL'), z.literal('ANY')]);
20
20
  export const SubModeSchema = z.enum(['FATIGUE', 'PINCH', 'NEVER']);
21
- export const DesignatedSubSchema = z.object({
22
- starter: playerInstanceSchema,
23
- bench: playerInstanceSchema.optional(),
21
+ // Fields shared by the all-sets config and each per-set config.
22
+ const setSubConfigShape = {
24
23
  mode: SubModeSchema,
24
+ bench: playerInstanceSchema.optional(),
25
25
  fatigueBand: z.nativeEnum(EnergyBand).optional(),
26
- fatigueBandsBySet: z.array(z.nativeEnum(EnergyBand)).max(5).optional(),
27
26
  conditions: z.array(PinchConditionSchema).optional(),
28
27
  conditionLogic: ConditionLogicSchema.optional()
29
- }).superRefine((data, ctx) => {
30
- if (data.mode === 'PINCH') {
31
- // Pinch mode needs a designated bench player (the server) and at least one condition.
32
- if (data.bench == null) {
33
- ctx.addIssue({ code: 'custom', message: 'PINCH_SERVER_REQUIRES_BENCH', path: ['bench'] });
34
- }
35
- if (data.conditions == null || data.conditions.length === 0) {
36
- ctx.addIssue({ code: 'custom', message: 'PINCH_SERVER_REQUIRES_CONDITIONS', path: ['conditions'] });
37
- }
28
+ };
29
+ // Pinch mode needs a designated bench player (the server) and at least one condition.
30
+ function refinePinch(data, ctx) {
31
+ if (data.mode !== 'PINCH')
32
+ return;
33
+ if (data.bench == null) {
34
+ ctx.addIssue({ code: 'custom', message: 'PINCH_SERVER_REQUIRES_BENCH', path: ['bench'] });
38
35
  }
36
+ if (data.conditions == null || data.conditions.length === 0) {
37
+ ctx.addIssue({ code: 'custom', message: 'PINCH_SERVER_REQUIRES_CONDITIONS', path: ['conditions'] });
38
+ }
39
+ }
40
+ export const SetSubConfigSchema = z.object(setSubConfigShape).superRefine(refinePinch);
41
+ export const DesignatedSubSchema = z.object({
42
+ starter: playerInstanceSchema,
43
+ ...setSubConfigShape,
44
+ // Optional per-set overrides (index 0 = set 1 ... index 4 = set 5); absent => the flat config for all sets.
45
+ sets: z.array(SetSubConfigSchema).max(5).optional()
46
+ }).superRefine((data, ctx) => {
47
+ // Per-set configs are each validated by SetSubConfigSchema; only validate the flat config when none are set.
48
+ if (data.sets == null)
49
+ refinePinch(data, ctx);
39
50
  });
@@ -131,4 +131,59 @@ describe('DesignatedSubSchema', () => {
131
131
  });
132
132
  expect(res.success).toBe(false);
133
133
  });
134
+ it('accepts an entry with per-set configs (mode/bench/band/conditions vary per set)', () => {
135
+ const res = DesignatedSubSchema.safeParse({
136
+ starter,
137
+ mode: 'FATIGUE',
138
+ fatigueBand: EnergyBand.TIRED,
139
+ sets: [
140
+ { mode: 'FATIGUE', fatigueBand: EnergyBand.WORN },
141
+ { mode: 'NEVER' },
142
+ { mode: 'PINCH', bench, conditions: [{ type: PinchConditionType.ASAP }] },
143
+ { mode: 'FATIGUE', fatigueBand: EnergyBand.EXHAUSTED },
144
+ { mode: 'FATIGUE' }
145
+ ]
146
+ });
147
+ expect(res.success).toBe(true);
148
+ });
149
+ it('rejects a per-set pinch config without a bench server', () => {
150
+ const res = DesignatedSubSchema.safeParse({
151
+ starter,
152
+ mode: 'FATIGUE',
153
+ sets: [{ mode: 'PINCH', conditions: [{ type: PinchConditionType.ASAP }] }]
154
+ });
155
+ expect(res.success).toBe(false);
156
+ if (!res.success) {
157
+ expect(res.error.issues.some(issue => issue.message === 'PINCH_SERVER_REQUIRES_BENCH')).toBe(true);
158
+ }
159
+ });
160
+ it('rejects a per-set pinch config with no conditions', () => {
161
+ const res = DesignatedSubSchema.safeParse({
162
+ starter,
163
+ mode: 'FATIGUE',
164
+ sets: [{ mode: 'PINCH', bench, conditions: [] }]
165
+ });
166
+ expect(res.success).toBe(false);
167
+ if (!res.success) {
168
+ expect(res.error.issues.some(issue => issue.message === 'PINCH_SERVER_REQUIRES_CONDITIONS')).toBe(true);
169
+ }
170
+ });
171
+ it('does not pinch-validate the flat config when per-set configs are present', () => {
172
+ // Flat mode is PINCH but missing bench/conditions; because `sets` is present, only each set is
173
+ // validated, so the flat config is ignored and this passes.
174
+ const res = DesignatedSubSchema.safeParse({
175
+ starter,
176
+ mode: 'PINCH',
177
+ sets: [{ mode: 'FATIGUE', fatigueBand: EnergyBand.TIRED }]
178
+ });
179
+ expect(res.success).toBe(true);
180
+ });
181
+ it('rejects more than five per-set configs', () => {
182
+ const res = DesignatedSubSchema.safeParse({
183
+ starter,
184
+ mode: 'FATIGUE',
185
+ sets: Array.from({ length: 6 }, () => ({ mode: 'FATIGUE' }))
186
+ });
187
+ expect(res.success).toBe(false);
188
+ });
134
189
  });
@@ -18,15 +18,49 @@ export declare const TacticsInputSchema: z.ZodObject<{
18
18
  receiveRotationOffset: z.ZodDefault<z.ZodBoolean>;
19
19
  pinchServerSubs: z.ZodCustom<Map<Player, Player>, Map<Player, Player>>;
20
20
  designatedSubs: z.ZodDefault<z.ZodArray<z.ZodObject<{
21
- starter: z.ZodCustom<Player, Player>;
22
- bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
21
+ sets: z.ZodOptional<z.ZodArray<z.ZodObject<{
22
+ mode: z.ZodEnum<{
23
+ NEVER: "NEVER";
24
+ FATIGUE: "FATIGUE";
25
+ PINCH: "PINCH";
26
+ }>;
27
+ bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
28
+ fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
29
+ conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
30
+ type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
31
+ }, z.core.$strip>, z.ZodObject<{
32
+ type: z.ZodLiteral<import("..").PinchConditionType.TEAM_SET_POINT>;
33
+ margin: z.ZodNumber;
34
+ opponent: z.ZodEnum<typeof import("..").OpponentRelation>;
35
+ }, z.core.$strip>, z.ZodObject<{
36
+ type: z.ZodLiteral<import("..").PinchConditionType.OPPONENT_SET_POINT>;
37
+ margin: z.ZodNumber;
38
+ }, z.core.$strip>, z.ZodObject<{
39
+ type: z.ZodLiteral<import("..").PinchConditionType.SCORE_DIFF>;
40
+ direction: z.ZodEnum<typeof import("..").ScoreDirection>;
41
+ points: z.ZodNumber;
42
+ }, z.core.$strip>, z.ZodObject<{
43
+ type: z.ZodLiteral<import("..").PinchConditionType.AFTER_ROTATIONS>;
44
+ rotations: z.ZodNumber;
45
+ }, z.core.$strip>, z.ZodObject<{
46
+ type: z.ZodLiteral<import("..").PinchConditionType.FROM_SET>;
47
+ set: z.ZodNumber;
48
+ }, z.core.$strip>, z.ZodObject<{
49
+ type: z.ZodLiteral<import("..").PinchConditionType.MIN_OWN_SCORE>;
50
+ score: z.ZodNumber;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ type: z.ZodLiteral<import("..").PinchConditionType.MIN_OPPONENT_SCORE>;
53
+ score: z.ZodNumber;
54
+ }, z.core.$strip>], "type">>>;
55
+ conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
56
+ }, z.core.$strip>>>;
23
57
  mode: z.ZodEnum<{
24
58
  NEVER: "NEVER";
25
59
  FATIGUE: "FATIGUE";
26
60
  PINCH: "PINCH";
27
61
  }>;
62
+ bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
28
63
  fatigueBand: z.ZodOptional<z.ZodEnum<typeof EnergyBand>>;
29
- fatigueBandsBySet: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof EnergyBand>>>;
30
64
  conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
31
65
  type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
32
66
  }, z.core.$strip>, z.ZodObject<{
@@ -54,6 +88,7 @@ export declare const TacticsInputSchema: z.ZodObject<{
54
88
  score: z.ZodNumber;
55
89
  }, z.core.$strip>], "type">>>;
56
90
  conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
91
+ starter: z.ZodCustom<Player, Player>;
57
92
  }, z.core.$strip>>>;
58
93
  substitutionBand: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<typeof EnergyBand>, z.ZodLiteral<"NEVER">]>>;
59
94
  rotationSystem: z.ZodDefault<z.ZodEnum<typeof RotationSystemEnum>>;
@@ -26,15 +26,49 @@ export declare const TeamInputSchema: z.ZodObject<{
26
26
  receiveRotationOffset: z.ZodDefault<z.ZodBoolean>;
27
27
  pinchServerSubs: z.ZodCustom<Map<Player, Player>, Map<Player, Player>>;
28
28
  designatedSubs: z.ZodDefault<z.ZodArray<z.ZodObject<{
29
- starter: z.ZodCustom<Player, Player>;
30
- bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
29
+ sets: z.ZodOptional<z.ZodArray<z.ZodObject<{
30
+ mode: z.ZodEnum<{
31
+ NEVER: "NEVER";
32
+ FATIGUE: "FATIGUE";
33
+ PINCH: "PINCH";
34
+ }>;
35
+ bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
36
+ fatigueBand: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
37
+ conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
38
+ type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
39
+ }, z.core.$strip>, z.ZodObject<{
40
+ type: z.ZodLiteral<import("..").PinchConditionType.TEAM_SET_POINT>;
41
+ margin: z.ZodNumber;
42
+ opponent: z.ZodEnum<typeof import("..").OpponentRelation>;
43
+ }, z.core.$strip>, z.ZodObject<{
44
+ type: z.ZodLiteral<import("..").PinchConditionType.OPPONENT_SET_POINT>;
45
+ margin: z.ZodNumber;
46
+ }, z.core.$strip>, z.ZodObject<{
47
+ type: z.ZodLiteral<import("..").PinchConditionType.SCORE_DIFF>;
48
+ direction: z.ZodEnum<typeof import("..").ScoreDirection>;
49
+ points: z.ZodNumber;
50
+ }, z.core.$strip>, z.ZodObject<{
51
+ type: z.ZodLiteral<import("..").PinchConditionType.AFTER_ROTATIONS>;
52
+ rotations: z.ZodNumber;
53
+ }, z.core.$strip>, z.ZodObject<{
54
+ type: z.ZodLiteral<import("..").PinchConditionType.FROM_SET>;
55
+ set: z.ZodNumber;
56
+ }, z.core.$strip>, z.ZodObject<{
57
+ type: z.ZodLiteral<import("..").PinchConditionType.MIN_OWN_SCORE>;
58
+ score: z.ZodNumber;
59
+ }, z.core.$strip>, z.ZodObject<{
60
+ type: z.ZodLiteral<import("..").PinchConditionType.MIN_OPPONENT_SCORE>;
61
+ score: z.ZodNumber;
62
+ }, z.core.$strip>], "type">>>;
63
+ conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
64
+ }, z.core.$strip>>>;
31
65
  mode: z.ZodEnum<{
32
66
  NEVER: "NEVER";
33
67
  FATIGUE: "FATIGUE";
34
68
  PINCH: "PINCH";
35
69
  }>;
70
+ bench: z.ZodOptional<z.ZodCustom<Player, Player>>;
36
71
  fatigueBand: z.ZodOptional<z.ZodEnum<typeof import("..").EnergyBand>>;
37
- fatigueBandsBySet: z.ZodOptional<z.ZodArray<z.ZodEnum<typeof import("..").EnergyBand>>>;
38
72
  conditions: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
39
73
  type: z.ZodLiteral<import("..").PinchConditionType.ASAP>;
40
74
  }, z.core.$strip>, z.ZodObject<{
@@ -62,6 +96,7 @@ export declare const TeamInputSchema: z.ZodObject<{
62
96
  score: z.ZodNumber;
63
97
  }, z.core.$strip>], "type">>>;
64
98
  conditionLogic: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"ALL">, z.ZodLiteral<"ANY">]>>;
99
+ starter: z.ZodCustom<Player, Player>;
65
100
  }, z.core.$strip>>>;
66
101
  substitutionBand: z.ZodDefault<z.ZodUnion<readonly [z.ZodEnum<typeof import("..").EnergyBand>, z.ZodLiteral<"NEVER">]>>;
67
102
  rotationSystem: z.ZodDefault<z.ZodEnum<typeof import("..").RotationSystemEnum>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.398",
3
+ "version": "0.0.399",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",