volleyballsimtypes 0.0.76 → 0.0.77

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 (97) hide show
  1. package/dist/cjs/src/data/index.d.ts +1 -2
  2. package/dist/cjs/src/data/index.js +2 -34
  3. package/dist/cjs/src/data/models/block.d.ts +3 -1
  4. package/dist/cjs/src/data/models/block.js +8 -7
  5. package/dist/cjs/src/data/models/event.d.ts +3 -1
  6. package/dist/cjs/src/data/models/event.js +8 -7
  7. package/dist/cjs/src/data/models/index.d.ts +32 -62
  8. package/dist/cjs/src/data/models/index.js +46 -65
  9. package/dist/cjs/src/data/models/iteration.d.ts +1 -1
  10. package/dist/cjs/src/data/models/iteration.js +2 -2
  11. package/dist/cjs/src/data/models/reception.d.ts +3 -1
  12. package/dist/cjs/src/data/models/reception.js +8 -7
  13. package/dist/cjs/src/data/models/serve.d.ts +3 -1
  14. package/dist/cjs/src/data/models/serve.js +8 -7
  15. package/dist/cjs/src/data/models/set.d.ts +3 -1
  16. package/dist/cjs/src/data/models/set.js +8 -7
  17. package/dist/cjs/src/data/models/spike.d.ts +3 -1
  18. package/dist/cjs/src/data/models/spike.js +8 -7
  19. package/dist/cjs/src/data/transformers/block.js +4 -2
  20. package/dist/cjs/src/data/transformers/reception.js +4 -2
  21. package/dist/cjs/src/data/transformers/serve.js +4 -2
  22. package/dist/cjs/src/data/transformers/set.js +4 -2
  23. package/dist/cjs/src/data/transformers/spike.js +4 -2
  24. package/dist/cjs/src/index.d.ts +1 -2
  25. package/dist/cjs/src/index.js +1 -124
  26. package/dist/cjs/src/service/event/__stubs__/index.js +2 -1
  27. package/dist/cjs/src/service/event/block.d.ts +1 -1
  28. package/dist/cjs/src/service/event/block.js +2 -2
  29. package/dist/cjs/src/service/event/block.test.js +10 -5
  30. package/dist/cjs/src/service/event/in-play-event.d.ts +4 -2
  31. package/dist/cjs/src/service/event/in-play-event.js +6 -5
  32. package/dist/cjs/src/service/event/libero-replacement.d.ts +1 -1
  33. package/dist/cjs/src/service/event/libero-replacement.js +2 -2
  34. package/dist/cjs/src/service/event/reception.d.ts +1 -1
  35. package/dist/cjs/src/service/event/reception.js +2 -2
  36. package/dist/cjs/src/service/event/reception.test.js +4 -2
  37. package/dist/cjs/src/service/event/serve.d.ts +1 -1
  38. package/dist/cjs/src/service/event/serve.js +2 -2
  39. package/dist/cjs/src/service/event/serve.test.js +4 -2
  40. package/dist/cjs/src/service/event/set.d.ts +1 -1
  41. package/dist/cjs/src/service/event/set.js +2 -2
  42. package/dist/cjs/src/service/event/set.test.js +4 -2
  43. package/dist/cjs/src/service/event/spike.d.ts +1 -1
  44. package/dist/cjs/src/service/event/spike.js +2 -2
  45. package/dist/cjs/src/service/event/spike.test.js +6 -3
  46. package/dist/cjs/src/service/player/role.d.ts +1 -1
  47. package/dist/cjs/src/service/team/team.d.ts +3 -3
  48. package/dist/cjs/src/service/team/team.js +6 -6
  49. package/dist/esm/src/data/index.d.ts +1 -2
  50. package/dist/esm/src/data/index.js +1 -1
  51. package/dist/esm/src/data/models/block.d.ts +3 -1
  52. package/dist/esm/src/data/models/block.js +8 -7
  53. package/dist/esm/src/data/models/event.d.ts +3 -1
  54. package/dist/esm/src/data/models/event.js +8 -7
  55. package/dist/esm/src/data/models/index.d.ts +32 -62
  56. package/dist/esm/src/data/models/index.js +32 -32
  57. package/dist/esm/src/data/models/iteration.d.ts +1 -1
  58. package/dist/esm/src/data/models/iteration.js +2 -2
  59. package/dist/esm/src/data/models/reception.d.ts +3 -1
  60. package/dist/esm/src/data/models/reception.js +8 -7
  61. package/dist/esm/src/data/models/serve.d.ts +3 -1
  62. package/dist/esm/src/data/models/serve.js +8 -7
  63. package/dist/esm/src/data/models/set.d.ts +3 -1
  64. package/dist/esm/src/data/models/set.js +8 -7
  65. package/dist/esm/src/data/models/spike.d.ts +3 -1
  66. package/dist/esm/src/data/models/spike.js +8 -7
  67. package/dist/esm/src/data/transformers/block.js +5 -3
  68. package/dist/esm/src/data/transformers/reception.js +5 -3
  69. package/dist/esm/src/data/transformers/serve.js +5 -3
  70. package/dist/esm/src/data/transformers/set.js +5 -3
  71. package/dist/esm/src/data/transformers/spike.js +5 -3
  72. package/dist/esm/src/index.d.ts +1 -2
  73. package/dist/esm/src/index.js +1 -1
  74. package/dist/esm/src/service/event/__stubs__/index.js +2 -1
  75. package/dist/esm/src/service/event/block.d.ts +1 -1
  76. package/dist/esm/src/service/event/block.js +2 -2
  77. package/dist/esm/src/service/event/block.test.js +10 -5
  78. package/dist/esm/src/service/event/in-play-event.d.ts +4 -2
  79. package/dist/esm/src/service/event/in-play-event.js +6 -5
  80. package/dist/esm/src/service/event/libero-replacement.d.ts +1 -1
  81. package/dist/esm/src/service/event/libero-replacement.js +3 -3
  82. package/dist/esm/src/service/event/reception.d.ts +1 -1
  83. package/dist/esm/src/service/event/reception.js +2 -2
  84. package/dist/esm/src/service/event/reception.test.js +4 -2
  85. package/dist/esm/src/service/event/serve.d.ts +1 -1
  86. package/dist/esm/src/service/event/serve.js +2 -2
  87. package/dist/esm/src/service/event/serve.test.js +4 -2
  88. package/dist/esm/src/service/event/set.d.ts +1 -1
  89. package/dist/esm/src/service/event/set.js +2 -2
  90. package/dist/esm/src/service/event/set.test.js +4 -2
  91. package/dist/esm/src/service/event/spike.d.ts +1 -1
  92. package/dist/esm/src/service/event/spike.js +2 -2
  93. package/dist/esm/src/service/event/spike.test.js +6 -3
  94. package/dist/esm/src/service/player/role.d.ts +1 -1
  95. package/dist/esm/src/service/team/team.d.ts +3 -3
  96. package/dist/esm/src/service/team/team.js +6 -6
  97. package/package.json +1 -1
