volleyballsimtypes 0.0.90 → 0.0.92
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 +13 -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/esm/src/data/init-models.js +13 -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/package.json +1 -1
|
@@ -119,7 +119,13 @@ 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: 'Teams',
|
|
124
|
+
through: PlayerTeam,
|
|
125
|
+
foreignKey: 'player_id',
|
|
126
|
+
otherKey: 'team_id'
|
|
127
|
+
});
|
|
128
|
+
Player.hasMany(PlayerTeam, { as: 'PlayerTeams', foreignKey: 'player_id' });
|
|
123
129
|
Player.belongsToMany(MatchSet, {
|
|
124
130
|
as: 'matchSets',
|
|
125
131
|
through: MatchSetStats,
|
|
@@ -212,6 +218,12 @@ function initModels(sequelize) {
|
|
|
212
218
|
otherKey: 'match_id'
|
|
213
219
|
});
|
|
214
220
|
Team.hasMany(MatchRating, { as: 'MatchRatings', foreignKey: 'team_id' });
|
|
221
|
+
Team.belongsToMany(Player, {
|
|
222
|
+
as: 'Players',
|
|
223
|
+
through: PlayerTeam,
|
|
224
|
+
foreignKey: 'team_id',
|
|
225
|
+
otherKey: 'player_id'
|
|
226
|
+
});
|
|
215
227
|
Team.hasMany(PlayerTeam, { as: 'PlayerTeams', foreignKey: 'team_id' });
|
|
216
228
|
Team.belongsToMany(Season, {
|
|
217
229
|
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;
|
|
@@ -116,7 +116,13 @@ 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: 'Teams',
|
|
121
|
+
through: PlayerTeam,
|
|
122
|
+
foreignKey: 'player_id',
|
|
123
|
+
otherKey: 'team_id'
|
|
124
|
+
});
|
|
125
|
+
Player.hasMany(PlayerTeam, { as: 'PlayerTeams', foreignKey: 'player_id' });
|
|
120
126
|
Player.belongsToMany(MatchSet, {
|
|
121
127
|
as: 'matchSets',
|
|
122
128
|
through: MatchSetStats,
|
|
@@ -209,6 +215,12 @@ export function initModels(sequelize) {
|
|
|
209
215
|
otherKey: 'match_id'
|
|
210
216
|
});
|
|
211
217
|
Team.hasMany(MatchRating, { as: 'MatchRatings', foreignKey: 'team_id' });
|
|
218
|
+
Team.belongsToMany(Player, {
|
|
219
|
+
as: 'Players',
|
|
220
|
+
through: PlayerTeam,
|
|
221
|
+
foreignKey: 'team_id',
|
|
222
|
+
otherKey: 'player_id'
|
|
223
|
+
});
|
|
212
224
|
Team.hasMany(PlayerTeam, { as: 'PlayerTeams', foreignKey: 'team_id' });
|
|
213
225
|
Team.belongsToMany(Season, {
|
|
214
226
|
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 };
|