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
@@ -0,0 +1,125 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const globals_1 = require("@jest/globals");
4
+ const tactics_z_1 = require("./tactics.z");
5
+ const test_helpers_1 = require("../../test-helpers");
6
+ (0, globals_1.describe)('TacticsInputSchema — injuries (replaceInjuredImmediately / reservePriorities)', () => {
7
+ const country = (0, test_helpers_1.makeCountry)();
8
+ const p1 = (0, test_helpers_1.makePlayer)(country);
9
+ const p2 = (0, test_helpers_1.makePlayer)(country);
10
+ const p3 = (0, test_helpers_1.makePlayer)(country);
11
+ const p4 = (0, test_helpers_1.makePlayer)(country);
12
+ const p5 = (0, test_helpers_1.makePlayer)(country);
13
+ const p6 = (0, test_helpers_1.makePlayer)(country);
14
+ const benchPlayer = (0, test_helpers_1.makePlayer)(country);
15
+ const libero = (0, test_helpers_1.makePlayer)(country);
16
+ const reserveA = (0, test_helpers_1.makePlayer)(country);
17
+ const reserveB = (0, test_helpers_1.makePlayer)(country);
18
+ function baseInput(overrides = {}) {
19
+ return {
20
+ lineup: {
21
+ 4: p4,
22
+ 3: p3,
23
+ 2: p2,
24
+ 5: p5,
25
+ 6: p6,
26
+ 1: p1,
27
+ 0: libero,
28
+ bench: [benchPlayer]
29
+ },
30
+ liberoReplacements: [],
31
+ ...overrides
32
+ };
33
+ }
34
+ (0, globals_1.it)('defaults replaceInjuredImmediately to true and reservePriorities to empty', () => {
35
+ const res = tactics_z_1.TacticsInputSchema.safeParse(baseInput());
36
+ (0, globals_1.expect)(res.success).toBe(true);
37
+ if (res.success) {
38
+ (0, globals_1.expect)(res.data.replaceInjuredImmediately).toBe(true);
39
+ (0, globals_1.expect)(res.data.reservePriorities).toEqual([]);
40
+ }
41
+ });
42
+ (0, globals_1.it)('accepts replaceInjuredImmediately false', () => {
43
+ const res = tactics_z_1.TacticsInputSchema.safeParse(baseInput({ replaceInjuredImmediately: false }));
44
+ (0, globals_1.expect)(res.success).toBe(true);
45
+ if (res.success)
46
+ (0, globals_1.expect)(res.data.replaceInjuredImmediately).toBe(false);
47
+ });
48
+ (0, globals_1.it)('accepts reserve lists of non-lineup roster players', () => {
49
+ const res = tactics_z_1.TacticsInputSchema.safeParse(baseInput({
50
+ reservePriorities: [
51
+ { position: 4, reserves: [reserveA] },
52
+ { position: 3, reserves: [reserveB] }
53
+ ]
54
+ }));
55
+ (0, globals_1.expect)(res.success).toBe(true);
56
+ });
57
+ (0, globals_1.it)('rejects a reserve that is a starter', () => {
58
+ const res = tactics_z_1.TacticsInputSchema.safeParse(baseInput({
59
+ reservePriorities: [{ position: 4, reserves: [p1] }]
60
+ }));
61
+ (0, globals_1.expect)(res.success).toBe(false);
62
+ if (!res.success) {
63
+ (0, globals_1.expect)(res.error.issues.some(issue => issue.message === 'RESERVE_MUST_NOT_BE_IN_LINEUP')).toBe(true);
64
+ }
65
+ });
66
+ (0, globals_1.it)('rejects a reserve that is on the bench', () => {
67
+ const res = tactics_z_1.TacticsInputSchema.safeParse(baseInput({
68
+ reservePriorities: [{ position: 4, reserves: [benchPlayer] }]
69
+ }));
70
+ (0, globals_1.expect)(res.success).toBe(false);
71
+ if (!res.success) {
72
+ (0, globals_1.expect)(res.error.issues.some(issue => issue.message === 'RESERVE_MUST_NOT_BE_IN_LINEUP')).toBe(true);
73
+ }
74
+ });
75
+ (0, globals_1.it)('rejects a reserve that is the libero', () => {
76
+ const res = tactics_z_1.TacticsInputSchema.safeParse(baseInput({
77
+ reservePriorities: [{ position: 4, reserves: [libero] }]
78
+ }));
79
+ (0, globals_1.expect)(res.success).toBe(false);
80
+ if (!res.success) {
81
+ (0, globals_1.expect)(res.error.issues.some(issue => issue.message === 'RESERVE_MUST_NOT_BE_IN_LINEUP')).toBe(true);
82
+ }
83
+ });
84
+ (0, globals_1.it)('rejects a reserve that doubles as the second libero', () => {
85
+ const res = tactics_z_1.TacticsInputSchema.safeParse(baseInput({
86
+ secondLibero: reserveA,
87
+ liberoSub: { mode: 'ALWAYS' },
88
+ reservePriorities: [{ position: 4, reserves: [reserveA] }]
89
+ }));
90
+ (0, globals_1.expect)(res.success).toBe(false);
91
+ if (!res.success) {
92
+ (0, globals_1.expect)(res.error.issues.some(issue => issue.message === 'RESERVE_MUST_NOT_BE_SECOND_LIBERO')).toBe(true);
93
+ }
94
+ });
95
+ (0, globals_1.it)('rejects the same player in two lists', () => {
96
+ const res = tactics_z_1.TacticsInputSchema.safeParse(baseInput({
97
+ reservePriorities: [
98
+ { position: 4, reserves: [reserveA] },
99
+ { position: 3, reserves: [reserveA] }
100
+ ]
101
+ }));
102
+ (0, globals_1.expect)(res.success).toBe(false);
103
+ if (!res.success) {
104
+ (0, globals_1.expect)(res.error.issues.some(issue => issue.message === 'RESERVE_IN_MULTIPLE_LISTS')).toBe(true);
105
+ }
106
+ });
107
+ (0, globals_1.it)('rejects a duplicated position', () => {
108
+ const res = tactics_z_1.TacticsInputSchema.safeParse(baseInput({
109
+ reservePriorities: [
110
+ { position: 4, reserves: [reserveA] },
111
+ { position: 4, reserves: [reserveB] }
112
+ ]
113
+ }));
114
+ (0, globals_1.expect)(res.success).toBe(false);
115
+ if (!res.success) {
116
+ (0, globals_1.expect)(res.error.issues.some(issue => issue.message === 'RESERVE_PRIORITY_DUPLICATE_POSITION')).toBe(true);
117
+ }
118
+ });
119
+ (0, globals_1.it)('rejects an out-of-range position', () => {
120
+ const res = tactics_z_1.TacticsInputSchema.safeParse(baseInput({
121
+ reservePriorities: [{ position: 7, reserves: [reserveA] }]
122
+ }));
123
+ (0, globals_1.expect)(res.success).toBe(false);
124
+ });
125
+ });
@@ -123,5 +123,10 @@ export declare const TacticsInputSchema: z.ZodObject<{
123
123
  rotation: z.ZodNumber;
124
124
  order: z.ZodArray<z.ZodCustom<Player, Player>>;
125
125
  }, z.core.$strip>>>>;
