volleyballsimtypes 0.0.462 → 0.0.464

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 (153) hide show
  1. package/dist/cjs/src/api/index.d.ts +14 -1
  2. package/dist/cjs/src/data/init-models.js +17 -0
  3. package/dist/cjs/src/data/models/currency-transaction.d.ts +4 -2
  4. package/dist/cjs/src/data/models/currency-transaction.js +2 -0
  5. package/dist/cjs/src/data/models/index.d.ts +3 -0
  6. package/dist/cjs/src/data/models/index.js +3 -0
  7. package/dist/cjs/src/data/models/match-preset.d.ts +28 -0
  8. package/dist/cjs/src/data/models/match-preset.js +65 -0
  9. package/dist/cjs/src/data/models/match-set.d.ts +2 -0
  10. package/dist/cjs/src/data/models/match-set.js +5 -0
  11. package/dist/cjs/src/data/models/match.d.ts +5 -2
  12. package/dist/cjs/src/data/models/match.js +4 -0
  13. package/dist/cjs/src/data/models/physician.d.ts +25 -0
  14. package/dist/cjs/src/data/models/physician.js +57 -0
  15. package/dist/cjs/src/data/models/physiotherapist.d.ts +25 -0
  16. package/dist/cjs/src/data/models/physiotherapist.js +57 -0
  17. package/dist/cjs/src/data/models/player.d.ts +8 -0
  18. package/dist/cjs/src/data/models/player.js +17 -0
  19. package/dist/cjs/src/data/models/tactics.d.ts +9 -1
  20. package/dist/cjs/src/data/models/tactics.js +9 -0
  21. package/dist/cjs/src/data/transformers/division.js +1 -1
  22. package/dist/cjs/src/data/transformers/lineup-preset.js +7 -1
  23. package/dist/cjs/src/data/transformers/lineup-preset.test.js +15 -2
  24. package/dist/cjs/src/data/transformers/match-preset-override.test.d.ts +1 -0
  25. package/dist/cjs/src/data/transformers/match-preset-override.test.js +275 -0
  26. package/dist/cjs/src/data/transformers/match-set.js +2 -0
  27. package/dist/cjs/src/data/transformers/match.d.ts +2 -1
  28. package/dist/cjs/src/data/transformers/match.js +21 -5
  29. package/dist/cjs/src/data/transformers/player.js +15 -1
  30. package/dist/cjs/src/data/transformers/qualifier.js +1 -1
  31. package/dist/cjs/src/data/transformers/rally-event-injury.test.d.ts +1 -0
  32. package/dist/cjs/src/data/transformers/rally-event-injury.test.js +33 -0
  33. package/dist/cjs/src/data/transformers/rally-event.d.ts +1 -0
  34. package/dist/cjs/src/data/transformers/rally-event.js +4 -1
  35. package/dist/cjs/src/data/transformers/season.js +1 -1
  36. package/dist/cjs/src/data/transformers/tactics.d.ts +3 -2
  37. package/dist/cjs/src/data/transformers/tactics.js +106 -3
  38. package/dist/cjs/src/data/transformers/team.d.ts +7 -1
  39. package/dist/cjs/src/data/transformers/team.js +22 -4
  40. package/dist/cjs/src/data/transformers/tournament.js +1 -1
  41. package/dist/cjs/src/service/event/schemas/substitution.z.d.ts +1 -0
  42. package/dist/cjs/src/service/event/schemas/substitution.z.js +2 -1
  43. package/dist/cjs/src/service/event/substitution.d.ts +1 -0
  44. package/dist/cjs/src/service/event/substitution.js +4 -2
  45. package/dist/cjs/src/service/match/match-set-forfeit.test.d.ts +1 -0
  46. package/dist/cjs/src/service/match/match-set-forfeit.test.js +76 -0
  47. package/dist/cjs/src/service/match/match-set.d.ts +8 -0
  48. package/dist/cjs/src/service/match/match-set.js +23 -1
  49. package/dist/cjs/src/service/match/match.d.ts +2 -0
  50. package/dist/cjs/src/service/match/match.js +2 -1
  51. package/dist/cjs/src/service/match/schemas/match-set.z.d.ts +1 -0
  52. package/dist/cjs/src/service/match/schemas/match-set.z.js +30 -2
  53. package/dist/cjs/src/service/match/schemas/match.z.d.ts +4 -0
  54. package/dist/cjs/src/service/match/schemas/match.z.js +4 -1
  55. package/dist/cjs/src/service/player/index.d.ts +1 -0
  56. package/dist/cjs/src/service/player/index.js +1 -0
  57. package/dist/cjs/src/service/player/injury.d.ts +14 -0
  58. package/dist/cjs/src/service/player/injury.js +39 -0
  59. package/dist/cjs/src/service/player/injury.test.d.ts +1 -0
  60. package/dist/cjs/src/service/player/injury.test.js +78 -0
  61. package/dist/cjs/src/service/player/player-generator.js +3 -1
  62. package/dist/cjs/src/service/player/player.d.ts +3 -0
  63. package/dist/cjs/src/service/player/player.js +3 -1
  64. package/dist/cjs/src/service/player/schemas/player.z.d.ts +6 -0
  65. package/dist/cjs/src/service/player/schemas/player.z.js +7 -0
  66. package/dist/cjs/src/service/team/index.d.ts +1 -0
  67. package/dist/cjs/src/service/team/index.js +1 -0
  68. package/dist/cjs/src/service/team/reserve-priority.d.ts +6 -0
  69. package/dist/cjs/src/service/team/reserve-priority.js +2 -0
  70. package/dist/cjs/src/service/team/schemas/reserve-priority.z.test.d.ts +1 -0
  71. package/dist/cjs/src/service/team/schemas/reserve-priority.z.test.js +125 -0
  72. package/dist/cjs/src/service/team/schemas/tactics.z.d.ts +5 -0
  73. package/dist/cjs/src/service/team/schemas/tactics.z.js +32 -1
  74. package/dist/cjs/src/service/team/schemas/team.z.d.ts +5 -0
  75. package/dist/cjs/src/service/team/tactics.d.ts +5 -0
  76. package/dist/cjs/src/service/team/tactics.js +3 -1
  77. package/dist/esm/src/api/index.d.ts +14 -1
  78. package/dist/esm/src/data/init-models.js +18 -1
  79. package/dist/esm/src/data/models/currency-transaction.d.ts +4 -2
  80. package/dist/esm/src/data/models/currency-transaction.js +2 -0
  81. package/dist/esm/src/data/models/index.d.ts +3 -0
  82. package/dist/esm/src/data/models/index.js +3 -0
  83. package/dist/esm/src/data/models/match-preset.d.ts +28 -0
  84. package/dist/esm/src/data/models/match-preset.js +61 -0
  85. package/dist/esm/src/data/models/match-set.d.ts +2 -0
  86. package/dist/esm/src/data/models/match-set.js +5 -0
  87. package/dist/esm/src/data/models/match.d.ts +5 -2
  88. package/dist/esm/src/data/models/match.js +4 -0
  89. package/dist/esm/src/data/models/physician.d.ts +25 -0
  90. package/dist/esm/src/data/models/physician.js +53 -0
  91. package/dist/esm/src/data/models/physiotherapist.d.ts +25 -0
  92. package/dist/esm/src/data/models/physiotherapist.js +53 -0
  93. package/dist/esm/src/data/models/player.d.ts +8 -0
  94. package/dist/esm/src/data/models/player.js +17 -0
  95. package/dist/esm/src/data/models/tactics.d.ts +9 -1
  96. package/dist/esm/src/data/models/tactics.js +9 -0
  97. package/dist/esm/src/data/transformers/division.js +1 -1
  98. package/dist/esm/src/data/transformers/lineup-preset.js +7 -1
  99. package/dist/esm/src/data/transformers/lineup-preset.test.js +15 -2
  100. package/dist/esm/src/data/transformers/match-preset-override.test.d.ts +1 -0
  101. package/dist/esm/src/data/transformers/match-preset-override.test.js +273 -0
  102. package/dist/esm/src/data/transformers/match-set.js +2 -0
  103. package/dist/esm/src/data/transformers/match.d.ts +2 -1
  104. package/dist/esm/src/data/transformers/match.js +21 -5
  105. package/dist/esm/src/data/transformers/player.js +15 -1
  106. package/dist/esm/src/data/transformers/qualifier.js +1 -1
  107. package/dist/esm/src/data/transformers/rally-event-injury.test.d.ts +1 -0
  108. package/dist/esm/src/data/transformers/rally-event-injury.test.js +31 -0
  109. package/dist/esm/src/data/transformers/rally-event.d.ts +1 -0
  110. package/dist/esm/src/data/transformers/rally-event.js +4 -1
  111. package/dist/esm/src/data/transformers/season.js +1 -1
  112. package/dist/esm/src/data/transformers/tactics.d.ts +3 -2
  113. package/dist/esm/src/data/transformers/tactics.js +106 -4
  114. package/dist/esm/src/data/transformers/team.d.ts +7 -1
  115. package/dist/esm/src/data/transformers/team.js +20 -5
  116. package/dist/esm/src/data/transformers/tournament.js +1 -1
  117. package/dist/esm/src/service/event/schemas/substitution.z.d.ts +1 -0
  118. package/dist/esm/src/service/event/schemas/substitution.z.js +2 -1
  119. package/dist/esm/src/service/event/substitution.d.ts +1 -0
  120. package/dist/esm/src/service/event/substitution.js +4 -2
  121. package/dist/esm/src/service/match/match-set-forfeit.test.d.ts +1 -0
  122. package/dist/esm/src/service/match/match-set-forfeit.test.js +74 -0
  123. package/dist/esm/src/service/match/match-set.d.ts +8 -0
  124. package/dist/esm/src/service/match/match-set.js +23 -1
  125. package/dist/esm/src/service/match/match.d.ts +2 -0
  126. package/dist/esm/src/service/match/match.js +2 -1
  127. package/dist/esm/src/service/match/schemas/match-set.z.d.ts +1 -0
  128. package/dist/esm/src/service/match/schemas/match-set.z.js +30 -2
  129. package/dist/esm/src/service/match/schemas/match.z.d.ts +4 -0
  130. package/dist/esm/src/service/match/schemas/match.z.js +4 -1
  131. package/dist/esm/src/service/player/index.d.ts +1 -0
  132. package/dist/esm/src/service/player/index.js +1 -0
  133. package/dist/esm/src/service/player/injury.d.ts +14 -0
  134. package/dist/esm/src/service/player/injury.js +33 -0
  135. package/dist/esm/src/service/player/injury.test.d.ts +1 -0
  136. package/dist/esm/src/service/player/injury.test.js +76 -0
  137. package/dist/esm/src/service/player/player-generator.js +3 -1
  138. package/dist/esm/src/service/player/player.d.ts +3 -0
  139. package/dist/esm/src/service/player/player.js +3 -1
  140. package/dist/esm/src/service/player/schemas/player.z.d.ts +6 -0
  141. package/dist/esm/src/service/player/schemas/player.z.js +7 -0
  142. package/dist/esm/src/service/team/index.d.ts +1 -0
  143. package/dist/esm/src/service/team/index.js +1 -0
  144. package/dist/esm/src/service/team/reserve-priority.d.ts +6 -0
  145. package/dist/esm/src/service/team/reserve-priority.js +1 -0
  146. package/dist/esm/src/service/team/schemas/reserve-priority.z.test.d.ts +1 -0
  147. package/dist/esm/src/service/team/schemas/reserve-priority.z.test.js +123 -0
  148. package/dist/esm/src/service/team/schemas/tactics.z.d.ts +5 -0
  149. package/dist/esm/src/service/team/schemas/tactics.z.js +32 -1
  150. package/dist/esm/src/service/team/schemas/team.z.d.ts +5 -0
  151. package/dist/esm/src/service/team/tactics.d.ts +5 -0
  152. package/dist/esm/src/service/team/tactics.js +3 -1
  153. package/package.json +1 -1
