volleyballsimtypes 0.0.88 → 0.0.89

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.
@@ -1,6 +1,6 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model } from 'sequelize';
3
- import type { IterationId, LeagueAttributes, LeagueId, LeagueModel, SeasonMatchAttributes, SeasonTeamsId, SeasonTeamsModel, TeamAttributes, TeamId, TeamModel } from '.';
3
+ import type { IterationId, LeagueAttributes, LeagueId, LeagueModel, SeasonMatchAttributes, SeasonTeamsAttributes, SeasonTeamsId, SeasonTeamsModel, TeamAttributes, TeamId, TeamModel } from '.';
4
4
  import { IterationModel, SeasonMatchId, SeasonMatchModel } from '.';
5
5
  export interface SeasonAttributes {
6
6
  season_id: string;
@@ -8,6 +8,7 @@ export interface SeasonAttributes {
8
8
  league_id: string;
9
9
  seasonTeams?: TeamAttributes[];
10
10
  SeasonMatches?: SeasonMatchAttributes[];
11
+ SeasonTeams?: SeasonTeamsAttributes[];
11
12
  league?: LeagueAttributes;
12
13
  champion?: string;
13
14
  }
@@ -1,12 +1,13 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model, Optional } from 'sequelize';
3
- import type { IterationId, TeamId, TeamModel, TournamentMatchAttributes, TournamentMatchId, TournamentMatchModel, TournamentTeamsId } from '.';
3
+ import type { IterationId, TeamId, TeamModel, TournamentMatchAttributes, TournamentMatchId, TournamentMatchModel, TournamentTeamsAttributes, TournamentTeamsId } from '.';
4
4
  import { IterationModel, TeamAttributes, TournamentTeamsModel } from '.';
5
5
  export interface TournamentAttributes {
6
6
  tournament_id: string;
7
7
  iteration: number;
8
8
  champion?: string;
9
9
  TournamentMatches?: TournamentMatchAttributes[];
10
+ TournamentTeams?: TournamentTeamsAttributes[];
10
11
  tournamentTeams?: TeamAttributes[];
11
12
  }
12
13
  export type TournamentPk = 'tournament_id';
@@ -6,13 +6,15 @@ const service_1 = require("../../service");
6
6
  function transformToAttributes(season, leagueId) {
7
7
  const seasonMatches = season.matches != null ?
8
8
  season.matches.map(match => (0, _1.transformFromSeasonMatch)(season.id, match.id)) : [];
9
+ const seasonTeams = season.teams.map(team => ({ season_id: season.id, team_id: team.id }));
9
10
  return {
10
11
  season_id: season.id,
11
12
  iteration: season.iteration.id,
12
13
  league_id: leagueId,
13
14
  champion: season.champion != null ? season.champion.id : undefined,
14
15
  seasonTeams: season.teams != null ? season.teams.map(_1.transformFromTeam) : [],
15
- SeasonMatches: seasonMatches
16
+ SeasonMatches: seasonMatches,
17
+ SeasonTeams: seasonTeams
16
18
  };
17
19
  }
18
20
  exports.transformFromSeason = transformToAttributes;
@@ -4,14 +4,18 @@ exports.transformFromTournament = exports.transformToAPITournament = exports.tra
4
4
  const _1 = require(".");
5
5
  const service_1 = require("../../service");
6
6
  function transformToAttributes(tournament) {
7
- const tournamentMatches = tournament.matches != null ?
8
- tournament.matches.map(match => (0, _1.transformFromTournamentMatch)(match, tournament.id)) : [];
7
+ const tournamentMatches = tournament.matches.map(match => (0, _1.transformFromTournamentMatch)(match, tournament.id));
8
+ const tournamentTeams = tournament.teams.map(team => ({
9
+ tournament_id: tournament.id,
10
+ team_id: team.id
11
+ }));
9
12
  return {
10
13
  tournament_id: tournament.id,
11
14
  iteration: tournament.iteration.id,
12
15
  champion: tournament.champion != null ? tournament.champion.id : undefined,
13
16
  tournamentTeams: tournament.teams != null ? tournament.teams.map(_1.transformFromTeam) : [],
14
- TournamentMatches: tournamentMatches
17
+ TournamentMatches: tournamentMatches,
18
+ TournamentTeams: tournamentTeams
15
19
  };
16
20
  }
17
21
  exports.transformFromTournament = transformToAttributes;
