volleyballsimtypes 0.0.190 → 0.0.192

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.
@@ -59,8 +59,10 @@ function initModels(sequelize) {
59
59
  League.hasMany(Division, { as: 'Divisions', foreignKey: 'league_id' });
60
60
  Division.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
61
61
  Division.hasMany(DivisionSeason, { as: 'DivisionSeasons', foreignKey: 'division_id' });
62
+ Division.hasMany(Team, { as: 'Teams', foreignKey: 'division_id' });
62
63
  DivisionSeason.belongsTo(Competition, { as: 'competition', foreignKey: 'competition_id' });
63
64
  DivisionSeason.belongsTo(Division, { as: 'division', foreignKey: 'division_id' });
65
+ Team.belongsTo(Division, { as: 'Division', foreignKey: 'division_id' });
64
66
  Match.belongsTo(Team, { as: 'AwayTeam', foreignKey: 'away_team' });
65
67
  Match.belongsTo(Team, { as: 'HomeTeam', foreignKey: 'home_team' });
66
68
  Match.belongsToMany(Team, {
@@ -1,12 +1,13 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model } from 'sequelize';
3
- import { DivisionSeasonAttributes, DivisionSeasonId, DivisionSeasonModel, LeagueId, LeagueModel } from '.';
3
+ import { DivisionSeasonAttributes, DivisionSeasonId, DivisionSeasonModel, LeagueId, LeagueModel, TeamAttributes, TeamId, TeamModel } from '.';
4
4
  export interface DivisionAttributes {
5
5
  division_id: string;
6
6
  league_id: string;
7
7
  tier: number;
8
8
  name: string;
9
9
  DivisionSeasons?: DivisionSeasonAttributes[];
10
+ Teams?: TeamAttributes[];
10
11
  }
11
12
  export type DivisionPk = 'division_id';
12
13
  export type DivisionId = DivisionModel[DivisionPk];
@@ -31,5 +32,16 @@ export declare class DivisionModel extends Model<DivisionAttributes, DivisionCre
31
32
  hasDivisionSeason: Sequelize.HasManyHasAssociationMixin<DivisionSeasonModel, DivisionSeasonId>;
32
33
  hasDivisionSeasons: Sequelize.HasManyHasAssociationsMixin<DivisionSeasonModel, DivisionSeasonId>;
33
34
  countDivisionSeasons: Sequelize.HasManyCountAssociationsMixin;
35
+ Teams: TeamModel[];
36
+ getTeams: Sequelize.HasManyGetAssociationsMixin<TeamModel>;
37
+ setTeams: Sequelize.HasManySetAssociationsMixin<TeamModel, TeamId>;
38
+ addTeam: Sequelize.HasManyAddAssociationMixin<TeamModel, TeamId>;
39
+ addTeams: Sequelize.HasManyAddAssociationsMixin<TeamModel, TeamId>;
40
+ createTeam: Sequelize.HasManyCreateAssociationMixin<TeamModel>;
41
+ removeTeam: Sequelize.HasManyRemoveAssociationMixin<TeamModel, TeamId>;
42
+ removeTeams: Sequelize.HasManyRemoveAssociationsMixin<TeamModel, TeamId>;
43
+ hasTeam: Sequelize.HasManyHasAssociationMixin<TeamModel, TeamId>;
44
+ hasTeams: Sequelize.HasManyHasAssociationsMixin<TeamModel, TeamId>;
45
+ countTeams: Sequelize.HasManyCountAssociationsMixin;
34
46
  static initModel(sequelize: Sequelize.Sequelize): typeof DivisionModel;
35
47
  }
@@ -1,6 +1,6 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model, Optional } from 'sequelize';
3
- import { CoachAttributes, CoachId, CoachModel, CompetitionChampionId, CompetitionChampionModel, CompetitionId, CompetitionModel, CompetitionTeamsId, CompetitionTeamsModel, CountryId, CountryModel, DraftPickId, DraftPickModel, MatchId, MatchModel, MatchRatingId, MatchRatingModel, PlayerAttributes, PlayerId, PlayerModel, PlayerTeamId, PlayerTeamModel, RallyId, RallyModel } from '.';
3
+ import { CoachAttributes, CoachId, CoachModel, 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;
@@ -8,8 +8,10 @@ export interface TeamAttributes {
8
8
  rating: number;
9
9
  coach_id?: string;
10
10
  country_id?: string;
11
+ division_id: string;
11
12
  coach?: CoachAttributes;
12
13
  Players?: PlayerAttributes[];
14
+ Division?: DivisionAttributes;
13
15
  }
14
16
  export type TeamPk = 'team_id';
15
17
  export type TeamId = TeamModel[TeamPk];
@@ -22,6 +24,7 @@ export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttribu
22
24
  short_name: string;
23
25
  country_id: string;
24
26
  rating: number;
27
+ division_id: string;
25
28
  coach: CoachModel;
26
29
  getCoach: Sequelize.BelongsToGetAssociationMixin<CoachModel>;
27
30
  setCoach: Sequelize.BelongsToSetAssociationMixin<CoachModel, CoachId>;
@@ -107,6 +110,10 @@ export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttribu
107
110
  hasRatingMatch: Sequelize.BelongsToManyHasAssociationMixin<MatchModel, MatchId>;
108
111
  hasRatingMatches: Sequelize.BelongsToManyHasAssociationsMixin<MatchModel, MatchId>;
109
112
  countRatingMatches: Sequelize.BelongsToManyCountAssociationsMixin;
113
+ Division: DivisionModel;
114
+ getDivision: Sequelize.BelongsToGetAssociationMixin<DivisionModel>;
115
+ setDivision: Sequelize.BelongsToSetAssociationMixin<DivisionModel, DivisionId>;
116
+ createDivision: Sequelize.BelongsToCreateAssociationMixin<DivisionModel>;
110
117
  MatchRatings: MatchRatingModel[];
111
118
  getMatchRatings: Sequelize.HasManyGetAssociationsMixin<MatchRatingModel>;
112
119
  setMatchRatings: Sequelize.HasManySetAssociationsMixin<MatchRatingModel, MatchRatingId>;
@@ -34,6 +34,14 @@ class TeamModel extends sequelize_1.Model {
34
34
  key: 'country_id'
35
35
  }
36
36
  },
