volleyballsimtypes 0.0.102 → 0.0.104

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 { MatchId, MatchModel, MatchSetStatsId, MatchSetStatsModel, PlayerId, PlayerModel, RallyId, RallyModel, SetPositionAttributes, SetPositionId, SetPositionModel } from '.';
3
+ import { MatchId, MatchModel, MatchSetStatsAttributes, MatchSetStatsId, MatchSetStatsModel, PlayerId, PlayerModel, RallyAttributes, RallyId, RallyModel, SetPositionAttributes, SetPositionId, SetPositionModel } from '.';
4
4
  export interface MatchSetAttributes {
5
5
  match_set_id: string;
6
6
  match_id: string;
@@ -9,6 +9,8 @@ export interface MatchSetAttributes {
9
9
  home_score: number;
10
10
  away_score: number;
11
11
  setPositions?: SetPositionAttributes[];
12
+ Rallies?: RallyAttributes[];
13
+ MatchSetStats?: MatchSetStatsAttributes[];
12
14
  }
13
15
  export type MatchSetPk = 'match_set_id';
14
16
  export type MatchSetId = MatchSetModel[MatchSetPk];
@@ -13,7 +13,9 @@ function transformToAttributes(set, matchId) {
13
13
  is_tie_break: set.isTieBreak,
14
14
  home_score: set.getHomeScore(),
15
15
  away_score: set.getAwayScore(),
16
- setPositions: [...homeSetPositions, ...awaySetPositions]
16
+ setPositions: [...homeSetPositions, ...awaySetPositions],
17
+ MatchSetStats: set.stats != null ? set.stats.map(stats => (0, _1.transformFromMatchSetStats)(stats, set.id)) : undefined,
18
+ Rallies: set.rallies != null ? set.rallies.map(rally => (0, _1.transformFromRally)(rally, set.id)) : undefined
17
19
  };
18
20
  }
19
21
  exports.transformFromMatchSet = transformToAttributes;
@@ -1,6 +1,6 @@
1
1
  import * as Sequelize from 'sequelize';
2
2
  import { Model } from 'sequelize';
3
- import { MatchId, MatchModel, MatchSetStatsId, MatchSetStatsModel, PlayerId, PlayerModel, RallyId, RallyModel, SetPositionAttributes, SetPositionId, SetPositionModel } from '.';
3
+ import { MatchId, MatchModel, MatchSetStatsAttributes, MatchSetStatsId, MatchSetStatsModel, PlayerId, PlayerModel, RallyAttributes, RallyId, RallyModel, SetPositionAttributes, SetPositionId, SetPositionModel } from '.';
4
4
  export interface MatchSetAttributes {
5
5
  match_set_id: string;
6
6
  match_id: string;
@@ -9,6 +9,8 @@ export interface MatchSetAttributes {
9
9
  home_score: number;
10
10
  away_score: number;
11
11
  setPositions?: SetPositionAttributes[];
12
+ Rallies?: RallyAttributes[];
13
+ MatchSetStats?: MatchSetStatsAttributes[];
12
14
  }
13
15
  export type MatchSetPk = 'match_set_id';
14
16
  export type MatchSetId = MatchSetModel[MatchSetPk];
@@ -1,5 +1,5 @@
1
1
  import { MatchSet } from '../../service';
2
- import { transformFromPlayerPosition, transformToAPIMatchSetStats, transformToAPIRally, transformToMatchSetStats, transformToPlayerPosition, transformToRally } from '.';
2
+ import { transformFromMatchSetStats, transformFromPlayerPosition, transformFromRally, transformToAPIMatchSetStats, transformToAPIRally, transformToMatchSetStats, transformToPlayerPosition, transformToRally } from '.';
3
3
  function transformToAttributes(set, matchId) {
4
4
  const homeSetPositions = set.homePlayerPosition.map(position => transformFromPlayerPosition(position, 'Home', set.id));
5
5
  const awaySetPositions = set.awayPlayerPosition.map(position => transformFromPlayerPosition(position, 'Away', set.id));
@@ -10,7 +10,9 @@ function transformToAttributes(set, matchId) {
10
10
  is_tie_break: set.isTieBreak,
11
11
  home_score: set.getHomeScore(),
12
12
  away_score: set.getAwayScore(),
13
- setPositions: [...homeSetPositions, ...awaySetPositions]
13
+ setPositions: [...homeSetPositions, ...awaySetPositions],
14
+ MatchSetStats: set.stats != null ? set.stats.map(stats => transformFromMatchSetStats(stats, set.id)) : undefined,
15
+ Rallies: set.rallies != null ? set.rallies.map(rally => transformFromRally(rally, set.id)) : undefined
14
16
  };
15
17
  }
16
18
  function transformToObject(model) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "volleyballsimtypes",
3
- "version": "0.0.102",
3
+ "version": "0.0.104",
4
4
  "description": "vbsim types",
5
5
  "main": "./dist/cjs/src/index.js",
6
6
  "module": "./dist/esm/src/index.js",