volleyballsimtypes 0.0.192 → 0.0.194
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 +4 -6
- package/dist/cjs/src/data/models/country.d.ts +1 -12
- package/dist/cjs/src/data/models/division.d.ts +2 -0
- package/dist/cjs/src/data/models/division.js +4 -0
- package/dist/cjs/src/data/models/index.d.ts +1 -1
- package/dist/cjs/src/data/models/index.js +1 -1
- package/dist/cjs/src/data/models/tactics.d.ts +30 -0
- package/dist/cjs/src/data/models/{coach.js → tactics.js} +9 -24
- package/dist/cjs/src/data/models/team.d.ts +8 -8
- package/dist/cjs/src/data/models/team.js +2 -2
- package/dist/cjs/src/data/transformers/division.d.ts +1 -1
- package/dist/cjs/src/data/transformers/division.js +13 -3
- package/dist/cjs/src/data/transformers/index.d.ts +1 -1
- package/dist/cjs/src/data/transformers/index.js +1 -1
- package/dist/cjs/src/data/transformers/league.js +1 -1
- package/dist/cjs/src/data/transformers/tactics.d.ts +5 -0
- package/dist/cjs/src/data/transformers/tactics.js +21 -0
- package/dist/cjs/src/data/transformers/team.js +3 -3
- package/dist/cjs/src/service/coach/index.d.ts +1 -1
- package/dist/cjs/src/service/coach/index.js +1 -1
- package/dist/cjs/src/service/coach/tactics.d.ts +13 -0
- package/dist/cjs/src/service/coach/{coach.js → tactics.js} +4 -6
- package/dist/cjs/src/service/competition/division.d.ts +5 -1
- package/dist/cjs/src/service/competition/division.js +3 -1
- package/dist/cjs/src/service/team/team.d.ts +4 -4
- package/dist/cjs/src/service/team/team.js +2 -2
- package/dist/esm/src/data/init-models.js +5 -7
- package/dist/esm/src/data/models/country.d.ts +1 -12
- package/dist/esm/src/data/models/division.d.ts +2 -0
- package/dist/esm/src/data/models/division.js +4 -0
- package/dist/esm/src/data/models/index.d.ts +1 -1
- package/dist/esm/src/data/models/index.js +1 -1
- package/dist/esm/src/data/models/tactics.d.ts +30 -0
- package/dist/esm/src/data/models/{coach.js → tactics.js} +7 -22
- package/dist/esm/src/data/models/team.d.ts +8 -8
- package/dist/esm/src/data/models/team.js +2 -2
- package/dist/esm/src/data/transformers/division.d.ts +1 -1
- package/dist/esm/src/data/transformers/division.js +14 -4
- package/dist/esm/src/data/transformers/index.d.ts +1 -1
- package/dist/esm/src/data/transformers/index.js +1 -1
- package/dist/esm/src/data/transformers/league.js +1 -1
- package/dist/esm/src/data/transformers/tactics.d.ts +5 -0
- package/dist/esm/src/data/transformers/tactics.js +17 -0
- package/dist/esm/src/data/transformers/team.js +4 -4
- package/dist/esm/src/service/coach/index.d.ts +1 -1
- package/dist/esm/src/service/coach/index.js +1 -1
- package/dist/esm/src/service/coach/tactics.d.ts +13 -0
- package/dist/esm/src/service/coach/{coach.js → tactics.js} +2 -4
- package/dist/esm/src/service/competition/division.d.ts +5 -1
- package/dist/esm/src/service/competition/division.js +3 -1
- package/dist/esm/src/service/team/team.d.ts +4 -4
- package/dist/esm/src/service/team/team.js +2 -2
- package/package.json +2 -2
- package/dist/cjs/src/data/models/coach.d.ts +0 -40
- package/dist/cjs/src/data/transformers/coach.d.ts +0 -5
- package/dist/cjs/src/data/transformers/coach.js +0 -29
- package/dist/cjs/src/service/coach/coach.d.ts +0 -19
- package/dist/esm/src/data/models/coach.d.ts +0 -40
- package/dist/esm/src/data/transformers/coach.d.ts +0 -5
- package/dist/esm/src/data/transformers/coach.js +0 -25
- package/dist/esm/src/service/coach/coach.d.ts +0 -19
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.initModels = void 0;
|
|
4
4
|
const models_1 = require("./models");
|
|
5
5
|
function initModels(sequelize) {
|
|
6
|
-
const
|
|
6
|
+
const Tactics = models_1.TacticsModel.initModel(sequelize);
|
|
7
7
|
const Country = models_1.CountryModel.initModel(sequelize);
|
|
8
8
|
const Competition = models_1.CompetitionModel.initModel(sequelize);
|
|
9
9
|
const CompetitionTeams = models_1.CompetitionTeamsModel.initModel(sequelize);
|
|
@@ -27,8 +27,7 @@ function initModels(sequelize) {
|
|
|
27
27
|
const SetPosition = models_1.SetPositionModel.initModel(sequelize);
|
|
28
28
|
const Team = models_1.TeamModel.initModel(sequelize);
|
|
29
29
|
const User = models_1.UserModel.initModel(sequelize);
|
|
30
|
-
|
|
31
|
-
Coach.hasMany(Team, { as: 'Teams', foreignKey: 'coach_id' });
|
|
30
|
+
Tactics.hasMany(Team, { as: 'Teams', foreignKey: 'tactics_id' });
|
|
32
31
|
Competition.belongsTo(Iteration, { as: 'Iteration', foreignKey: 'iteration' });
|
|
33
32
|
Competition.hasMany(CompetitionMatch, { as: 'CompetitionMatches', foreignKey: 'competition_id' });
|
|
34
33
|
Competition.hasMany(CompetitionTeams, { as: 'CompetitionTeams', foreignKey: 'competition_id' });
|
|
@@ -46,7 +45,6 @@ function initModels(sequelize) {
|
|
|
46
45
|
CompetitionMatch.belongsTo(Match, { as: 'Match', foreignKey: 'match_id' });
|
|
47
46
|
CompetitionTeams.belongsTo(Competition, { as: 'competition', foreignKey: 'competition_id' });
|
|
48
47
|
CompetitionTeams.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
49
|
-
Country.hasMany(Coach, { as: 'Coaches', foreignKey: 'country_id' });
|
|
50
48
|
Country.hasMany(League, { as: 'Leagues', foreignKey: 'country_id' });
|
|
51
49
|
Country.hasMany(Player, { as: 'Players', foreignKey: 'country_id' });
|
|
52
50
|
Country.hasMany(Team, { as: 'Teams', foreignKey: 'country_id' });
|
|
@@ -128,7 +126,7 @@ function initModels(sequelize) {
|
|
|
128
126
|
Rally.belongsTo(Team, { as: 'ServingTeam', foreignKey: 'serving_team' });
|
|
129
127
|
SetPosition.belongsTo(MatchSet, { as: 'matchSet', foreignKey: 'match_set_id' });
|
|
130
128
|
SetPosition.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
131
|
-
Team.belongsTo(
|
|
129
|
+
Team.belongsTo(Tactics, { as: 'tactics', foreignKey: 'tactics_id' });
|
|
132
130
|
Team.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
133
131
|
Team.belongsToMany(Competition, {
|
|
134
132
|
as: 'Competitions',
|
|
@@ -158,7 +156,6 @@ function initModels(sequelize) {
|
|
|
158
156
|
Team.hasMany(Rally, { as: 'Rallies', foreignKey: 'serving_team' });
|
|
159
157
|
Team.hasMany(MatchResult, { as: 'WonMatches', foreignKey: 'winner_team_id' });
|
|
160
158
|
return {
|
|
161
|
-
Coach,
|
|
162
159
|
Competition,
|
|
163
160
|
CompetitionChampion,
|
|
164
161
|
CompetitionMatch,
|
|
@@ -181,6 +178,7 @@ function initModels(sequelize) {
|
|
|
181
178
|
Rally,
|
|
182
179
|
SetPosition,
|
|
183
180
|
Team,
|
|
181
|
+
Tactics,
|
|
184
182
|
User
|
|
185
183
|
};
|
|
186
184
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import {
|
|
3
|
+
import { LeagueId, LeagueModel, PlayerId, PlayerModel, TeamId, TeamModel } from '.';
|
|
4
4
|
export interface CountryAttributes {
|
|
5
5
|
country_id: string;
|
|
6
6
|
name: string;
|
|
@@ -13,17 +13,6 @@ export declare class CountryModel extends Model<CountryAttributes, CountryCreati
|
|
|
13
13
|
country_id: string;
|
|
14
14
|
name: string;
|
|
15
15
|
short_name: string;
|
|
16
|
-
Coaches: CoachModel[];
|
|
17
|
-
getCoaches: Sequelize.HasManyGetAssociationsMixin<CoachModel>;
|
|
18
|
-
setCoaches: Sequelize.HasManySetAssociationsMixin<CoachModel, CoachId>;
|
|
19
|
-
addCoach: Sequelize.HasManyAddAssociationMixin<CoachModel, CoachId>;
|
|
20
|
-
addCoaches: Sequelize.HasManyAddAssociationsMixin<CoachModel, CoachId>;
|
|
21
|
-
createCoach: Sequelize.HasManyCreateAssociationMixin<CoachModel>;
|
|
22
|
-
removeCoach: Sequelize.HasManyRemoveAssociationMixin<CoachModel, CoachId>;
|
|
23
|
-
removeCoaches: Sequelize.HasManyRemoveAssociationsMixin<CoachModel, CoachId>;
|
|
24
|
-
hasCoach: Sequelize.HasManyHasAssociationMixin<CoachModel, CoachId>;
|
|
25
|
-
hasCoaches: Sequelize.HasManyHasAssociationsMixin<CoachModel, CoachId>;
|
|
26
|
-
countCoaches: Sequelize.HasManyCountAssociationsMixin;
|
|
27
16
|
Leagues: LeagueModel[];
|
|
28
17
|
getLeagues: Sequelize.HasManyGetAssociationsMixin<LeagueModel>;
|
|
29
18
|
setLeagues: Sequelize.HasManySetAssociationsMixin<LeagueModel, LeagueId>;
|
|
@@ -5,6 +5,7 @@ export interface DivisionAttributes {
|
|
|
5
5
|
division_id: string;
|
|
6
6
|
league_id: string;
|
|
7
7
|
tier: number;
|
|
8
|
+
subdivision: number;
|
|
8
9
|
name: string;
|
|
9
10
|
DivisionSeasons?: DivisionSeasonAttributes[];
|
|
10
11
|
Teams?: TeamAttributes[];
|
|
@@ -16,6 +17,7 @@ export declare class DivisionModel extends Model<DivisionAttributes, DivisionCre
|
|
|
16
17
|
division_id: string;
|
|
17
18
|
league_id: string;
|
|
18
19
|
tier: number;
|
|
20
|
+
subdivision: number;
|
|
19
21
|
name: string;
|
|
20
22
|
league: LeagueModel;
|
|
21
23
|
getLeague: Sequelize.BelongsToGetAssociationMixin<LeagueModel>;
|
|
@@ -22,6 +22,10 @@ class DivisionModel extends sequelize_1.Model {
|
|
|
22
22
|
type: sequelize_1.DataTypes.INTEGER,
|
|
23
23
|
allowNull: false
|
|
24
24
|
},
|
|
25
|
+
subdivision: {
|
|
26
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
27
|
+
allowNull: false
|
|
28
|
+
},
|
|
25
29
|
name: {
|
|
26
30
|
type: sequelize_1.DataTypes.STRING,
|
|
27
31
|
allowNull: false,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './box-score';
|
|
2
|
-
export * from './coach';
|
|
3
2
|
export * from './competition';
|
|
4
3
|
export * from './competition-champion';
|
|
5
4
|
export * from './competition-match';
|
|
@@ -22,3 +21,4 @@ export * from './rally';
|
|
|
22
21
|
export * from './set-position';
|
|
23
22
|
export * from './team';
|
|
24
23
|
export * from './user';
|
|
24
|
+
export * from './tactics';
|
|
@@ -15,7 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./box-score"), exports);
|
|
18
|
-
__exportStar(require("./coach"), exports);
|
|
19
18
|
__exportStar(require("./competition"), exports);
|
|
20
19
|
__exportStar(require("./competition-champion"), exports);
|
|
21
20
|
__exportStar(require("./competition-match"), exports);
|
|
@@ -38,3 +37,4 @@ __exportStar(require("./rally"), exports);
|
|
|
38
37
|
__exportStar(require("./set-position"), exports);
|
|
39
38
|
__exportStar(require("./team"), exports);
|
|
40
39
|
__exportStar(require("./user"), exports);
|
|
40
|
+
__exportStar(require("./tactics"), exports);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model, Optional } from 'sequelize';
|
|
3
|
+
import { TeamId, TeamModel } from '.';
|
|
4
|
+
export interface TacticsAttributes {
|
|
5
|
+
tactics_id: string;
|
|
6
|
+
formation: FormationType;
|
|
7
|
+
substitution_tolerance: number;
|
|
8
|
+
}
|
|
9
|
+
export type FormationType = '4-2' | '5-1' | '6-2';
|
|
10
|
+
export type TacticsPk = 'tactics_id';
|
|
11
|
+
export type TacticsId = TacticsModel[TacticsPk];
|
|
12
|
+
export type TacticsOptionalAttributes = 'substitution_tolerance';
|
|
13
|
+
export type TacticsCreationAttributes = Optional<TacticsAttributes, TacticsOptionalAttributes>;
|
|
14
|
+
export declare class TacticsModel extends Model<TacticsAttributes, TacticsCreationAttributes> implements TacticsAttributes {
|
|
15
|
+
tactics_id: string;
|
|
16
|
+
formation: FormationType;
|
|
17
|
+
substitution_tolerance: number;
|
|
18
|
+
Teams: TeamModel[];
|
|
19
|
+
getTeams: Sequelize.HasManyGetAssociationsMixin<TeamModel>;
|
|
20
|
+
setTeams: Sequelize.HasManySetAssociationsMixin<TeamModel, TeamId>;
|
|
21
|
+
addTeam: Sequelize.HasManyAddAssociationMixin<TeamModel, TeamId>;
|
|
22
|
+
addTeams: Sequelize.HasManyAddAssociationsMixin<TeamModel, TeamId>;
|
|
23
|
+
createTeam: Sequelize.HasManyCreateAssociationMixin<TeamModel>;
|
|
24
|
+
removeTeam: Sequelize.HasManyRemoveAssociationMixin<TeamModel, TeamId>;
|
|
25
|
+
removeTeams: Sequelize.HasManyRemoveAssociationsMixin<TeamModel, TeamId>;
|
|
26
|
+
hasTeam: Sequelize.HasManyHasAssociationMixin<TeamModel, TeamId>;
|
|
27
|
+
hasTeams: Sequelize.HasManyHasAssociationsMixin<TeamModel, TeamId>;
|
|
28
|
+
countTeams: Sequelize.HasManyCountAssociationsMixin;
|
|
29
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof TacticsModel;
|
|
30
|
+
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TacticsModel = void 0;
|
|
4
4
|
const sequelize_1 = require("sequelize");
|
|
5
|
-
class
|
|
5
|
+
class TacticsModel extends sequelize_1.Model {
|
|
6
6
|
static initModel(sequelize) {
|
|
7
|
-
return
|
|
8
|
-
|
|
7
|
+
return TacticsModel.init({
|
|
8
|
+
tactics_id: {
|
|
9
9
|
type: sequelize_1.DataTypes.UUID,
|
|
10
10
|
allowNull: false,
|
|
11
|
-
primaryKey: true
|
|
11
|
+
primaryKey: true,
|
|
12
|
+
field: 'coach_id'
|
|
12
13
|
},
|
|
13
14
|
formation: {
|
|
14
15
|
type: sequelize_1.DataTypes.ENUM('4-2', '5-1', '6-2'),
|
|
@@ -18,31 +19,15 @@ class CoachModel extends sequelize_1.Model {
|
|
|
18
19
|
type: sequelize_1.DataTypes.REAL,
|
|
19
20
|
allowNull: false,
|
|
20
21
|
defaultValue: 0
|
|
21
|
-
},
|
|
22
|
-
first_name: {
|
|
23
|
-
type: sequelize_1.DataTypes.STRING,
|
|
24
|
-
allowNull: false
|
|
25
|
-
},
|
|
26
|
-
last_name: {
|
|
27
|
-
type: sequelize_1.DataTypes.STRING,
|
|
28
|
-
allowNull: false
|
|
29
|
-
},
|
|
30
|
-
country_id: {
|
|
31
|
-
type: sequelize_1.DataTypes.UUID,
|
|
32
|
-
allowNull: false,
|
|
33
|
-
references: {
|
|
34
|
-
model: 'Country',
|
|
35
|
-
key: 'country_id'
|
|
36
|
-
}
|
|
37
22
|
}
|
|
38
23
|
}, {
|
|
39
24
|
sequelize,
|
|
40
|
-
tableName: '
|
|
25
|
+
tableName: 'Tactics',
|
|
41
26
|
schema: 'public',
|
|
42
27
|
timestamps: false,
|
|
43
28
|
indexes: [
|
|
44
29
|
{
|
|
45
|
-
name: '
|
|
30
|
+
name: 'Tactics_pk',
|
|
46
31
|
unique: true,
|
|
47
32
|
fields: [
|
|
48
33
|
{ name: 'coach_id' }
|
|
@@ -52,4 +37,4 @@ class CoachModel extends sequelize_1.Model {
|
|
|
52
37
|
});
|
|
53
38
|
}
|
|
54
39
|
}
|
|
55
|
-
exports.
|
|
40
|
+
exports.TacticsModel = TacticsModel;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model, Optional } from 'sequelize';
|
|
3
|
-
import {
|
|
3
|
+
import { TacticsAttributes, TacticsId, TacticsModel, CompetitionChampionId, CompetitionChampionModel, CompetitionId, CompetitionModel, CompetitionTeamsId, CompetitionTeamsModel, CountryId, CountryModel, DraftPickId, DraftPickModel, DivisionAttributes, DivisionId, DivisionModel, MatchId, MatchModel, MatchRatingId, MatchRatingModel, PlayerAttributes, PlayerId, PlayerModel, PlayerTeamId, PlayerTeamModel, RallyId, RallyModel } from '.';
|
|
4
4
|
export interface TeamAttributes {
|
|
5
5
|
team_id: string;
|
|
6
6
|
name: string;
|
|
7
7
|
short_name: string;
|
|
8
8
|
rating: number;
|
|
9
|
-
|
|
9
|
+
tactics_id?: string;
|
|
10
10
|
country_id?: string;
|
|
11
11
|
division_id: string;
|
|
12
|
-
|
|
12
|
+
tactics?: TacticsAttributes;
|
|
13
13
|
Players?: PlayerAttributes[];
|
|
14
14
|
Division?: DivisionAttributes;
|
|
15
15
|
}
|
|
@@ -19,16 +19,16 @@ export type TeamOptionalAttributes = 'rating';
|
|
|
19
19
|
export type TeamCreationAttributes = Optional<TeamAttributes, TeamOptionalAttributes>;
|
|
20
20
|
export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttributes> implements TeamAttributes {
|
|
21
21
|
team_id: string;
|
|
22
|
-
|
|
22
|
+
tactics_id: string;
|
|
23
23
|
name: string;
|
|
24
24
|
short_name: string;
|
|
25
25
|
country_id: string;
|
|
26
26
|
rating: number;
|
|
27
27
|
division_id: string;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
tactics: TacticsModel;
|
|
29
|
+
getTactics: Sequelize.BelongsToGetAssociationMixin<TacticsModel>;
|
|
30
|
+
setTactics: Sequelize.BelongsToSetAssociationMixin<TacticsModel, TacticsId>;
|
|
31
|
+
createTactics: Sequelize.BelongsToCreateAssociationMixin<TacticsModel>;
|
|
32
32
|
country: CountryModel;
|
|
33
33
|
getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
|
|
34
34
|
setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
|
|
@@ -10,11 +10,11 @@ class TeamModel extends sequelize_1.Model {
|
|
|
10
10
|
allowNull: false,
|
|
11
11
|
primaryKey: true
|
|
12
12
|
},
|
|
13
|
-
|
|
13
|
+
tactics_id: {
|
|
14
14
|
type: sequelize_1.DataTypes.UUID,
|
|
15
15
|
allowNull: false,
|
|
16
16
|
references: {
|
|
17
|
-
model: '
|
|
17
|
+
model: 'Tactics',
|
|
18
18
|
key: 'coach_id'
|
|
19
19
|
}
|
|
20
20
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DivisionAttributes, DivisionModel } from '../models';
|
|
2
2
|
import { Division } from '../../service';
|
|
3
|
-
declare function transformToAttributes(division: Division
|
|
3
|
+
declare function transformToAttributes(division: Division): DivisionAttributes;
|
|
4
4
|
declare function transformToObject(model: DivisionModel): Division;
|
|
5
5
|
export { transformToObject as transformToDivision, transformToAttributes as transformFromDivision };
|
|
@@ -4,12 +4,20 @@ exports.transformFromDivision = exports.transformToDivision = void 0;
|
|
|
4
4
|
const service_1 = require("../../service");
|
|
5
5
|
const season_1 = require("./season");
|
|
6
6
|
const team_1 = require("./team");
|
|
7
|
-
function transformToAttributes(division
|
|
7
|
+
function transformToAttributes(division) {
|
|
8
|
+
const Teams = (division.teams ?? []).map(team_1.transformFromTeam);
|
|
9
|
+
const DivisionSeasons = division.seasons.map(season => ({
|
|
10
|
+
division_id: division.id,
|
|
11
|
+
competition_id: season.id
|
|
12
|
+
}));
|
|
8
13
|
return {
|
|
9
14
|
division_id: division.id,
|
|
10
|
-
league_id: leagueId,
|
|
15
|
+
league_id: division.leagueId,
|
|
11
16
|
tier: division.tier,
|
|
12
|
-
|
|
17
|
+
subdivision: division.subdivision,
|
|
18
|
+
name: division.name,
|
|
19
|
+
DivisionSeasons,
|
|
20
|
+
Teams
|
|
13
21
|
};
|
|
14
22
|
}
|
|
15
23
|
exports.transformFromDivision = transformToAttributes;
|
|
@@ -18,6 +26,8 @@ function transformToObject(model) {
|
|
|
18
26
|
id: model.division_id,
|
|
19
27
|
name: model.name,
|
|
20
28
|
tier: model.tier,
|
|
29
|
+
subdivision: model.subdivision,
|
|
30
|
+
leagueId: model.league_id,
|
|
21
31
|
seasons: (model.DivisionSeasons ?? []).map((ds) => (0, season_1.transformToSeason)(ds.competition)),
|
|
22
32
|
teams: model.Teams != null ? model.Teams.map(team_1.transformToTeam) : undefined
|
|
23
33
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './coach';
|
|
2
1
|
export * from './country';
|
|
3
2
|
export * from './court-position';
|
|
4
3
|
export * from './formation';
|
|
@@ -22,3 +21,4 @@ export * from './season-match';
|
|
|
22
21
|
export * from './player-team';
|
|
23
22
|
export * from './match-rating';
|
|
24
23
|
export * from './team';
|
|
24
|
+
export * from './tactics';
|
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./coach"), exports);
|
|
18
17
|
__exportStar(require("./country"), exports);
|
|
19
18
|
__exportStar(require("./court-position"), exports);
|
|
20
19
|
__exportStar(require("./formation"), exports);
|
|
@@ -38,3 +37,4 @@ __exportStar(require("./season-match"), exports);
|
|
|
38
37
|
__exportStar(require("./player-team"), exports);
|
|
39
38
|
__exportStar(require("./match-rating"), exports);
|
|
40
39
|
__exportStar(require("./team"), exports);
|
|
40
|
+
__exportStar(require("./tactics"), exports);
|
|
@@ -4,7 +4,7 @@ exports.transformFromLeague = exports.transformToLeague = void 0;
|
|
|
4
4
|
const service_1 = require("../../service");
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
function transformToAttributes(league) {
|
|
7
|
-
const Divisions = league.divisions?.map(
|
|
7
|
+
const Divisions = league.divisions?.map((division) => (0, _1.transformFromDivision)(division));
|
|
8
8
|
return {
|
|
9
9
|
league_id: league.id,
|
|
10
10
|
country_id: league.country.id,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { TacticsAttributes, TacticsModel } from '../models';
|
|
2
|
+
import { Tactics } from '../../service';
|
|
3
|
+
declare function transformToAttributes(tactics: Tactics): TacticsAttributes;
|
|
4
|
+
declare function transformToObject(model: TacticsModel): Tactics;
|
|
5
|
+
export { transformToObject as transformToTactics, transformToAttributes as transformFromTactics };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformFromTactics = exports.transformToTactics = void 0;
|
|
4
|
+
const _1 = require(".");
|
|
5
|
+
const service_1 = require("../../service");
|
|
6
|
+
function transformToAttributes(tactics) {
|
|
7
|
+
return {
|
|
8
|
+
tactics_id: tactics.id,
|
|
9
|
+
substitution_tolerance: tactics.substitutionTolerance ?? 0,
|
|
10
|
+
formation: (0, _1.transformFromFormation)(tactics.formation)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
exports.transformFromTactics = transformToAttributes;
|
|
14
|
+
function transformToObject(model) {
|
|
15
|
+
return new service_1.Tactics({
|
|
16
|
+
id: model.tactics_id,
|
|
17
|
+
substitutionTolerance: model.substitution_tolerance,
|
|
18
|
+
formation: (0, _1.transformToFormation)(model.formation)
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
exports.transformToTactics = transformToObject;
|
|
@@ -8,9 +8,9 @@ function transformToAttributes(team) {
|
|
|
8
8
|
team_id: team.id,
|
|
9
9
|
name: team.name,
|
|
10
10
|
short_name: team.shortName,
|
|
11
|
-
|
|
11
|
+
tactics_id: team.tactics?.id,
|
|
12
12
|
country_id: team.country?.id,
|
|
13
|
-
|
|
13
|
+
tactics: team.tactics != null ? (0, _1.transformFromTactics)(team.tactics) : undefined,
|
|
14
14
|
rating: team.rating,
|
|
15
15
|
division_id: team.divisionId
|
|
16
16
|
};
|
|
@@ -22,7 +22,7 @@ function transformToObject(model) {
|
|
|
22
22
|
name: model.name,
|
|
23
23
|
shortName: model.short_name,
|
|
24
24
|
country: model.country != null ? (0, _1.transformToCountry)(model.country) : undefined,
|
|
25
|
-
|
|
25
|
+
tactics: model.tactics != null ? (0, _1.transformToTactics)(model.tactics) : undefined,
|
|
26
26
|
roster: (model.PlayerTeams ?? []).map((pt) => (0, _1.transformToPlayer)(pt.player)),
|
|
27
27
|
rating: model.rating,
|
|
28
28
|
divisionId: model.division_id
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './tactics';
|
|
2
2
|
export * from './formation';
|
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./tactics"), exports);
|
|
18
18
|
__exportStar(require("./formation"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Formation } from './formation';
|
|
2
|
+
interface TacticsOpts {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly formation: Formation;
|
|
5
|
+
readonly substitutionTolerance?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare class Tactics {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly formation: Formation;
|
|
10
|
+
readonly substitutionTolerance: number;
|
|
11
|
+
constructor({ id, formation, substitutionTolerance }: TacticsOpts);
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Tactics = void 0;
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
|
-
class
|
|
6
|
-
constructor({ id,
|
|
5
|
+
class Tactics {
|
|
6
|
+
constructor({ id, formation, substitutionTolerance = 0 }) {
|
|
7
7
|
(0, utils_1.validateUUID)(id);
|
|
8
8
|
this.id = id;
|
|
9
|
-
this.name = name;
|
|
10
|
-
this.country = country;
|
|
11
9
|
this.formation = formation;
|
|
12
10
|
this.substitutionTolerance = substitutionTolerance;
|
|
13
11
|
}
|
|
14
12
|
}
|
|
15
|
-
exports.
|
|
13
|
+
exports.Tactics = Tactics;
|
|
@@ -4,6 +4,8 @@ interface DivisionOpts {
|
|
|
4
4
|
readonly id: string;
|
|
5
5
|
readonly name: string;
|
|
6
6
|
readonly tier: number;
|
|
7
|
+
readonly subdivision: number;
|
|
8
|
+
readonly leagueId: string;
|
|
7
9
|
readonly seasons: Season[];
|
|
8
10
|
readonly teams?: Team[];
|
|
9
11
|
}
|
|
@@ -11,8 +13,10 @@ export declare class Division {
|
|
|
11
13
|
readonly id: string;
|
|
12
14
|
readonly name: string;
|
|
13
15
|
readonly tier: number;
|
|
16
|
+
readonly subdivision: number;
|
|
17
|
+
readonly leagueId: string;
|
|
14
18
|
readonly seasons: Season[];
|
|
15
19
|
readonly teams?: Team[];
|
|
16
|
-
constructor({ id, name, tier, seasons, teams }: DivisionOpts);
|
|
20
|
+
constructor({ id, name, tier, subdivision, seasons, teams, leagueId }: DivisionOpts);
|
|
17
21
|
}
|
|
18
22
|
export {};
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Division = void 0;
|
|
4
4
|
class Division {
|
|
5
|
-
constructor({ id, name, tier, seasons, teams }) {
|
|
5
|
+
constructor({ id, name, tier, subdivision, seasons, teams, leagueId }) {
|
|
6
6
|
this.id = id;
|
|
7
7
|
this.name = name;
|
|
8
8
|
this.tier = tier;
|
|
9
|
+
this.subdivision = subdivision;
|
|
10
|
+
this.leagueId = leagueId;
|
|
9
11
|
this.seasons = seasons;
|
|
10
12
|
this.teams = teams;
|
|
11
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Coach } from '../coach';
|
|
2
1
|
import { Player } from '../player';
|
|
3
2
|
import { Country } from '../country';
|
|
3
|
+
import { Tactics } from '../coach';
|
|
4
4
|
interface TeamParams {
|
|
5
5
|
readonly id: string;
|
|
6
6
|
readonly rating: number;
|
|
@@ -9,7 +9,7 @@ interface TeamParams {
|
|
|
9
9
|
readonly divisionId: string;
|
|
10
10
|
readonly roster: Player[];
|
|
11
11
|
readonly country?: Country;
|
|
12
|
-
readonly
|
|
12
|
+
readonly tactics?: Tactics;
|
|
13
13
|
}
|
|
14
14
|
export declare class Team {
|
|
15
15
|
readonly id: string;
|
|
@@ -17,10 +17,10 @@ export declare class Team {
|
|
|
17
17
|
readonly name: string;
|
|
18
18
|
readonly shortName: string;
|
|
19
19
|
readonly divisionId: string;
|
|
20
|
-
readonly
|
|
20
|
+
readonly tactics?: Tactics;
|
|
21
21
|
readonly country?: Country;
|
|
22
22
|
private _rating;
|
|
23
|
-
constructor({ id, rating, name, shortName, divisionId, country, roster,
|
|
23
|
+
constructor({ id, rating, name, shortName, divisionId, country, roster, tactics }: TeamParams);
|
|
24
24
|
get rating(): number;
|
|
25
25
|
set rating(value: number);
|
|
26
26
|
isPlayerInRoster(player: Player): boolean;
|
|
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Team = void 0;
|
|
4
4
|
const utils_1 = require("../utils");
|
|
5
5
|
class Team {
|
|
6
|
-
constructor({ id, rating, name, shortName, divisionId, country, roster,
|
|
6
|
+
constructor({ id, rating, name, shortName, divisionId, country, roster, tactics }) {
|
|
7
7
|
(0, utils_1.validateUUID)(id);
|
|
8
8
|
this.id = id;
|
|
9
9
|
this._rating = rating;
|
|
10
10
|
this.roster = roster;
|
|
11
|
-
this.
|
|
11
|
+
this.tactics = tactics;
|
|
12
12
|
this.name = name;
|
|
13
13
|
this.shortName = shortName;
|
|
14
14
|
this.divisionId = divisionId;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BoxScoreModel,
|
|
1
|
+
import { BoxScoreModel, CompetitionChampionModel, CompetitionMatchModel, CompetitionModel, CompetitionTeamsModel, CountryModel, DivisionModel, DivisionSeasonModel, DraftModel, DraftPickModel, IterationModel, LeagueModel, MatchModel, MatchRatingModel, MatchResultModel, MatchSetModel, PerformanceStatsModel, PlayerModel, PlayerTeamModel, RallyModel, SetPositionModel, TacticsModel, TeamModel, UserModel } from './models';
|
|
2
2
|
export function initModels(sequelize) {
|
|
3
|
-
const
|
|
3
|
+
const Tactics = TacticsModel.initModel(sequelize);
|
|
4
4
|
const Country = CountryModel.initModel(sequelize);
|
|
5
5
|
const Competition = CompetitionModel.initModel(sequelize);
|
|
6
6
|
const CompetitionTeams = CompetitionTeamsModel.initModel(sequelize);
|
|
@@ -24,8 +24,7 @@ export function initModels(sequelize) {
|
|
|
24
24
|
const SetPosition = SetPositionModel.initModel(sequelize);
|
|
25
25
|
const Team = TeamModel.initModel(sequelize);
|
|
26
26
|
const User = UserModel.initModel(sequelize);
|
|
27
|
-
|
|
28
|
-
Coach.hasMany(Team, { as: 'Teams', foreignKey: 'coach_id' });
|
|
27
|
+
Tactics.hasMany(Team, { as: 'Teams', foreignKey: 'tactics_id' });
|
|
29
28
|
Competition.belongsTo(Iteration, { as: 'Iteration', foreignKey: 'iteration' });
|
|
30
29
|
Competition.hasMany(CompetitionMatch, { as: 'CompetitionMatches', foreignKey: 'competition_id' });
|
|
31
30
|
Competition.hasMany(CompetitionTeams, { as: 'CompetitionTeams', foreignKey: 'competition_id' });
|
|
@@ -43,7 +42,6 @@ export function initModels(sequelize) {
|
|
|
43
42
|
CompetitionMatch.belongsTo(Match, { as: 'Match', foreignKey: 'match_id' });
|
|
44
43
|
CompetitionTeams.belongsTo(Competition, { as: 'competition', foreignKey: 'competition_id' });
|
|
45
44
|
CompetitionTeams.belongsTo(Team, { as: 'team', foreignKey: 'team_id' });
|
|
46
|
-
Country.hasMany(Coach, { as: 'Coaches', foreignKey: 'country_id' });
|
|
47
45
|
Country.hasMany(League, { as: 'Leagues', foreignKey: 'country_id' });
|
|
48
46
|
Country.hasMany(Player, { as: 'Players', foreignKey: 'country_id' });
|
|
49
47
|
Country.hasMany(Team, { as: 'Teams', foreignKey: 'country_id' });
|
|
@@ -125,7 +123,7 @@ export function initModels(sequelize) {
|
|
|
125
123
|
Rally.belongsTo(Team, { as: 'ServingTeam', foreignKey: 'serving_team' });
|
|
126
124
|
SetPosition.belongsTo(MatchSet, { as: 'matchSet', foreignKey: 'match_set_id' });
|
|
127
125
|
SetPosition.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
128
|
-
Team.belongsTo(
|
|
126
|
+
Team.belongsTo(Tactics, { as: 'tactics', foreignKey: 'tactics_id' });
|
|
129
127
|
Team.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
130
128
|
Team.belongsToMany(Competition, {
|
|
131
129
|
as: 'Competitions',
|
|
@@ -155,7 +153,6 @@ export function initModels(sequelize) {
|
|
|
155
153
|
Team.hasMany(Rally, { as: 'Rallies', foreignKey: 'serving_team' });
|
|
156
154
|
Team.hasMany(MatchResult, { as: 'WonMatches', foreignKey: 'winner_team_id' });
|
|
157
155
|
return {
|
|
158
|
-
Coach,
|
|
159
156
|
Competition,
|
|
160
157
|
CompetitionChampion,
|
|
161
158
|
CompetitionMatch,
|
|
@@ -178,6 +175,7 @@ export function initModels(sequelize) {
|
|
|
178
175
|
Rally,
|
|
179
176
|
SetPosition,
|
|
180
177
|
Team,
|
|
178
|
+
Tactics,
|
|
181
179
|
User
|
|
182
180
|
};
|
|
183
181
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import {
|
|
3
|
+
import { LeagueId, LeagueModel, PlayerId, PlayerModel, TeamId, TeamModel } from '.';
|
|
4
4
|
export interface CountryAttributes {
|
|
5
5
|
country_id: string;
|
|
6
6
|
name: string;
|
|
@@ -13,17 +13,6 @@ export declare class CountryModel extends Model<CountryAttributes, CountryCreati
|
|
|
13
13
|
country_id: string;
|
|
14
14
|
name: string;
|
|
15
15
|
short_name: string;
|
|
16
|
-
Coaches: CoachModel[];
|
|
17
|
-
getCoaches: Sequelize.HasManyGetAssociationsMixin<CoachModel>;
|
|
18
|
-
setCoaches: Sequelize.HasManySetAssociationsMixin<CoachModel, CoachId>;
|
|
19
|
-
addCoach: Sequelize.HasManyAddAssociationMixin<CoachModel, CoachId>;
|
|
20
|
-
addCoaches: Sequelize.HasManyAddAssociationsMixin<CoachModel, CoachId>;
|
|
21
|
-
createCoach: Sequelize.HasManyCreateAssociationMixin<CoachModel>;
|
|
22
|
-
removeCoach: Sequelize.HasManyRemoveAssociationMixin<CoachModel, CoachId>;
|
|
23
|
-
removeCoaches: Sequelize.HasManyRemoveAssociationsMixin<CoachModel, CoachId>;
|
|
24
|
-
hasCoach: Sequelize.HasManyHasAssociationMixin<CoachModel, CoachId>;
|
|
25
|
-
hasCoaches: Sequelize.HasManyHasAssociationsMixin<CoachModel, CoachId>;
|
|
26
|
-
countCoaches: Sequelize.HasManyCountAssociationsMixin;
|
|
27
16
|
Leagues: LeagueModel[];
|
|
28
17
|
getLeagues: Sequelize.HasManyGetAssociationsMixin<LeagueModel>;
|
|
29
18
|
setLeagues: Sequelize.HasManySetAssociationsMixin<LeagueModel, LeagueId>;
|
|
@@ -5,6 +5,7 @@ export interface DivisionAttributes {
|
|
|
5
5
|
division_id: string;
|
|
6
6
|
league_id: string;
|
|
7
7
|
tier: number;
|
|
8
|
+
subdivision: number;
|
|
8
9
|
name: string;
|
|
9
10
|
DivisionSeasons?: DivisionSeasonAttributes[];
|
|
10
11
|
Teams?: TeamAttributes[];
|
|
@@ -16,6 +17,7 @@ export declare class DivisionModel extends Model<DivisionAttributes, DivisionCre
|
|
|
16
17
|
division_id: string;
|
|
17
18
|
league_id: string;
|
|
18
19
|
tier: number;
|
|
20
|
+
subdivision: number;
|
|
19
21
|
name: string;
|
|
20
22
|
league: LeagueModel;
|
|
21
23
|
getLeague: Sequelize.BelongsToGetAssociationMixin<LeagueModel>;
|