37
+ division_id: {
38
+ type: sequelize_1.DataTypes.UUID,
39
+ allowNull: false,
40
+ references: {
41
+ model: 'Division',
42
+ key: 'division_id'
43
+ }
44
+ },
37
45
  rating: {
38
46
  type: sequelize_1.DataTypes.REAL,
39
47
  allowNull: false,
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.transformFromDivision = exports.transformToDivision = void 0;
4
4
  const service_1 = require("../../service");
5
5
  const season_1 = require("./season");
6
+ const team_1 = require("./team");
6
7
  function transformToAttributes(division, leagueId) {
7
8
  return {
8
9
  division_id: division.id,
@@ -17,7 +18,8 @@ function transformToObject(model) {
17
18
  id: model.division_id,
18
19
  name: model.name,
19
20
  tier: model.tier,
20
- seasons: (model.DivisionSeasons ?? []).map((ds) => (0, season_1.transformToSeason)(ds.competition))
21
+ seasons: (model.DivisionSeasons ?? []).map((ds) => (0, season_1.transformToSeason)(ds.competition)),
22
+ teams: model.Teams != null ? model.Teams.map(team_1.transformToTeam) : undefined
21
23
  });
22
24
  }
23
25
  exports.transformToDivision = transformToObject;
@@ -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.division?.map(div => (0, _1.transformFromDivision)(div, league.id));
7
+ const Divisions = league.divisions?.map(div => (0, _1.transformFromDivision)(div, league.id));
8
8
  return {
9
9
  league_id: league.id,
10
10
  country_id: league.country.id,
@@ -18,7 +18,7 @@ function transformToObject(model) {
18
18
  id: model.league_id,
19
19
  name: model.name,
20
20
  country: (0, _1.transformToCountry)(model.country),
21
- division: (model.Divisions ?? []).map((division) => (0, _1.transformToDivision)(division))
21
+ divisions: (model.Divisions ?? []).map((division) => (0, _1.transformToDivision)(division))
22
22
  });
23
23
  }
24
24
  exports.transformToLeague = transformToObject;
@@ -11,7 +11,8 @@ function transformToAttributes(team) {
11
11
  coach_id: team.coach?.id,
12
12
  country_id: team.country?.id,
13
13
  coach: team.coach != null ? (0, _1.transformFromCoach)(team.coach) : undefined,
14
- rating: team.rating
14
+ rating: team.rating,
15
+ division_id: team.divisionId
15
16
  };
16
17
  }
17
18
  exports.transformFromTeam = transformToAttributes;