@@ -1,6 +1,5 @@
1
1
  import { PerformanceStats } from './performance-stats';
2
2
  export declare class Role {
3
- readonly name: string;
4
3
  static readonly SETTER: Role;
5
4
  static readonly LIBERO: Role;
6
5
  static readonly OUTSIDE_HITTER: Role;
@@ -8,6 +7,7 @@ export declare class Role {
8
7
  static readonly MIDDLE_BLOCKER: Role;
9
8
  static readonly DEFENSIVE_SPECIALIST: Role;
10
9
  private static readonly ROLES;
10
+ readonly name: string;
11
11
  private constructor();
12
12
  static getRoles(): Role[];
13
13
  static calculateScore(stats: PerformanceStats, role: Role): number;
@@ -20,12 +20,12 @@ export declare class Team {
20
20
  readonly coach?: Coach;
21
21
  readonly league?: League;
22
22
  readonly country?: Country;
23
- private _rating;
24
23
  constructor({ id, rating, name, shortName, country, roster, coach, league }: TeamOpts);
25
- isPlayerInRoster(player: Player): boolean;
26
- toString(): string;
24
+ private _rating;
27
25
  get rating(): number;
28
26
  set rating(value: number);
27
+ isPlayerInRoster(player: Player): boolean;
28
+ toString(): string;
29
29
  updateRating(ratingChange: number): void;
30
30
  }
31
31
  export {};
@@ -15,18 +15,18 @@ class Team {
15
15
  this.country = country;
16
16
  this.league = league;
17
17
  }
18
- isPlayerInRoster(player) {
19
- return this.roster.some(p => p.id === player.id);
20
- }
21
- toString() {
22
- return `${this.name} [${this.shortName}] (${this.country?.name}) ELO=${this._rating}`;
23
- }
24
18
  get rating() {
25
19
  return this._rating;
26
20
  }
27
21
  set rating(value) {
28
22
  this._rating = value;
29
23
  }
24
+ isPlayerInRoster(player) {
25
+ return this.roster.some(p => p.id === player.id);
26
+ }
27
+ toString() {
28
+ return `${this.name} [${this.shortName}] (${this.country?.name}) ELO=${this._rating}`;
29
+ }
30
30
  updateRating(ratingChange) {
31
31
  if (Math.abs(ratingChange) > match_1.MatchRating.K)
32
32
  throw new Error(`INVALID RATING CHANGE: ${ratingChange}`);
@@ -1,4 +1,3 @@
1
- export type { MatchRatingCreationAttributes, MatchRatingId, MatchRatingPk, DraftPk, DraftId, DraftCreationAttributes, DraftPickCreationAttributes, DraftPickId, DraftPickPk, PlayerTeamCreationAttributes, PlayerTeamId, PlayerTeamOptionalAttributes, PlayerTeamPk, BlockCreationAttributes, BlockFailure, BlockId, BlockPk, BlockType, CoachCreationAttributes, CoachId, CoachPk, CountryCreationAttributes, CountryId, CountryPk, CourtPositionType, CourtTarget, EventCreationAttributes, EventId, EventPk, EventType, FormationType, LeagueCreationAttributes, LeagueId, LeaguePk, LiberoReplacementCreationAttributes, LiberoReplacementId, LiberoReplacementPk, LiberoReplacementType, MatchCreationAttributes, MatchId, MatchPk, MatchSetCreationAttributes, MatchSetId, MatchSetPk, MatchSetStatsCreationAttributes, MatchSetStatsId, MatchSetStatsPk, PerformanceStatsCreationAttributes, PerformanceStatsId, PerformanceStatsPk, PlayerCreationAttributes, PlayerId, PlayerPk, RallyCreationAttributes, RallyId, RallyPk, RallyPositionCreationAttributes, RallyPositionId, RallyPositionPk, ReceptionCreationAttributes, ReceptionFailure, ReceptionId, ReceptionPk, ReceptionType, RoleType, ScoreCreationAttributes, ScoreId, ScorePk, SeasonCreationAttributes, SeasonId, SeasonMatchCreationAttributes, SeasonMatchId, SeasonMatchPk, SeasonPk, SeasonTeamsCreationAttributes, SeasonTeamsId, SeasonTeamsPk, ServeCreationAttributes, ServeFailure, ServeId, ServePk, ServeType, SetCreationAttributes, SetFailure, SetId, SetPk, SetType, Side, SpikeCreationAttributes, SpikeFailure, SpikeId, SpikePk, SpikeType, SubstitutionCreationAttributes, SubstitutionId, SubstitutionPk, TeamCreationAttributes, TeamId, TeamPk, TournamentCreationAttributes, TournamentId, TournamentMatchCreationAttributes, TournamentMatchId, TournamentMatchPk, TournamentPk, TournamentStage, TournamentTeamsCreationAttributes, TournamentTeamsId, TournamentTeamsPk, TraitType, IterationPk, IterationCreationAttributes, IterationId, UserCreationAttributes, UserOptionalAttributes, UserRole, UserId, UserPk } from './models';
2
- export { UserAttributes, UserModel, MatchRatingModel, MatchRatingAttributes, DraftModel, DraftAttributes, DraftPickAttributes, DraftPickModel, PlayerTeamModel, PlayerTeamAttributes, BlockAttributes, BlockModel, BlockOptionalAttributes, CoachAttributes, CoachModel, CoachOptionalAttributes, CountryAttributes, CountryModel, EventAttributes, EventModel, LeagueAttributes, LeagueModel, LiberoReplacementAttributes, LiberoReplacementModel, MatchAttributes, MatchModel, MatchSetAttributes, MatchSetModel, MatchSetOptionalAttributes, MatchSetStatsAttributes, MatchSetStatsModel, MatchSetStatsOptionalAttributes, PerformanceStatsAttributes, PerformanceStatsModel, PerformanceStatsOptionalAttributes, PlayerAttributes, PlayerModel, RallyAttributes, RallyModel, RallyPositionAttributes, RallyPositionModel, ReceptionAttributes, ReceptionModel, ScoreAttributes, ScoreModel, SeasonAttributes, SeasonMatchAttributes, SeasonMatchModel, SeasonModel, SeasonTeamsAttributes, SeasonTeamsModel, ServeAttributes, ServeModel, SetAttributes, SetModel, SpikeAttributes, SpikeModel, SubstitutionAttributes, SubstitutionModel, TeamAttributes, TeamModel, TournamentAttributes, TournamentMatchAttributes, TournamentMatchModel, TournamentModel, TournamentOptionalAttributes, TournamentTeamsAttributes, TournamentTeamsModel, IterationModel, IterationAttributes } from './models';
1
+ export * from './models';
3
2
  export * from './transformers';
4
3
  export { initModels } from './init-models';
@@ -1,3 +1,3 @@
1
- export { UserModel, MatchRatingModel, DraftModel, DraftPickModel, PlayerTeamModel, BlockModel, CoachModel, CountryModel, EventModel, LeagueModel, LiberoReplacementModel, MatchModel, MatchSetModel, MatchSetStatsModel, PerformanceStatsModel, PlayerModel, RallyModel, RallyPositionModel, ReceptionModel, ScoreModel, SeasonMatchModel, SeasonModel, SeasonTeamsModel, ServeModel, SetModel, SpikeModel, SubstitutionModel, TeamModel, TournamentMatchModel, TournamentModel, TournamentTeamsModel, IterationModel } from './models';
1
+ export * from './models';
2
2
  export * from './transformers';
3
3
  export { initModels } from './init-models';
@@ -1,6 +1,6 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model, Optional } from 'sequelize';
3
- import type { CourtTarget, EventType, PlayerId, PlayerModel, RallyId, RallyModel } from '.';
3
+ import { CourtTarget, EventType, PlayerId, PlayerModel, RallyId, RallyModel, TraitType } from '.';
4
4
  export interface BlockAttributes {
5
5
  event_id: string;
6
6
  rally_id: string;
@@ -15,6 +15,7 @@ export interface BlockAttributes {
15
15
  blocker_3?: string;
16
16
  modifier: number;
17
17
  score: number;
18
+ active_traits: TraitType[];
18
19
  }
19
20
  export type BlockType = 'NO_BLOCKER' | 'SINGLE' | 'DOUBLE' | 'TRIPLE';
20
21
  export type BlockFailure = 'NO_FAILURE' | 'FAULT' | 'MISS' | 'OUT_OF_BOUNDS' | 'WIPE' | 'TOOL';
@@ -36,6 +37,7 @@ export declare class BlockModel extends Model<BlockAttributes, BlockCreationAttr
36
37
  blocker_3?: string;
37
38
  modifier: number;
38
39
  score: number;
40
+ active_traits: TraitType[];
39
41
  player: PlayerModel;
40
42
  getPlayer: Sequelize.BelongsToGetAssociationMixin<PlayerModel>;
41
43
  setPlayer: Sequelize.BelongsToSetAssociationMixin<PlayerModel, PlayerId>;
@@ -74,21 +74,22 @@ export class BlockModel extends Model {
74
74
  score: {
75
75
  type: DataTypes.REAL,
76
76
  allowNull: false
77
+ },
78
+ active_traits: {
79
+ type: DataTypes.ARRAY(DataTypes.ENUM('MARKSMAN', 'MOVING_WALL', 'MASTER_MIND', 'METEOR_SERVE', 'VIGOROUS', 'GUARDIAN')),
80
+ allowNull: false,
81
+ defaultValue: [[]]
77
82
  }
78
83
  }, {
79
84
  sequelize,
80
85
  tableName: 'Block',
81
86
  schema: 'public',
82
87
  timestamps: false,
83
- indexes: [
84
- {
88
+ indexes: [{
85
89
  name: 'Block_pk',
86
90
  unique: true,
87
- fields: [
88
- { name: 'event_id' }
89
- ]
90
- }
91
- ]
91
+ fields: [{ name: 'event_id' }]
92
+ }]
92
93
  });
93
94
  }
94
95
  }