126
+ replaceInjuredImmediately: z.ZodDefault<z.ZodBoolean>;
127
+ reservePriorities: z.ZodDefault<z.ZodArray<z.ZodObject<{
128
+ position: z.ZodNumber;
129
+ reserves: z.ZodArray<z.ZodCustom<Player, Player>>;
130
+ }, z.core.$strip>>>;
126
131
  }, z.core.$strip>;
127
132
  export type TacticsInput = z.infer<typeof TacticsInputSchema>;
@@ -80,7 +80,15 @@ exports.TacticsInputSchema = zod_1.z.object({
80
80
  // Per-set overrides (5 entries, index 0 = set 1; absent => the flat fields apply to all sets). Each entry is
81
81
  // validated with the same cross-field rules as the flat fields (see superRefine below).
82
82
  systemSets: zod_1.z.array(systemSetSchema).max(5).optional(),
83
- offensivePreferenceSets: zod_1.z.array(zod_1.z.array(offensivePreferenceSchema)).max(5).optional()
83
+ offensivePreferenceSets: zod_1.z.array(zod_1.z.array(offensivePreferenceSchema)).max(5).optional(),
84
+ // Injuries. Defaults keep every existing Tactics.create({...}) call valid. reservePriorities is flat-only
85
+ // (whole match): per-position ordered reserve lists; cross-field rules (reserves must be OUTSIDE the lineup,
86
+ // no player in two lists, unique positions) in the superRefine below.
87
+ replaceInjuredImmediately: zod_1.z.boolean().default(true),
88
+ reservePriorities: zod_1.z.array(zod_1.z.object({
89
+ position: zod_1.z.number().int().min(1).max(6),
90
+ reserves: zod_1.z.array(playerInstanceSchema)
91
+ })).default([])
84
92
  }).superRefine((data, ctx) => {
85
93
  // Cross-field rules for the rotation system. These keep an invalid config from ever reaching the sim (the
86
94
  // pinch-server outage was caused by an unvalidated tactics payload).
@@ -178,4 +186,27 @@ exports.TacticsInputSchema = zod_1.z.object({
178
186
  }
179
187
  }
180
188
  }
189
+ // Reserve priorities (injuries). A reserve must be a roster member OUTSIDE the lineup (starters, libero zone
190
+ // and bench refill themselves via subs); each position appears at most once; no player sits in two lists; and
191
+ // the second libero cannot double as a reserve (its promotion would strand the L2 swap validation).
192
+ const seenReservePositions = new Set();
193
+ const seenReserveIds = new Set();
194
+ for (const rp of data.reservePriorities) {
195
+ if (seenReservePositions.has(rp.position)) {
196
+ ctx.addIssue({ code: 'custom', message: 'RESERVE_PRIORITY_DUPLICATE_POSITION', path: ['reservePriorities'] });
197
+ }
198
+ seenReservePositions.add(rp.position);
199
+ for (const reserve of rp.reserves) {
200
+ if (inLineupIds.has(reserve.id)) {
201
+ ctx.addIssue({ code: 'custom', message: 'RESERVE_MUST_NOT_BE_IN_LINEUP', path: ['reservePriorities'] });
202
+ }
203
+ if (data.secondLibero != null && reserve.id === data.secondLibero.id) {
204
+ ctx.addIssue({ code: 'custom', message: 'RESERVE_MUST_NOT_BE_SECOND_LIBERO', path: ['reservePriorities'] });
205
+ }
206
+ if (seenReserveIds.has(reserve.id)) {
207
+ ctx.addIssue({ code: 'custom', message: 'RESERVE_IN_MULTIPLE_LISTS', path: ['reservePriorities'] });
208
+ }
209
+ seenReserveIds.add(reserve.id);
210
+ }
211
+ }
181
212
  });