@@ -49,11 +49,16 @@ export type Match = Omit<DataProps<_Match>, 'sets' | 'homeTeam' | 'awayTeam' | '
49
49
  awayForm?: MatchForm[];
50
50
  isFriendly?: boolean;
51
51
  detailUnavailable?: boolean;
52
+ selectedPresetId?: string;
52
53
  };
53
54
  export type RallyEvent = DataProps<_RallyEvent> & {
54
55
  teamId?: string;
55
56
  };
56
- export type Player = Omit<DataProps<_Player>, 'stats' | 'birthAge' | 'birthIteration' | 'declineProfile' | 'nickname'> & {
57
+ export interface ApiPlayerInjuryStatus {
58
+ severity: number;
59
+ injuredUntil: string;
60
+ }
61
+ export type Player = Omit<DataProps<_Player>, 'stats' | 'birthAge' | 'birthIteration' | 'declineProfile' | 'nickname' | 'injuryProneProfile' | 'injury'> & {
57
62
  -readonly [K in 'birthAge' | 'birthIteration']?: DataProps<_Player>[K];
58
63
  } & {
59
64
  stats?: PerformanceStats;
@@ -61,6 +66,7 @@ export type Player = Omit<DataProps<_Player>, 'stats' | 'birthAge' | 'birthItera
61
66
  jerseyNumber: number;
62
67
  locked?: boolean;
63
68
  declineStatus?: DeclineStatus;
69
+ injuryStatus?: ApiPlayerInjuryStatus;
64
70
  nickname?: string;
65
71
  };
66
72
  export interface StartingLineup {
@@ -99,6 +105,10 @@ export interface ApiSystemSet {
99
105
  rotationSystem: RotationSystemEnum;
100
106
  designatedSetters: string[];
101
107
  }
108
+ export interface ApiReservePriority {
109
+ position: number;
110
+ reserves: string[];
111
+ }
102
112
  export interface ApiLiberoSetSubConfig {
103
113
  mode: LiberoSubMode;
104
114
  fatigueBand?: EnergyBand;
@@ -120,6 +130,8 @@ export interface Tactics {
120
130
  offensivePreferences: ApiOffensivePreference[];
121
131
  systemSets?: ApiSystemSet[];
122
132
  offensivePreferenceSets?: ApiOffensivePreference[][];
133
+ replaceInjuredImmediately: boolean;
134
+ reservePriorities?: ApiReservePriority[];
123
135
  }
124
136
  export interface ApiLineupPreset {
125
137
  presetId: string;
@@ -128,6 +140,7 @@ export interface ApiLineupPreset {
128
140
  orderIndex: number;
129
141
  config: Tactics;
130
142
  }
143
+ export type ApiLineupPresetSummary = Omit<ApiLineupPreset, 'config'>;
131
144
  export type Team = Omit<DataProps<_Team>, 'roster' | '_rating' | 'rating' | 'tactics'> & {
132
145
  roster: Player[];
133
146
  rating: {
@@ -5,9 +5,12 @@ const models_1 = require("./models");
5
5
  function initModels(sequelize) {
6
6
  const Coach = models_1.CoachModel.initModel(sequelize);
7
7
  const Scout = models_1.ScoutModel.initModel(sequelize);
8
+ const Physician = models_1.PhysicianModel.initModel(sequelize);
9
+ const Physiotherapist = models_1.PhysiotherapistModel.initModel(sequelize);
8
10
  const CurrencyTransaction = models_1.CurrencyTransactionModel.initModel(sequelize);
9
11
  const Tactics = models_1.TacticsModel.initModel(sequelize);
10
12
  const LineupPreset = models_1.LineupPresetModel.initModel(sequelize);
13
+ const MatchPreset = models_1.MatchPresetModel.initModel(sequelize);
11
14
  const AuthUser = models_1.AuthUserModel.initModel(sequelize);
12
15
  const UserCurrency = models_1.UserCurrencyModel.initModel(sequelize);
13
16
  const UserPlayerProgress = models_1.UserPlayerProgressModel.initModel(sequelize);
@@ -210,11 +213,22 @@ function initModels(sequelize) {
210
213
  Coach.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
211
214
  Team.hasOne(Scout, { as: 'Scout', foreignKey: 'team_id' });
212
215
  Scout.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
216
+ Team.hasOne(Physician, { as: 'Physician', foreignKey: 'team_id' });
217
+ Physician.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
218
+ Team.hasOne(Physiotherapist, { as: 'Physiotherapist', foreignKey: 'team_id' });
219
+ Physiotherapist.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
213
220
  Team.hasOne(Tactics, { as: 'tactics', foreignKey: 'team_id' });
214
221
  // Lineup presets are loaded only by the management API; deliberately NOT in Team.defaultScope so the
215
222
  // simulator's team loads are unchanged (it reads the active config from the mirrored Tactics row).
216
223
  Team.hasMany(LineupPreset, { as: 'lineupPresets', foreignKey: 'team_id' });
217
224
  LineupPreset.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
225
+ // Per-match preset choices. Deliberately NOT part of any default scope: only the simulator's match query
226
+ // loads MatchPresets, so every other transformToMatch caller stays on the active-tactics path.
227
+ Match.hasMany(MatchPreset, { as: 'MatchPresets', foreignKey: 'match_id' });
228
+ MatchPreset.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
229
+ MatchPreset.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
230
+ MatchPreset.belongsTo(LineupPreset, { as: 'preset', foreignKey: 'preset_id' });
231
+ LineupPreset.hasMany(MatchPreset, { as: 'MatchPresets', foreignKey: 'preset_id' });
218
232
  Team.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
219
233
  Team.belongsToMany(Competition, {
220
234
  as: 'Competitions',
@@ -289,6 +303,7 @@ function initModels(sequelize) {
289
303
  TeamReplacement,
290
304
  Tactics,
291
305
  LineupPreset,
306
+ MatchPreset,
292
307
  UserTeam,
293
308
  UserCurrency,
294
309
  UserPlayerProgress,
@@ -301,6 +316,8 @@ function initModels(sequelize) {
301
316
  Notification,
302
317
  Coach,
303
318
  Scout,
319
+ Physician,
320
+ Physiotherapist,
304
321
  CurrencyTransaction,
305
322
  VPER,
306
323
  LegacyTeamFlag,
@@ -15,9 +15,11 @@ export declare enum CurrencyTransactionSourceEnum {
15
15
  PLAYER_RETIRE = "PLAYER_RETIRE",
16
16
  ADMIN_GRANT = "ADMIN_GRANT",
17
17
  SEASON_REWARD = "SEASON_REWARD",
18
- COMPETITION_REWARD = "COMPETITION_REWARD"
18
+ COMPETITION_REWARD = "COMPETITION_REWARD",
19
+ PHYSICIAN_UPGRADE = "PHYSICIAN_UPGRADE",
20
+ PHYSIOTHERAPIST_UPGRADE = "PHYSIOTHERAPIST_UPGRADE"
19
21
  }
20
- export type CurrencyTransactionSource = CurrencyTransactionSourceEnum.MATCH_REWARD | CurrencyTransactionSourceEnum.GACHA_PULL | CurrencyTransactionSourceEnum.COACH_UPGRADE | CurrencyTransactionSourceEnum.SCOUT_UPGRADE | CurrencyTransactionSourceEnum.PLAYER_DISMISS | CurrencyTransactionSourceEnum.PLAYER_RETIRE | CurrencyTransactionSourceEnum.ADMIN_GRANT | CurrencyTransactionSourceEnum.SEASON_REWARD | CurrencyTransactionSourceEnum.COMPETITION_REWARD;
22
+ export type CurrencyTransactionSource = CurrencyTransactionSourceEnum.MATCH_REWARD | CurrencyTransactionSourceEnum.GACHA_PULL | CurrencyTransactionSourceEnum.COACH_UPGRADE | CurrencyTransactionSourceEnum.SCOUT_UPGRADE | CurrencyTransactionSourceEnum.PLAYER_DISMISS | CurrencyTransactionSourceEnum.PLAYER_RETIRE | CurrencyTransactionSourceEnum.ADMIN_GRANT | CurrencyTransactionSourceEnum.SEASON_REWARD | CurrencyTransactionSourceEnum.COMPETITION_REWARD | CurrencyTransactionSourceEnum.PHYSICIAN_UPGRADE | CurrencyTransactionSourceEnum.PHYSIOTHERAPIST_UPGRADE;
21
23
  export interface CurrencyTransactionAttributes {
22
24
  transaction_id: string;
23
25
  user_id: string;
@@ -18,6 +18,8 @@ var CurrencyTransactionSourceEnum;
18
18
  CurrencyTransactionSourceEnum["ADMIN_GRANT"] = "ADMIN_GRANT";
19
19
  CurrencyTransactionSourceEnum["SEASON_REWARD"] = "SEASON_REWARD";
20
20
  CurrencyTransactionSourceEnum["COMPETITION_REWARD"] = "COMPETITION_REWARD";
21
+ CurrencyTransactionSourceEnum["PHYSICIAN_UPGRADE"] = "PHYSICIAN_UPGRADE";
22
+ CurrencyTransactionSourceEnum["PHYSIOTHERAPIST_UPGRADE"] = "PHYSIOTHERAPIST_UPGRADE";
21
23
  })(CurrencyTransactionSourceEnum || (exports.CurrencyTransactionSourceEnum = CurrencyTransactionSourceEnum = {}));
22
24
  class CurrencyTransactionModel extends sequelize_1.Model {
23
25
  static initModel(sequelize) {
@@ -32,10 +32,13 @@ export * from './region-qualifier';
32
32
  export * from './national-country';
33
33
  export * from './coach';
34
34
  export * from './scout';
35
+ export * from './physician';
36
+ export * from './physiotherapist';
35
37
  export * from './team';
36
38
  export * from './team-replacement';
37
39
  export * from './tactics';
38
40
  export * from './lineup-preset';
41
+ export * from './match-preset';
39
42
  export * from './user-currency';
40
43
  export * from './user-player-progress';
41
44
  export * from './gacha-pity';
@@ -48,10 +48,13 @@ __exportStar(require("./region-qualifier"), exports);
48
48
  __exportStar(require("./national-country"), exports);
49
49
  __exportStar(require("./coach"), exports);
50
50
  __exportStar(require("./scout"), exports);
51
+ __exportStar(require("./physician"), exports);
52
+ __exportStar(require("./physiotherapist"), exports);
51
53
  __exportStar(require("./team"), exports);
52
54
  __exportStar(require("./team-replacement"), exports);
53
55
  __exportStar(require("./tactics"), exports);
54
56
  __exportStar(require("./lineup-preset"), exports);
57
+ __exportStar(require("./match-preset"), exports);
55
58
  __exportStar(require("./user-currency"), exports);
56
59
  __exportStar(require("./user-player-progress"), exports);
57
60
  __exportStar(require("./gacha-pity"), exports);
@@ -0,0 +1,28 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model } from 'sequelize';
3
+ import { LineupPresetId, LineupPresetModel, MatchId, MatchModel, TeamId, TeamModel } from '.';
4
+ export interface MatchPresetAttributes {
5
+ match_id: string;
6
+ team_id: string;
7
+ preset_id: string;
8
+ }
9
+ export type MatchPresetPk = 'match_id' | 'team_id';
10
+ export type MatchPresetCreationAttributes = MatchPresetAttributes;
11
+ export declare class MatchPresetModel extends Model<MatchPresetAttributes, MatchPresetCreationAttributes> implements MatchPresetAttributes {
12
+ match_id: string;
13
+ team_id: string;
14
+ preset_id: string;
15
+ match: MatchModel;
16
+ getMatch: Sequelize.BelongsToGetAssociationMixin<MatchModel>;
17
+ setMatch: Sequelize.BelongsToSetAssociationMixin<MatchModel, MatchId>;
18
+ createMatch: Sequelize.BelongsToCreateAssociationMixin<MatchModel>;
19
+ team: TeamModel;
20
+ getTeam: Sequelize.BelongsToGetAssociationMixin<TeamModel>;
21
+ setTeam: Sequelize.BelongsToSetAssociationMixin<TeamModel, TeamId>;
22
+ createTeam: Sequelize.BelongsToCreateAssociationMixin<TeamModel>;
23
+ preset: LineupPresetModel;
24
+ getPreset: Sequelize.BelongsToGetAssociationMixin<LineupPresetModel>;
25
+ setPreset: Sequelize.BelongsToSetAssociationMixin<LineupPresetModel, LineupPresetId>;
26
+ createPreset: Sequelize.BelongsToCreateAssociationMixin<LineupPresetModel>;
27
+ static initModel(sequelize: Sequelize.Sequelize): typeof MatchPresetModel;
28
+ }
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MatchPresetModel = void 0;
4
+ const sequelize_1 = require("sequelize");
5
+ class MatchPresetModel extends sequelize_1.Model {
6
+ static initModel(sequelize) {
7
+ return MatchPresetModel.init({
8
+ match_id: {
9
+ type: sequelize_1.DataTypes.UUID,
10
+ allowNull: false,
11
+ primaryKey: true,
12
+ references: {
13
+ model: 'Match',
14
+ key: 'match_id'
15
+ }
16
+ },
17
+ team_id: {
18
+ type: sequelize_1.DataTypes.UUID,
19
+ allowNull: false,
20
+ primaryKey: true,
21
+ references: {
22
+ model: 'Team',
23
+ key: 'team_id'
24
+ }
25
+ },
26
+ preset_id: {
27
+ type: sequelize_1.DataTypes.UUID,
28
+ allowNull: false,
29
+ references: {
30
+ model: 'LineupPreset',
31
+ key: 'preset_id'
32
+ }
33
+ }
34
+ }, {
35
+ sequelize,
36
+ tableName: 'MatchPreset',
37
+ schema: 'public',
38
+ timestamps: false,
39
+ indexes: [
40
+ {
41
+ name: 'MatchPreset_pk',
42
+ unique: true,
43
+ fields: [
44
+ { name: 'match_id' },
45
+ { name: 'team_id' }
46
+ ]
47
+ },
48
+ {
49
+ name: 'MatchPreset_team_id_idx',
50
+ fields: [
51
+ { name: 'team_id' }
52
+ ]
53
+ },
54
+ {
55
+ // Keeps the LineupPreset ON DELETE CASCADE cheap.
56
+ name: 'MatchPreset_preset_id_idx',
57
+ fields: [
58
+ { name: 'preset_id' }
59
+ ]
60
+ }
61
+ ]
62
+ });
63
+ }
64
+ }
65
+ exports.MatchPresetModel = MatchPresetModel;
@@ -9,6 +9,7 @@ export interface MatchSetAttributes {
9
9
  order: number;
10
10
  home_score: number;
11
11
  away_score: number;
12
+ forfeited?: boolean;
12
13
  player_positions: PlayerPositionAttributes[];
13
14
  Rallies?: RallyAttributes[];
14
15
  BoxScores?: BoxScoreAttributes[];
@@ -23,6 +24,7 @@ export declare class MatchSetModel extends Model<MatchSetAttributes, MatchSetCre
23
24
  order: number;
24
25
  home_score: number;
25
26
  away_score: number;
27
+ forfeited: boolean;
26
28
  player_positions: PlayerPositionAttributes[];
27
29
  match: MatchModel;
28
30
  getMatch: Sequelize.BelongsToGetAssociationMixin<MatchModel>;
@@ -35,6 +35,11 @@ class MatchSetModel extends sequelize_1.Model {
35
35
  type: sequelize_1.DataTypes.INTEGER,
36
36
  allowNull: false
37
37
  },
38
+ forfeited: {
39
+ type: sequelize_1.DataTypes.BOOLEAN,
40
+ allowNull: false,
41
+ defaultValue: false
42
+ },
38
43
  player_positions: {
39
44
  type: sequelize_1.DataTypes.JSONB,
40
45
  allowNull: false,
@@ -1,8 +1,8 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model } from 'sequelize';
3
3
  import { Status } from '../common';
4
- import { CompetitionMatchId, CompetitionMatchModel, MatchRatingId, MatchRatingModel, MatchResultId, MatchResultModel, MatchSetAttributes, MatchSetId, MatchSetModel, VPERAttributes, VPERId, VPERModel, TeamId, TeamModel } from '.';
5
- import { MatchRallyAggregates } from '../../service';
4
+ import { CompetitionMatchId, CompetitionMatchModel, MatchRatingId, MatchRatingModel, MatchResultId, MatchResultModel, MatchPresetModel, MatchSetAttributes, MatchSetId, MatchSetModel, VPERAttributes, VPERId, VPERModel, TeamId, TeamModel } from '.';
5
+ import { MatchForfeitType, MatchRallyAggregates } from '../../service';
6
6
  export interface MatchAttributes {
7
7
  match_id: string;
8
8
  home_team: string;
@@ -13,6 +13,7 @@ export interface MatchAttributes {
13
13
  in_progress_at?: Date;
14
14
  complete_at?: Date;
15
15
  rally_aggregates?: MatchRallyAggregates | null;
16
+ forfeit_type?: MatchForfeitType | null;
16
17
  MatchSets?: MatchSetAttributes[];
17
18
  VPERs?: VPERAttributes[];
18
19
  }
@@ -29,6 +30,7 @@ export declare class MatchModel extends Model<MatchAttributes, MatchCreationAttr
29
30
  in_progress_at?: Date;
30
31
  complete_at?: Date;
31
32
  rally_aggregates?: MatchRallyAggregates | null;
33
+ forfeit_type?: MatchForfeitType | null;
32
34
  CompetitionMatch: CompetitionMatchModel;
33
35
  getCompetitionMatch: Sequelize.HasOneGetAssociationMixin<CompetitionMatchModel>;
34
36
  setCompetitionMatch: Sequelize.HasOneSetAssociationMixin<CompetitionMatchModel, CompetitionMatchId>;
@@ -59,6 +61,7 @@ export declare class MatchModel extends Model<MatchAttributes, MatchCreationAttr
59
61
  hasVPER: Sequelize.HasManyHasAssociationMixin<VPERModel, VPERId>;
60
62
  hasVPERs: Sequelize.HasManyHasAssociationsMixin<VPERModel, VPERId>;
61
63
  countVPERs: Sequelize.HasManyCountAssociationsMixin;
64
+ MatchPresets?: MatchPresetModel[];
62
65
  MatchSets: MatchSetModel[];
63
66
  getMatchSets: Sequelize.HasManyGetAssociationsMixin<MatchSetModel>;
64
67
  setMatchSets: Sequelize.HasManySetAssociationsMixin<MatchSetModel, MatchSetId>;
@@ -51,6 +51,10 @@ class MatchModel extends sequelize_1.Model {
51
51
  rally_aggregates: {
52
52
  type: sequelize_1.DataTypes.JSONB,
53
53
  allowNull: true
54
+ },
55
+ forfeit_type: {
56
+ type: sequelize_1.DataTypes.TEXT,
57
+ allowNull: true
54
58
  }
55
59
  }, {
56
60
  sequelize,
@@ -0,0 +1,25 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model } from 'sequelize';
3
+ import { TeamId, TeamModel } from '.';
4
+ export interface PhysicianAttributes {
5
+ physician_id: string;
6
+ team_id: string;
7
+ name: string;
8
+ rarity: string;
9
+ currency_invested: number;
10
+ }
11
+ export type PhysicianPk = 'physician_id';
12
+ export type PhysicianId = PhysicianModel[PhysicianPk];
13
+ export type PhysicianCreationAttributes = PhysicianAttributes;
14
+ export declare class PhysicianModel extends Model<PhysicianAttributes, PhysicianCreationAttributes> implements PhysicianAttributes {
15
+ physician_id: string;
16
+ team_id: string;
17
+ name: string;
18
+ rarity: string;
19
+ currency_invested: number;
20
+ team: TeamModel;
21
+ getTeam: Sequelize.BelongsToGetAssociationMixin<TeamModel>;
22
+ setTeam: Sequelize.BelongsToSetAssociationMixin<TeamModel, TeamId>;
23
+ createTeam: Sequelize.BelongsToCreateAssociationMixin<TeamModel>;
24
+ static initModel(sequelize: Sequelize.Sequelize): typeof PhysicianModel;
25
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PhysicianModel = void 0;
4
+ const sequelize_1 = require("sequelize");
5
+ class PhysicianModel extends sequelize_1.Model {
6
+ static initModel(sequelize) {
7
+ return PhysicianModel.init({
8
+ physician_id: {
9
+ type: sequelize_1.DataTypes.UUID,
10
+ allowNull: false,
11
+ primaryKey: true
12
+ },
13
+ team_id: {
14
+ type: sequelize_1.DataTypes.UUID,
15
+ allowNull: false,
16
+ unique: true,
17
+ references: {
18
+ model: 'Team',
19
+ key: 'team_id'
20
+ }
21
+ },
22
+ name: {
23
+ type: sequelize_1.DataTypes.STRING,
24
+ allowNull: false,
25
+ defaultValue: ''
26
+ },
27
+ rarity: {
28
+ type: sequelize_1.DataTypes.STRING,
29
+ allowNull: false,
30
+ defaultValue: 'COMMON'
31
+ },
32
+ currency_invested: {
33
+ type: sequelize_1.DataTypes.INTEGER,
34
+ allowNull: false,
35
+ defaultValue: 0
36
+ }
37
+ }, {
38
+ sequelize,
39
+ tableName: 'Physician',
40
+ schema: 'public',
41
+ timestamps: false,
42
+ indexes: [
43
+ {
44
+ name: 'Physician_pk',
45
+ unique: true,
46
+ fields: [{ name: 'physician_id' }]
47
+ },
48
+ {
49
+ name: 'Physician_team_id_unique',
50
+ unique: true,
51
+ fields: [{ name: 'team_id' }]
52
+ }
53
+ ]
54
+ });
55
+ }
56
+ }
57
+ exports.PhysicianModel = PhysicianModel;
@@ -0,0 +1,25 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model } from 'sequelize';
3
+ import { TeamId, TeamModel } from '.';
4
+ export interface PhysiotherapistAttributes {
5
+ physiotherapist_id: string;
6
+ team_id: string;
7
+ name: string;
8
+ rarity: string;
9
+ currency_invested: number;
10
+ }
11
+ export type PhysiotherapistPk = 'physiotherapist_id';
12
+ export type PhysiotherapistId = PhysiotherapistModel[PhysiotherapistPk];
13
+ export type PhysiotherapistCreationAttributes = PhysiotherapistAttributes;
14
+ export declare class PhysiotherapistModel extends Model<PhysiotherapistAttributes, PhysiotherapistCreationAttributes> implements PhysiotherapistAttributes {
15
+ physiotherapist_id: string;
16
+ team_id: string;
17
+ name: string;
18
+ rarity: string;
19
+ currency_invested: number;
20
+ team: TeamModel;
21
+ getTeam: Sequelize.BelongsToGetAssociationMixin<TeamModel>;
22
+ setTeam: Sequelize.BelongsToSetAssociationMixin<TeamModel, TeamId>;
23
+ createTeam: Sequelize.BelongsToCreateAssociationMixin<TeamModel>;
24
+ static initModel(sequelize: Sequelize.Sequelize): typeof PhysiotherapistModel;
25
+ }
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PhysiotherapistModel = void 0;
4
+ const sequelize_1 = require("sequelize");
5
+ class PhysiotherapistModel extends sequelize_1.Model {
6
+ static initModel(sequelize) {
7
+ return PhysiotherapistModel.init({
8
+ physiotherapist_id: {
9
+ type: sequelize_1.DataTypes.UUID,
10
+ allowNull: false,
11
+ primaryKey: true
12
+ },
13
+ team_id: {
14
+ type: sequelize_1.DataTypes.UUID,
15
+ allowNull: false,
16
+ unique: true,
17
+ references: {
18
+ model: 'Team',
19
+ key: 'team_id'
20
+ }
21
+ },
22
+ name: {
23
+ type: sequelize_1.DataTypes.STRING,
24
+ allowNull: false,
25
+ defaultValue: ''
26
+ },
27
+ rarity: {
28
+ type: sequelize_1.DataTypes.STRING,
29
+ allowNull: false,
30
+ defaultValue: 'COMMON'
31
+ },
32
+ currency_invested: {
33
+ type: sequelize_1.DataTypes.INTEGER,
34
+ allowNull: false,
35
+ defaultValue: 0
36
+ }
37
+ }, {
38
+ sequelize,
39
+ tableName: 'Physiotherapist',
40
+ schema: 'public',
41
+ timestamps: false,
42
+ indexes: [
43
+ {
44
+ name: 'Physiotherapist_pk',
45
+ unique: true,
46
+ fields: [{ name: 'physiotherapist_id' }]
47
+ },
48
+ {
49
+ name: 'Physiotherapist_team_id_unique',
50
+ unique: true,
51
+ fields: [{ name: 'team_id' }]
52
+ }
53
+ ]
54
+ });
55
+ }
56
+ }
57
+ exports.PhysiotherapistModel = PhysiotherapistModel;
@@ -15,6 +15,10 @@ export interface PlayerAttributes {
15
15
  birth_iteration: number;
16
16
  last_declined_iteration: number | null;
17
17
  decline_profile: DeclineProfile;
18
+ injury_prone_profile?: number | string;
19
+ injury_severity?: number | null;
20
+ injured_until?: Date | string | null;
21
+ injury_debuff?: number | string | null;
18
22
  PerformanceStat?: PerformanceStatsAttributes;
19
23
  BoxScores?: BoxScoreAttributes[];
20
24
  }
@@ -34,6 +38,10 @@ export declare class PlayerModel extends Model<PlayerAttributes, PlayerCreationA
34
38
  birth_iteration: number;
35
39
  last_declined_iteration: number | null;
36
40
  decline_profile: DeclineProfile;
41
+ injury_prone_profile: number | string;
42
+ injury_severity: number | null;
43
+ injured_until: Date | string | null;
44
+ injury_debuff: number | string | null;
37
45
  country: CountryModel;
38
46
  getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
39
47
  setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
@@ -62,6 +62,23 @@ class PlayerModel extends sequelize_1.Model {
62
62
  type: sequelize_1.DataTypes.ENUM(...Object.values(service_1.DeclineProfileEnum)),
63
63
  allowNull: false,
64
64
  defaultValue: service_1.DeclineProfileEnum.STANDARD
65
+ },
66
+ injury_prone_profile: {
67
+ type: sequelize_1.DataTypes.DECIMAL(3, 2),
68
+ allowNull: false,
69
+ defaultValue: 0.5
70
+ },
71
+ injury_severity: {
72
+ type: sequelize_1.DataTypes.INTEGER,
73
+ allowNull: true
74
+ },
75
+ injured_until: {
76
+ type: sequelize_1.DataTypes.DATE,
77
+ allowNull: true
78
+ },
79
+ injury_debuff: {
80
+ type: sequelize_1.DataTypes.DECIMAL(3, 2),
81
+ allowNull: true
65
82
  }
66
83
  }, {
67
84
  sequelize,
@@ -39,6 +39,10 @@ export interface SystemSetAttributes {
39
39
  rotationSystem: RotationSystemEnum;
40
40
  designatedSetters: PlayerId[];
41
41
  }
42
+ export interface ReservePriorityAttributes {
43
+ position: CourtPosition;
44
+ reserves: PlayerId[];
45
+ }
42
46
  export interface LiberoSetSubConfigAttributes {
43
47
  mode: LiberoSubMode;
44
48
  fatigueBand?: EnergyBand;
@@ -61,10 +65,12 @@ export interface TacticsAttributes {
61
65
  offensive_preferences: OffensivePreferenceAttributes[];
62
66
  system_sets?: SystemSetAttributes[];
63
67
  offensive_preference_sets?: OffensivePreferenceAttributes[][];
68
+ replace_injured_immediately?: boolean;
69
+ reserve_priorities?: ReservePriorityAttributes[];
64
70
  }
65
71
  export type TacticsPk = 'team_id';
66
72
  export type TacticsId = TacticsModel[TacticsPk];
67
- export type TacticsOptionalAttributes = 'lineup' | 'libero_replacements' | 'receive_rotation_offset' | 'designated_subs' | 'substitution_band' | 'second_libero' | 'libero_sub' | 'libero_replacement_sets' | 'rotation_system' | 'designated_setters' | 'offensive_preferences' | 'system_sets' | 'offensive_preference_sets';
73
+ export type TacticsOptionalAttributes = 'lineup' | 'libero_replacements' | 'receive_rotation_offset' | 'designated_subs' | 'substitution_band' | 'second_libero' | 'libero_sub' | 'libero_replacement_sets' | 'rotation_system' | 'designated_setters' | 'offensive_preferences' | 'system_sets' | 'offensive_preference_sets' | 'replace_injured_immediately' | 'reserve_priorities';
68
74
  export type TacticsCreationAttributes = Optional<TacticsAttributes, TacticsOptionalAttributes>;
69
75
  export declare class TacticsModel extends Model<TacticsAttributes, TacticsCreationAttributes> implements TacticsAttributes {
70
76
  team_id: string;
@@ -81,6 +87,8 @@ export declare class TacticsModel extends Model<TacticsAttributes, TacticsCreati
81
87
  offensive_preferences: OffensivePreferenceAttributes[];
82
88
  system_sets?: SystemSetAttributes[];
83
89
  offensive_preference_sets?: OffensivePreferenceAttributes[][];
90
+ replace_injured_immediately?: boolean;
91
+ reserve_priorities?: ReservePriorityAttributes[];
84
92
  team: TeamModel;
85
93
  getTeam: Sequelize.BelongsToGetAssociationMixin<TeamModel>;
86
94
  setTeam: Sequelize.BelongsToSetAssociationMixin<TeamModel, TeamId>;
@@ -74,6 +74,15 @@ class TacticsModel extends sequelize_1.Model {
74
74
  offensive_preference_sets: {
75
75
  type: sequelize_1.DataTypes.JSONB,
76
76
  allowNull: true
77
+ },
78
+ replace_injured_immediately: {
79
+ type: sequelize_1.DataTypes.BOOLEAN,
80
+ allowNull: false,
81
+ defaultValue: true
82
+ },
83
+ reserve_priorities: {
84
+ type: sequelize_1.DataTypes.JSONB,
85
+ allowNull: true
77
86
  }
78
87
  }, {
79
88
  sequelize,
@@ -27,6 +27,6 @@ function transformToObject(model) {
27
27
  subdivision: model.subdivision,
28
28
  leagueId: model.league_id,
29
29
  seasons: (model.DivisionSeasons ?? []).map((ds) => (0, season_1.transformToSeason)(ds.competition)),
30
- teams: model.Teams != null ? model.Teams.map(team_1.transformToTeam) : undefined
30
+ teams: model.Teams != null ? model.Teams.map(team => (0, team_1.transformToTeam)(team)) : undefined
31
31
  });
32
32
  }
@@ -2,12 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transformToLineupPreset = transformToObject;
4
4
  // `config` is already stored as the API Tactics DTO, so a preset row maps to its API shape with no hydration.
5
+ // Presets saved before the injuries fields exist lack replaceInjuredImmediately: heal it to the effective
6
+ // default (true, matching transformToTactics' hydration) so the DTO's required field is honest and a UI
7
+ // toggle seeded from an old preset cannot silently flip the user's effective setting on re-save.
5
8
  function transformToObject(model) {
6
9
  return {
7
10
  presetId: model.preset_id,
8
11
  name: model.name,
9
12
  isActive: model.is_active,
10
13
  orderIndex: model.order_index,
11
- config: model.config
14
+ config: {
15
+ ...model.config,
16
+ replaceInjuredImmediately: model.config.replaceInjuredImmediately ?? true
17
+ }
12
18
  };
13
19
  }