@@ -1,12 +1,13 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model } from 'sequelize';
3
- import type { PlayerId, PlayerModel, RallyId, RallyModel } from '.';
3
+ import { PlayerId, PlayerModel, RallyId, RallyModel, TraitType } from '.';
4
4
  export interface EventAttributes {
5
5
  event_id: string;
6
6
  rally_id: string;
7
7
  event_type: EventType;
8
8
  order: number;
9
9
  player_id: string;
10
+ active_traits: TraitType[];
10
11
  }
11
12
  export type EventType = 'LIBERO_REPLACEMENT' | 'SUBSTITUTION' | 'SERVE' | 'RECEPTION' | 'SET' | 'SPIKE' | 'BLOCK' | 'SCORE';
12
13
  export type CourtTarget = 'NO_TARGET' | 'OPPONENT_RIGHT_BACK' | 'OPPONENT_MIDDLE_BACK' | 'OPPONENT_LEFT_BACK' | 'OPPONENT_RIGHT_FRONT' | 'OPPONENT_MIDDLE_FRONT' | 'OPPONENT_LEFT_FRONT' | 'TEAM_LEFT_FRONT' | 'TEAM_MIDDLE_FRONT' | 'TEAM_RIGHT_FRONT' | 'TEAM_LEFT_BACK' | 'TEAM_MIDDLE_BACK' | 'TEAM_RIGHT_BACK';
