volleyballsimtypes 0.0.138 → 0.0.140
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/service/player/trait.js +2 -2
- package/dist/esm/data/index.d.ts +3 -0
- package/dist/esm/data/index.js +3 -0
- package/dist/esm/data/init-models.d.ts +2 -0
- package/dist/esm/data/init-models.js +194 -0
- package/dist/esm/data/models/coach.d.ts +40 -0
- package/dist/esm/data/models/coach.js +51 -0
- package/dist/esm/data/models/competition-champion.d.ts +23 -0
- package/dist/esm/data/models/competition-champion.js +34 -0
- package/dist/esm/data/models/competition-match.d.ts +29 -0
- package/dist/esm/data/models/competition-match.js +42 -0
- package/dist/esm/data/models/competition-teams.d.ts +23 -0
- package/dist/esm/data/models/competition-teams.js +38 -0
- package/dist/esm/data/models/competition.d.ts +67 -0
- package/dist/esm/data/models/competition.js +34 -0
- package/dist/esm/data/models/country.d.ts +61 -0
- package/dist/esm/data/models/country.js +30 -0
- package/dist/esm/data/models/draft-pick.d.ts +31 -0
- package/dist/esm/data/models/draft-pick.js +46 -0
- package/dist/esm/data/models/draft.d.ts +29 -0
- package/dist/esm/data/models/draft.js +30 -0
- package/dist/esm/data/models/index.d.ts +24 -0
- package/dist/esm/data/models/index.js +24 -0
- package/dist/esm/data/models/iteration.d.ts +26 -0
- package/dist/esm/data/models/iteration.js +26 -0
- package/dist/esm/data/models/league-season.d.ts +23 -0
- package/dist/esm/data/models/league-season.js +34 -0
- package/dist/esm/data/models/league.d.ts +44 -0
- package/dist/esm/data/models/league.js +34 -0
- package/dist/esm/data/models/match-rating.d.ts +27 -0
- package/dist/esm/data/models/match-rating.js +48 -0
- package/dist/esm/data/models/match-set-stats.d.ts +58 -0
- package/dist/esm/data/models/match-set-stats.js +123 -0
- package/dist/esm/data/models/match-set.d.ts +85 -0
- package/dist/esm/data/models/match-set.js +47 -0
- package/dist/esm/data/models/match.d.ts +67 -0
- package/dist/esm/data/models/match.js +47 -0
- package/dist/esm/data/models/performance-stats.d.ts +40 -0
- package/dist/esm/data/models/performance-stats.js +81 -0
- package/dist/esm/data/models/player-team.d.ts +28 -0
- package/dist/esm/data/models/player-team.js +48 -0
- package/dist/esm/data/models/player-trait.d.ts +23 -0
- package/dist/esm/data/models/player-trait.js +38 -0
- package/dist/esm/data/models/player.d.ts +124 -0
- package/dist/esm/data/models/player.js +42 -0
- package/dist/esm/data/models/rally.d.ts +29 -0
- package/dist/esm/data/models/rally.js +46 -0
- package/dist/esm/data/models/set-position.d.ts +29 -0
- package/dist/esm/data/models/set-position.js +46 -0
- package/dist/esm/data/models/team.d.ts +162 -0
- package/dist/esm/data/models/team.js +59 -0
- package/dist/esm/data/models/trait.d.ts +37 -0
- package/dist/esm/data/models/trait.js +26 -0
- package/dist/esm/data/models/user.d.ts +22 -0
- package/dist/esm/data/models/user.js +53 -0
- package/dist/esm/data/transformers/coach.d.ts +5 -0
- package/dist/esm/data/transformers/coach.js +25 -0
- package/dist/esm/data/transformers/country.d.ts +5 -0
- package/dist/esm/data/transformers/country.js +16 -0
- package/dist/esm/data/transformers/court-position.d.ts +5 -0
- package/dist/esm/data/transformers/court-position.js +27 -0
- package/dist/esm/data/transformers/draft-pick.d.ts +5 -0
- package/dist/esm/data/transformers/draft-pick.js +18 -0
- package/dist/esm/data/transformers/draft.d.ts +5 -0
- package/dist/esm/data/transformers/draft.js +20 -0
- package/dist/esm/data/transformers/formation.d.ts +5 -0
- package/dist/esm/data/transformers/formation.js +8 -0
- package/dist/esm/data/transformers/index.d.ts +25 -0
- package/dist/esm/data/transformers/index.js +25 -0
- package/dist/esm/data/transformers/iteration.d.ts +5 -0
- package/dist/esm/data/transformers/iteration.js +14 -0
- package/dist/esm/data/transformers/league.d.ts +5 -0
- package/dist/esm/data/transformers/league.js +28 -0
- package/dist/esm/data/transformers/match-rating.d.ts +4 -0
- package/dist/esm/data/transformers/match-rating.js +13 -0
- package/dist/esm/data/transformers/match-set-stats.d.ts +5 -0
- package/dist/esm/data/transformers/match-set-stats.js +57 -0
- package/dist/esm/data/transformers/match-set.d.ts +5 -0
- package/dist/esm/data/transformers/match-set.js +44 -0
- package/dist/esm/data/transformers/match.d.ts +5 -0
- package/dist/esm/data/transformers/match.js +27 -0
- package/dist/esm/data/transformers/performance-stats.d.ts +5 -0
- package/dist/esm/data/transformers/performance-stats.js +33 -0
- package/dist/esm/data/transformers/player-team.d.ts +3 -0
- package/dist/esm/data/transformers/player-team.js +9 -0
- package/dist/esm/data/transformers/player.d.ts +5 -0
- package/dist/esm/data/transformers/player.js +26 -0
- package/dist/esm/data/transformers/rally.d.ts +5 -0
- package/dist/esm/data/transformers/rally.js +23 -0
- package/dist/esm/data/transformers/role.d.ts +5 -0
- package/dist/esm/data/transformers/role.js +23 -0
- package/dist/esm/data/transformers/season-match.d.ts +4 -0
- package/dist/esm/data/transformers/season-match.js +13 -0
- package/dist/esm/data/transformers/season.d.ts +5 -0
- package/dist/esm/data/transformers/season.js +39 -0
- package/dist/esm/data/transformers/set-position.d.ts +5 -0
- package/dist/esm/data/transformers/set-position.js +16 -0
- package/dist/esm/data/transformers/stage.d.ts +5 -0
- package/dist/esm/data/transformers/stage.js +21 -0
- package/dist/esm/data/transformers/team.d.ts +5 -0
- package/dist/esm/data/transformers/team.js +28 -0
- package/dist/esm/data/transformers/tournament-match.d.ts +5 -0
- package/dist/esm/data/transformers/tournament-match.js +19 -0
- package/dist/esm/data/transformers/tournament.d.ts +5 -0
- package/dist/esm/data/transformers/tournament.js +33 -0
- package/dist/esm/data/transformers/trait.d.ts +5 -0
- package/dist/esm/data/transformers/trait.js +15 -0
- package/dist/esm/index.d.ts +2 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/service/coach/coach.d.ts +19 -0
- package/dist/esm/service/coach/coach.js +11 -0
- package/dist/esm/service/coach/formation.d.ts +31 -0
- package/dist/esm/service/coach/formation.js +122 -0
- package/dist/esm/service/coach/index.d.ts +2 -0
- package/dist/esm/service/coach/index.js +2 -0
- package/dist/esm/service/competition/index.d.ts +11 -0
- package/dist/esm/service/competition/index.js +12 -0
- package/dist/esm/service/competition/iteration.d.ts +10 -0
- package/dist/esm/service/competition/iteration.js +8 -0
- package/dist/esm/service/competition/league.d.ts +16 -0
- package/dist/esm/service/competition/league.js +8 -0
- package/dist/esm/service/competition/season.d.ts +23 -0
- package/dist/esm/service/competition/season.js +27 -0
- package/dist/esm/service/competition/stage.d.ts +11 -0
- package/dist/esm/service/competition/stage.js +24 -0
- package/dist/esm/service/competition/standing.d.ts +28 -0
- package/dist/esm/service/competition/standing.js +76 -0
- package/dist/esm/service/competition/tournament-match.d.ts +14 -0
- package/dist/esm/service/competition/tournament-match.js +9 -0
- package/dist/esm/service/competition/tournament.d.ts +20 -0
- package/dist/esm/service/competition/tournament.js +18 -0
- package/dist/esm/service/country/country.d.ts +17 -0
- package/dist/esm/service/country/country.js +18 -0
- package/dist/esm/service/country/index.d.ts +1 -0
- package/dist/esm/service/country/index.js +1 -0
- package/dist/esm/service/draft/draft-pick.d.ts +14 -0
- package/dist/esm/service/draft/draft-pick.js +7 -0
- package/dist/esm/service/draft/draft.d.ts +15 -0
- package/dist/esm/service/draft/draft.js +8 -0
- package/dist/esm/service/draft/index.d.ts +2 -0
- package/dist/esm/service/draft/index.js +2 -0
- package/dist/esm/service/event/index.d.ts +1 -0
- package/dist/esm/service/event/index.js +1 -0
- package/dist/esm/service/event/rally-event.d.ts +20 -0
- package/dist/esm/service/event/rally-event.js +16 -0
- package/dist/esm/service/index.d.ts +9 -0
- package/dist/esm/service/index.js +9 -0
- package/dist/esm/service/match/court-position.d.ts +21 -0
- package/dist/esm/service/match/court-position.js +53 -0
- package/dist/esm/service/match/court-target-enum.d.ts +21 -0
- package/dist/esm/service/match/court-target-enum.js +54 -0
- package/dist/esm/service/match/index.d.ts +7 -0
- package/dist/esm/service/match/index.js +7 -0
- package/dist/esm/service/match/match-rating.d.ts +35 -0
- package/dist/esm/service/match/match-rating.js +61 -0
- package/dist/esm/service/match/match-set.d.ts +65 -0
- package/dist/esm/service/match/match-set.js +56 -0
- package/dist/esm/service/match/match-team.d.ts +7 -0
- package/dist/esm/service/match/match-team.js +17 -0
- package/dist/esm/service/match/match.d.ts +36 -0
- package/dist/esm/service/match/match.js +57 -0
- package/dist/esm/service/match/rally.d.ts +22 -0
- package/dist/esm/service/match/rally.js +13 -0
- package/dist/esm/service/player/index.d.ts +5 -0
- package/dist/esm/service/player/index.js +5 -0
- package/dist/esm/service/player/performance-stats.d.ts +30 -0
- package/dist/esm/service/player/performance-stats.js +34 -0
- package/dist/esm/service/player/player.d.ts +46 -0
- package/dist/esm/service/player/player.js +84 -0
- package/dist/esm/service/player/role.d.ts +17 -0
- package/dist/esm/service/player/role.js +42 -0
- package/dist/esm/service/player/stats.d.ts +11 -0
- package/dist/esm/service/player/stats.js +25 -0
- package/dist/esm/service/player/trait.d.ts +21 -0
- package/dist/esm/service/player/trait.js +108 -0
- package/dist/esm/service/team/index.d.ts +1 -0
- package/dist/esm/service/team/index.js +1 -0
- package/dist/esm/service/team/team.d.ts +31 -0
- package/dist/esm/service/team/team.js +32 -0
- package/dist/esm/service/utils/index.d.ts +2 -0
- package/dist/esm/service/utils/index.js +2 -0
- package/dist/esm/service/utils/object-utils.d.ts +1 -0
- package/dist/esm/service/utils/object-utils.js +1 -0
- package/dist/esm/service/utils/string-utils.d.ts +2 -0
- package/dist/esm/service/utils/string-utils.js +11 -0
- package/dist/esm/src/service/player/trait.js +2 -2
- package/package.json +1 -1
|
@@ -74,7 +74,7 @@ Trait.MOVING_WALL = new Trait({
|
|
|
74
74
|
Trait.MARKSMAN = new Trait({
|
|
75
75
|
id: 'ace3458e-69ab-487c-a9c0-d656f705d8dd',
|
|
76
76
|
name: 'Marksman',
|
|
77
|
-
modifier: 1.
|
|
77
|
+
modifier: 1.01,
|
|
78
78
|
chance: 0.3,
|
|
79
79
|
statThreshold: 75,
|
|
80
80
|
stat: stats_1.GeneralStat.ATTACK,
|
|
@@ -84,7 +84,7 @@ Trait.MARKSMAN = new Trait({
|
|
|
84
84
|
Trait.METEOR_SERVE = new Trait({
|
|
85
85
|
id: 'c929a79d-5866-40d6-bbd6-b0b67a929c4c',
|
|
86
86
|
name: 'Meteor Serve',
|
|
87
|
-
modifier: 1.
|
|
87
|
+
modifier: 1.1,
|
|
88
88
|
chance: 0.1,
|
|
89
89
|
statThreshold: 75,
|
|
90
90
|
stat: stats_1.GeneralStat.SERVE,
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { CoachModel, CompetitionChampionModel, CompetitionMatchModel, CompetitionModel, CompetitionTeamsModel, CountryModel, DraftModel, DraftPickModel, IterationModel, LeagueModel, LeagueSeasonModel, MatchModel, MatchRatingModel, MatchSetModel, MatchSetStatsModel, PerformanceStatsModel, PlayerModel, PlayerTeamModel, PlayerTraitModel, RallyModel, SetPositionModel, TeamModel, TraitModel, UserModel } from './models';
|
|
2
|
+
export function initModels(sequelize) {
|
|
3
|
+
const Coach = CoachModel.initModel(sequelize);
|
|
4
|
+
const Country = CountryModel.initModel(sequelize);
|
|
5
|
+
const Competition = CompetitionModel.initModel(sequelize);
|
|
6
|
+
const CompetitionTeams = CompetitionTeamsModel.initModel(sequelize);
|
|
7
|
+
const CompetitionChampion = CompetitionChampionModel.initModel(sequelize);
|
|
8
|
+
const CompetitionMatch = CompetitionMatchModel.initModel(sequelize);
|
|
9
|
+
const Draft = DraftModel.initModel(sequelize);
|
|
10
|
+
const DraftPick = DraftPickModel.initModel(sequelize);
|
|
11
|
+
const Iteration = IterationModel.initModel(sequelize);
|
|
12
|
+
const League = LeagueModel.initModel(sequelize);
|
|
13
|
+
const LeagueSeason = LeagueSeasonModel.initModel(sequelize);
|
|
14
|
+
const Match = MatchModel.initModel(sequelize);
|
|
15
|
+
const MatchRating = MatchRatingModel.initModel(sequelize);
|
|
16
|
+
const MatchSet = MatchSetModel.initModel(sequelize);
|
|
17
|
+
const MatchSetStats = MatchSetStatsModel.initModel(sequelize);
|
|
18
|
+
const PerformanceStats = PerformanceStatsModel.initModel(sequelize);
|
|
19
|
+
const Player = PlayerModel.initModel(sequelize);
|
|
20
|
+
const PlayerTeam = PlayerTeamModel.initModel(sequelize);
|
|
21
|
+
const PlayerTrait = PlayerTraitModel.initModel(sequelize);
|
|
22
|
+
const Rally = RallyModel.initModel(sequelize);
|
|
23
|
+
const SetPosition = SetPositionModel.initModel(sequelize);
|
|
24
|
+
const Team = TeamModel.initModel(sequelize);
|
|
25
|
+
const Trait = TraitModel.initModel(sequelize);
|
|
26
|
+
const User = UserModel.initModel(sequelize);
|
|
27
|
+
Coach.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
28
|
+
Coach.hasMany(Team, { as: 'Teams', foreignKey: 'coach_id' });
|
|
29
|
+
Competition.belongsTo(Iteration, { as: 'Iteration', foreignKey: 'iteration' });
|
|
30
|
+
Competition.hasMany(CompetitionMatch, { as: 'CompetitionMatches', foreignKey: 'competition_id' });
|
|
31
|
+
Competition.hasMany(CompetitionTeams, { as: 'CompetitionTeams', foreignKey: 'competition_id' });
|
|
32
|
+
Competition.hasOne(CompetitionChampion, { as: 'CompetitionChampion', foreignKey: 'competition_id' });
|
|
33
|
+
Competition.hasOne(LeagueSeason, { as: 'LeagueSeason', foreignKey: 'competition_id' });
|
|
34
|
+
Competition.belongsToMany(Team, {
|
|
35
|
+
as: 'Teams',
|
|
36
|
+
through: CompetitionTeams,
|
|
37
|
+
foreignKey: 'competition_id',
|
|
38
|
+
otherKey: 'team_id'
|
|
39
|
+
});
|
|
40
|
+
CompetitionChampion.belongsTo(Competition, { as: 'competition', foreignKey: 'competition_id' });
|
|
41
|
+
CompetitionChampion.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
42
|
+
CompetitionMatch.belongsTo(Competition, { as: 'Competition', foreignKey: 'competition_id' });
|
|
43
|
+
CompetitionMatch.belongsTo(Match, { as: 'Match', foreignKey: 'match_id' });
|
|
44
|
+
CompetitionTeams.belongsTo(Competition, { as: 'competition', foreignKey: 'competition_id' });
|
|
45
|
+
CompetitionTeams.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
46
|
+
Country.hasMany(Coach, { as: 'Coaches', foreignKey: 'country_id' });
|
|
47
|
+
Country.hasMany(League, { as: 'Leagues', foreignKey: 'country_id' });
|
|
48
|
+
Country.hasMany(Player, { as: 'Players', foreignKey: 'country_id' });
|
|
49
|
+
Country.hasMany(Team, { as: 'Teams', foreignKey: 'country_id' });
|
|
50
|
+
Draft.hasMany(DraftPick, { as: 'DraftPicks', foreignKey: 'draft_id' });
|
|
51
|
+
DraftPick.belongsTo(Draft, { as: 'draft', foreignKey: 'draft_id' });
|
|
52
|
+
DraftPick.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
53
|
+
DraftPick.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
54
|
+
Iteration.hasMany(Competition, { as: 'Competitions', foreignKey: 'iteration' });
|
|
55
|
+
League.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
56
|
+
League.hasMany(LeagueSeason, { as: 'LeagueSeasons', foreignKey: 'league_id' });
|
|
57
|
+
League.hasMany(Team, { as: 'Teams', foreignKey: 'league_id' });
|
|
58
|
+
LeagueSeason.belongsTo(Competition, { as: 'competition', foreignKey: 'competition_id' });
|
|
59
|
+
LeagueSeason.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
|
|
60
|
+
Match.belongsTo(Team, { as: 'AwayTeam', foreignKey: 'away_team' });
|
|
61
|
+
Match.belongsTo(Team, { as: 'HomeTeam', foreignKey: 'home_team' });
|
|
62
|
+
Match.belongsToMany(Team, {
|
|
63
|
+
as: 'TeamMatchRatings',
|
|
64
|
+
through: MatchRating,
|
|
65
|
+
foreignKey: 'match_id',
|
|
66
|
+
otherKey: 'team_id'
|
|
67
|
+
});
|
|
68
|
+
Match.hasMany(MatchRating, { as: 'MatchRatings', foreignKey: 'match_id' });
|
|
69
|
+
Match.hasMany(MatchSet, { as: 'MatchSets', foreignKey: 'match_id' });
|
|
70
|
+
Match.hasOne(CompetitionMatch, { as: 'CompetitionMatch', foreignKey: 'match_id' });
|
|
71
|
+
MatchRating.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
|
|
72
|
+
MatchRating.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
73
|
+
MatchSet.belongsTo(Match, { as: 'match', foreignKey: 'match_id' });
|
|
74
|
+
MatchSet.belongsToMany(Player, {
|
|
75
|
+
as: 'SetPositionsPlayer',
|
|
76
|
+
through: SetPosition,
|
|
77
|
+
foreignKey: 'match_set_id',
|
|
78
|
+
otherKey: 'player_id'
|
|
79
|
+
});
|
|
80
|
+
MatchSet.belongsToMany(Player, {
|
|
81
|
+
as: 'SetStatsPlayers',
|
|
82
|
+
through: MatchSetStats,
|
|
83
|
+
foreignKey: 'match_set_id',
|
|
84
|
+
otherKey: 'player_id'
|
|
85
|
+
});
|
|
86
|
+
MatchSet.hasMany(MatchSetStats, { as: 'MatchSetStats', foreignKey: 'match_set_id' });
|
|
87
|
+
MatchSet.hasMany(Rally, { as: 'Rallies', foreignKey: 'match_set_id' });
|
|
88
|
+
MatchSet.hasMany(SetPosition, { as: 'SetPositions', foreignKey: 'match_set_id' });
|
|
89
|
+
MatchSetStats.belongsTo(MatchSet, { as: 'matchSet', foreignKey: 'match_set_id' });
|
|
90
|
+
MatchSetStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
91
|
+
PerformanceStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
92
|
+
Player.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
93
|
+
Player.belongsToMany(MatchSet, {
|
|
94
|
+
as: 'SetPositionSets',
|
|
95
|
+
through: SetPosition,
|
|
96
|
+
foreignKey: 'player_id',
|
|
97
|
+
otherKey: 'match_set_id'
|
|
98
|
+
});
|
|
99
|
+
Player.belongsToMany(MatchSet, {
|
|
100
|
+
as: 'StatsMatchSets',
|
|
101
|
+
through: MatchSetStats,
|
|
102
|
+
foreignKey: 'player_id',
|
|
103
|
+
otherKey: 'match_set_id'
|
|
104
|
+
});
|
|
105
|
+
Player.belongsToMany(Team, {
|
|
106
|
+
as: 'Teams',
|
|
107
|
+
through: PlayerTeam,
|
|
108
|
+
foreignKey: 'player_id',
|
|
109
|
+
otherKey: 'team_id'
|
|
110
|
+
});
|
|
111
|
+
Player.belongsToMany(Trait, {
|
|
112
|
+
as: 'Traits',
|
|
113
|
+
through: PlayerTrait,
|
|
114
|
+
foreignKey: 'player_id',
|
|
115
|
+
otherKey: 'trait_id'
|
|
116
|
+
});
|
|
117
|
+
Player.hasMany(MatchSetStats, { as: 'MatchSetStats', foreignKey: 'player_id' });
|
|
118
|
+
Player.hasMany(PlayerTeam, { as: 'PlayerTeams', foreignKey: 'player_id' });
|
|
119
|
+
Player.hasMany(PlayerTrait, { as: 'PlayerTraits', foreignKey: 'player_id' });
|
|
120
|
+
Player.hasMany(SetPosition, { as: 'SetPositions', foreignKey: 'player_id' });
|
|
121
|
+
Player.hasOne(DraftPick, { as: 'DraftPick', foreignKey: 'player_id' });
|
|
122
|
+
Player.hasOne(PerformanceStats, { as: 'PerformanceStat', foreignKey: 'player_id' });
|
|
123
|
+
PlayerTeam.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
124
|
+
PlayerTeam.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
125
|
+
PlayerTrait.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
126
|
+
PlayerTrait.belongsTo(Trait, { as: 'trait', foreignKey: 'trait_id' });
|
|
127
|
+
Rally.belongsTo(MatchSet, { as: 'matchSet', foreignKey: 'match_set_id' });
|
|
128
|
+
Rally.belongsTo(Team, { as: 'ServingTeam', foreignKey: 'serving_team' });
|
|
129
|
+
SetPosition.belongsTo(MatchSet, { as: 'matchSet', foreignKey: 'match_set_id' });
|
|
130
|
+
SetPosition.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
131
|
+
Team.belongsTo(Coach, { as: 'coach', foreignKey: 'coach_id' });
|
|
132
|
+
Team.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
133
|
+
Team.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
|
|
134
|
+
Team.belongsToMany(Competition, {
|
|
135
|
+
as: 'Competitions',
|
|
136
|
+
through: CompetitionTeams,
|
|
137
|
+
foreignKey: 'team_id',
|
|
138
|
+
otherKey: 'competition_id'
|
|
139
|
+
});
|
|
140
|
+
Team.belongsToMany(Match, {
|
|
141
|
+
as: 'RatingMatches',
|
|
142
|
+
through: MatchRating,
|
|
143
|
+
foreignKey: 'team_id',
|
|
144
|
+
otherKey: 'match_id'
|
|
145
|
+
});
|
|
146
|
+
Team.belongsToMany(Player, {
|
|
147
|
+
as: 'Players',
|
|
148
|
+
through: PlayerTeam,
|
|
149
|
+
foreignKey: 'team_id',
|
|
150
|
+
otherKey: 'player_id'
|
|
151
|
+
});
|
|
152
|
+
Team.hasMany(CompetitionChampion, { as: 'CompetitionChampions', foreignKey: 'team_id' });
|
|
153
|
+
Team.hasMany(CompetitionTeams, { as: 'CompetitionTeams', foreignKey: 'team_id' });
|
|
154
|
+
Team.hasMany(DraftPick, { as: 'DraftPicks', foreignKey: 'team_id' });
|
|
155
|
+
Team.hasMany(Match, { as: 'HomeMatches', foreignKey: 'home_team' });
|
|
156
|
+
Team.hasMany(Match, { as: 'AwayMatches', foreignKey: 'away_team' });
|
|
157
|
+
Team.hasMany(MatchRating, { as: 'MatchRatings', foreignKey: 'team_id' });
|
|
158
|
+
Team.hasMany(PlayerTeam, { as: 'PlayerTeams', foreignKey: 'team_id' });
|
|
159
|
+
Team.hasMany(Rally, { as: 'Rallies', foreignKey: 'serving_team' });
|
|
160
|
+
Trait.belongsToMany(Player, {
|
|
161
|
+
as: 'Players',
|
|
162
|
+
through: PlayerTrait,
|
|
163
|
+
foreignKey: 'trait_id',
|
|
164
|
+
otherKey: 'player_id'
|
|
165
|
+
});
|
|
166
|
+
Trait.hasMany(PlayerTrait, { as: 'PlayerTraits', foreignKey: 'trait_id' });
|
|
167
|
+
return {
|
|
168
|
+
Coach,
|
|
169
|
+
Competition,
|
|
170
|
+
CompetitionChampion,
|
|
171
|
+
CompetitionMatch,
|
|
172
|
+
CompetitionTeams,
|
|
173
|
+
Country,
|
|
174
|
+
Draft,
|
|
175
|
+
DraftPick,
|
|
176
|
+
Event,
|
|
177
|
+
Iteration,
|
|
178
|
+
League,
|
|
179
|
+
LeagueSeason,
|
|
180
|
+
Match,
|
|
181
|
+
MatchRating,
|
|
182
|
+
MatchSet,
|
|
183
|
+
MatchSetStats,
|
|
184
|
+
PerformanceStats,
|
|
185
|
+
Player,
|
|
186
|
+
PlayerTeam,
|
|
187
|
+
PlayerTrait,
|
|
188
|
+
Rally,
|
|
189
|
+
SetPosition,
|
|
190
|
+
Team,
|
|
191
|
+
Trait,
|
|
192
|
+
User
|
|
193
|
+
};
|
|
194
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model, Optional } from 'sequelize';
|
|
3
|
+
import { CountryId, CountryModel, TeamId, TeamModel } from '.';
|
|
4
|
+
export interface CoachAttributes {
|
|
5
|
+
coach_id: string;
|
|
6
|
+
formation: FormationType;
|
|
7
|
+
substitution_tolerance: number;
|
|
8
|
+
first_name: string;
|
|
9
|
+
last_name: string;
|
|
10
|
+
country_id: string;
|
|
11
|
+
}
|
|
12
|
+
export type FormationType = '4-2' | '5-1' | '6-2';
|
|
13
|
+
export type CoachPk = 'coach_id';
|
|
14
|
+
export type CoachId = CoachModel[CoachPk];
|
|
15
|
+
export type CoachOptionalAttributes = 'substitution_tolerance';
|
|
16
|
+
export type CoachCreationAttributes = Optional<CoachAttributes, CoachOptionalAttributes>;
|
|
17
|
+
export declare class CoachModel extends Model<CoachAttributes, CoachCreationAttributes> implements CoachAttributes {
|
|
18
|
+
coach_id: string;
|
|
19
|
+
formation: FormationType;
|
|
20
|
+
substitution_tolerance: number;
|
|
21
|
+
first_name: string;
|
|
22
|
+
last_name: string;
|
|
23
|
+
country_id: string;
|
|
24
|
+
Teams: TeamModel[];
|
|
25
|
+
getTeams: Sequelize.HasManyGetAssociationsMixin<TeamModel>;
|
|
26
|
+
setTeams: Sequelize.HasManySetAssociationsMixin<TeamModel, TeamId>;
|
|
27
|
+
addTeam: Sequelize.HasManyAddAssociationMixin<TeamModel, TeamId>;
|
|
28
|
+
addTeams: Sequelize.HasManyAddAssociationsMixin<TeamModel, TeamId>;
|
|
29
|
+
createTeam: Sequelize.HasManyCreateAssociationMixin<TeamModel>;
|
|
30
|
+
removeTeam: Sequelize.HasManyRemoveAssociationMixin<TeamModel, TeamId>;
|
|
31
|
+
removeTeams: Sequelize.HasManyRemoveAssociationsMixin<TeamModel, TeamId>;
|
|
32
|
+
hasTeam: Sequelize.HasManyHasAssociationMixin<TeamModel, TeamId>;
|
|
33
|
+
hasTeams: Sequelize.HasManyHasAssociationsMixin<TeamModel, TeamId>;
|
|
34
|
+
countTeams: Sequelize.HasManyCountAssociationsMixin;
|
|
35
|
+
country: CountryModel;
|
|
36
|
+
getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
|
|
37
|
+
setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
|
|
38
|
+
createCountry: Sequelize.BelongsToCreateAssociationMixin<CountryModel>;
|
|
39
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof CoachModel;
|
|
40
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { DataTypes, Model } from 'sequelize';
|
|
2
|
+
export class CoachModel extends Model {
|
|
3
|
+
static initModel(sequelize) {
|
|
4
|
+
return CoachModel.init({
|
|
5
|
+
coach_id: {
|
|
6
|
+
type: DataTypes.UUID,
|
|
7
|
+
allowNull: false,
|
|
8
|
+
primaryKey: true
|
|
9
|
+
},
|
|
10
|
+
formation: {
|
|
11
|
+
type: DataTypes.ENUM('4-2', '5-1', '6-2'),
|
|
12
|
+
allowNull: false
|
|
13
|
+
},
|
|
14
|
+
substitution_tolerance: {
|
|
15
|
+
type: DataTypes.REAL,
|
|
16
|
+
allowNull: false,
|
|
17
|
+
defaultValue: 0
|
|
18
|
+
},
|
|
19
|
+
first_name: {
|
|
20
|
+
type: DataTypes.STRING,
|
|
21
|
+
allowNull: false
|
|
22
|
+
},
|
|
23
|
+
last_name: {
|
|
24
|
+
type: DataTypes.STRING,
|
|
25
|
+
allowNull: false
|
|
26
|
+
},
|
|
27
|
+
country_id: {
|
|
28
|
+
type: DataTypes.UUID,
|
|
29
|
+
allowNull: false,
|
|
30
|
+
references: {
|
|
31
|
+
model: 'Country',
|
|
32
|
+
key: 'country_id'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
sequelize,
|
|
37
|
+
tableName: 'Coach',
|
|
38
|
+
schema: 'public',
|
|
39
|
+
timestamps: false,
|
|
40
|
+
indexes: [
|
|
41
|
+
{
|
|
42
|
+
name: 'Coach_pk',
|
|
43
|
+
unique: true,
|
|
44
|
+
fields: [
|
|
45
|
+
{ name: 'coach_id' }
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model } from 'sequelize';
|
|
3
|
+
import { CompetitionId, CompetitionModel, TeamId, TeamModel } from '.';
|
|
4
|
+
export interface CompetitionChampionAttributes {
|
|
5
|
+
competition_id: string;
|
|
6
|
+
team_id: string;
|
|
7
|
+
}
|
|
8
|
+
export type CompetitionChampionPk = 'competition_id';
|
|
9
|
+
export type CompetitionChampionId = CompetitionChampionModel[CompetitionChampionPk];
|
|
10
|
+
export type CompetitionChampionCreationAttributes = CompetitionChampionAttributes;
|
|
11
|
+
export declare class CompetitionChampionModel extends Model<CompetitionChampionAttributes, CompetitionChampionCreationAttributes> implements CompetitionChampionAttributes {
|
|
12
|
+
competition_id: string;
|
|
13
|
+
team_id: string;
|
|
14
|
+
competition: CompetitionModel;
|
|
15
|
+
getCompetition: Sequelize.BelongsToGetAssociationMixin<CompetitionModel>;
|
|
16
|
+
setCompetition: Sequelize.BelongsToSetAssociationMixin<CompetitionModel, CompetitionId>;
|
|
17
|
+
createCompetition: Sequelize.BelongsToCreateAssociationMixin<CompetitionModel>;
|
|
18
|
+
team: TeamModel;
|
|
19
|
+
getTeam: Sequelize.BelongsToGetAssociationMixin<TeamModel>;
|
|
20
|
+
setTeam: Sequelize.BelongsToSetAssociationMixin<TeamModel, TeamId>;
|
|
21
|
+
createTeam: Sequelize.BelongsToCreateAssociationMixin<TeamModel>;
|
|
22
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof CompetitionChampionModel;
|
|
23
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DataTypes, Model } from 'sequelize';
|
|
2
|
+
export class CompetitionChampionModel extends Model {
|
|
3
|
+
static initModel(sequelize) {
|
|
4
|
+
return CompetitionChampionModel.init({
|
|
5
|
+
competition_id: {
|
|
6
|
+
type: DataTypes.UUID,
|
|
7
|
+
allowNull: false,
|
|
8
|
+
primaryKey: true,
|
|
9
|
+
references: {
|
|
10
|
+
model: 'Competition',
|
|
11
|
+
key: 'competition_id'
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
team_id: {
|
|
15
|
+
type: DataTypes.UUID,
|
|
16
|
+
allowNull: false,
|
|
17
|
+
references: {
|
|
18
|
+
model: 'Team',
|
|
19
|
+
key: 'team_id'
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
sequelize,
|
|
24
|
+
tableName: 'CompetitionChampion',
|
|
25
|
+
schema: 'public',
|
|
26
|
+
timestamps: false,
|
|
27
|
+
indexes: [{
|
|
28
|
+
name: 'competitionchampion_pk',
|
|
29
|
+
unique: true,
|
|
30
|
+
fields: [{ name: 'competition_id' }]
|
|
31
|
+
}]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model } from 'sequelize';
|
|
3
|
+
import { CompetitionId, CompetitionModel, MatchAttributes, MatchId, MatchModel } from '.';
|
|
4
|
+
export interface CompetitionMatchAttributes {
|
|
5
|
+
competition_id: string;
|
|
6
|
+
match_id: string;
|
|
7
|
+
index: number;
|
|
8
|
+
stage: CompetitionStage;
|
|
9
|
+
Match?: MatchAttributes;
|
|
10
|
+
}
|
|
11
|
+
export type CompetitionMatchPk = 'match_id';
|
|
12
|
+
export type CompetitionMatchId = CompetitionMatchModel[CompetitionMatchPk];
|
|
13
|
+
export type CompetitionMatchCreationAttributes = CompetitionMatchAttributes;
|
|
14
|
+
export type CompetitionStage = 'FINAL' | 'LEAGUE' | 'QUARTERFINALS' | 'ROUND_OF_8' | 'SEMIFINALS';
|
|
15
|
+
export declare class CompetitionMatchModel extends Model<CompetitionMatchAttributes, CompetitionMatchCreationAttributes> implements CompetitionMatchAttributes {
|
|
16
|
+
competition_id: string;
|
|
17
|
+
match_id: string;
|
|
18
|
+
index: number;
|
|
19
|
+
stage: CompetitionStage;
|
|
20
|
+
Competition: CompetitionModel;
|
|
21
|
+
getCompetition: Sequelize.BelongsToGetAssociationMixin<CompetitionModel>;
|
|
22
|
+
setCompetition: Sequelize.BelongsToSetAssociationMixin<CompetitionModel, CompetitionId>;
|
|
23
|
+
createCompetition: Sequelize.BelongsToCreateAssociationMixin<CompetitionModel>;
|
|
24
|
+
Match: MatchModel;
|
|
25
|
+
getMatch: Sequelize.BelongsToGetAssociationMixin<MatchModel>;
|
|
26
|
+
setMatch: Sequelize.BelongsToSetAssociationMixin<MatchModel, MatchId>;
|
|
27
|
+
createMatch: Sequelize.BelongsToCreateAssociationMixin<MatchModel>;
|
|
28
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof CompetitionMatchModel;
|
|
29
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { DataTypes, Model } from 'sequelize';
|
|
2
|
+
export class CompetitionMatchModel extends Model {
|
|
3
|
+
static initModel(sequelize) {
|
|
4
|
+
return CompetitionMatchModel.init({
|
|
5
|
+
competition_id: {
|
|
6
|
+
type: DataTypes.UUID,
|
|
7
|
+
allowNull: false,
|
|
8
|
+
references: {
|
|
9
|
+
model: 'Competition',
|
|
10
|
+
key: 'competition_id'
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
match_id: {
|
|
14
|
+
type: DataTypes.UUID,
|
|
15
|
+
allowNull: false,
|
|
16
|
+
primaryKey: true,
|
|
17
|
+
references: {
|
|
18
|
+
model: 'Match',
|
|
19
|
+
key: 'match_id'
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
index: {
|
|
23
|
+
type: DataTypes.INTEGER,
|
|
24
|
+
allowNull: false
|
|
25
|
+
},
|
|
26
|
+
stage: {
|
|
27
|
+
type: DataTypes.ENUM('FINAL', 'LEAGUE', 'QUARTERFINALS', 'ROUND_OF_8', 'SEMIFINALS'),
|
|
28
|
+
allowNull: false
|
|
29
|
+
}
|
|
30
|
+
}, {
|
|
31
|
+
sequelize,
|
|
32
|
+
tableName: 'CompetitionMatch',
|
|
33
|
+
schema: 'public',
|
|
34
|
+
timestamps: false,
|
|
35
|
+
indexes: [{
|
|
36
|
+
name: 'competitionmatch_pk',
|
|
37
|
+
unique: true,
|
|
38
|
+
fields: [{ name: 'match_id' }]
|
|
39
|
+
}]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model } from 'sequelize';
|
|
3
|
+
import { CompetitionId, CompetitionModel, TeamId, TeamModel } from '.';
|
|
4
|
+
export interface CompetitionTeamsAttributes {
|
|
5
|
+
competition_id: string;
|
|
6
|
+
team_id: string;
|
|
7
|
+
}
|
|
8
|
+
export type CompetitionTeamsPk = 'competition_id' | 'team_id';
|
|
9
|
+
export type CompetitionTeamsId = CompetitionTeamsModel[CompetitionTeamsPk];
|
|
10
|
+
export type CompetitionTeamsCreationAttributes = CompetitionTeamsAttributes;
|
|
11
|
+
export declare class CompetitionTeamsModel extends Model<CompetitionTeamsAttributes, CompetitionTeamsCreationAttributes> implements CompetitionTeamsAttributes {
|
|
12
|
+
competition_id: string;
|
|
13
|
+
team_id: string;
|
|
14
|
+
competition: CompetitionModel;
|
|
15
|
+
getCompetition: Sequelize.BelongsToGetAssociationMixin<CompetitionModel>;
|
|
16
|
+
setCompetition: Sequelize.BelongsToSetAssociationMixin<CompetitionModel, CompetitionId>;
|
|
17
|
+
createCompetition: Sequelize.BelongsToCreateAssociationMixin<CompetitionModel>;
|
|
18
|
+
team: TeamModel;
|
|
19
|
+
getTeam: Sequelize.BelongsToGetAssociationMixin<TeamModel>;
|
|
20
|
+
setTeam: Sequelize.BelongsToSetAssociationMixin<TeamModel, TeamId>;
|
|
21
|
+
createTeam: Sequelize.BelongsToCreateAssociationMixin<TeamModel>;
|
|
22
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof CompetitionTeamsModel;
|
|
23
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { DataTypes, Model } from 'sequelize';
|
|
2
|
+
export class CompetitionTeamsModel extends Model {
|
|
3
|
+
static initModel(sequelize) {
|
|
4
|
+
return CompetitionTeamsModel.init({
|
|
5
|
+
competition_id: {
|
|
6
|
+
type: DataTypes.UUID,
|
|
7
|
+
allowNull: false,
|
|
8
|
+
primaryKey: true,
|
|
9
|
+
references: {
|
|
10
|
+
model: 'Competition',
|
|
11
|
+
key: 'competition_id'
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
team_id: {
|
|
15
|
+
type: DataTypes.UUID,
|
|
16
|
+
allowNull: false,
|
|
17
|
+
primaryKey: true,
|
|
18
|
+
references: {
|
|
19
|
+
model: 'Team',
|
|
20
|
+
key: 'team_id'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
sequelize,
|
|
25
|
+
tableName: 'CompetitionTeams',
|
|
26
|
+
schema: 'public',
|
|
27
|
+
timestamps: false,
|
|
28
|
+
indexes: [{
|
|
29
|
+
name: 'competitionteams_pk',
|
|
30
|
+
unique: true,
|
|
31
|
+
fields: [
|
|
32
|
+
{ name: 'competition_id' },
|
|
33
|
+
{ name: 'team_id' }
|
|
34
|
+
]
|
|
35
|
+
}]
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model } from 'sequelize';
|
|
3
|
+
import { CompetitionChampionAttributes, CompetitionChampionId, CompetitionChampionModel, CompetitionMatchAttributes, CompetitionMatchId, CompetitionMatchModel, CompetitionTeamsAttributes, CompetitionTeamsId, CompetitionTeamsModel, IterationId, IterationModel, LeagueSeasonAttributes, LeagueSeasonId, LeagueSeasonModel, TeamId, TeamModel } from '.';
|
|
4
|
+
export interface CompetitionAttributes {
|
|
5
|
+
competition_id: string;
|
|
6
|
+
iteration: number;
|
|
7
|
+
type: CompetitionType;
|
|
8
|
+
LeagueSeason?: LeagueSeasonAttributes;
|
|
9
|
+
CompetitionChampion?: CompetitionChampionAttributes;
|
|
10
|
+
CompetitionMatches?: CompetitionMatchAttributes[];
|
|
11
|
+
CompetitionTeams?: CompetitionTeamsAttributes[];
|
|
12
|
+
}
|
|
13
|
+
export type CompetitionPk = 'competition_id';
|
|
14
|
+
export type CompetitionType = 'LEAGUE' | 'TOURNAMENT';
|
|
15
|
+
export type CompetitionId = CompetitionModel[CompetitionPk];
|
|
16
|
+
export type CompetitionCreationAttributes = CompetitionAttributes;
|
|
17
|
+
export declare class CompetitionModel extends Model<CompetitionAttributes, CompetitionCreationAttributes> implements CompetitionAttributes {
|
|
18
|
+
competition_id: string;
|
|
19
|
+
iteration: number;
|
|
20
|
+
type: CompetitionType;
|
|
21
|
+
CompetitionChampion: CompetitionChampionModel;
|
|
22
|
+
getCompetitionChampion: Sequelize.HasOneGetAssociationMixin<CompetitionChampionModel>;
|
|
23
|
+
setCompetitionChampion: Sequelize.HasOneSetAssociationMixin<CompetitionChampionModel, CompetitionChampionId>;
|
|
24
|
+
createCompetitionChampion: Sequelize.HasOneCreateAssociationMixin<CompetitionChampionModel>;
|
|
25
|
+
CompetitionMatches: CompetitionMatchModel[];
|
|
26
|
+
getCompetitionMatches: Sequelize.HasManyGetAssociationsMixin<CompetitionMatchModel>;
|
|
27
|
+
setCompetitionMatches: Sequelize.HasManySetAssociationsMixin<CompetitionMatchModel, CompetitionMatchId>;
|
|
28
|
+
addCompetitionMatch: Sequelize.HasManyAddAssociationMixin<CompetitionMatchModel, CompetitionMatchId>;
|
|
29
|
+
addCompetitionMatches: Sequelize.HasManyAddAssociationsMixin<CompetitionMatchModel, CompetitionMatchId>;
|
|
30
|
+
createCompetitionMatch: Sequelize.HasManyCreateAssociationMixin<CompetitionMatchModel>;
|
|
31
|
+
removeCompetitionMatch: Sequelize.HasManyRemoveAssociationMixin<CompetitionMatchModel, CompetitionMatchId>;
|
|
32
|
+
removeCompetitionMatches: Sequelize.HasManyRemoveAssociationsMixin<CompetitionMatchModel, CompetitionMatchId>;
|
|
33
|
+
hasCompetitionMatch: Sequelize.HasManyHasAssociationMixin<CompetitionMatchModel, CompetitionMatchId>;
|
|
34
|
+
hasCompetitionMatches: Sequelize.HasManyHasAssociationsMixin<CompetitionMatchModel, CompetitionMatchId>;
|
|
35
|
+
countCompetitionMatches: Sequelize.HasManyCountAssociationsMixin;
|
|
36
|
+
CompetitionTeams: CompetitionTeamsModel[];
|
|
37
|
+
getCompetitionTeams: Sequelize.HasManyGetAssociationsMixin<CompetitionTeamsModel>;
|
|
38
|
+
setCompetitionTeams: Sequelize.HasManySetAssociationsMixin<CompetitionTeamsModel, CompetitionTeamsId>;
|
|
39
|
+
addCompetitionTeam: Sequelize.HasManyAddAssociationMixin<CompetitionTeamsModel, CompetitionTeamsId>;
|
|
40
|
+
addCompetitionTeams: Sequelize.HasManyAddAssociationsMixin<CompetitionTeamsModel, CompetitionTeamsId>;
|
|
41
|
+
createCompetitionTeam: Sequelize.HasManyCreateAssociationMixin<CompetitionTeamsModel>;
|
|
42
|
+
removeCompetitionTeam: Sequelize.HasManyRemoveAssociationMixin<CompetitionTeamsModel, CompetitionTeamsId>;
|
|
43
|
+
removeCompetitionTeams: Sequelize.HasManyRemoveAssociationsMixin<CompetitionTeamsModel, CompetitionTeamsId>;
|
|
44
|
+
hasCompetitionTeam: Sequelize.HasManyHasAssociationMixin<CompetitionTeamsModel, CompetitionTeamsId>;
|
|
45
|
+
hasCompetitionTeams: Sequelize.HasManyHasAssociationsMixin<CompetitionTeamsModel, CompetitionTeamsId>;
|
|
46
|
+
countCompetitionTeams: Sequelize.HasManyCountAssociationsMixin;
|
|
47
|
+
LeagueSeason: LeagueSeasonModel;
|
|
48
|
+
getLeagueSeason: Sequelize.HasOneGetAssociationMixin<LeagueSeasonModel>;
|
|
49
|
+
setLeagueSeason: Sequelize.HasOneSetAssociationMixin<LeagueSeasonModel, LeagueSeasonId>;
|
|
50
|
+
createLeagueSeason: Sequelize.HasOneCreateAssociationMixin<LeagueSeasonModel>;
|
|
51
|
+
Teams: TeamModel[];
|
|
52
|
+
getTeams: Sequelize.BelongsToManyGetAssociationsMixin<TeamModel>;
|
|
53
|
+
setTeams: Sequelize.BelongsToManySetAssociationsMixin<TeamModel, TeamId>;
|
|
54
|
+
addTeam: Sequelize.BelongsToManyAddAssociationMixin<TeamModel, TeamId>;
|
|
55
|
+
addTeams: Sequelize.BelongsToManyAddAssociationsMixin<TeamModel, TeamId>;
|
|
56
|
+
createTeam: Sequelize.BelongsToManyCreateAssociationMixin<TeamModel>;
|
|
57
|
+
removeTeam: Sequelize.BelongsToManyRemoveAssociationMixin<TeamModel, TeamId>;
|
|
58
|
+
removeTeams: Sequelize.BelongsToManyRemoveAssociationsMixin<TeamModel, TeamId>;
|
|
59
|
+
hasTeam: Sequelize.BelongsToManyHasAssociationMixin<TeamModel, TeamId>;
|
|
60
|
+
hasTeams: Sequelize.BelongsToManyHasAssociationsMixin<TeamModel, TeamId>;
|
|
61
|
+
countTeams: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
62
|
+
Iteration: IterationModel;
|
|
63
|
+
getIteration: Sequelize.BelongsToGetAssociationMixin<IterationModel>;
|
|
64
|
+
setIteration: Sequelize.BelongsToSetAssociationMixin<IterationModel, IterationId>;
|
|
65
|
+
createIteration: Sequelize.BelongsToCreateAssociationMixin<IterationModel>;
|
|
66
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof CompetitionModel;
|
|
67
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DataTypes, Model } from 'sequelize';
|
|
2
|
+
export class CompetitionModel extends Model {
|
|
3
|
+
static initModel(sequelize) {
|
|
4
|
+
return CompetitionModel.init({
|
|
5
|
+
competition_id: {
|
|
6
|
+
type: DataTypes.UUID,
|
|
7
|
+
allowNull: false,
|
|
8
|
+
primaryKey: true
|
|
9
|
+
},
|
|
10
|
+
iteration: {
|
|
11
|
+
type: DataTypes.INTEGER,
|
|
12
|
+
allowNull: false,
|
|
13
|
+
references: {
|
|
14
|
+
model: 'Iteration',
|
|
15
|
+
key: 'iteration_id'
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
type: {
|
|
19
|
+
type: DataTypes.ENUM('LEAGUE', 'TOURNAMENT'),
|
|
20
|
+
allowNull: false
|
|
21
|
+
}
|
|
22
|
+
}, {
|
|
23
|
+
sequelize,
|
|
24
|
+
tableName: 'Competition',
|
|
25
|
+
schema: 'public',
|
|
26
|
+
timestamps: false,
|
|
27
|
+
indexes: [{
|
|
28
|
+
name: 'competition_pk',
|
|
29
|
+
unique: true,
|
|
30
|
+
fields: [{ name: 'competition_id' }]
|
|
31
|
+
}]
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|