@@ -131,6 +131,11 @@ export declare const TeamInputSchema: z.ZodObject<{
131
131
  rotation: z.ZodNumber;
132
132
  order: z.ZodArray<z.ZodCustom<Player, Player>>;
133
133
  }, z.core.$strip>>>>;
134
+ replaceInjuredImmediately: z.ZodDefault<z.ZodBoolean>;
135
+ reservePriorities: z.ZodDefault<z.ZodArray<z.ZodObject<{
136
+ position: z.ZodNumber;
137
+ reserves: z.ZodArray<z.ZodCustom<Player, Player>>;
138
+ }, z.core.$strip>>>;
134
139
  }, z.core.$strip>>;
135
140
  }, z.core.$strip>;
136
141
  export type TeamInput = z.infer<typeof TeamInputSchema>;
@@ -5,6 +5,7 @@ import { LiberoSubConfig } from './libero-sub';
5
5
  import { SubBand } from './energy-band';
6
6
  import { RotationSystemEnum } from './rotation-system';
7
7
  import { OffensivePreference } from './offensive-preference';
8
+ import { ReservePriority } from './reserve-priority';
8
9
  export interface StartingLineup {
9
10
  readonly [CourtPosition.LEFT_FRONT]: Player;
10
11
  readonly [CourtPosition.MIDDLE_FRONT]: Player;
@@ -33,6 +34,8 @@ export interface TacticsOpts {
33
34
  readonly offensivePreferences: OffensivePreference[];
34
35
  readonly systemSets?: SystemSet[];
35
36
  readonly offensivePreferenceSets?: OffensivePreference[][];
37
+ readonly replaceInjuredImmediately: boolean;
38
+ readonly reservePriorities: ReservePriority[];
36
39
  }
37
40
  export declare class Tactics {
38
41
  readonly lineup: StartingLineup;
@@ -48,6 +51,8 @@ export declare class Tactics {
48
51
  readonly offensivePreferences: OffensivePreference[];
49
52
  readonly systemSets?: SystemSet[];
50
53
  readonly offensivePreferenceSets?: OffensivePreference[][];
54
+ readonly replaceInjuredImmediately: boolean;
55
+ readonly reservePriorities: ReservePriority[];
51
56
  static create(input: unknown): Tactics;
52
57
  private constructor();
53
58
  findPlayerInLineup(id: string): CourtPosition | undefined;
@@ -18,7 +18,7 @@ class Tactics {
18
18
  }
19
19
  return new Tactics(result.data);
20
20
  }
21
- constructor({ lineup, liberoReplacements, receiveRotationOffset = false, designatedSubs = [], substitutionBand = energy_band_1.EnergyBand.TIRED, secondLibero, liberoSub, liberoReplacementSets, rotationSystem = rotation_system_1.RotationSystemEnum.SIX_ZERO, designatedSetters = [], offensivePreferences = [], systemSets, offensivePreferenceSets }) {
21
+ constructor({ lineup, liberoReplacements, receiveRotationOffset = false, designatedSubs = [], substitutionBand = energy_band_1.EnergyBand.TIRED, secondLibero, liberoSub, liberoReplacementSets, rotationSystem = rotation_system_1.RotationSystemEnum.SIX_ZERO, designatedSetters = [], offensivePreferences = [], systemSets, offensivePreferenceSets, replaceInjuredImmediately = true, reservePriorities = [] }) {
22
22
  this.lineup = lineup;
23
23
  this.liberoReplacements = liberoReplacements;
24
24
  this.receiveRotationOffset = receiveRotationOffset;
@@ -32,6 +32,8 @@ class Tactics {
32
32
  this.offensivePreferences = offensivePreferences;
33
33
  this.systemSets = systemSets;
34
34
  this.offensivePreferenceSets = offensivePreferenceSets;
35
+ this.replaceInjuredImmediately = replaceInjuredImmediately;
36
+ this.reservePriorities = reservePriorities;
35
37
  }
36
38
  findPlayerInLineup(id) {
37
39
  if (this.lineup.bench.some(p => p.id === id))
@@ -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: {
@@ -1,10 +1,13 @@
1
- import { AuthIdentityModel, AuthSessionModel, AuthUserModel, BoxScoreModel, CoachModel, ScoutModel, BoxScoreTotalsModel, CompetitionChampionModel, CurrencyTransactionModel, GachaPityModel, GachaPullHistoryModel, WishlistModel, UserSettingsModel, UserDeviceTokenModel, CompetitionMatchModel, CompetitionMVPModel, CompetitionModel, CompetitionStandingsMatchModel, CompetitionStandingsModel, CompetitionTeamsModel, CountryModel, DivisionModel, DivisionSeasonModel, IterationModel, LeagueModel, MatchModel, MatchRatingModel, MatchResultModel, MatchSetModel, PerformanceStatsModel, PlayerModel, PlayerImprovementLogModel, PlayerDeclineLogModel, PlayerTeamModel, RetiredPlayerModel, PromotionMatchModel, FriendlyModel, RegionQualifierModel, NationalCountryModel, RallyModel, TacticsModel, LineupPresetModel, TeamModel, TeamReplacementModel, UserCurrencyModel, UserPlayerProgressModel, UserPullGrantModel, UserTeamModel, VPERModel, NotificationModel, AppConfigModel, LegacyTeamFlagModel } from './models';
1
+ import { AuthIdentityModel, AuthSessionModel, AuthUserModel, BoxScoreModel, CoachModel, ScoutModel, PhysicianModel, PhysiotherapistModel, BoxScoreTotalsModel, CompetitionChampionModel, CurrencyTransactionModel, GachaPityModel, GachaPullHistoryModel, WishlistModel, UserSettingsModel, UserDeviceTokenModel, CompetitionMatchModel, CompetitionMVPModel, CompetitionModel, CompetitionStandingsMatchModel, CompetitionStandingsModel, CompetitionTeamsModel, CountryModel, DivisionModel, DivisionSeasonModel, IterationModel, LeagueModel, MatchModel, MatchRatingModel, MatchResultModel, MatchSetModel, PerformanceStatsModel, PlayerModel, PlayerImprovementLogModel, PlayerDeclineLogModel, PlayerTeamModel, RetiredPlayerModel, PromotionMatchModel, FriendlyModel, RegionQualifierModel, NationalCountryModel, RallyModel, TacticsModel, LineupPresetModel, MatchPresetModel, TeamModel, TeamReplacementModel, UserCurrencyModel, UserPlayerProgressModel, UserPullGrantModel, UserTeamModel, VPERModel, NotificationModel, AppConfigModel, LegacyTeamFlagModel } from './models';
2
2
  export function initModels(sequelize) {
3
3
  const Coach = CoachModel.initModel(sequelize);
4
4
  const Scout = ScoutModel.initModel(sequelize);
5
+ const Physician = PhysicianModel.initModel(sequelize);
6
+ const Physiotherapist = PhysiotherapistModel.initModel(sequelize);
5
7
  const CurrencyTransaction = CurrencyTransactionModel.initModel(sequelize);
6
8
  const Tactics = TacticsModel.initModel(sequelize);
7
9
  const LineupPreset = LineupPresetModel.initModel(sequelize);
10
+ const MatchPreset = MatchPresetModel.initModel(sequelize);
8
11
  const AuthUser = AuthUserModel.initModel(sequelize);
9
12
  const UserCurrency = UserCurrencyModel.initModel(sequelize);
10
13
  const UserPlayerProgress = UserPlayerProgressModel.initModel(sequelize);
@@ -207,11 +210,22 @@ export function initModels(sequelize) {
207
210
  Coach.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
208
211
  Team.hasOne(Scout, { as: 'Scout', foreignKey: 'team_id' });
209
212
  Scout.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
213
+ Team.hasOne(Physician, { as: 'Physician', foreignKey: 'team_id' });
214
+ Physician.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
215
+ Team.hasOne(Physiotherapist, { as: 'Physiotherapist', foreignKey: 'team_id' });
216
+ Physiotherapist.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
210
217
  Team.hasOne(Tactics, { as: 'tactics', foreignKey: 'team_id' });
211
218
  // Lineup presets are loaded only by the management API; deliberately NOT in Team.defaultScope so the
212
219
  // simulator's team loads are unchanged (it reads the active config from the mirrored Tactics row).
213
220
  Team.hasMany(LineupPreset, { as: 'lineupPresets', foreignKey: 'team_id' });
214
221
  LineupPreset.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
222
+ // Per-match preset choices. Deliberately NOT part of any default scope: only the simulator's match query
223
+ // loads MatchPresets, so every other transformToMatch caller stays on the active-tactics path.
224
+ Match.hasMany(MatchPreset, { as: 'MatchPresets', foreignKey: 'match_id' });
225
+ MatchPreset.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
226
+ MatchPreset.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
227
+ MatchPreset.belongsTo(LineupPreset, { as: 'preset', foreignKey: 'preset_id' });
228
+ LineupPreset.hasMany(MatchPreset, { as: 'MatchPresets', foreignKey: 'preset_id' });
215
229
  Team.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
216
230
  Team.belongsToMany(Competition, {
217
231
  as: 'Competitions',
@@ -286,6 +300,7 @@ export function initModels(sequelize) {
286
300
  TeamReplacement,
287
301
  Tactics,
288
302
  LineupPreset,
303
+ MatchPreset,
289
304
  UserTeam,
290
305
  UserCurrency,
291
306
  UserPlayerProgress,
@@ -298,6 +313,8 @@ export function initModels(sequelize) {
298
313
  Notification,
299
314
  Coach,
300
315
  Scout,
316
+ Physician,
317
+ Physiotherapist,
301
318
  CurrencyTransaction,
302
319
  VPER,
303
320
  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;
@@ -15,6 +15,8 @@ export var CurrencyTransactionSourceEnum;
15
15
  CurrencyTransactionSourceEnum["ADMIN_GRANT"] = "ADMIN_GRANT";
16
16
  CurrencyTransactionSourceEnum["SEASON_REWARD"] = "SEASON_REWARD";
17
17
  CurrencyTransactionSourceEnum["COMPETITION_REWARD"] = "COMPETITION_REWARD";
18
+ CurrencyTransactionSourceEnum["PHYSICIAN_UPGRADE"] = "PHYSICIAN_UPGRADE";
19
+ CurrencyTransactionSourceEnum["PHYSIOTHERAPIST_UPGRADE"] = "PHYSIOTHERAPIST_UPGRADE";
18
20
  })(CurrencyTransactionSourceEnum || (CurrencyTransactionSourceEnum = {}));
19
21
  export class CurrencyTransactionModel extends Model {
20
22
  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';
@@ -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';
@@ -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,61 @@
1
+ import { DataTypes, Model } from 'sequelize';
2
+ export class MatchPresetModel extends Model {
3
+ static initModel(sequelize) {
4
+ return MatchPresetModel.init({
5
+ match_id: {
6
+ type: DataTypes.UUID,
7
+ allowNull: false,
8
+ primaryKey: true,
9
+ references: {
10
+ model: 'Match',
11
+ key: 'match_id'
12
+ }
13
+ },
14
+ team_id: {
15
+ type: DataTypes.UUID,
16
+ allowNull: false,
17
+ primaryKey: true,
18
+ references: {
19
+ model: 'Team',
20
+ key: 'team_id'
21
+ }
22
+ },
23
+ preset_id: {
24
+ type: DataTypes.UUID,
25
+ allowNull: false,
26
+ references: {
27
+ model: 'LineupPreset',
28
+ key: 'preset_id'
29
+ }
30
+ }
31
+ }, {
32
+ sequelize,
33
+ tableName: 'MatchPreset',
34
+ schema: 'public',
35
+ timestamps: false,
36
+ indexes: [
37
+ {
38
+ name: 'MatchPreset_pk',
39
+ unique: true,
40
+ fields: [
41
+ { name: 'match_id' },
42
+ { name: 'team_id' }
43
+ ]
44
+ },
45
+ {
46
+ name: 'MatchPreset_team_id_idx',
47
+ fields: [
48
+ { name: 'team_id' }
49
+ ]
50
+ },
51
+ {
52
+ // Keeps the LineupPreset ON DELETE CASCADE cheap.
53
+ name: 'MatchPreset_preset_id_idx',
54
+ fields: [
55
+ { name: 'preset_id' }
56
+ ]
57
+ }
58
+ ]
59
+ });
60
+ }
61
+ }
@@ -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>;
@@ -32,6 +32,11 @@ export class MatchSetModel extends Model {
32
32
  type: DataTypes.INTEGER,
33
33
  allowNull: false
34
34
  },
35
+ forfeited: {
36
+ type: DataTypes.BOOLEAN,
37
+ allowNull: false,
38
+ defaultValue: false
39
+ },
35
40
  player_positions: {
36
41
  type: DataTypes.JSONB,
37
42
  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>;
@@ -48,6 +48,10 @@ export class MatchModel extends Model {
48
48
  rally_aggregates: {
49
49
  type: DataTypes.JSONB,
50
50
  allowNull: true
51
+ },
52
+ forfeit_type: {
53
+ type: DataTypes.TEXT,
54
+ allowNull: true
51
55
  }
52
56
  }, {
53
57
  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,53 @@
1
+ import { DataTypes, Model } from 'sequelize';
2
+ export class PhysicianModel extends Model {
3
+ static initModel(sequelize) {
4
+ return PhysicianModel.init({
5
+ physician_id: {
6
+ type: DataTypes.UUID,
7
+ allowNull: false,
8
+ primaryKey: true
9
+ },
10
+ team_id: {
11
+ type: DataTypes.UUID,
12
+ allowNull: false,
13
+ unique: true,
14
+ references: {
15
+ model: 'Team',
16
+ key: 'team_id'
17
+ }
18
+ },
19
+ name: {
20
+ type: DataTypes.STRING,
21
+ allowNull: false,
22
+ defaultValue: ''
23
+ },
24
+ rarity: {
25
+ type: DataTypes.STRING,
26
+ allowNull: false,
27
+ defaultValue: 'COMMON'
28
+ },
29
+ currency_invested: {
30
+ type: DataTypes.INTEGER,
31
+ allowNull: false,
32
+ defaultValue: 0
33
+ }
34
+ }, {
35
+ sequelize,
36
+ tableName: 'Physician',
37
+ schema: 'public',
38
+ timestamps: false,
39
+ indexes: [
40
+ {
41
+ name: 'Physician_pk',
42
+ unique: true,
43
+ fields: [{ name: 'physician_id' }]
44
+ },
45
+ {
46
+ name: 'Physician_team_id_unique',
47
+ unique: true,
48
+ fields: [{ name: 'team_id' }]
49
+ }
50
+ ]
51
+ });
52
+ }
53
+ }