@@ -23,7 +24,8 @@ function transformToObject(model) {
23
24
  country: model.country != null ? (0, _1.transformToCountry)(model.country) : undefined,
24
25
  coach: model.coach != null ? (0, _1.transformToCoach)(model.coach) : undefined,
25
26
  roster: (model.PlayerTeams ?? []).map((pt) => (0, _1.transformToPlayer)(pt.player)),
26
- rating: model.rating
27
+ rating: model.rating,
28
+ divisionId: model.division_id
27
29
  });
28
30
  }
29
31
  exports.transformToTeam = transformToObject;
@@ -1,15 +1,18 @@
1
1
  import { Season } from './season';
2
+ import { Team } from '../team';
2
3
  interface DivisionOpts {
3
4
  readonly id: string;
4
5
  readonly name: string;
5
6
  readonly tier: number;
6
7
  readonly seasons: Season[];
8
+ readonly teams?: Team[];
7
9
  }
8
10
  export declare class Division {
9
11
  readonly id: string;
10
12
  readonly name: string;
11
13
  readonly tier: number;
12
14
  readonly seasons: Season[];
13
- constructor({ id, name, tier, seasons }: DivisionOpts);
15
+ readonly teams?: Team[];
16
+ constructor({ id, name, tier, seasons, teams }: DivisionOpts);
14
17
  }
15
18
  export {};
@@ -2,11 +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 }) {
5
+ constructor({ id, name, tier, seasons, teams }) {
6
6
  this.id = id;
7
7
  this.name = name;
8
8
  this.tier = tier;
9
9
  this.seasons = seasons;
10
+ this.teams = teams;
10
11
  }
11
12
  }
12
13
  exports.Division = Division;
@@ -4,13 +4,13 @@ interface LeagueOpts {
4
4
  readonly id: string;
5
5
  readonly name: string;
6
6
  readonly country: Country;
7
- readonly division: Division[];
7
+ readonly divisions: Division[];
8
8
  }
9
9
  export declare class League {
10
10
  readonly id: string;
11
11
  readonly name: string;
12
- readonly division: Division[];
12
+ readonly divisions: Division[];
13
13
  readonly country: Country;
14
- constructor({ id, name, country, division }: LeagueOpts);
14
+ constructor({ id, name, country, divisions }: LeagueOpts);
15
15
  }
16
16
  export {};
