volleyballsimtypes 0.0.89 → 0.0.91
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.
- package/dist/cjs/src/data/init-models.js +12 -1
- package/dist/cjs/src/data/models/player-team.d.ts +2 -0
- package/dist/cjs/src/data/models/player-team.js +5 -0
- package/dist/cjs/src/data/models/player.d.ts +23 -5
- package/dist/cjs/src/data/models/team.d.ts +13 -2
- package/dist/cjs/src/data/transformers/player-team.d.ts +1 -1
- package/dist/cjs/src/data/transformers/player-team.js +3 -2
- package/dist/cjs/src/data/transformers/season-match.d.ts +2 -1
- package/dist/cjs/src/data/transformers/season-match.js +4 -2
- package/dist/cjs/src/data/transformers/season.js +1 -1
- package/dist/cjs/src/data/transformers/tournament-match.js +1 -1
- package/dist/esm/src/data/init-models.js +12 -1
- package/dist/esm/src/data/models/player-team.d.ts +2 -0
- package/dist/esm/src/data/models/player-team.js +5 -0
- package/dist/esm/src/data/models/player.d.ts +23 -5
- package/dist/esm/src/data/models/team.d.ts +13 -2
- package/dist/esm/src/data/transformers/player-team.d.ts +1 -1
- package/dist/esm/src/data/transformers/player-team.js +3 -2
- package/dist/esm/src/data/transformers/season-match.d.ts +2 -1
- package/dist/esm/src/data/transformers/season-match.js +4 -2
- package/dist/esm/src/data/transformers/season.js +1 -1
- package/dist/esm/src/data/transformers/tournament-match.js +1 -1
- package/package.json +1 -1
|
@@ -119,7 +119,12 @@ function initModels(sequelize) {
|
|
|
119
119
|
Player.hasMany(Substitution, { as: 'InSubstitutions', foreignKey: 'player_id' });
|
|
120
120
|
Player.hasOne(PerformanceStats, { as: 'PerformanceStat', foreignKey: 'player_id' });
|
|
121
121
|
Player.hasOne(DraftPick, { as: 'DraftPick', foreignKey: 'player_id' });
|
|
122
|
-
Player.
|
|
122
|
+
Player.belongsToMany(Team, {
|
|
123
|
+
as: 'PlayerTeams', through: PlayerTeam,
|
|
124
|
+
foreignKey: 'player_id',
|
|
125
|
+
otherKey: 'team_id'
|
|
126
|
+
});
|
|
127
|
+
Player.hasMany(PlayerTeam, { as: 'PlayerTeams', foreignKey: 'player_id' });
|
|
123
128
|
Player.belongsToMany(MatchSet, {
|
|
124
129
|
as: 'matchSets',
|
|
125
130
|
through: MatchSetStats,
|
|
@@ -212,6 +217,12 @@ function initModels(sequelize) {
|
|
|
212
217
|
otherKey: 'match_id'
|
|
213
218
|
});
|
|
214
219
|
Team.hasMany(MatchRating, { as: 'MatchRatings', foreignKey: 'team_id' });
|
|
220
|
+
Team.belongsToMany(Player, {
|
|
221
|
+
as: 'Players',
|
|
222
|
+
through: PlayerTeam,
|
|
223
|
+
foreignKey: 'team_id',
|
|
224
|
+
otherKey: 'player_id'
|
|
225
|
+
});
|
|
215
226
|
Team.hasMany(PlayerTeam, { as: 'PlayerTeams', foreignKey: 'team_id' });
|
|
216
227
|
Team.belongsToMany(Season, {
|
|
217
228
|
as: 'seasons',
|
|
@@ -6,6 +6,7 @@ export interface PlayerTeamAttributes {
|
|
|
6
6
|
player_id: string;
|
|
7
7
|
team_id?: string;
|
|
8
8
|
jersey_number: number;
|
|
9
|
+
active: boolean;
|
|
9
10
|
}
|
|
10
11
|
export type PlayerTeamPk = 'player_id';
|
|
11
12
|
export type PlayerTeamId = PlayerTeamModel[PlayerTeamPk];
|
|
@@ -15,6 +16,7 @@ export declare class PlayerTeamModel extends Model<PlayerTeamAttributes, PlayerT
|
|
|
15
16
|
player_id: string;
|
|
16
17
|
team_id?: string;
|
|
17
18
|
jersey_number: number;
|
|
19
|
+
active: boolean;
|
|
18
20
|
player: PlayerModel;
|
|
19
21
|
getPlayer: Sequelize.BelongsToGetAssociationMixin<PlayerModel>;
|
|
20
22
|
setPlayer: Sequelize.BelongsToSetAssociationMixin<PlayerModel, PlayerId>;
|
|
@@ -26,6 +26,11 @@ class PlayerTeamModel extends sequelize_1.Model {
|
|
|
26
26
|
type: sequelize_1.DataTypes.INTEGER,
|
|
27
27
|
allowNull: false,
|
|
28
28
|
defaultValue: 1
|
|
29
|
+
},
|
|
30
|
+
active: {
|
|
31
|
+
type: sequelize_1.DataTypes.BOOLEAN,
|
|
32
|
+
allowNull: false,
|
|
33
|
+
defaultValue: false
|
|
29
34
|
}
|
|
30
35
|
}, {
|
|
31
36
|
sequelize,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import { BlockId, BlockModel, CountryId, CountryModel, DraftPickId, DraftPickModel, EventId, EventModel, LiberoReplacementId, LiberoReplacementModel, MatchSetId, MatchSetModel, MatchSetStatsAttributes, MatchSetStatsId, MatchSetStatsModel, PerformanceStatsAttributes, PerformanceStatsId, PerformanceStatsModel, PlayerTeamId, PlayerTeamModel, RallyId, RallyModel, RallyPositionId, RallyPositionModel, ReceptionId, ReceptionModel, ScoreId, ScoreModel, ServeId, ServeModel, SetId, SetModel, SpikeId, SpikeModel, SubstitutionId, SubstitutionModel, TraitId, TraitModel } from '.';
|
|
3
|
+
import { BlockId, BlockModel, CountryId, CountryModel, DraftPickId, DraftPickModel, EventId, EventModel, LiberoReplacementId, LiberoReplacementModel, MatchSetId, MatchSetModel, MatchSetStatsAttributes, MatchSetStatsId, MatchSetStatsModel, PerformanceStatsAttributes, PerformanceStatsId, PerformanceStatsModel, PlayerTeamId, PlayerTeamModel, RallyId, RallyModel, RallyPositionId, RallyPositionModel, ReceptionId, ReceptionModel, ScoreId, ScoreModel, ServeId, ServeModel, SetId, SetModel, SpikeId, SpikeModel, SubstitutionId, SubstitutionModel, TeamId, TeamModel, TraitId, TraitModel } from '.';
|
|
4
4
|
export interface PlayerAttributes {
|
|
5
5
|
player_id: string;
|
|
6
6
|
roles: RoleType[];
|
|
@@ -153,10 +153,28 @@ export declare class PlayerModel extends Model<PlayerAttributes, PlayerCreationA
|
|
|
153
153
|
getPerformanceStat: Sequelize.HasOneGetAssociationMixin<PerformanceStatsModel>;
|
|
154
154
|
setPerformanceStat: Sequelize.HasOneSetAssociationMixin<PerformanceStatsModel, PerformanceStatsId>;
|
|
155
155
|
createPerformanceStat: Sequelize.HasOneCreateAssociationMixin<PerformanceStatsModel>;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
PlayerTeams: PlayerTeamModel[];
|
|
157
|
+
getPlayerTeams: Sequelize.HasManyGetAssociationsMixin<PlayerTeamModel>;
|
|
158
|
+
setPlayerTeams: Sequelize.HasManySetAssociationsMixin<PlayerTeamModel, PlayerTeamId>;
|
|
159
|
+
addPlayerTeam: Sequelize.HasManyAddAssociationMixin<PlayerTeamModel, PlayerTeamId>;
|
|
160
|
+
addPlayerTeams: Sequelize.HasManyAddAssociationsMixin<PlayerTeamModel, PlayerTeamId>;
|
|
161
|
+
createPlayerTeam: Sequelize.HasManyCreateAssociationMixin<PlayerTeamModel>;
|
|
162
|
+
removePlayerTeam: Sequelize.HasManyRemoveAssociationMixin<PlayerTeamModel, PlayerTeamId>;
|
|
163
|
+
removePlayerTeams: Sequelize.HasManyRemoveAssociationsMixin<PlayerTeamModel, PlayerTeamId>;
|
|
164
|
+
hasPlayerTeam: Sequelize.HasManyHasAssociationMixin<PlayerTeamModel, PlayerTeamId>;
|
|
165
|
+
hasPlayerTeams: Sequelize.HasManyHasAssociationsMixin<PlayerTeamModel, PlayerTeamId>;
|
|
166
|
+
countPlayerTeams: Sequelize.HasManyCountAssociationsMixin;
|
|
167
|
+
Teams: TeamModel[];
|
|
168
|
+
getTeams: Sequelize.BelongsToManyGetAssociationsMixin<TeamModel>;
|
|
169
|
+
setTeams: Sequelize.BelongsToManySetAssociationsMixin<TeamModel, TeamId>;
|
|
170
|
+
addTeam: Sequelize.BelongsToManyAddAssociationMixin<TeamModel, TeamId>;
|
|
171
|
+
addTeams: Sequelize.BelongsToManyAddAssociationsMixin<TeamModel, TeamId>;
|
|
172
|
+
createTeam: Sequelize.BelongsToManyCreateAssociationMixin<TeamModel>;
|
|
173
|
+
removeTeam: Sequelize.BelongsToManyRemoveAssociationMixin<TeamModel, TeamId>;
|
|
174
|
+
removeTeams: Sequelize.BelongsToManyRemoveAssociationsMixin<TeamModel, TeamId>;
|
|
175
|
+
hasTeam: Sequelize.BelongsToManyHasAssociationMixin<TeamModel, TeamId>;
|
|
176
|
+
hasTeams: Sequelize.BelongsToManyHasAssociationsMixin<TeamModel, TeamId>;
|
|
177
|
+
countTeams: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
160
178
|
rallies: RallyModel[];
|
|
161
179
|
getRallies: Sequelize.BelongsToManyGetAssociationsMixin<RallyModel>;
|
|
162
180
|
setRallies: Sequelize.BelongsToManySetAssociationsMixin<RallyModel, RallyId>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import { CoachAttributes, CoachModel, CountryModel, DraftPickModel, LeagueAttributes, LeagueModel, MatchModel, MatchRatingModel, PlayerModel, PlayerTeamModel, RallyModel, ScoreModel, SeasonModel, SeasonTeamsModel, TournamentModel, TournamentTeamsModel } from '.';
|
|
3
|
+
import { CoachAttributes, CoachModel, CountryModel, DraftPickModel, LeagueAttributes, LeagueModel, MatchModel, MatchRatingModel, PlayerAttributes, PlayerId, PlayerModel, PlayerTeamModel, RallyModel, ScoreModel, SeasonModel, SeasonTeamsModel, TournamentModel, TournamentTeamsModel } from '.';
|
|
4
4
|
import type { CoachId, CountryId, DraftPickId, LeagueId, MatchId, MatchRatingId, PlayerTeamId, RallyId, ScoreId, SeasonId, SeasonTeamsId, TournamentId, TournamentTeamsId } from './';
|
|
5
5
|
export interface TeamAttributes {
|
|
6
6
|
team_id: string;
|
|
@@ -12,7 +12,7 @@ export interface TeamAttributes {
|
|
|
12
12
|
country_id?: string;
|
|
13
13
|
coach?: CoachAttributes;
|
|
14
14
|
league?: LeagueAttributes;
|
|
15
|
-
Players?:
|
|
15
|
+
Players?: PlayerAttributes[];
|
|
16
16
|
}
|
|
17
17
|
export type TeamPk = 'team_id';
|
|
18
18
|
export type TeamId = TeamModel[TeamPk];
|
|
@@ -191,5 +191,16 @@ export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttribu
|
|
|
191
191
|
hasTournamentTeam: Sequelize.HasManyHasAssociationMixin<TournamentTeamsModel, TournamentTeamsId>;
|
|
192
192
|
hasTournamentTeams: Sequelize.HasManyHasAssociationsMixin<TournamentTeamsModel, TournamentTeamsId>;
|
|
193
193
|
countTournamentTeams: Sequelize.HasManyCountAssociationsMixin;
|
|
194
|
+
Players: PlayerModel[];
|
|
195
|
+
getPlayers: Sequelize.BelongsToManyGetAssociationsMixin<PlayerModel>;
|
|
196
|
+
setPlayers: Sequelize.BelongsToManySetAssociationsMixin<PlayerModel, PlayerId>;
|
|
197
|
+
addPlayer: Sequelize.BelongsToManyAddAssociationMixin<PlayerModel, PlayerId>;
|
|
198
|
+
addPlayers: Sequelize.BelongsToManyAddAssociationsMixin<PlayerModel, PlayerId>;
|
|
199
|
+
createPlayer: Sequelize.BelongsToManyCreateAssociationMixin<PlayerModel>;
|
|
200
|
+
removePlayer: Sequelize.BelongsToManyRemoveAssociationMixin<PlayerModel, PlayerId>;
|
|
201
|
+
removePlayers: Sequelize.BelongsToManyRemoveAssociationsMixin<PlayerModel, PlayerId>;
|
|
202
|
+
hasPlayer: Sequelize.BelongsToManyHasAssociationMixin<PlayerModel, PlayerId>;
|
|
203
|
+
hasPlayers: Sequelize.BelongsToManyHasAssociationsMixin<PlayerModel, PlayerId>;
|
|
204
|
+
countPlayers: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
194
205
|
static initModel(sequelize: Sequelize.Sequelize): typeof TeamModel;
|
|
195
206
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PlayerTeamAttributes } from '../models';
|
|
2
|
-
declare function transformToAttributes(playerId: string, teamId: string, jerseyNumber: number): PlayerTeamAttributes;
|
|
2
|
+
declare function transformToAttributes(playerId: string, teamId: string, jerseyNumber: number, active?: boolean): PlayerTeamAttributes;
|
|
3
3
|
export { transformToAttributes as transformFromPlayerTeam };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformFromPlayerTeam = void 0;
|
|
4
|
-
function transformToAttributes(playerId, teamId, jerseyNumber) {
|
|
4
|
+
function transformToAttributes(playerId, teamId, jerseyNumber, active = false) {
|
|
5
5
|
return {
|
|
6
6
|
player_id: playerId,
|
|
7
7
|
team_id: teamId,
|
|
8
|
-
jersey_number: jerseyNumber
|
|
8
|
+
jersey_number: jerseyNumber,
|
|
9
|
+
active
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
12
|
exports.transformFromPlayerTeam = transformToAttributes;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { SeasonMatchAttributes } from '../models';
|
|
2
|
-
|
|
2
|
+
import { Match } from '../../service';
|
|
3
|
+
declare function transformToAttributes(seasonId: string, match: Match): SeasonMatchAttributes;
|
|
3
4
|
export { transformToAttributes as transformFromSeasonMatch };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformFromSeasonMatch = void 0;
|
|
4
|
-
|
|
4
|
+
const match_1 = require("./match");
|
|
5
|
+
function transformToAttributes(seasonId, match) {
|
|
5
6
|
return {
|
|
6
7
|
season_id: seasonId,
|
|
7
|
-
match_id:
|
|
8
|
+
match_id: match.id,
|
|
9
|
+
match: (0, match_1.transformFromMatch)(match)
|
|
8
10
|
};
|
|
9
11
|
}
|
|
10
12
|
exports.transformFromSeasonMatch = transformToAttributes;
|
|
@@ -5,7 +5,7 @@ const _1 = require(".");
|
|
|
5
5
|
const service_1 = require("../../service");
|
|
6
6
|
function transformToAttributes(season, leagueId) {
|
|
7
7
|
const seasonMatches = season.matches != null ?
|
|
8
|
-
season.matches.map(match => (0, _1.transformFromSeasonMatch)(season.id, match
|
|
8
|
+
season.matches.map(match => (0, _1.transformFromSeasonMatch)(season.id, match)) : [];
|
|
9
9
|
const seasonTeams = season.teams.map(team => ({ season_id: season.id, team_id: team.id }));
|
|
10
10
|
return {
|
|
11
11
|
season_id: season.id,
|
|
@@ -9,7 +9,7 @@ function transformToAttributes(tournamentMatch, tournamentId) {
|
|
|
9
9
|
match_id: tournamentMatch.match.id,
|
|
10
10
|
index: tournamentMatch.index,
|
|
11
11
|
stage: (0, _1.transformFromStage)(tournamentMatch.stage),
|
|
12
|
-
match:
|
|
12
|
+
match: (0, _1.transformFromMatch)(tournamentMatch.match)
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
exports.transformFromTournamentMatch = transformToAttributes;
|
|
@@ -116,7 +116,12 @@ export function initModels(sequelize) {
|
|
|
116
116
|
Player.hasMany(Substitution, { as: 'InSubstitutions', foreignKey: 'player_id' });
|
|
117
117
|
Player.hasOne(PerformanceStats, { as: 'PerformanceStat', foreignKey: 'player_id' });
|
|
118
118
|
Player.hasOne(DraftPick, { as: 'DraftPick', foreignKey: 'player_id' });
|
|
119
|
-
Player.
|
|
119
|
+
Player.belongsToMany(Team, {
|
|
120
|
+
as: 'PlayerTeams', through: PlayerTeam,
|
|
121
|
+
foreignKey: 'player_id',
|
|
122
|
+
otherKey: 'team_id'
|
|
123
|
+
});
|
|
124
|
+
Player.hasMany(PlayerTeam, { as: 'PlayerTeams', foreignKey: 'player_id' });
|
|
120
125
|
Player.belongsToMany(MatchSet, {
|
|
121
126
|
as: 'matchSets',
|
|
122
127
|
through: MatchSetStats,
|
|
@@ -209,6 +214,12 @@ export function initModels(sequelize) {
|
|
|
209
214
|
otherKey: 'match_id'
|
|
210
215
|
});
|
|
211
216
|
Team.hasMany(MatchRating, { as: 'MatchRatings', foreignKey: 'team_id' });
|
|
217
|
+
Team.belongsToMany(Player, {
|
|
218
|
+
as: 'Players',
|
|
219
|
+
through: PlayerTeam,
|
|
220
|
+
foreignKey: 'team_id',
|
|
221
|
+
otherKey: 'player_id'
|
|
222
|
+
});
|
|
212
223
|
Team.hasMany(PlayerTeam, { as: 'PlayerTeams', foreignKey: 'team_id' });
|
|
213
224
|
Team.belongsToMany(Season, {
|
|
214
225
|
as: 'seasons',
|
|
@@ -6,6 +6,7 @@ export interface PlayerTeamAttributes {
|
|
|
6
6
|
player_id: string;
|
|
7
7
|
team_id?: string;
|
|
8
8
|
jersey_number: number;
|
|
9
|
+
active: boolean;
|
|
9
10
|
}
|
|
10
11
|
export type PlayerTeamPk = 'player_id';
|
|
11
12
|
export type PlayerTeamId = PlayerTeamModel[PlayerTeamPk];
|
|
@@ -15,6 +16,7 @@ export declare class PlayerTeamModel extends Model<PlayerTeamAttributes, PlayerT
|
|
|
15
16
|
player_id: string;
|
|
16
17
|
team_id?: string;
|
|
17
18
|
jersey_number: number;
|
|
19
|
+
active: boolean;
|
|
18
20
|
player: PlayerModel;
|
|
19
21
|
getPlayer: Sequelize.BelongsToGetAssociationMixin<PlayerModel>;
|
|
20
22
|
setPlayer: Sequelize.BelongsToSetAssociationMixin<PlayerModel, PlayerId>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import { BlockId, BlockModel, CountryId, CountryModel, DraftPickId, DraftPickModel, EventId, EventModel, LiberoReplacementId, LiberoReplacementModel, MatchSetId, MatchSetModel, MatchSetStatsAttributes, MatchSetStatsId, MatchSetStatsModel, PerformanceStatsAttributes, PerformanceStatsId, PerformanceStatsModel, PlayerTeamId, PlayerTeamModel, RallyId, RallyModel, RallyPositionId, RallyPositionModel, ReceptionId, ReceptionModel, ScoreId, ScoreModel, ServeId, ServeModel, SetId, SetModel, SpikeId, SpikeModel, SubstitutionId, SubstitutionModel, TraitId, TraitModel } from '.';
|
|
3
|
+
import { BlockId, BlockModel, CountryId, CountryModel, DraftPickId, DraftPickModel, EventId, EventModel, LiberoReplacementId, LiberoReplacementModel, MatchSetId, MatchSetModel, MatchSetStatsAttributes, MatchSetStatsId, MatchSetStatsModel, PerformanceStatsAttributes, PerformanceStatsId, PerformanceStatsModel, PlayerTeamId, PlayerTeamModel, RallyId, RallyModel, RallyPositionId, RallyPositionModel, ReceptionId, ReceptionModel, ScoreId, ScoreModel, ServeId, ServeModel, SetId, SetModel, SpikeId, SpikeModel, SubstitutionId, SubstitutionModel, TeamId, TeamModel, TraitId, TraitModel } from '.';
|
|
4
4
|
export interface PlayerAttributes {
|
|
5
5
|
player_id: string;
|
|
6
6
|
roles: RoleType[];
|
|
@@ -153,10 +153,28 @@ export declare class PlayerModel extends Model<PlayerAttributes, PlayerCreationA
|
|
|
153
153
|
getPerformanceStat: Sequelize.HasOneGetAssociationMixin<PerformanceStatsModel>;
|
|
154
154
|
setPerformanceStat: Sequelize.HasOneSetAssociationMixin<PerformanceStatsModel, PerformanceStatsId>;
|
|
155
155
|
createPerformanceStat: Sequelize.HasOneCreateAssociationMixin<PerformanceStatsModel>;
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
PlayerTeams: PlayerTeamModel[];
|
|
157
|
+
getPlayerTeams: Sequelize.HasManyGetAssociationsMixin<PlayerTeamModel>;
|
|
158
|
+
setPlayerTeams: Sequelize.HasManySetAssociationsMixin<PlayerTeamModel, PlayerTeamId>;
|
|
159
|
+
addPlayerTeam: Sequelize.HasManyAddAssociationMixin<PlayerTeamModel, PlayerTeamId>;
|
|
160
|
+
addPlayerTeams: Sequelize.HasManyAddAssociationsMixin<PlayerTeamModel, PlayerTeamId>;
|
|
161
|
+
createPlayerTeam: Sequelize.HasManyCreateAssociationMixin<PlayerTeamModel>;
|
|
162
|
+
removePlayerTeam: Sequelize.HasManyRemoveAssociationMixin<PlayerTeamModel, PlayerTeamId>;
|
|
163
|
+
removePlayerTeams: Sequelize.HasManyRemoveAssociationsMixin<PlayerTeamModel, PlayerTeamId>;
|
|
164
|
+
hasPlayerTeam: Sequelize.HasManyHasAssociationMixin<PlayerTeamModel, PlayerTeamId>;
|
|
165
|
+
hasPlayerTeams: Sequelize.HasManyHasAssociationsMixin<PlayerTeamModel, PlayerTeamId>;
|
|
166
|
+
countPlayerTeams: Sequelize.HasManyCountAssociationsMixin;
|
|
167
|
+
Teams: TeamModel[];
|
|
168
|
+
getTeams: Sequelize.BelongsToManyGetAssociationsMixin<TeamModel>;
|
|
169
|
+
setTeams: Sequelize.BelongsToManySetAssociationsMixin<TeamModel, TeamId>;
|
|
170
|
+
addTeam: Sequelize.BelongsToManyAddAssociationMixin<TeamModel, TeamId>;
|
|
171
|
+
addTeams: Sequelize.BelongsToManyAddAssociationsMixin<TeamModel, TeamId>;
|
|
172
|
+
createTeam: Sequelize.BelongsToManyCreateAssociationMixin<TeamModel>;
|
|
173
|
+
removeTeam: Sequelize.BelongsToManyRemoveAssociationMixin<TeamModel, TeamId>;
|
|
174
|
+
removeTeams: Sequelize.BelongsToManyRemoveAssociationsMixin<TeamModel, TeamId>;
|
|
175
|
+
hasTeam: Sequelize.BelongsToManyHasAssociationMixin<TeamModel, TeamId>;
|
|
176
|
+
hasTeams: Sequelize.BelongsToManyHasAssociationsMixin<TeamModel, TeamId>;
|
|
177
|
+
countTeams: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
160
178
|
rallies: RallyModel[];
|
|
161
179
|
getRallies: Sequelize.BelongsToManyGetAssociationsMixin<RallyModel>;
|
|
162
180
|
setRallies: Sequelize.BelongsToManySetAssociationsMixin<RallyModel, RallyId>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import { CoachAttributes, CoachModel, CountryModel, DraftPickModel, LeagueAttributes, LeagueModel, MatchModel, MatchRatingModel, PlayerModel, PlayerTeamModel, RallyModel, ScoreModel, SeasonModel, SeasonTeamsModel, TournamentModel, TournamentTeamsModel } from '.';
|
|
3
|
+
import { CoachAttributes, CoachModel, CountryModel, DraftPickModel, LeagueAttributes, LeagueModel, MatchModel, MatchRatingModel, PlayerAttributes, PlayerId, PlayerModel, PlayerTeamModel, RallyModel, ScoreModel, SeasonModel, SeasonTeamsModel, TournamentModel, TournamentTeamsModel } from '.';
|
|
4
4
|
import type { CoachId, CountryId, DraftPickId, LeagueId, MatchId, MatchRatingId, PlayerTeamId, RallyId, ScoreId, SeasonId, SeasonTeamsId, TournamentId, TournamentTeamsId } from './';
|
|
5
5
|
export interface TeamAttributes {
|
|
6
6
|
team_id: string;
|
|
@@ -12,7 +12,7 @@ export interface TeamAttributes {
|
|
|
12
12
|
country_id?: string;
|
|
13
13
|
coach?: CoachAttributes;
|
|
14
14
|
league?: LeagueAttributes;
|
|
15
|
-
Players?:
|
|
15
|
+
Players?: PlayerAttributes[];
|
|
16
16
|
}
|
|
17
17
|
export type TeamPk = 'team_id';
|
|
18
18
|
export type TeamId = TeamModel[TeamPk];
|
|
@@ -191,5 +191,16 @@ export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttribu
|
|
|
191
191
|
hasTournamentTeam: Sequelize.HasManyHasAssociationMixin<TournamentTeamsModel, TournamentTeamsId>;
|
|
192
192
|
hasTournamentTeams: Sequelize.HasManyHasAssociationsMixin<TournamentTeamsModel, TournamentTeamsId>;
|
|
193
193
|
countTournamentTeams: Sequelize.HasManyCountAssociationsMixin;
|
|
194
|
+
Players: PlayerModel[];
|
|
195
|
+
getPlayers: Sequelize.BelongsToManyGetAssociationsMixin<PlayerModel>;
|
|
196
|
+
setPlayers: Sequelize.BelongsToManySetAssociationsMixin<PlayerModel, PlayerId>;
|
|
197
|
+
addPlayer: Sequelize.BelongsToManyAddAssociationMixin<PlayerModel, PlayerId>;
|
|
198
|
+
addPlayers: Sequelize.BelongsToManyAddAssociationsMixin<PlayerModel, PlayerId>;
|
|
199
|
+
createPlayer: Sequelize.BelongsToManyCreateAssociationMixin<PlayerModel>;
|
|
200
|
+
removePlayer: Sequelize.BelongsToManyRemoveAssociationMixin<PlayerModel, PlayerId>;
|
|
201
|
+
removePlayers: Sequelize.BelongsToManyRemoveAssociationsMixin<PlayerModel, PlayerId>;
|
|
202
|
+
hasPlayer: Sequelize.BelongsToManyHasAssociationMixin<PlayerModel, PlayerId>;
|
|
203
|
+
hasPlayers: Sequelize.BelongsToManyHasAssociationsMixin<PlayerModel, PlayerId>;
|
|
204
|
+
countPlayers: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
194
205
|
static initModel(sequelize: Sequelize.Sequelize): typeof TeamModel;
|
|
195
206
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { PlayerTeamAttributes } from '../models';
|
|
2
|
-
declare function transformToAttributes(playerId: string, teamId: string, jerseyNumber: number): PlayerTeamAttributes;
|
|
2
|
+
declare function transformToAttributes(playerId: string, teamId: string, jerseyNumber: number, active?: boolean): PlayerTeamAttributes;
|
|
3
3
|
export { transformToAttributes as transformFromPlayerTeam };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
function transformToAttributes(playerId, teamId, jerseyNumber) {
|
|
1
|
+
function transformToAttributes(playerId, teamId, jerseyNumber, active = false) {
|
|
2
2
|
return {
|
|
3
3
|
player_id: playerId,
|
|
4
4
|
team_id: teamId,
|
|
5
|
-
jersey_number: jerseyNumber
|
|
5
|
+
jersey_number: jerseyNumber,
|
|
6
|
+
active
|
|
6
7
|
};
|
|
7
8
|
}
|
|
8
9
|
export { transformToAttributes as transformFromPlayerTeam };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { SeasonMatchAttributes } from '../models';
|
|
2
|
-
|
|
2
|
+
import { Match } from '../../service';
|
|
3
|
+
declare function transformToAttributes(seasonId: string, match: Match): SeasonMatchAttributes;
|
|
3
4
|
export { transformToAttributes as transformFromSeasonMatch };
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { transformFromMatch } from './match';
|
|
2
|
+
function transformToAttributes(seasonId, match) {
|
|
2
3
|
return {
|
|
3
4
|
season_id: seasonId,
|
|
4
|
-
match_id:
|
|
5
|
+
match_id: match.id,
|
|
6
|
+
match: transformFromMatch(match)
|
|
5
7
|
};
|
|
6
8
|
}
|
|
7
9
|
export { transformToAttributes as transformFromSeasonMatch };
|
|
@@ -2,7 +2,7 @@ import { transformFromSeasonMatch, transformFromTeam, transformToAPIMatch, trans
|
|
|
2
2
|
import { Season } from '../../service';
|
|
3
3
|
function transformToAttributes(season, leagueId) {
|
|
4
4
|
const seasonMatches = season.matches != null ?
|
|
5
|
-
season.matches.map(match => transformFromSeasonMatch(season.id, match
|
|
5
|
+
season.matches.map(match => transformFromSeasonMatch(season.id, match)) : [];
|
|
6
6
|
const seasonTeams = season.teams.map(team => ({ season_id: season.id, team_id: team.id }));
|
|
7
7
|
return {
|
|
8
8
|
season_id: season.id,
|
|
@@ -6,7 +6,7 @@ function transformToAttributes(tournamentMatch, tournamentId) {
|
|
|
6
6
|
match_id: tournamentMatch.match.id,
|
|
7
7
|
index: tournamentMatch.index,
|
|
8
8
|
stage: transformFromStage(tournamentMatch.stage),
|
|
9
|
-
match:
|
|
9
|
+
match: transformFromMatch(tournamentMatch.match)
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
12
|
function transformToObject(model) {
|