@@ -19,6 +20,7 @@ export declare class EventModel extends Model<EventAttributes, EventCreationAttr
19
20
  event_type: EventType;
20
21
  order: number;
21
22
  player_id: string;
23
+ active_traits: TraitType[];
22
24
  player: PlayerModel;
23
25
  getPlayer: Sequelize.BelongsToGetAssociationMixin<PlayerModel>;
24
26
  setPlayer: Sequelize.BelongsToSetAssociationMixin<PlayerModel, PlayerId>;
@@ -30,21 +30,22 @@ export class EventModel extends Model {
30
30
  model: 'Player',
31
31
  key: 'player_id'
32
32
  }
33
+ },
34
+ active_traits: {
35
+ type: DataTypes.ARRAY(DataTypes.ENUM('MARKSMAN', 'MOVING_WALL', 'MASTER_MIND', 'METEOR_SERVE', 'VIGOROUS', 'GUARDIAN')),
36
+ allowNull: false,
37
+ defaultValue: [[]]
33
38
  }
34
39
  }, {
35
40
  sequelize,
36
41
  tableName: 'Event',
37
42
  schema: 'public',
38
43
  timestamps: false,
39
- indexes: [
40
- {
44
+ indexes: [{
41
45
  name: 'Event_pk',
42
46
  unique: true,
43
- fields: [
44
- { name: 'event_id' }
45
- ]
46
- }
47
- ]
47
+ fields: [{ name: 'event_id' }]
48
+ }]
48
49
  });
49
50
  }
50
51
  }