@@ -2,11 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.League = void 0;
4
4
  class League {
5
- constructor({ id, name, country, division }) {
5
+ constructor({ id, name, country, divisions }) {
6
6
  this.id = id;
7
7
  this.name = name;
8
8
  this.country = country;
9
- this.division = division;
9
+ this.divisions = divisions;
10
10
  }
11
11
  }
12
12
  exports.League = League;
@@ -6,6 +6,7 @@ interface TeamParams {
6
6
  readonly rating: number;
7
7
  readonly name: string;
8
8
  readonly shortName: string;
9
+ readonly divisionId: string;
9
10
  readonly roster: Player[];
10
11
  readonly country?: Country;
11
12
  readonly coach?: Coach;
@@ -15,10 +16,11 @@ export declare class Team {
15
16
  readonly roster: Player[];
16
17
  readonly name: string;
17
18
  readonly shortName: string;
19
+ readonly divisionId: string;
18
20
  readonly coach?: Coach;
19
21
  readonly country?: Country;
20
22
  private _rating;
21
- constructor({ id, rating, name, shortName, country, roster, coach }: TeamParams);
23
+ constructor({ id, rating, name, shortName, divisionId, country, roster, coach }: TeamParams);
22
24
  get rating(): number;
23
25
  set rating(value: number);
24
26
  isPlayerInRoster(player: Player): boolean;
@@ -3,7 +3,7 @@ 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, country, roster, coach }) {
6
+ constructor({ id, rating, name, shortName, divisionId, country, roster, coach }) {
7
7
  (0, utils_1.validateUUID)(id);
8
8
  this.id = id;
9
9
  this._rating = rating;
@@ -11,6 +11,7 @@ class Team {
11
11
  this.coach = coach;
12
12
  this.name = name;
13
13
  this.shortName = shortName;
14
+ this.divisionId = divisionId;
14
15
  this.country = country;
15
16
  }
16
17
  get rating() {
@@ -56,8 +56,10 @@ export function initModels(sequelize) {
56
56
  League.hasMany(Division, { as: 'Divisions', foreignKey: 'league_id' });
57
57
  Division.belongsTo(League, { as: 'league', foreignKey: 'league_id' });
58
58
  Division.hasMany(DivisionSeason, { as: 'DivisionSeasons', foreignKey: 'division_id' });
59
+ Division.hasMany(Team, { as: 'Teams', foreignKey: 'division_id' });
59
60
  DivisionSeason.belongsTo(Competition, { as: 'competition', foreignKey: 'competition_id' });
60
61
  DivisionSeason.belongsTo(Division, { as: 'division', foreignKey: 'division_id' });
62
+ Team.belongsTo(Division, { as: 'Division', foreignKey: 'division_id' });
61
63
  Match.belongsTo(Team, { as: 'AwayTeam', foreignKey: 'away_team' });
62
64
  Match.belongsTo(Team, { as: 'HomeTeam', foreignKey: 'home_team' });
63
65
  Match.belongsToMany(Team, {
@@ -1,12 +1,13 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model } from 'sequelize';
3
- import { DivisionSeasonAttributes, DivisionSeasonId, DivisionSeasonModel, LeagueId, LeagueModel } from '.';
3
+ import { DivisionSeasonAttributes, DivisionSeasonId, DivisionSeasonModel, LeagueId, LeagueModel, TeamAttributes, TeamId, TeamModel } from '.';
4
4
  export interface DivisionAttributes {
5
5
  division_id: string;
6
6
  league_id: string;
7
7
  tier: number;
8
8
  name: string;
9
9
  DivisionSeasons?: DivisionSeasonAttributes[];
10
+ Teams?: TeamAttributes[];
10
11
  }
11
12
  export type DivisionPk = 'division_id';
12
13
  export type DivisionId = DivisionModel[DivisionPk];
@@ -31,5 +32,16 @@ export declare class DivisionModel extends Model<DivisionAttributes, DivisionCre
31
32
  hasDivisionSeason: Sequelize.HasManyHasAssociationMixin<DivisionSeasonModel, DivisionSeasonId>;
32
33
  hasDivisionSeasons: Sequelize.HasManyHasAssociationsMixin<DivisionSeasonModel, DivisionSeasonId>;
33
34
  countDivisionSeasons: Sequelize.HasManyCountAssociationsMixin;
35
+ Teams: TeamModel[];
36
+ getTeams: Sequelize.HasManyGetAssociationsMixin<TeamModel>;
37
+ setTeams: Sequelize.HasManySetAssociationsMixin<TeamModel, TeamId>;
38
+ addTeam: Sequelize.HasManyAddAssociationMixin<TeamModel, TeamId>;
39
+ addTeams: Sequelize.HasManyAddAssociationsMixin<TeamModel, TeamId>;
40
+ createTeam: Sequelize.HasManyCreateAssociationMixin<TeamModel>;
41
+ removeTeam: Sequelize.HasManyRemoveAssociationMixin<TeamModel, TeamId>;
42
+ removeTeams: Sequelize.HasManyRemoveAssociationsMixin<TeamModel, TeamId>;
43
+ hasTeam: Sequelize.HasManyHasAssociationMixin<TeamModel, TeamId>;
44
+ hasTeams: Sequelize.HasManyHasAssociationsMixin<TeamModel, TeamId>;
45
+ countTeams: Sequelize.HasManyCountAssociationsMixin;
34
46
  static initModel(sequelize: Sequelize.Sequelize): typeof DivisionModel;
35
47
  }
@@ -1,6 +1,6 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model, Optional } from 'sequelize';
3
- import { CoachAttributes, CoachId, CoachModel, CompetitionChampionId, CompetitionChampionModel, CompetitionId, CompetitionModel, CompetitionTeamsId, CompetitionTeamsModel, CountryId, CountryModel, DraftPickId, DraftPickModel, MatchId, MatchModel, MatchRatingId, MatchRatingModel, PlayerAttributes, PlayerId, PlayerModel, PlayerTeamId, PlayerTeamModel, RallyId, RallyModel } from '.';
3
+ import { CoachAttributes, CoachId, CoachModel, 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;
@@ -8,8 +8,10 @@ export interface TeamAttributes {
8
8
  rating: number;
9
9
  coach_id?: string;
10
10
  country_id?: string;
11
+ division_id: string;
11
12
  coach?: CoachAttributes;
12
13
  Players?: PlayerAttributes[];
14
+ Division?: DivisionAttributes;
13
15
  }
14
16
  export type TeamPk = 'team_id';
15
17
  export type TeamId = TeamModel[TeamPk];
@@ -22,6 +24,7 @@ export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttribu
22
24
  short_name: string;
23
25
  country_id: string;
24
26
  rating: number;
27
+ division_id: string;
25
28
  coach: CoachModel;
26
29
  getCoach: Sequelize.BelongsToGetAssociationMixin<CoachModel>;
27
30
  setCoach: Sequelize.BelongsToSetAssociationMixin<CoachModel, CoachId>;
@@ -107,6 +110,10 @@ export declare class TeamModel extends Model<TeamAttributes, TeamCreationAttribu
107
110
  hasRatingMatch: Sequelize.BelongsToManyHasAssociationMixin<MatchModel, MatchId>;
108
111
  hasRatingMatches: Sequelize.BelongsToManyHasAssociationsMixin<MatchModel, MatchId>;
109
112
  countRatingMatches: Sequelize.BelongsToManyCountAssociationsMixin;
113
+ Division: DivisionModel;
114
+ getDivision: Sequelize.BelongsToGetAssociationMixin<DivisionModel>;
115
+ setDivision: Sequelize.BelongsToSetAssociationMixin<DivisionModel, DivisionId>;
116
+ createDivision: Sequelize.BelongsToCreateAssociationMixin<DivisionModel>;
110
117
  MatchRatings: MatchRatingModel[];
111
118
  getMatchRatings: Sequelize.HasManyGetAssociationsMixin<MatchRatingModel>;
112
119
  setMatchRatings: Sequelize.HasManySetAssociationsMixin<MatchRatingModel, MatchRatingId>;
@@ -31,6 +31,14 @@ export class TeamModel extends Model {
31
31
  key: 'country_id'
32
32
  }
33
33
  },
34
+ division_id: {
35
+ type: DataTypes.UUID,
36
+ allowNull: false,
37
+ references: {
38
+ model: 'Division',
39
+ key: 'division_id'
40
+ }
41
+ },
34
42
  rating: {
35
43
  type: DataTypes.REAL,
36
44
  allowNull: false,
@@ -1,5 +1,6 @@
1
1
  import { Division } from '../../service';
2
2
  import { transformToSeason } from './season';
3
+ import { transformToTeam } from './team';
3
4
  function transformToAttributes(division, leagueId) {
4
5
  return {
5
6
  division_id: division.id,
@@ -13,7 +14,8 @@ function transformToObject(model) {
13
14
  id: model.division_id,
14
15
  name: model.name,
15
16
  tier: model.tier,
16
- seasons: (model.DivisionSeasons ?? []).map((ds) => transformToSeason(ds.competition))
17
+ seasons: (model.DivisionSeasons ?? []).map((ds) => transformToSeason(ds.competition)),
18
+ teams: model.Teams != null ? model.Teams.map(transformToTeam) : undefined
17
19
  });
18
20
  }
19
21
  export { transformToObject as transformToDivision, transformToAttributes as transformFromDivision };
@@ -1,7 +1,7 @@
1
1
  import { League } from '../../service';
2
2
  import { transformFromDivision, transformToCountry, transformToDivision } from '.';
3
3
  function transformToAttributes(league) {
4
- const Divisions = league.division?.map(div => transformFromDivision(div, league.id));
4
+ const Divisions = league.divisions?.map(div => transformFromDivision(div, league.id));
5
5
  return {
6
6
  league_id: league.id,
7
7
  country_id: league.country.id,
@@ -14,7 +14,7 @@ function transformToObject(model) {
14
14
  id: model.league_id,
15
15
  name: model.name,
16
16
  country: transformToCountry(model.country),
17
- division: (model.Divisions ?? []).map((division) => transformToDivision(division))
17
+ divisions: (model.Divisions ?? []).map((division) => transformToDivision(division))
18
18
  });
19
19
  }
20
20
  export { transformToObject as transformToLeague, transformToAttributes as transformFromLeague };
@@ -8,7 +8,8 @@ function transformToAttributes(team) {
8
8
  coach_id: team.coach?.id,
9
9
  country_id: team.country?.id,
10
10
  coach: team.coach != null ? transformFromCoach(team.coach) : undefined,
11
- rating: team.rating
11
+ rating: team.rating,
12
+ division_id: team.divisionId
12
13
  };
13
14
  }
14
15
  function transformToObject(model) {
@@ -19,7 +20,8 @@ function transformToObject(model) {
19
20
  country: model.country != null ? transformToCountry(model.country) : undefined,
20
21
  coach: model.coach != null ? transformToCoach(model.coach) : undefined,
21
22
  roster: (model.PlayerTeams ?? []).map((pt) => transformToPlayer(pt.player)),
22
- rating: model.rating
23
+ rating: model.rating,
24
+ divisionId: model.division_id
23
25
  });
24
26
  }
25
27
  export { transformToObject as transformToTeam, transformToAttributes as transformFromTeam };
@@ -1,15 +1,18 @@
1
1
  import { Season } from './season';
2
+ import { Team } from '../team';
2
3
  interface DivisionOpts {
3
4
  readonly id: string;
4
5
  readonly name: string;
5
6
  readonly tier: number;
6
7
  readonly seasons: Season[];
8
+ readonly teams?: Team[];
7
9
  }
8
10
  export declare class Division {
9
11
  readonly id: string;
10
12
  readonly name: string;
11
13
  readonly tier: number;
12
14
  readonly seasons: Season[];
13
- constructor({ id, name, tier, seasons }: DivisionOpts);
15
+ readonly teams?: Team[];
16
+ constructor({ id, name, tier, seasons, teams }: DivisionOpts);
14
17
  }
15
18
  export {};
@@ -1,8 +1,9 @@
1
1
  export class Division {
2
- constructor({ id, name, tier, seasons }) {
2
+ constructor({ id, name, tier, seasons, teams }) {
3
3
  this.id = id;
4
4
  this.name = name;
5
5
  this.tier = tier;
6
6
  this.seasons = seasons;
7
+ this.teams = teams;
7
8
  }
8
9
  }
@@ -4,13 +4,13 @@ interface LeagueOpts {
4
4
  readonly id: string;
5
5
  readonly name: string;
6
6
  readonly country: Country;
7
- readonly division: Division[];
7
+ readonly divisions: Division[];
8
8
  }
9
9
  export declare class League {
10
10
  readonly id: string;
11
11
  readonly name: string;
12
- readonly division: Division[];
12
+ readonly divisions: Division[];
13
13
  readonly country: Country;
14
- constructor({ id, name, country, division }: LeagueOpts);
14
+ constructor({ id, name, country, divisions }: LeagueOpts);
15
15
  }
16
16
  export {};
@@ -1,8 +1,8 @@
1
1
  export class League {
2
- constructor({ id, name, country, division }) {
2
+ constructor({ id, name, country, divisions }) {
3
3
  this.id = id;
4
4
  this.name = name;
5
5
  this.country = country;
6
- this.division = division;
6
+ this.divisions = divisions;
7
7
  }
8
8
  }
@@ -6,6 +6,7 @@ interface TeamParams {
6
6
  readonly rating: number;
7
7
  readonly name: string;
8
8
  readonly shortName: string;
9
+ readonly divisionId: string;
9
10
  readonly roster: Player[];
10
11
  readonly country?: Country;
11
12
  readonly coach?: Coach;
@@ -15,10 +16,11 @@ export declare class Team {
15
16
  readonly roster: Player[];
16
17
  readonly name: string;
17
18
  readonly shortName: string;
19
+ readonly divisionId: string;
18
20
  readonly coach?: Coach;
19
21
  readonly country?: Country;
20
22
  private _rating;
21
- constructor({ id, rating, name, shortName, country, roster, coach }: TeamParams);
23
+ constructor({ id, rating, name, shortName, divisionId, country, roster, coach }: TeamParams);
22
24
  get rating(): number;
23
25
  set rating(value: number);
24
26
  isPlayerInRoster(player: Player): boolean;
@@ -1,6 +1,6 @@
1
1
  import { validateUUID } from '../utils';
2
2
  export class Team {
3
- constructor({ id, rating, name, shortName, country, roster, coach }) {
3
+ constructor({ id, rating, name, shortName, divisionId, country, roster, coach }) {
4
4
  validateUUID(id);
5
5
  this.id = id;
6
6
  this._rating = rating;
@@ -8,6 +8,7 @@ export class Team {
8
8
  this.coach = coach;
9
9
  this.name = name;
10
10
  this.shortName = shortName;
11
+ this.divisionId = divisionId;
11
12
  this.country = country;
12
13
  }
13
14
  get rating() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.190",
3
+ "version": "0.0.192",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",