volleyballsimtypes 0.0.194 → 0.0.195
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/transformers/season.js +8 -2
- package/dist/cjs/src/service/competition/season.d.ts +3 -1
- package/dist/cjs/src/service/competition/season.js +2 -1
- package/dist/esm/src/data/transformers/season.js +8 -2
- package/dist/esm/src/service/competition/season.d.ts +3 -1
- package/dist/esm/src/service/competition/season.js +2 -1
- package/package.json +1 -1
|
@@ -15,6 +15,10 @@ function transformToAttributes(season) {
|
|
|
15
15
|
team_id: season.champion?.id
|
|
16
16
|
}
|
|
17
17
|
: undefined;
|
|
18
|
+
const DivisionSeason = {
|
|
19
|
+
competition_id: season.id,
|
|
20
|
+
division_id: season.divisionId
|
|
21
|
+
};
|
|
18
22
|
return {
|
|
19
23
|
competition_id: season.id,
|
|
20
24
|
type: 'LEAGUE',
|
|
@@ -22,7 +26,8 @@ function transformToAttributes(season) {
|
|
|
22
26
|
CompetitionChampion: champion,
|
|
23
27
|
CompetitionMatches: matches,
|
|
24
28
|
CompetitionTeams: teams,
|
|
25
|
-
status: season.status
|
|
29
|
+
status: season.status,
|
|
30
|
+
DivisionSeason
|
|
26
31
|
};
|
|
27
32
|
}
|
|
28
33
|
exports.transformFromSeason = transformToAttributes;
|
|
@@ -33,7 +38,8 @@ function transformToObject(model) {
|
|
|
33
38
|
iteration: (0, _1.transformToIteration)(model.Iteration),
|
|
34
39
|
teams: model.Teams != null ? model.Teams.map(_1.transformToTeam) : [],
|
|
35
40
|
champion: model.CompetitionChampion != null ? (0, _1.transformToTeam)(model.CompetitionChampion.team) : undefined,
|
|
36
|
-
status: model.status
|
|
41
|
+
status: model.status,
|
|
42
|
+
divisionId: model.DivisionSeason.division_id
|
|
37
43
|
});
|
|
38
44
|
}
|
|
39
45
|
exports.transformToSeason = transformToObject;
|
|
@@ -8,6 +8,7 @@ interface SeasonOpts {
|
|
|
8
8
|
readonly teams: Team[];
|
|
9
9
|
readonly matches: Match[];
|
|
10
10
|
readonly iteration: Iteration;
|
|
11
|
+
readonly divisionId: string;
|
|
11
12
|
readonly champion?: Team;
|
|
12
13
|
readonly status: StatusEnum;
|
|
13
14
|
}
|
|
@@ -16,10 +17,11 @@ export declare class Season {
|
|
|
16
17
|
readonly teams: Team[];
|
|
17
18
|
readonly matches: Match[];
|
|
18
19
|
readonly iteration: Iteration;
|
|
20
|
+
readonly divisionId: string;
|
|
19
21
|
readonly standings: Standing[];
|
|
20
22
|
readonly status: StatusEnum;
|
|
21
23
|
champion?: Team;
|
|
22
|
-
constructor({ id, iteration, teams, matches, champion, status }: SeasonOpts);
|
|
24
|
+
constructor({ id, iteration, teams, matches, champion, status, divisionId }: SeasonOpts);
|
|
23
25
|
calculateStandings(): Standing[];
|
|
24
26
|
updateStandings(): void;
|
|
25
27
|
}
|
|
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Season = void 0;
|
|
4
4
|
const standing_1 = require("./standing");
|
|
5
5
|
class Season {
|
|
6
|
-
constructor({ id, iteration, teams, matches, champion, status }) {
|
|
6
|
+
constructor({ id, iteration, teams, matches, champion, status, divisionId }) {
|
|
7
7
|
this.id = id;
|
|
8
8
|
this.teams = teams;
|
|
9
9
|
this.matches = matches;
|
|
10
10
|
this.iteration = iteration;
|
|
11
|
+
this.divisionId = divisionId;
|
|
11
12
|
this.champion = champion;
|
|
12
13
|
this.standings = this.calculateStandings();
|
|
13
14
|
this.status = status;
|
|
@@ -12,6 +12,10 @@ function transformToAttributes(season) {
|
|
|
12
12
|
team_id: season.champion?.id
|
|
13
13
|
}
|
|
14
14
|
: undefined;
|
|
15
|
+
const DivisionSeason = {
|
|
16
|
+
competition_id: season.id,
|
|
17
|
+
division_id: season.divisionId
|
|
18
|
+
};
|
|
15
19
|
return {
|
|
16
20
|
competition_id: season.id,
|
|
17
21
|
type: 'LEAGUE',
|
|
@@ -19,7 +23,8 @@ function transformToAttributes(season) {
|
|
|
19
23
|
CompetitionChampion: champion,
|
|
20
24
|
CompetitionMatches: matches,
|
|
21
25
|
CompetitionTeams: teams,
|
|
22
|
-
status: season.status
|
|
26
|
+
status: season.status,
|
|
27
|
+
DivisionSeason
|
|
23
28
|
};
|
|
24
29
|
}
|
|
25
30
|
function transformToObject(model) {
|
|
@@ -29,7 +34,8 @@ function transformToObject(model) {
|
|
|
29
34
|
iteration: transformToIteration(model.Iteration),
|
|
30
35
|
teams: model.Teams != null ? model.Teams.map(transformToTeam) : [],
|
|
31
36
|
champion: model.CompetitionChampion != null ? transformToTeam(model.CompetitionChampion.team) : undefined,
|
|
32
|
-
status: model.status
|
|
37
|
+
status: model.status,
|
|
38
|
+
divisionId: model.DivisionSeason.division_id
|
|
33
39
|
});
|
|
34
40
|
}
|
|
35
41
|
export { transformToObject as transformToSeason, transformToAttributes as transformFromSeason };
|
|
@@ -8,6 +8,7 @@ interface SeasonOpts {
|
|
|
8
8
|
readonly teams: Team[];
|
|
9
9
|
readonly matches: Match[];
|
|
10
10
|
readonly iteration: Iteration;
|
|
11
|
+
readonly divisionId: string;
|
|
11
12
|
readonly champion?: Team;
|
|
12
13
|
readonly status: StatusEnum;
|
|
13
14
|
}
|
|
@@ -16,10 +17,11 @@ export declare class Season {
|
|
|
16
17
|
readonly teams: Team[];
|
|
17
18
|
readonly matches: Match[];
|
|
18
19
|
readonly iteration: Iteration;
|
|
20
|
+
readonly divisionId: string;
|
|
19
21
|
readonly standings: Standing[];
|
|
20
22
|
readonly status: StatusEnum;
|
|
21
23
|
champion?: Team;
|
|
22
|
-
constructor({ id, iteration, teams, matches, champion, status }: SeasonOpts);
|
|
24
|
+
constructor({ id, iteration, teams, matches, champion, status, divisionId }: SeasonOpts);
|
|
23
25
|
calculateStandings(): Standing[];
|
|
24
26
|
updateStandings(): void;
|
|
25
27
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Standing } from './standing';
|
|
2
2
|
export class Season {
|
|
3
|
-
constructor({ id, iteration, teams, matches, champion, status }) {
|
|
3
|
+
constructor({ id, iteration, teams, matches, champion, status, divisionId }) {
|
|
4
4
|
this.id = id;
|
|
5
5
|
this.teams = teams;
|
|
6
6
|
this.matches = matches;
|
|
7
7
|
this.iteration = iteration;
|
|
8
|
+
this.divisionId = divisionId;
|
|
8
9
|
this.champion = champion;
|
|
9
10
|
this.standings = this.calculateStandings();
|
|
10
11
|
this.status = status;
|