@@ -1,62 +1,32 @@
1
- export type { BlockCreationAttributes, BlockFailure, BlockId, BlockOptionalAttributes, BlockPk, BlockType } from './block';
2
- export { BlockAttributes, BlockModel } from './block';
3
- export type { CoachCreationAttributes, CoachId, CoachOptionalAttributes, CoachPk, FormationType } from './coach';
4
- export { CoachAttributes, CoachModel } from './coach';
5
- export type { CountryCreationAttributes, CountryId, CountryPk } from './country';
6
- export { CountryAttributes, CountryModel } from './country';
7
- export type { DraftCreationAttributes, DraftId, DraftPk } from './draft';
8
- export { DraftAttributes, DraftModel } from './draft';
9
- export type { DraftPickCreationAttributes, DraftPickId, DraftPickPk } from './draft-pick';
10
- export { DraftPickAttributes, DraftPickModel } from './draft-pick';
11
- export type { PlayerTeamCreationAttributes, PlayerTeamId, PlayerTeamOptionalAttributes, PlayerTeamPk } from './player-team';
12
- export { PlayerTeamAttributes, PlayerTeamModel } from './player-team';
13
- export type { CourtTarget, EventCreationAttributes, EventId, EventPk, EventType } from './event';
14
- export { EventAttributes, EventModel } from './event';
15
- export type { IterationCreationAttributes, IterationId, IterationPk } from './iteration';
16
- export { IterationAttributes, IterationModel } from './iteration';
17
- export type { LeagueCreationAttributes, LeagueId, LeaguePk } from './league';
18
- export { LeagueAttributes, LeagueModel } from './league';
19
- export type { LiberoReplacementCreationAttributes, LiberoReplacementId, LiberoReplacementPk, LiberoReplacementType } from './libero-replacement';
20
- export { LiberoReplacementAttributes, LiberoReplacementModel } from './libero-replacement';
21
- export type { MatchCreationAttributes, MatchId, MatchPk } from './match';
22
- export { MatchAttributes, MatchModel } from './match';
23
- export type { MatchSetCreationAttributes, MatchSetId, MatchSetOptionalAttributes, MatchSetPk } from './match-set';
24
- export { MatchSetAttributes, MatchSetModel } from './match-set';
25
- export type { MatchSetStatsCreationAttributes, MatchSetStatsId, MatchSetStatsOptionalAttributes, MatchSetStatsPk } from './match-set-stats';
26
- export { MatchSetStatsAttributes, MatchSetStatsModel } from './match-set-stats';
27
- export type { PerformanceStatsCreationAttributes, PerformanceStatsId, PerformanceStatsOptionalAttributes, PerformanceStatsPk } from './performance-stats';
28
- export { PerformanceStatsAttributes, PerformanceStatsModel } from './performance-stats';
29
- export type { PlayerCreationAttributes, PlayerId, PlayerPk, RoleType, TraitType } from './player';
30
- export { PlayerAttributes, PlayerModel } from './player';
31
- export { RallyAttributes, RallyCreationAttributes, RallyId, RallyModel, RallyPk } from './rally';
32
- export { CourtPositionType, RallyPositionAttributes, RallyPositionCreationAttributes, RallyPositionId, RallyPositionModel, RallyPositionPk, Side } from './rally-position';
33
- export type { ReceptionCreationAttributes, ReceptionFailure, ReceptionId, ReceptionPk, ReceptionType } from './reception';
34
- export { ReceptionAttributes, ReceptionModel } from './reception';
35
- export type { ScoreCreationAttributes, ScoreId, ScorePk } from './score';
36
- export { ScoreAttributes, ScoreModel } from './score';
37
- export type { SeasonCreationAttributes, SeasonId, SeasonPk } from './season';
38
- export { SeasonAttributes, SeasonModel } from './season';
39
- export type { SeasonTeamsCreationAttributes, SeasonTeamsId, SeasonTeamsPk } from './season-teams';
40
- export { SeasonTeamsAttributes, SeasonTeamsModel } from './season-teams';
41
- export type { SeasonMatchCreationAttributes, SeasonMatchId, SeasonMatchPk } from './season-match';
42
- export { SeasonMatchAttributes, SeasonMatchModel } from './season-match';
43
- export type { ServeCreationAttributes, ServeFailure, ServeId, ServePk, ServeType } from './serve';
44
- export { ServeAttributes, ServeModel } from './serve';
45
- export type { SetCreationAttributes, SetFailure, SetId, SetPk, SetType } from './set';
46
- export { SetAttributes, SetModel } from './set';
47
- export type { SpikeCreationAttributes, SpikeFailure, SpikeId, SpikePk, SpikeType } from './spike';
48
- export { SpikeAttributes, SpikeModel } from './spike';
49
- export type { SubstitutionCreationAttributes, SubstitutionId, SubstitutionPk } from './substitution';
50
- export { SubstitutionAttributes, SubstitutionModel } from './substitution';
51
- export type { TeamCreationAttributes, TeamId, TeamPk } from './team';
52
- export { TeamAttributes, TeamModel } from './team';
53
- export type { TournamentCreationAttributes, TournamentId, TournamentOptionalAttributes, TournamentPk } from './tournament';
54
- export { TournamentAttributes, TournamentModel } from './tournament';
55
- export type { TournamentMatchCreationAttributes, TournamentMatchId, TournamentMatchPk, TournamentStage } from './tournament-match';
56
- export { TournamentMatchAttributes, TournamentMatchModel } from './tournament-match';
57
- export type { TournamentTeamsCreationAttributes, TournamentTeamsId, TournamentTeamsPk } from './tournament-teams';
58
- export { TournamentTeamsAttributes, TournamentTeamsModel } from './tournament-teams';
59
- export type { MatchRatingCreationAttributes, MatchRatingId, MatchRatingPk } from './match-rating';
60
- export { MatchRatingAttributes, MatchRatingModel } from './match-rating';
61
- export type { UserCreationAttributes, UserId, UserOptionalAttributes, UserPk, UserRole } from './user';
62
- export { UserAttributes, UserModel } from './user';
1
+ export * from './block';
2
+ export * from './coach';
3
+ export * from './country';
4
+ export * from './draft';
5
+ export * from './draft-pick';
6
+ export * from './event';
7
+ export * from './iteration';
8
+ export * from './league';
9
+ export * from './libero-replacement';
10
+ export * from './match';
11
+ export * from './match-rating';
12
+ export * from './match-set';
13
+ export * from './match-set-stats';
14
+ export * from './performance-stats';
15
+ export * from './player';
16
+ export * from './player-team';
17
+ export * from './rally';
18
+ export * from './rally-position';
19
+ export * from './reception';
20
+ export * from './score';
21
+ export * from './season';
22
+ export * from './season-match';
23
+ export * from './season-teams';
24
+ export * from './serve';
25
+ export * from './set';
26
+ export * from './spike';
27
+ export * from './substitution';
28
+ export * from './team';
29
+ export * from './tournament';
30
+ export * from './tournament-match';
31
+ export * from './tournament-teams';
32
+ export * from './user';
@@ -1,32 +1,32 @@
1
- export { BlockModel } from './block';
2
- export { CoachModel } from './coach';
3
- export { CountryModel } from './country';
4
- export { DraftModel } from './draft';
5
- export { DraftPickModel } from './draft-pick';
6
- export { PlayerTeamModel } from './player-team';
7
- export { EventModel } from './event';
8
- export { IterationModel } from './iteration';
9
- export { LeagueModel } from './league';
10
- export { LiberoReplacementModel } from './libero-replacement';
11
- export { MatchModel } from './match';
12
- export { MatchSetModel } from './match-set';
13
- export { MatchSetStatsModel } from './match-set-stats';
14
- export { PerformanceStatsModel } from './performance-stats';
15
- export { PlayerModel } from './player';
16
- export { RallyModel } from './rally';
17
- export { RallyPositionModel } from './rally-position';
18
- export { ReceptionModel } from './reception';
19
- export { ScoreModel } from './score';
20
- export { SeasonModel } from './season';
21
- export { SeasonTeamsModel } from './season-teams';
22
- export { SeasonMatchModel } from './season-match';
23
- export { ServeModel } from './serve';
24
- export { SetModel } from './set';
25
- export { SpikeModel } from './spike';
26
- export { SubstitutionModel } from './substitution';
27
- export { TeamModel } from './team';
28
- export { TournamentModel } from './tournament';
29
- export { TournamentMatchModel } from './tournament-match';
30
- export { TournamentTeamsModel } from './tournament-teams';
31
- export { MatchRatingModel } from './match-rating';
32
- export { UserModel } from './user';
1
+ export * from './block';
2
+ export * from './coach';
3
+ export * from './country';
4
+ export * from './draft';
5
+ export * from './draft-pick';
6
+ export * from './event';
7
+ export * from './iteration';
8
+ export * from './league';
9
+ export * from './libero-replacement';
10
+ export * from './match';
11
+ export * from './match-rating';
12
+ export * from './match-set';
13
+ export * from './match-set-stats';
14
+ export * from './performance-stats';
15
+ export * from './player';
16
+ export * from './player-team';
17
+ export * from './rally';
18
+ export * from './rally-position';
19
+ export * from './reception';
20
+ export * from './score';
21
+ export * from './season';
22
+ export * from './season-match';
23
+ export * from './season-teams';
24
+ export * from './serve';
25
+ export * from './set';
26
+ export * from './spike';
27
+ export * from './substitution';
28
+ export * from './team';
29
+ export * from './tournament';
30
+ export * from './tournament-match';
31
+ export * from './tournament-teams';
32
+ export * from './user';
@@ -5,7 +5,7 @@ export interface IterationAttributes {
5
5
  iteration_id: number;
6
6
  start_date: Date;
7
7
  }
