volleyballsimtypes 0.0.30 → 0.0.31

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.
@@ -19,8 +19,8 @@ function initModels(sequelize) {
19
19
  const Reception = models_1.ReceptionModel.initModel(sequelize);
20
20
  const Score = models_1.ScoreModel.initModel(sequelize);
21
21
  const Season = models_1.SeasonModel.initModel(sequelize);
22
- const SeasonTeams = models_1.SeasonTeamsModel.initModel(sequelize);
23
22
  const SeasonMatches = models_1.SeasonMatchesModel.initModel(sequelize);
23
+ const SeasonTeams = models_1.SeasonTeamsModel.initModel(sequelize);
24
24
  const Serve = models_1.ServeModel.initModel(sequelize);
25
25
  const Set = models_1.SetModel.initModel(sequelize);
26
26
  const Spike = models_1.SpikeModel.initModel(sequelize);
@@ -28,169 +28,169 @@ function initModels(sequelize) {
28
28
  const Team = models_1.TeamModel.initModel(sequelize);
29
29
  const Tournament = models_1.TournamentModel.initModel(sequelize);
30
30
  const TournamentMatch = models_1.TournamentMatchModel.initModel(sequelize);
31
- MatchSet.belongsToMany(Player, {
32
- as: 'player_id_Players',
33
- through: MatchSetStats,
34
- foreignKey: 'match_set_id',
35
- otherKey: 'player_id'
36
- });
37
- Player.belongsToMany(MatchSet, {
38
- as: 'match_set_id_MatchSets',
39
- through: MatchSetStats,
40
- foreignKey: 'player_id',
41
- otherKey: 'match_set_id'
42
- });
43
- Player.belongsToMany(Rally, {
44
- as: 'rally_id_Rallies',
45
- through: RallyPosition,
46
- foreignKey: 'player_id',
47
- otherKey: 'rally_id'
48
- });
49
- Rally.belongsToMany(Player, {
50
- as: 'player_id_Player_RallyPositions',
51
- through: RallyPosition,
52
- foreignKey: 'rally_id',
53
- otherKey: 'player_id'
54
- });
55
- Season.belongsToMany(Team, {
56
- as: 'seasonTeams',
57
- through: SeasonTeams,
58
- foreignKey: 'season_id',
59
- otherKey: 'team_id'
60
- });
61
- Team.belongsToMany(Season, {
62
- as: 'season_id_Seasons',
63
- through: SeasonTeams,
64
- foreignKey: 'team_id',
65
- otherKey: 'season_id'
66
- });
67
- Season.belongsToMany(Match, {
68
- as: 'seasonMatches',
69
- through: SeasonMatches,
70
- foreignKey: 'season_id',
71
- otherKey: 'match_id'
72
- });
31
+ Block.belongsTo(Player, { as: 'blocker_1_Player', foreignKey: 'blocker_1' });
32
+ Block.belongsTo(Player, { as: 'blocker_2_Player', foreignKey: 'blocker_2' });
33
+ Block.belongsTo(Player, { as: 'blocker_3_Player', foreignKey: 'blocker_3' });
34
+ Block.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
35
+ Block.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
36
+ Coach.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
37
+ Coach.hasMany(Team, { as: 'Teams', foreignKey: 'coach_id' });
38
+ Country.hasMany(Coach, { as: 'Coaches', foreignKey: 'country_id' });
39
+ Country.hasMany(League, { as: 'Leagues', foreignKey: 'country_id' });
40
+ Country.hasMany(Player, { as: 'Players', foreignKey: 'country_id' });
41
+ Country.hasMany(Team, { as: 'Teams', foreignKey: 'country_id' });
42
+ Event.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
43
+ Event.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
44
+ League.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
45
+ League.hasMany(League, { as: 'Teams', foreignKey: 'league_id' });
46
+ League.hasMany(Season, { as: 'Seasons', foreignKey: 'league_id' });
47
+ LiberoReplacement.belongsTo(Player, { as: 'libero_Player', foreignKey: 'libero' });
48
+ LiberoReplacement.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
49
+ LiberoReplacement.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
50
+ Match.belongsTo(Team, { as: 'awayTeam', foreignKey: 'away_team' });
51
+ Match.belongsTo(Team, { as: 'homeTeam', foreignKey: 'home_team' });
52
+ Match.hasMany(MatchSet, { as: 'MatchSets', foreignKey: 'match_id' });
53
+ Match.hasMany(SeasonMatches, { as: 'SeasonMatches', foreignKey: 'match_id' });
54
+ Match.hasMany(TournamentMatch, { as: 'TournamentMatch', foreignKey: 'match_id' });
73
55
  Match.belongsToMany(Season, {
74
56
  as: 'season_id_Seasons',
75
57
  through: SeasonMatches,
76
58
  foreignKey: 'match_id',
77
59
  otherKey: 'season_id'
78
60
  });
79
- Tournament.belongsToMany(Match, {
80
- as: 'tournamentMatch',
81
- through: TournamentMatch,
82
- foreignKey: 'tournament_id',
83
- otherKey: 'match_id'
84
- });
85
61
  Match.belongsToMany(Tournament, {
86
62
  as: 'tournament_id_Tournaments',
87
63
  through: TournamentMatch,
88
64
  foreignKey: 'match_id',
89
65
  otherKey: 'tournament_id'
90
66
  });
91
- Team.belongsTo(Coach, { as: 'coach', foreignKey: 'coach_id' });
92
- Coach.hasMany(Team, { as: 'Teams', foreignKey: 'coach_id' });
93
- Coach.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
94
- Country.hasMany(Coach, { as: 'Coaches', foreignKey: 'country_id' });
95
- League.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
96
- Country.hasMany(League, { as: 'Leagues', foreignKey: 'country_id' });
97
- Player.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
98
- Country.hasMany(Player, { as: 'Players', foreignKey: 'country_id' });
99
- Team.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
100
- Country.hasMany(Team, { as: 'Teams', foreignKey: 'country_id' });
101
- Season.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
102
- League.hasMany(Season, { as: 'Seasons', foreignKey: 'league_id' });
103
67
  MatchSet.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
104
- Match.hasMany(MatchSet, { as: 'MatchSets', foreignKey: 'match_id' });
105
- MatchSetStats.belongsTo(MatchSet, { as: 'match_set', foreignKey: 'match_set_id' });
68
+ MatchSet.belongsTo(Player, { as: 'away_libero_Player', foreignKey: 'away_libero' });
69
+ MatchSet.belongsTo(Player, { as: 'home_libero_Player', foreignKey: 'home_libero' });
106
70
  MatchSet.hasMany(MatchSetStats, { as: 'MatchSetStats', foreignKey: 'match_set_id' });
107
- Rally.belongsTo(MatchSet, { as: 'match_set', foreignKey: 'match_set_id' });
108
71
  MatchSet.hasMany(Rally, { as: 'Rallies', foreignKey: 'match_set_id' });
109
- Block.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
72
+ MatchSet.belongsToMany(Player, {
73
+ as: 'player_id_Players',
74
+ through: MatchSetStats,
75
+ foreignKey: 'match_set_id',
76
+ otherKey: 'player_id'
77
+ });
78
+ MatchSetStats.belongsTo(MatchSet, { as: 'match_set', foreignKey: 'match_set_id' });
79
+ MatchSetStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
80
+ PerformanceStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
81
+ Player.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
82
+ Player.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
110
83
  Player.hasMany(Block, { as: 'Blocks', foreignKey: 'player_id' });
111
- Block.belongsTo(Player, { as: 'blocker_1_Player', foreignKey: 'blocker_1' });
112
84
  Player.hasMany(Block, { as: 'blocker_1_Blocks', foreignKey: 'blocker_1' });
113
- Block.belongsTo(Player, { as: 'blocker_2_Player', foreignKey: 'blocker_2' });
114
85
  Player.hasMany(Block, { as: 'blocker_2_Blocks', foreignKey: 'blocker_2' });
115
- Block.belongsTo(Player, { as: 'blocker_3_Player', foreignKey: 'blocker_3' });
116
86
  Player.hasMany(Block, { as: 'blocker_3_Blocks', foreignKey: 'blocker_3' });
117
- Event.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
118
87
  Player.hasMany(Event, { as: 'Events', foreignKey: 'player_id' });
119
- LiberoReplacement.belongsTo(Player, { as: 'libero_Player', foreignKey: 'libero' });
120
88
  Player.hasMany(LiberoReplacement, { as: 'LiberoReplacements', foreignKey: 'libero' });
121
- LiberoReplacement.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
122
89
  Player.hasMany(LiberoReplacement, { as: 'player_LiberoReplacements', foreignKey: 'player_id' });
123
- MatchSet.belongsTo(Player, { as: 'away_libero_Player', foreignKey: 'away_libero' });
124
90
  Player.hasMany(MatchSet, { as: 'MatchSets', foreignKey: 'away_libero' });
125
- MatchSet.belongsTo(Player, { as: 'home_libero_Player', foreignKey: 'home_libero' });
126
91
  Player.hasMany(MatchSet, { as: 'home_libero_MatchSets', foreignKey: 'home_libero' });
127
- MatchSetStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
128
92
  Player.hasMany(MatchSetStats, { as: 'MatchSetStats', foreignKey: 'player_id' });
129
- PerformanceStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
130
- Player.hasOne(PerformanceStats, { as: 'PerformanceStat', foreignKey: 'player_id' });
131
- RallyPosition.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
132
93
  Player.hasMany(RallyPosition, { as: 'RallyPositions', foreignKey: 'player_id' });
133
- Reception.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
134
94
  Player.hasMany(Reception, { as: 'Receptions', foreignKey: 'player_id' });
135
- Score.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
136
95
  Player.hasMany(Score, { as: 'Scores', foreignKey: 'player_id' });
137
- Serve.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
138
96
  Player.hasMany(Serve, { as: 'Serves', foreignKey: 'player_id' });
139
- Set.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
140
97
  Player.hasMany(Set, { as: 'Sets', foreignKey: 'player_id' });
141
- Spike.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
142
98
  Player.hasMany(Spike, { as: 'Spikes', foreignKey: 'player_id' });
143
- Substitution.belongsTo(Player, { as: 'player_out_Player', foreignKey: 'player_out' });
144
99
  Player.hasMany(Substitution, { as: 'Substitutions', foreignKey: 'player_out' });
145
- Substitution.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
146
100
  Player.hasMany(Substitution, { as: 'player_Substitutions', foreignKey: 'player_id' });
147
- Block.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
101
+ Player.hasOne(PerformanceStats, { as: 'PerformanceStat', foreignKey: 'player_id' });
102
+ Player.belongsToMany(MatchSet, {
103
+ as: 'match_set_id_MatchSets',
104
+ through: MatchSetStats,
105
+ foreignKey: 'player_id',
106
+ otherKey: 'match_set_id'
107
+ });
108
+ Player.belongsToMany(Rally, {
109
+ as: 'rally_id_Rallies',
110
+ through: RallyPosition,
111
+ foreignKey: 'player_id',
112
+ otherKey: 'rally_id'
113
+ });
114
+ Rally.belongsTo(MatchSet, { as: 'match_set', foreignKey: 'match_set_id' });
115
+ Rally.belongsTo(Team, { as: 'serving_team_Team', foreignKey: 'serving_team' });
148
116
  Rally.hasMany(Block, { as: 'Blocks', foreignKey: 'rally_id' });
149
- Event.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
150
117
  Rally.hasMany(Event, { as: 'Events', foreignKey: 'rally_id' });
151
- LiberoReplacement.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
152
118
  Rally.hasMany(LiberoReplacement, { as: 'LiberoReplacements', foreignKey: 'rally_id' });
153
- RallyPosition.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
154
119
  Rally.hasMany(RallyPosition, { as: 'RallyPositions', foreignKey: 'rally_id' });
155
- Reception.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
156
120
  Rally.hasMany(Reception, { as: 'Receptions', foreignKey: 'rally_id' });
157
- Score.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
158
121
  Rally.hasMany(Score, { as: 'Scores', foreignKey: 'rally_id' });
159
- Serve.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
160
122
  Rally.hasMany(Serve, { as: 'Serves', foreignKey: 'rally_id' });
161
- Set.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
162
123
  Rally.hasMany(Set, { as: 'Sets', foreignKey: 'rally_id' });
163
- Spike.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
164
124
  Rally.hasMany(Spike, { as: 'Spikes', foreignKey: 'rally_id' });
165
- Substitution.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
166
125
  Rally.hasMany(Substitution, { as: 'Substitutions', foreignKey: 'rally_id' });
167
- SeasonTeams.belongsTo(Season, { as: 'season', foreignKey: 'season_id' });
126
+ Rally.belongsToMany(Player, {
127
+ as: 'player_id_Player_RallyPositions',
128
+ through: RallyPosition,
129
+ foreignKey: 'rally_id',
130
+ otherKey: 'player_id'
131
+ });
132
+ RallyPosition.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
133
+ RallyPosition.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
134
+ Reception.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
135
+ Reception.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
136
+ Score.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
137
+ Score.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
138
+ Score.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
139
+ Season.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
140
+ Season.belongsTo(Team, { as: 'Champion', foreignKey: 'champion' });
141
+ Season.hasMany(SeasonMatches, { as: 'SeasonMatches', foreignKey: 'season_id' });
168
142
  Season.hasMany(SeasonTeams, { as: 'SeasonTeams', foreignKey: 'season_id' });
169
- Match.belongsTo(Team, { as: 'homeTeam', foreignKey: 'home_team' });
143
+ Season.belongsToMany(Team, {
144
+ as: 'seasonTeams',
145
+ through: SeasonTeams,
146
+ foreignKey: 'season_id',
147
+ otherKey: 'team_id'
148
+ });
149
+ Season.belongsToMany(Match, {
150
+ as: 'seasonMatches',
151
+ through: SeasonMatches,
152
+ foreignKey: 'season_id',
153
+ otherKey: 'match_id'
154
+ });
155
+ SeasonMatches.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
156
+ SeasonMatches.belongsTo(Season, { as: 'season', foreignKey: 'season_id' });
157
+ SeasonTeams.belongsTo(Season, { as: 'season', foreignKey: 'season_id' });
158
+ SeasonTeams.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
159
+ Serve.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
160
+ Serve.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
161
+ Set.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
162
+ Set.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
163
+ Spike.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
164
+ Spike.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
165
+ Substitution.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
166
+ Substitution.belongsTo(Player, { as: 'player_out_Player', foreignKey: 'player_out' });
167
+ Substitution.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
168
+ Team.belongsTo(Coach, { as: 'coach', foreignKey: 'coach_id' });
169
+ Team.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
170
+ Team.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
170
171
  Team.hasMany(Match, { as: 'Matches', foreignKey: 'home_team' });
171
- Match.belongsTo(Team, { as: 'awayTeam', foreignKey: 'away_team' });
172
172
  Team.hasMany(Match, { as: 'away_team_Matches', foreignKey: 'away_team' });
173
- Player.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
174
173
  Team.hasMany(Player, { as: 'Players', foreignKey: 'team_id' });
175
- Rally.belongsTo(Team, { as: 'serving_team_Team', foreignKey: 'serving_team' });
176
174
  Team.hasMany(Rally, { as: 'Rallies', foreignKey: 'serving_team' });
177
- Score.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
178
175
  Team.hasMany(Score, { as: 'Scores', foreignKey: 'team_id' });
179
- SeasonTeams.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
180
- Team.hasMany(SeasonTeams, { as: 'SeasonTeams', foreignKey: 'team_id' });
181
- Match.hasMany(SeasonMatches, { as: 'SeasonMatches', foreignKey: 'match_id' });
182
- Season.hasMany(SeasonMatches, { as: 'SeasonMatches', foreignKey: 'season_id' });
183
- SeasonMatches.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
184
- SeasonMatches.belongsTo(Season, { as: 'season', foreignKey: 'season_id' });
185
- Team.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
186
- League.hasMany(League, { as: 'Teams', foreignKey: 'league_id' });
187
- Season.belongsTo(Team, { as: 'Champion', foreignKey: 'champion' });
188
176
  Team.hasMany(Season, { as: 'titles', foreignKey: 'champion' });
177
+ Team.hasMany(SeasonTeams, { as: 'SeasonTeams', foreignKey: 'team_id' });
178
+ Team.belongsToMany(Season, {
179
+ as: 'season_id_Seasons',
180
+ through: SeasonTeams,
181
+ foreignKey: 'team_id',
182
+ otherKey: 'season_id'
183
+ });
189
184
  Tournament.belongsTo(Team, { as: 'Champion', foreignKey: 'champion' });
190
- Tournament.hasMany(TournamentMatch, { as: 'Matches', foreignKey: 'tournament_id' });
191
- Match.hasMany(TournamentMatch, { as: 'TournamentMatch', foreignKey: 'match_id' });
192
- TournamentMatch.belongsTo(Tournament, { as: 'tournament', foreignKey: 'tournament_id' });
185
+ Tournament.hasMany(TournamentMatch, { as: 'TournamentMatches', foreignKey: 'tournament_id' });
186
+ Tournament.belongsToMany(Match, {
187
+ as: 'tournamentMatch',
188
+ through: TournamentMatch,
189
+ foreignKey: 'tournament_id',
190
+ otherKey: 'match_id'
191
+ });
193
192
  TournamentMatch.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
193
+ TournamentMatch.belongsTo(Tournament, { as: 'tournament', foreignKey: 'tournament_id' });
194
194
  return {
195
195
  Block,
196
196
  Coach,
@@ -11,7 +11,6 @@ export interface SeasonAttributes {
11
11
  league_id: string;
12
12
  seasonTeams?: TeamAttributes[];
13
13
  seasonMatches?: MatchAttributes[];
14
- Matches?: MatchAttributes[];
15
14
  league?: LeagueAttributes;
16
15
  champion?: string;
17
16
  }
@@ -18,6 +18,7 @@ export interface TeamAttributes {
18
18
  country_id: string;
19
19
  coach?: CoachAttributes;
20
20
  league?: LeagueAttributes;
21
+ Players?: PlayerModel[];
21
22
  }
22
23
  export type TeamPk = 'team_id';
23
24
  export type TeamId = TeamModel[TeamPk];
@@ -16,8 +16,8 @@ export function initModels(sequelize) {
16
16
  const Reception = ReceptionModel.initModel(sequelize);
17
17
  const Score = ScoreModel.initModel(sequelize);
18
18
  const Season = SeasonModel.initModel(sequelize);
19
- const SeasonTeams = SeasonTeamsModel.initModel(sequelize);
20
19
  const SeasonMatches = SeasonMatchesModel.initModel(sequelize);
20
+ const SeasonTeams = SeasonTeamsModel.initModel(sequelize);
21
21
  const Serve = ServeModel.initModel(sequelize);
22
22
  const Set = SetModel.initModel(sequelize);
23
23
  const Spike = SpikeModel.initModel(sequelize);
@@ -25,169 +25,169 @@ export function initModels(sequelize) {
25
25
  const Team = TeamModel.initModel(sequelize);
26
26
  const Tournament = TournamentModel.initModel(sequelize);
27
27
  const TournamentMatch = TournamentMatchModel.initModel(sequelize);
28
- MatchSet.belongsToMany(Player, {
29
- as: 'player_id_Players',
30
- through: MatchSetStats,
31
- foreignKey: 'match_set_id',
32
- otherKey: 'player_id'
33
- });
34
- Player.belongsToMany(MatchSet, {
35
- as: 'match_set_id_MatchSets',
36
- through: MatchSetStats,
37
- foreignKey: 'player_id',
38
- otherKey: 'match_set_id'
39
- });
40
- Player.belongsToMany(Rally, {
41
- as: 'rally_id_Rallies',
42
- through: RallyPosition,
43
- foreignKey: 'player_id',
44
- otherKey: 'rally_id'
45
- });
46
- Rally.belongsToMany(Player, {
47
- as: 'player_id_Player_RallyPositions',
48
- through: RallyPosition,
49
- foreignKey: 'rally_id',
50
- otherKey: 'player_id'
51
- });
52
- Season.belongsToMany(Team, {
53
- as: 'seasonTeams',
54
- through: SeasonTeams,
55
- foreignKey: 'season_id',
56
- otherKey: 'team_id'
57
- });
58
- Team.belongsToMany(Season, {
59
- as: 'season_id_Seasons',
60
- through: SeasonTeams,
61
- foreignKey: 'team_id',
62
- otherKey: 'season_id'
63
- });
64
- Season.belongsToMany(Match, {
65
- as: 'seasonMatches',
66
- through: SeasonMatches,
67
- foreignKey: 'season_id',
68
- otherKey: 'match_id'
69
- });
28
+ Block.belongsTo(Player, { as: 'blocker_1_Player', foreignKey: 'blocker_1' });
29
+ Block.belongsTo(Player, { as: 'blocker_2_Player', foreignKey: 'blocker_2' });
30
+ Block.belongsTo(Player, { as: 'blocker_3_Player', foreignKey: 'blocker_3' });
31
+ Block.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
32
+ Block.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
33
+ Coach.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
34
+ Coach.hasMany(Team, { as: 'Teams', foreignKey: 'coach_id' });
35
+ Country.hasMany(Coach, { as: 'Coaches', foreignKey: 'country_id' });
36
+ Country.hasMany(League, { as: 'Leagues', foreignKey: 'country_id' });
37
+ Country.hasMany(Player, { as: 'Players', foreignKey: 'country_id' });
38
+ Country.hasMany(Team, { as: 'Teams', foreignKey: 'country_id' });
39
+ Event.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
40
+ Event.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
41
+ League.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
42
+ League.hasMany(League, { as: 'Teams', foreignKey: 'league_id' });
43
+ League.hasMany(Season, { as: 'Seasons', foreignKey: 'league_id' });
44
+ LiberoReplacement.belongsTo(Player, { as: 'libero_Player', foreignKey: 'libero' });
45
+ LiberoReplacement.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
46
+ LiberoReplacement.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
47
+ Match.belongsTo(Team, { as: 'awayTeam', foreignKey: 'away_team' });
48
+ Match.belongsTo(Team, { as: 'homeTeam', foreignKey: 'home_team' });
49
+ Match.hasMany(MatchSet, { as: 'MatchSets', foreignKey: 'match_id' });
50
+ Match.hasMany(SeasonMatches, { as: 'SeasonMatches', foreignKey: 'match_id' });
51
+ Match.hasMany(TournamentMatch, { as: 'TournamentMatch', foreignKey: 'match_id' });
70
52
  Match.belongsToMany(Season, {
71
53
  as: 'season_id_Seasons',
72
54
  through: SeasonMatches,
73
55
  foreignKey: 'match_id',
74
56
  otherKey: 'season_id'
75
57
  });
76
- Tournament.belongsToMany(Match, {
77
- as: 'tournamentMatch',
78
- through: TournamentMatch,
79
- foreignKey: 'tournament_id',
80
- otherKey: 'match_id'
81
- });
82
58
  Match.belongsToMany(Tournament, {
83
59
  as: 'tournament_id_Tournaments',
84
60
  through: TournamentMatch,
85
61
  foreignKey: 'match_id',
86
62
  otherKey: 'tournament_id'
87
63
  });
88
- Team.belongsTo(Coach, { as: 'coach', foreignKey: 'coach_id' });
89
- Coach.hasMany(Team, { as: 'Teams', foreignKey: 'coach_id' });
90
- Coach.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
91
- Country.hasMany(Coach, { as: 'Coaches', foreignKey: 'country_id' });
92
- League.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
93
- Country.hasMany(League, { as: 'Leagues', foreignKey: 'country_id' });
94
- Player.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
95
- Country.hasMany(Player, { as: 'Players', foreignKey: 'country_id' });
96
- Team.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
97
- Country.hasMany(Team, { as: 'Teams', foreignKey: 'country_id' });
98
- Season.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
99
- League.hasMany(Season, { as: 'Seasons', foreignKey: 'league_id' });
100
64
  MatchSet.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
101
- Match.hasMany(MatchSet, { as: 'MatchSets', foreignKey: 'match_id' });
102
- MatchSetStats.belongsTo(MatchSet, { as: 'match_set', foreignKey: 'match_set_id' });
65
+ MatchSet.belongsTo(Player, { as: 'away_libero_Player', foreignKey: 'away_libero' });
66
+ MatchSet.belongsTo(Player, { as: 'home_libero_Player', foreignKey: 'home_libero' });
103
67
  MatchSet.hasMany(MatchSetStats, { as: 'MatchSetStats', foreignKey: 'match_set_id' });
104
- Rally.belongsTo(MatchSet, { as: 'match_set', foreignKey: 'match_set_id' });
105
68
  MatchSet.hasMany(Rally, { as: 'Rallies', foreignKey: 'match_set_id' });
106
- Block.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
69
+ MatchSet.belongsToMany(Player, {
70
+ as: 'player_id_Players',
71
+ through: MatchSetStats,
72
+ foreignKey: 'match_set_id',
73
+ otherKey: 'player_id'
74
+ });
75
+ MatchSetStats.belongsTo(MatchSet, { as: 'match_set', foreignKey: 'match_set_id' });
76
+ MatchSetStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
77
+ PerformanceStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
78
+ Player.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
79
+ Player.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
107
80
  Player.hasMany(Block, { as: 'Blocks', foreignKey: 'player_id' });
108
- Block.belongsTo(Player, { as: 'blocker_1_Player', foreignKey: 'blocker_1' });
109
81
  Player.hasMany(Block, { as: 'blocker_1_Blocks', foreignKey: 'blocker_1' });
110
- Block.belongsTo(Player, { as: 'blocker_2_Player', foreignKey: 'blocker_2' });
111
82
  Player.hasMany(Block, { as: 'blocker_2_Blocks', foreignKey: 'blocker_2' });
112
- Block.belongsTo(Player, { as: 'blocker_3_Player', foreignKey: 'blocker_3' });
113
83
  Player.hasMany(Block, { as: 'blocker_3_Blocks', foreignKey: 'blocker_3' });
114
- Event.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
115
84
  Player.hasMany(Event, { as: 'Events', foreignKey: 'player_id' });
116
- LiberoReplacement.belongsTo(Player, { as: 'libero_Player', foreignKey: 'libero' });
117
85
  Player.hasMany(LiberoReplacement, { as: 'LiberoReplacements', foreignKey: 'libero' });
118
- LiberoReplacement.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
119
86
  Player.hasMany(LiberoReplacement, { as: 'player_LiberoReplacements', foreignKey: 'player_id' });
120
- MatchSet.belongsTo(Player, { as: 'away_libero_Player', foreignKey: 'away_libero' });
121
87
  Player.hasMany(MatchSet, { as: 'MatchSets', foreignKey: 'away_libero' });
122
- MatchSet.belongsTo(Player, { as: 'home_libero_Player', foreignKey: 'home_libero' });
123
88
  Player.hasMany(MatchSet, { as: 'home_libero_MatchSets', foreignKey: 'home_libero' });
124
- MatchSetStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
125
89
  Player.hasMany(MatchSetStats, { as: 'MatchSetStats', foreignKey: 'player_id' });
126
- PerformanceStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
127
- Player.hasOne(PerformanceStats, { as: 'PerformanceStat', foreignKey: 'player_id' });
128
- RallyPosition.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
129
90
  Player.hasMany(RallyPosition, { as: 'RallyPositions', foreignKey: 'player_id' });
130
- Reception.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
131
91
  Player.hasMany(Reception, { as: 'Receptions', foreignKey: 'player_id' });
132
- Score.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
133
92
  Player.hasMany(Score, { as: 'Scores', foreignKey: 'player_id' });
134
- Serve.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
135
93
  Player.hasMany(Serve, { as: 'Serves', foreignKey: 'player_id' });
136
- Set.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
137
94
  Player.hasMany(Set, { as: 'Sets', foreignKey: 'player_id' });
138
- Spike.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
139
95
  Player.hasMany(Spike, { as: 'Spikes', foreignKey: 'player_id' });
140
- Substitution.belongsTo(Player, { as: 'player_out_Player', foreignKey: 'player_out' });
141
96
  Player.hasMany(Substitution, { as: 'Substitutions', foreignKey: 'player_out' });
142
- Substitution.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
143
97
  Player.hasMany(Substitution, { as: 'player_Substitutions', foreignKey: 'player_id' });
144
- Block.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
98
+ Player.hasOne(PerformanceStats, { as: 'PerformanceStat', foreignKey: 'player_id' });
99
+ Player.belongsToMany(MatchSet, {
100
+ as: 'match_set_id_MatchSets',
101
+ through: MatchSetStats,
102
+ foreignKey: 'player_id',
103
+ otherKey: 'match_set_id'
104
+ });
105
+ Player.belongsToMany(Rally, {
106
+ as: 'rally_id_Rallies',
107
+ through: RallyPosition,
108
+ foreignKey: 'player_id',
109
+ otherKey: 'rally_id'
110
+ });
111
+ Rally.belongsTo(MatchSet, { as: 'match_set', foreignKey: 'match_set_id' });
112
+ Rally.belongsTo(Team, { as: 'serving_team_Team', foreignKey: 'serving_team' });
145
113
  Rally.hasMany(Block, { as: 'Blocks', foreignKey: 'rally_id' });
146
- Event.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
147
114
  Rally.hasMany(Event, { as: 'Events', foreignKey: 'rally_id' });
148
- LiberoReplacement.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
149
115
  Rally.hasMany(LiberoReplacement, { as: 'LiberoReplacements', foreignKey: 'rally_id' });
150
- RallyPosition.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
151
116
  Rally.hasMany(RallyPosition, { as: 'RallyPositions', foreignKey: 'rally_id' });
152
- Reception.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
153
117
  Rally.hasMany(Reception, { as: 'Receptions', foreignKey: 'rally_id' });
154
- Score.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
155
118
  Rally.hasMany(Score, { as: 'Scores', foreignKey: 'rally_id' });
156
- Serve.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
157
119
  Rally.hasMany(Serve, { as: 'Serves', foreignKey: 'rally_id' });
158
- Set.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
159
120
  Rally.hasMany(Set, { as: 'Sets', foreignKey: 'rally_id' });
160
- Spike.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
161
121
  Rally.hasMany(Spike, { as: 'Spikes', foreignKey: 'rally_id' });
162
- Substitution.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
163
122
  Rally.hasMany(Substitution, { as: 'Substitutions', foreignKey: 'rally_id' });
164
- SeasonTeams.belongsTo(Season, { as: 'season', foreignKey: 'season_id' });
123
+ Rally.belongsToMany(Player, {
124
+ as: 'player_id_Player_RallyPositions',
125
+ through: RallyPosition,
126
+ foreignKey: 'rally_id',
127
+ otherKey: 'player_id'
128
+ });
129
+ RallyPosition.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
130
+ RallyPosition.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
131
+ Reception.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
132
+ Reception.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
133
+ Score.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
134
+ Score.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
135
+ Score.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
136
+ Season.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
137
+ Season.belongsTo(Team, { as: 'Champion', foreignKey: 'champion' });
138
+ Season.hasMany(SeasonMatches, { as: 'SeasonMatches', foreignKey: 'season_id' });
165
139
  Season.hasMany(SeasonTeams, { as: 'SeasonTeams', foreignKey: 'season_id' });
166
- Match.belongsTo(Team, { as: 'homeTeam', foreignKey: 'home_team' });
140
+ Season.belongsToMany(Team, {
141
+ as: 'seasonTeams',
142
+ through: SeasonTeams,
143
+ foreignKey: 'season_id',
144
+ otherKey: 'team_id'
145
+ });
146
+ Season.belongsToMany(Match, {
147
+ as: 'seasonMatches',
148
+ through: SeasonMatches,
149
+ foreignKey: 'season_id',
150
+ otherKey: 'match_id'
151
+ });
152
+ SeasonMatches.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
153
+ SeasonMatches.belongsTo(Season, { as: 'season', foreignKey: 'season_id' });
154
+ SeasonTeams.belongsTo(Season, { as: 'season', foreignKey: 'season_id' });
155
+ SeasonTeams.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
156
+ Serve.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
157
+ Serve.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
158
+ Set.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
159
+ Set.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
160
+ Spike.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
161
+ Spike.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
162
+ Substitution.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
163
+ Substitution.belongsTo(Player, { as: 'player_out_Player', foreignKey: 'player_out' });
164
+ Substitution.belongsTo(Rally, { as: 'rally', foreignKey: 'rally_id' });
165
+ Team.belongsTo(Coach, { as: 'coach', foreignKey: 'coach_id' });
166
+ Team.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
167
+ Team.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
167
168
  Team.hasMany(Match, { as: 'Matches', foreignKey: 'home_team' });
168
- Match.belongsTo(Team, { as: 'awayTeam', foreignKey: 'away_team' });
169
169
  Team.hasMany(Match, { as: 'away_team_Matches', foreignKey: 'away_team' });
170
- Player.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
171
170
  Team.hasMany(Player, { as: 'Players', foreignKey: 'team_id' });
172
- Rally.belongsTo(Team, { as: 'serving_team_Team', foreignKey: 'serving_team' });
173
171
  Team.hasMany(Rally, { as: 'Rallies', foreignKey: 'serving_team' });
174
- Score.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
175
172
  Team.hasMany(Score, { as: 'Scores', foreignKey: 'team_id' });
176
- SeasonTeams.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
177
- Team.hasMany(SeasonTeams, { as: 'SeasonTeams', foreignKey: 'team_id' });
178
- Match.hasMany(SeasonMatches, { as: 'SeasonMatches', foreignKey: 'match_id' });
179
- Season.hasMany(SeasonMatches, { as: 'SeasonMatches', foreignKey: 'season_id' });
180
- SeasonMatches.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
181
- SeasonMatches.belongsTo(Season, { as: 'season', foreignKey: 'season_id' });
182
- Team.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
183
- League.hasMany(League, { as: 'Teams', foreignKey: 'league_id' });
184
- Season.belongsTo(Team, { as: 'Champion', foreignKey: 'champion' });
185
173
  Team.hasMany(Season, { as: 'titles', foreignKey: 'champion' });
174
+ Team.hasMany(SeasonTeams, { as: 'SeasonTeams', foreignKey: 'team_id' });
175
+ Team.belongsToMany(Season, {
176
+ as: 'season_id_Seasons',
177
+ through: SeasonTeams,
178
+ foreignKey: 'team_id',
179
+ otherKey: 'season_id'
180
+ });
186
181
  Tournament.belongsTo(Team, { as: 'Champion', foreignKey: 'champion' });
187
- Tournament.hasMany(TournamentMatch, { as: 'Matches', foreignKey: 'tournament_id' });
188
- Match.hasMany(TournamentMatch, { as: 'TournamentMatch', foreignKey: 'match_id' });
189
- TournamentMatch.belongsTo(Tournament, { as: 'tournament', foreignKey: 'tournament_id' });
182
+ Tournament.hasMany(TournamentMatch, { as: 'TournamentMatches', foreignKey: 'tournament_id' });
183
+ Tournament.belongsToMany(Match, {
184
+ as: 'tournamentMatch',
185
+ through: TournamentMatch,
186
+ foreignKey: 'tournament_id',
187
+ otherKey: 'match_id'
188
+ });
190
189
  TournamentMatch.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
190
+ TournamentMatch.belongsTo(Tournament, { as: 'tournament', foreignKey: 'tournament_id' });
191
191
  return {
192
192
  Block,
193
193
  Coach,
@@ -11,7 +11,6 @@ export interface SeasonAttributes {
11
11
  league_id: string;
12
12
  seasonTeams?: TeamAttributes[];
13
13
  seasonMatches?: MatchAttributes[];
14
- Matches?: MatchAttributes[];
15
14
  league?: LeagueAttributes;
16
15
  champion?: string;
17
16
  }
@@ -18,6 +18,7 @@ export interface TeamAttributes {
18
18
  country_id: string;
19
19
  coach?: CoachAttributes;
20
20
  league?: LeagueAttributes;
21
+ Players?: PlayerModel[];
21
22
  }
22
23
  export type TeamPk = 'team_id';
23
24
  export type TeamId = TeamModel[TeamPk];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",