@@ -1,6 +1,6 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model } from 'sequelize';
3
- import type { IterationId, LeagueAttributes, LeagueId, LeagueModel, SeasonMatchAttributes, SeasonTeamsId, SeasonTeamsModel, TeamAttributes, TeamId, TeamModel } from '.';
3
+ import type { IterationId, LeagueAttributes, LeagueId, LeagueModel, SeasonMatchAttributes, SeasonTeamsAttributes, SeasonTeamsId, SeasonTeamsModel, TeamAttributes, TeamId, TeamModel } from '.';
4
4
  import { IterationModel, SeasonMatchId, SeasonMatchModel } from '.';
5
5
  export interface SeasonAttributes {
6
6
  season_id: string;
@@ -8,6 +8,7 @@ export interface SeasonAttributes {
8
8
  league_id: string;
9
9
  seasonTeams?: TeamAttributes[];
10
10
  SeasonMatches?: SeasonMatchAttributes[];
11
+ SeasonTeams?: SeasonTeamsAttributes[];
11
12
  league?: LeagueAttributes;
12
13
  champion?: string;
13
14
  }
@@ -1,12 +1,13 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model, Optional } from 'sequelize';
3
- import type { IterationId, TeamId, TeamModel, TournamentMatchAttributes, TournamentMatchId, TournamentMatchModel, TournamentTeamsId } from '.';
3
+ import type { IterationId, TeamId, TeamModel, TournamentMatchAttributes, TournamentMatchId, TournamentMatchModel, TournamentTeamsAttributes, TournamentTeamsId } from '.';
4
4
  import { IterationModel, TeamAttributes, TournamentTeamsModel } from '.';
5
5
  export interface TournamentAttributes {
6
6
  tournament_id: string;
7
7
  iteration: number;
8
8
  champion?: string;
9
9
  TournamentMatches?: TournamentMatchAttributes[];
10
+ TournamentTeams?: TournamentTeamsAttributes[];
10
11
  tournamentTeams?: TeamAttributes[];
11
12
  }
12
13
  export type TournamentPk = 'tournament_id';
@@ -3,13 +3,15 @@ import { Season } from '../../service';
3
3
  function transformToAttributes(season, leagueId) {
4
4
  const seasonMatches = season.matches != null ?
5
5
  season.matches.map(match => transformFromSeasonMatch(season.id, match.id)) : [];
6
+ const seasonTeams = season.teams.map(team => ({ season_id: season.id, team_id: team.id }));
6
7
  return {
7
8
  season_id: season.id,
8
9
  iteration: season.iteration.id,
9
10
  league_id: leagueId,
10
11
  champion: season.champion != null ? season.champion.id : undefined,
11
12
  seasonTeams: season.teams != null ? season.teams.map(transformFromTeam) : [],
12
- SeasonMatches: seasonMatches
13
+ SeasonMatches: seasonMatches,
14
+ SeasonTeams: seasonTeams
13
15
  };
14
16
  }
15
17
  function transformToObject(model) {
@@ -1,14 +1,18 @@
1
1
  import { transformFromTeam, transformFromTournamentMatch, transformToAPITeam, transformToAPITournamentMatch, transformToIteration, transformToTeam, transformToTournamentMatch } from '.';
2
2
  import { Tournament } from '../../service';
3
3
  function transformToAttributes(tournament) {
4
- const tournamentMatches = tournament.matches != null ?
5
- tournament.matches.map(match => transformFromTournamentMatch(match, tournament.id)) : [];
4
+ const tournamentMatches = tournament.matches.map(match => transformFromTournamentMatch(match, tournament.id));
5
+ const tournamentTeams = tournament.teams.map(team => ({
6
+ tournament_id: tournament.id,
7
+ team_id: team.id
8
+ }));
6
9
  return {
7
10
  tournament_id: tournament.id,
8
11
  iteration: tournament.iteration.id,
9
12
  champion: tournament.champion != null ? tournament.champion.id : undefined,
10
13
  tournamentTeams: tournament.teams != null ? tournament.teams.map(transformFromTeam) : [],
11
- TournamentMatches: tournamentMatches
14
+ TournamentMatches: tournamentMatches,
15
+ TournamentTeams: tournamentTeams
12
16
  };
13
17
  }
14
18
  function transformToObject(model) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.88",
3
+ "version": "0.0.89",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",