8
- export type IterationPk = "iteration_id";
8
+ export type IterationPk = 'iteration_id';
9
9
  export type IterationId = IterationModel[IterationPk];
10
10
  export type IterationCreationAttributes = IterationAttributes;
11
11
  export declare class IterationModel extends Model<IterationAttributes, IterationCreationAttributes> implements IterationAttributes {
@@ -20,10 +20,10 @@ export class IterationModel extends Model {
20
20
  timestamps: false,
21
21
  indexes: [
22
22
  {
23
- name: "Iteration_pk",
23
+ name: 'Iteration_pk',
24
24
  unique: true,
25
25
  fields: [
26
- { name: "iteration_id" },
26
+ { name: 'iteration_id' },
27
27
  ]
28
28
  },
29
29
  ]
@@ -1,6 +1,6 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model } from 'sequelize';
3
- import type { CourtTarget, EventType, PlayerId, PlayerModel, RallyId, RallyModel } from '.';
3
+ import { CourtTarget, EventType, PlayerId, PlayerModel, RallyId, RallyModel, TraitType } from '.';
4
4
  export interface ReceptionAttributes {
5
5
  event_id: string;
6
6
  rally_id: string;
@@ -12,6 +12,7 @@ export interface ReceptionAttributes {
12
12
  player_id: string;
13
13
  modifier: number;
14
14
  score: number;
15
+ active_traits: TraitType[];
15
16
  }
16
17
  export type ReceptionFailure = 'NO_FAILURE' | 'FAULT' | 'MISS' | 'OUT_OF_BOUNDS' | 'BAD_PASS';
17
18
  export type ReceptionType = 'DIG' | 'OVERHAND' | 'ONE_HAND' | 'OTHER_BODY_PART';
@@ -29,6 +30,7 @@ export declare class ReceptionModel extends Model<ReceptionAttributes, Reception
29
30
  player_id: string;
30
31
  modifier: number;
31
32
  score: number;
33
+ active_traits: TraitType[];
32
34
  player: PlayerModel;
33
35
  getPlayer: Sequelize.BelongsToGetAssociationMixin<PlayerModel>;
34
36
  setPlayer: Sequelize.BelongsToSetAssociationMixin<PlayerModel, PlayerId>;
@@ -50,21 +50,22 @@ export class ReceptionModel extends Model {
50
50
  score: {
51
51
  type: DataTypes.REAL,
52
52
  allowNull: false
53
+ },
54
+ active_traits: {
55
+ type: DataTypes.ARRAY(DataTypes.ENUM('MARKSMAN', 'MOVING_WALL', 'MASTER_MIND', 'METEOR_SERVE', 'VIGOROUS', 'GUARDIAN')),
56
+ allowNull: false,
57
+ defaultValue: [[]]
53
58
  }
54
59
  }, {
55
60
  sequelize,
56
61
  tableName: 'Reception',
57
62
  schema: 'public',
58
63
  timestamps: false,
59
- indexes: [
60
- {
64
+ indexes: [{
61
65
  name: 'Reception_pk',
62
66
  unique: true,
63
- fields: [
64
- { name: 'event_id' }
65
- ]
66
- }
67
- ]
67
+ fields: [{ name: 'event_id' }]
68
+ }]
68
69
  });
69
70
  }
70
71
  }
@@ -1,6 +1,6 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model } from 'sequelize';
3
- import type { CourtTarget, EventType, PlayerId, PlayerModel, RallyId, RallyModel } from '.';
3
+ import { CourtTarget, EventType, PlayerId, PlayerModel, RallyId, RallyModel, TraitType } from '.';
4
4
  export interface ServeAttributes {
5
5
  event_id: string;
6
6
  rally_id: string;
@@ -12,6 +12,7 @@ export interface ServeAttributes {
12
12
  modifier: number;
13
13
  score: number;
14
14
  type: ServeType;
15
+ active_traits: TraitType[];
15
16
  }
16
17
  export type ServeFailure = 'NO_FAILURE' | 'FAULT' | 'MISS' | 'NET' | 'OUT_OF_BOUNDS';
17
18
  export type ServeType = 'UNDERHAND' | 'OVERHAND_TOPSPIN' | 'OVERHAND_FLOAT' | 'JUMP_TOPSPIN' | 'JUMP_FLOAT';
@@ -29,6 +30,7 @@ export declare class ServeModel extends Model<ServeAttributes, ServeCreationAttr
29
30
  modifier: number;
30
31
  score: number;
31
32
  type: ServeType;
33
+ active_traits: TraitType[];
32
34
  player: PlayerModel;
33
35
  getPlayer: Sequelize.BelongsToGetAssociationMixin<PlayerModel>;
34
36
  setPlayer: Sequelize.BelongsToSetAssociationMixin<PlayerModel, PlayerId>;
@@ -50,21 +50,22 @@ export class ServeModel extends Model {
50
50
  type: {
51
51
  type: DataTypes.ENUM('UNDERHAND', 'OVERHAND_TOPSPIN', 'OVERHAND_FLOAT', 'JUMP_TOPSPIN', 'JUMP_FLOAT'),
52
52
  allowNull: false
53
+ },
54
+ active_traits: {
55
+ type: DataTypes.ARRAY(DataTypes.ENUM('MARKSMAN', 'MOVING_WALL', 'MASTER_MIND', 'METEOR_SERVE', 'VIGOROUS', 'GUARDIAN')),
56
+ allowNull: false,
57
+ defaultValue: [[]]
53
58
  }
54
59
  }, {
55
60
  sequelize,
56
61
  tableName: 'Serve',
57
62
  schema: 'public',
58
63
  timestamps: false,
59
- indexes: [
60
- {
64
+ indexes: [{
61
65
  name: 'Serve_pk',
62
66
  unique: true,
63
- fields: [
64
- { name: 'event_id' }
65
- ]
66
- }
67
- ]
67
+ fields: [{ name: 'event_id' }]
68
+ }]
68
69
  });
69
70
  }
70
71
  }
@@ -1,6 +1,6 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model } from 'sequelize';
3
- import type { CourtTarget, EventType, PlayerId, PlayerModel, RallyId, RallyModel } from '.';
3
+ import { CourtTarget, EventType, PlayerId, PlayerModel, RallyId, RallyModel, TraitType } from '.';
4
4
  export interface SetAttributes {
5
5
  event_id: string;
6
6
  rally_id: string;
@@ -12,6 +12,7 @@ export interface SetAttributes {
12
12
  player_id: string;
13
13
  modifier: number;
14
14
  score: number;
15
+ active_traits: TraitType[];
15
16
  }
16
17
  export type SetFailure = 'NO_FAILURE' | 'FAULT' | 'MISS' | 'OUT_OF_BOUNDS' | 'BAD_PASS';
17
18
  export type SetType = 'OVERHAND' | 'UNDERHAND' | 'SPIKE' | 'DUMP';
@@ -29,6 +30,7 @@ export declare class SetModel extends Model<SetAttributes, SetCreationAttributes
29
30
  player_id: string;
30
31
  modifier: number;
31
32
  score: number;
33
+ active_traits: TraitType[];
32
34
  player: PlayerModel;
33
35
  getPlayer: Sequelize.BelongsToGetAssociationMixin<PlayerModel>;
34
36
  setPlayer: Sequelize.BelongsToSetAssociationMixin<PlayerModel, PlayerId>;
@@ -50,21 +50,22 @@ export class SetModel extends Model {
50
50
  score: {
51
51
  type: DataTypes.REAL,
52
52
  allowNull: false
53
+ },
54
+ active_traits: {
55
+ type: DataTypes.ARRAY(DataTypes.ENUM('MARKSMAN', 'MOVING_WALL', 'MASTER_MIND', 'METEOR_SERVE', 'VIGOROUS', 'GUARDIAN')),
56
+ allowNull: false,
57
+ defaultValue: [[]]
53
58
  }
54
59
  }, {
55
60
  sequelize,
56
61
  tableName: 'Set',
57
62
  schema: 'public',
58
63
  timestamps: false,
59
- indexes: [
60
- {
64
+ indexes: [{
61
65
  name: 'Set_pk',
62
66
  unique: true,
63
- fields: [
64
- { name: 'event_id' }
65
- ]
66
- }
67
- ]
67
+ fields: [{ name: 'event_id' }]
68
+ }]
68
69
  });
69
70
  }
70
71
  }
@@ -1,6 +1,6 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model } from 'sequelize';
3
- import type { CourtTarget, EventType, PlayerId, PlayerModel, RallyId, RallyModel } from '.';
3
+ import { CourtTarget, EventType, PlayerId, PlayerModel, RallyId, RallyModel, TraitType } from '.';
4
4
  export interface SpikeAttributes {
5
5
  event_id: string;
6
6
  rally_id: string;
@@ -12,6 +12,7 @@ export interface SpikeAttributes {
12
12
  player_id: string;
13
13
  modifier: number;
14
14
  score: number;
15
+ active_traits: TraitType[];
15
16
  }
16
17
  export type SpikeType = 'CROSS_SHOT' | 'LINE_SHOT' | 'TOOL_SHOT' | 'TIP' | 'DOWN_BALL' | 'OVERHAND';
17
18
  export type SpikeFailure = 'NO_FAILURE' | 'FAULT' | 'MISS' | 'OUT_OF_BOUNDS' | 'NET';
@@ -29,6 +30,7 @@ export declare class SpikeModel extends Model<SpikeAttributes, SpikeCreationAttr
29
30
  player_id: string;
30
31
  modifier: number;
31
32
  score: number;
33
+ active_traits: TraitType[];
32
34
  player: PlayerModel;
33
35
  getPlayer: Sequelize.BelongsToGetAssociationMixin<PlayerModel>;
34
36
  setPlayer: Sequelize.BelongsToSetAssociationMixin<PlayerModel, PlayerId>;
@@ -50,21 +50,22 @@ export class SpikeModel extends Model {
50
50
  score: {
51
51
  type: DataTypes.REAL,
52
52
  allowNull: false
53
+ },
54
+ active_traits: {
55
+ type: DataTypes.ARRAY(DataTypes.ENUM('MARKSMAN', 'MOVING_WALL', 'MASTER_MIND', 'METEOR_SERVE', 'VIGOROUS', 'GUARDIAN')),
56
+ allowNull: false,
57
+ defaultValue: [[]]
53
58
  }
54
59
  }, {
55
60
  sequelize,
56
61
  tableName: 'Spike',
57
62
  schema: 'public',
58
63
  timestamps: false,
59
- indexes: [
60
- {
64
+ indexes: [{
61
65
  name: 'Spike_pk',
62
66
  unique: true,
63
- fields: [
64
- { name: 'event_id' }
65
- ]
66
- }
67
- ]
67
+ fields: [{ name: 'event_id' }]
68
+ }]
68
69
  });
69
70
  }
70
71
  }
@@ -1,5 +1,5 @@
1
1
  import { Block, BlockFailureEnum, BlockTypeEnum } from '../../service';
2
- import { transformFromCourtTarget, transformFromEventType, transformToCourtTarget, transformToEventType, transformToPlayer } from '.';
2
+ import { transformFromCourtTarget, transformFromEventType, transformFromTrait, transformToCourtTarget, transformToEventType, transformToPlayer, transformToTrait } from '.';
3
3
  function transformToBlockFailure(failure) {
4
4
  switch (failure) {
5
5
  case BlockFailureEnum.NO_FAILURE:
@@ -52,7 +52,8 @@ function transformToAttributes(event, rallyId) {
52
52
  event_type: transformFromEventType(event.eventType),
53
53
  blocker_1: event.blockers[0]?.id,
54
54
  blocker_2: event.blockers[1]?.id,
55
- blocker_3: event.blockers[2]?.id
55
+ blocker_3: event.blockers[2]?.id,
56
+ active_traits: event.activeTraits.map(transformFromTrait)
56
57
  };
57
58
  }
58
59
  function transformToObject(model) {
@@ -66,7 +67,8 @@ function transformToObject(model) {
66
67
  modifier: model.modifier,
67
68
  order: model.order,
68
69
  score: model.score,
69
- blockers: []
70
+ blockers: [],
71
+ activeTraits: model.active_traits.map(transformToTrait)
70
72
  });
71
73
  if (model.Blocker_1 != null)
72
74
  block.blockers.push(transformToPlayer(model.Blocker_1));