volleyballsimtypes 0.0.181 → 0.0.182
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 +8 -8
- package/dist/cjs/src/data/models/box-score.d.ts +69 -0
- package/dist/cjs/src/data/models/{match-set-stats.js → box-score.js} +60 -23
- 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/match-set.d.ts +13 -13
- package/dist/cjs/src/data/models/player.d.ts +13 -13
- package/dist/cjs/src/data/transformers/box-score.d.ts +5 -0
- package/dist/cjs/src/data/transformers/box-score.js +77 -0
- 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/match-set.js +3 -4
- package/dist/cjs/src/data/transformers/player.d.ts +1 -3
- package/dist/cjs/src/data/transformers/player.js +2 -49
- package/dist/cjs/src/service/match/box-score.d.ts +75 -0
- package/dist/cjs/src/service/match/box-score.js +64 -0
- package/dist/cjs/src/service/match/index.d.ts +1 -0
- package/dist/cjs/src/service/match/index.js +1 -0
- package/dist/cjs/src/service/match/match-set.d.ts +5 -28
- package/dist/cjs/src/service/match/match-set.js +3 -8
- package/dist/cjs/src/service/match/match.d.ts +0 -1
- package/dist/cjs/src/service/match/match.js +2 -4
- package/dist/cjs/src/service/player/player.d.ts +4 -4
- package/dist/cjs/src/service/player/player.js +2 -2
- package/dist/esm/src/data/init-models.js +9 -9
- package/dist/esm/src/data/models/box-score.d.ts +69 -0
- package/dist/esm/src/data/models/{match-set-stats.js → box-score.js} +58 -21
- 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/match-set.d.ts +13 -13
- package/dist/esm/src/data/models/player.d.ts +13 -13
- package/dist/esm/src/data/transformers/box-score.d.ts +5 -0
- package/dist/esm/src/data/transformers/box-score.js +73 -0
- 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/match-set.js +4 -5
- package/dist/esm/src/data/transformers/player.d.ts +1 -3
- package/dist/esm/src/data/transformers/player.js +2 -47
- package/dist/esm/src/service/match/box-score.d.ts +75 -0
- package/dist/esm/src/service/match/box-score.js +53 -0
- package/dist/esm/src/service/match/index.d.ts +1 -0
- package/dist/esm/src/service/match/index.js +1 -0
- package/dist/esm/src/service/match/match-set.d.ts +5 -28
- package/dist/esm/src/service/match/match-set.js +3 -8
- package/dist/esm/src/service/match/match.d.ts +0 -1
- package/dist/esm/src/service/match/match.js +2 -4
- package/dist/esm/src/service/player/player.d.ts +4 -4
- package/dist/esm/src/service/player/player.js +2 -2
- package/package.json +1 -1
- package/dist/cjs/src/data/models/match-set-stats.d.ts +0 -58
- package/dist/cjs/src/data/transformers/match-set-stats.d.ts +0 -5
- package/dist/cjs/src/data/transformers/match-set-stats.js +0 -62
- package/dist/esm/src/data/models/match-set-stats.d.ts +0 -58
- package/dist/esm/src/data/transformers/match-set-stats.d.ts +0 -5
- package/dist/esm/src/data/transformers/match-set-stats.js +0 -58
|
@@ -18,7 +18,7 @@ function initModels(sequelize) {
|
|
|
18
18
|
const MatchRating = models_1.MatchRatingModel.initModel(sequelize);
|
|
19
19
|
const MatchResult = models_1.MatchResultModel.initModel(sequelize);
|
|
20
20
|
const MatchSet = models_1.MatchSetModel.initModel(sequelize);
|
|
21
|
-
const
|
|
21
|
+
const BoxScore = models_1.BoxScoreModel.initModel(sequelize);
|
|
22
22
|
const PerformanceStats = models_1.PerformanceStatsModel.initModel(sequelize);
|
|
23
23
|
const Player = models_1.PlayerModel.initModel(sequelize);
|
|
24
24
|
const PlayerTeam = models_1.PlayerTeamModel.initModel(sequelize);
|
|
@@ -84,15 +84,15 @@ function initModels(sequelize) {
|
|
|
84
84
|
});
|
|
85
85
|
MatchSet.belongsToMany(Player, {
|
|
86
86
|
as: 'SetStatsPlayers',
|
|
87
|
-
through:
|
|
87
|
+
through: BoxScore,
|
|
88
88
|
foreignKey: 'match_set_id',
|
|
89
89
|
otherKey: 'player_id'
|
|
90
90
|
});
|
|
91
|
-
MatchSet.hasMany(
|
|
91
|
+
MatchSet.hasMany(BoxScore, { as: 'BoxScore', foreignKey: 'match_set_id' });
|
|
92
92
|
MatchSet.hasMany(Rally, { as: 'Rallies', foreignKey: 'match_set_id' });
|
|
93
93
|
MatchSet.hasMany(SetPosition, { as: 'SetPositions', foreignKey: 'match_set_id' });
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
BoxScore.belongsTo(MatchSet, { as: 'matchSet', foreignKey: 'match_set_id' });
|
|
95
|
+
BoxScore.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
96
96
|
PerformanceStats.belongsTo(Player, { as: 'player', foreignKey: 'player_id' });
|
|
97
97
|
Player.belongsTo(Country, { as: 'country', foreignKey: 'country_id' });
|
|
98
98
|
Player.belongsToMany(MatchSet, {
|
|
@@ -103,7 +103,7 @@ function initModels(sequelize) {
|
|
|
103
103
|
});
|
|
104
104
|
Player.belongsToMany(MatchSet, {
|
|
105
105
|
as: 'StatsMatchSets',
|
|
106
|
-
through:
|
|
106
|
+
through: BoxScore,
|
|
107
107
|
foreignKey: 'player_id',
|
|
108
108
|
otherKey: 'match_set_id'
|
|
109
109
|
});
|
|
@@ -113,7 +113,7 @@ function initModels(sequelize) {
|
|
|
113
113
|
foreignKey: 'player_id',
|
|
114
114
|
otherKey: 'team_id'
|
|
115
115
|
});
|
|
116
|
-
Player.hasMany(
|
|
116
|
+
Player.hasMany(BoxScore, { as: 'BoxScore', foreignKey: 'player_id' });
|
|
117
117
|
Player.hasMany(PlayerTeam, { as: 'PlayerTeams', foreignKey: 'player_id' });
|
|
118
118
|
Player.hasMany(SetPosition, { as: 'SetPositions', foreignKey: 'player_id' });
|
|
119
119
|
Player.hasOne(DraftPick, { as: 'DraftPick', foreignKey: 'player_id' });
|
|
@@ -170,7 +170,7 @@ function initModels(sequelize) {
|
|
|
170
170
|
MatchRating,
|
|
171
171
|
MatchResult,
|
|
172
172
|
MatchSet,
|
|
173
|
-
|
|
173
|
+
BoxScore,
|
|
174
174
|
PerformanceStats,
|
|
175
175
|
Player,
|
|
176
176
|
PlayerTeam,
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model } from 'sequelize';
|
|
3
|
+
import { MatchSetId, MatchSetModel, PlayerId, PlayerModel } from '.';
|
|
4
|
+
export interface BoxScoreAttributes {
|
|
5
|
+
player_id: string;
|
|
6
|
+
match_set_id: string;
|
|
7
|
+
attack_attempts: number;
|
|
8
|
+
attack_kills: number;
|
|
9
|
+
attack_errors: number;
|
|
10
|
+
serve_attempts: number;
|
|
11
|
+
serve_aces: number;
|
|
12
|
+
serve_errors: number;
|
|
13
|
+
reception_attempts: number;
|
|
14
|
+
reception_perfect: number;
|
|
15
|
+
reception_positive: number;
|
|
16
|
+
reception_overpasses: number;
|
|
17
|
+
reception_errors: number;
|
|
18
|
+
block_solo: number;
|
|
19
|
+
block_assists: number;
|
|
20
|
+
block_errors: number;
|
|
21
|
+
setting_assists: number;
|
|
22
|
+
setting_errors: number;
|
|
23
|
+
defense_digs: number;
|
|
24
|
+
defense_errors: number;
|
|
25
|
+
misc_points_played: number;
|
|
26
|
+
misc_points_won_on_court: number;
|
|
27
|
+
misc_serve_turns: number;
|
|
28
|
+
misc_sideout_opportunities: number;
|
|
29
|
+
misc_successful_sideouts: number;
|
|
30
|
+
}
|
|
31
|
+
export type BoxScorePk = 'player_id' | 'match_set_id';
|
|
32
|
+
export type BoxScoreId = BoxScoreModel[BoxScorePk];
|
|
33
|
+
export type BoxScoreCreationAttributes = BoxScoreAttributes;
|
|
34
|
+
export declare class BoxScoreModel extends Model<BoxScoreAttributes, BoxScoreCreationAttributes> implements BoxScoreAttributes {
|
|
35
|
+
player_id: string;
|
|
36
|
+
match_set_id: string;
|
|
37
|
+
attack_attempts: number;
|
|
38
|
+
attack_kills: number;
|
|
39
|
+
attack_errors: number;
|
|
40
|
+
serve_attempts: number;
|
|
41
|
+
serve_aces: number;
|
|
42
|
+
serve_errors: number;
|
|
43
|
+
reception_attempts: number;
|
|
44
|
+
reception_perfect: number;
|
|
45
|
+
reception_positive: number;
|
|
46
|
+
reception_overpasses: number;
|
|
47
|
+
reception_errors: number;
|
|
48
|
+
block_solo: number;
|
|
49
|
+
block_assists: number;
|
|
50
|
+
block_errors: number;
|
|
51
|
+
setting_assists: number;
|
|
52
|
+
setting_errors: number;
|
|
53
|
+
defense_digs: number;
|
|
54
|
+
defense_errors: number;
|
|
55
|
+
misc_points_played: number;
|
|
56
|
+
misc_points_won_on_court: number;
|
|
57
|
+
misc_serve_turns: number;
|
|
58
|
+
misc_sideout_opportunities: number;
|
|
59
|
+
misc_successful_sideouts: number;
|
|
60
|
+
Player: PlayerModel;
|
|
61
|
+
getPlayer: Sequelize.BelongsToGetAssociationMixin<PlayerModel>;
|
|
62
|
+
setPlayer: Sequelize.BelongsToSetAssociationMixin<PlayerModel, PlayerId>;
|
|
63
|
+
createPlayer: Sequelize.BelongsToCreateAssociationMixin<PlayerModel>;
|
|
64
|
+
MatchSet: MatchSetModel;
|
|
65
|
+
getMatchSet: Sequelize.BelongsToGetAssociationMixin<MatchSetModel>;
|
|
66
|
+
setMatchSet: Sequelize.BelongsToSetAssociationMixin<MatchSetModel, MatchSetId>;
|
|
67
|
+
createMatchSet: Sequelize.BelongsToCreateAssociationMixin<MatchSetModel>;
|
|
68
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof BoxScoreModel;
|
|
69
|
+
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.BoxScoreModel = void 0;
|
|
4
4
|
const sequelize_1 = require("sequelize");
|
|
5
|
-
class
|
|
5
|
+
class BoxScoreModel extends sequelize_1.Model {
|
|
6
6
|
static initModel(sequelize) {
|
|
7
|
-
return
|
|
7
|
+
return BoxScoreModel.init({
|
|
8
8
|
player_id: {
|
|
9
9
|
type: sequelize_1.DataTypes.UUID,
|
|
10
10
|
allowNull: false,
|
|
@@ -23,98 +23,135 @@ class MatchSetStatsModel extends sequelize_1.Model {
|
|
|
23
23
|
key: 'match_set_id'
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
|
-
|
|
26
|
+
// Attack
|
|
27
|
+
attack_attempts: {
|
|
27
28
|
type: sequelize_1.DataTypes.INTEGER,
|
|
28
29
|
allowNull: false,
|
|
29
30
|
defaultValue: 0
|
|
30
31
|
},
|
|
31
|
-
|
|
32
|
+
attack_kills: {
|
|
32
33
|
type: sequelize_1.DataTypes.INTEGER,
|
|
33
34
|
allowNull: false,
|
|
34
35
|
defaultValue: 0
|
|
35
36
|
},
|
|
36
|
-
|
|
37
|
+
attack_errors: {
|
|
37
38
|
type: sequelize_1.DataTypes.INTEGER,
|
|
38
39
|
allowNull: false,
|
|
39
40
|
defaultValue: 0
|
|
40
41
|
},
|
|
41
|
-
|
|
42
|
+
// Serve
|
|
43
|
+
serve_attempts: {
|
|
42
44
|
type: sequelize_1.DataTypes.INTEGER,
|
|
43
45
|
allowNull: false,
|
|
44
46
|
defaultValue: 0
|
|
45
47
|
},
|
|
46
|
-
|
|
48
|
+
serve_aces: {
|
|
47
49
|
type: sequelize_1.DataTypes.INTEGER,
|
|
48
50
|
allowNull: false,
|
|
49
51
|
defaultValue: 0
|
|
50
52
|
},
|
|
51
|
-
|
|
53
|
+
serve_errors: {
|
|
52
54
|
type: sequelize_1.DataTypes.INTEGER,
|
|
53
55
|
allowNull: false,
|
|
54
56
|
defaultValue: 0
|
|
55
57
|
},
|
|
56
|
-
|
|
58
|
+
// Reception
|
|
59
|
+
reception_attempts: {
|
|
57
60
|
type: sequelize_1.DataTypes.INTEGER,
|
|
58
61
|
allowNull: false,
|
|
59
62
|
defaultValue: 0
|
|
60
63
|
},
|
|
61
|
-
|
|
64
|
+
reception_perfect: {
|
|
62
65
|
type: sequelize_1.DataTypes.INTEGER,
|
|
63
66
|
allowNull: false,
|
|
64
67
|
defaultValue: 0
|
|
65
68
|
},
|
|
66
|
-
|
|
69
|
+
reception_positive: {
|
|
67
70
|
type: sequelize_1.DataTypes.INTEGER,
|
|
68
71
|
allowNull: false,
|
|
69
72
|
defaultValue: 0
|
|
70
73
|
},
|
|
71
|
-
|
|
74
|
+
reception_overpasses: {
|
|
72
75
|
type: sequelize_1.DataTypes.INTEGER,
|
|
73
76
|
allowNull: false,
|
|
74
77
|
defaultValue: 0
|
|
75
78
|
},
|
|
76
|
-
|
|
79
|
+
reception_errors: {
|
|
77
80
|
type: sequelize_1.DataTypes.INTEGER,
|
|
78
81
|
allowNull: false,
|
|
79
82
|
defaultValue: 0
|
|
80
83
|
},
|
|
81
|
-
|
|
84
|
+
// Block
|
|
85
|
+
block_solo: {
|
|
82
86
|
type: sequelize_1.DataTypes.INTEGER,
|
|
83
87
|
allowNull: false,
|
|
84
88
|
defaultValue: 0
|
|
85
89
|
},
|
|
86
|
-
|
|
90
|
+
block_assists: {
|
|
87
91
|
type: sequelize_1.DataTypes.INTEGER,
|
|
88
92
|
allowNull: false,
|
|
89
93
|
defaultValue: 0
|
|
90
94
|
},
|
|
91
|
-
|
|
95
|
+
block_errors: {
|
|
92
96
|
type: sequelize_1.DataTypes.INTEGER,
|
|
93
97
|
allowNull: false,
|
|
94
98
|
defaultValue: 0
|
|
95
99
|
},
|
|
96
|
-
|
|
100
|
+
// Setting
|
|
101
|
+
setting_assists: {
|
|
97
102
|
type: sequelize_1.DataTypes.INTEGER,
|
|
98
103
|
allowNull: false,
|
|
99
104
|
defaultValue: 0
|
|
100
105
|
},
|
|
101
|
-
|
|
106
|
+
setting_errors: {
|
|
102
107
|
type: sequelize_1.DataTypes.INTEGER,
|
|
103
108
|
allowNull: false,
|
|
104
109
|
defaultValue: 0
|
|
105
110
|
},
|
|
106
|
-
|
|
111
|
+
// Defense
|
|
112
|
+
defense_digs: {
|
|
113
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
114
|
+
allowNull: false,
|
|
115
|
+
defaultValue: 0
|
|
116
|
+
},
|
|
117
|
+
defense_errors: {
|
|
118
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
119
|
+
allowNull: false,
|
|
120
|
+
defaultValue: 0
|
|
121
|
+
},
|
|
122
|
+
// Misc
|
|
123
|
+
misc_points_played: {
|
|
124
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
125
|
+
allowNull: false,
|
|
126
|
+
defaultValue: 0
|
|
127
|
+
},
|
|
128
|
+
misc_points_won_on_court: {
|
|
129
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
130
|
+
allowNull: false,
|
|
131
|
+
defaultValue: 0
|
|
132
|
+
},
|
|
133
|
+
misc_serve_turns: {
|
|
134
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
135
|
+
allowNull: false,
|
|
136
|
+
defaultValue: 0
|
|
137
|
+
},
|
|
138
|
+
misc_sideout_opportunities: {
|
|
139
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
140
|
+
allowNull: false,
|
|
141
|
+
defaultValue: 0
|
|
142
|
+
},
|
|
143
|
+
misc_successful_sideouts: {
|
|
107
144
|
type: sequelize_1.DataTypes.INTEGER,
|
|
108
145
|
allowNull: false,
|
|
109
146
|
defaultValue: 0
|
|
110
147
|
}
|
|
111
148
|
}, {
|
|
112
149
|
sequelize,
|
|
113
|
-
tableName: '
|
|
150
|
+
tableName: 'BoxScore',
|
|
114
151
|
schema: 'public',
|
|
115
152
|
timestamps: false,
|
|
116
153
|
indexes: [{
|
|
117
|
-
name: '
|
|
154
|
+
name: 'BoxScore_pk',
|
|
118
155
|
unique: true,
|
|
119
156
|
fields: [
|
|
120
157
|
{ name: 'player_id' },
|
|
@@ -124,4 +161,4 @@ class MatchSetStatsModel extends sequelize_1.Model {
|
|
|
124
161
|
});
|
|
125
162
|
}
|
|
126
163
|
}
|
|
127
|
-
exports.
|
|
164
|
+
exports.BoxScoreModel = BoxScoreModel;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from './box-score';
|
|
1
2
|
export * from './coach';
|
|
2
3
|
export * from './competition';
|
|
3
4
|
export * from './competition-champion';
|
|
@@ -13,7 +14,6 @@ export * from './match';
|
|
|
13
14
|
export * from './match-rating';
|
|
14
15
|
export * from './match-result';
|
|
15
16
|
export * from './match-set';
|
|
16
|
-
export * from './match-set-stats';
|
|
17
17
|
export * from './performance-stats';
|
|
18
18
|
export * from './player';
|
|
19
19
|
export * from './player-team';
|
|
@@ -14,6 +14,7 @@ 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("./box-score"), exports);
|
|
17
18
|
__exportStar(require("./coach"), exports);
|
|
18
19
|
__exportStar(require("./competition"), exports);
|
|
19
20
|
__exportStar(require("./competition-champion"), exports);
|
|
@@ -29,7 +30,6 @@ __exportStar(require("./match"), exports);
|
|
|
29
30
|
__exportStar(require("./match-rating"), exports);
|
|
30
31
|
__exportStar(require("./match-result"), exports);
|
|
31
32
|
__exportStar(require("./match-set"), exports);
|
|
32
|
-
__exportStar(require("./match-set-stats"), exports);
|
|
33
33
|
__exportStar(require("./performance-stats"), exports);
|
|
34
34
|
__exportStar(require("./player"), exports);
|
|
35
35
|
__exportStar(require("./player-team"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import {
|
|
3
|
+
import { BoxScoreAttributes, BoxScoreId, BoxScoreModel, MatchId, MatchModel, 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;
|
|
@@ -10,7 +10,7 @@ export interface MatchSetAttributes {
|
|
|
10
10
|
away_score: number;
|
|
11
11
|
SetPositions?: SetPositionAttributes[];
|
|
12
12
|
Rallies?: RallyAttributes[];
|
|
13
|
-
|
|
13
|
+
BoxScores?: BoxScoreAttributes[];
|
|
14
14
|
}
|
|
15
15
|
export type MatchSetPk = 'match_set_id';
|
|
16
16
|
export type MatchSetId = MatchSetModel[MatchSetPk];
|
|
@@ -26,17 +26,17 @@ export declare class MatchSetModel extends Model<MatchSetAttributes, MatchSetCre
|
|
|
26
26
|
getMatch: Sequelize.BelongsToGetAssociationMixin<MatchModel>;
|
|
27
27
|
setMatch: Sequelize.BelongsToSetAssociationMixin<MatchModel, MatchId>;
|
|
28
28
|
createMatch: Sequelize.BelongsToCreateAssociationMixin<MatchModel>;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
29
|
+
BoxScores: BoxScoreModel[];
|
|
30
|
+
getBoxScores: Sequelize.HasManyGetAssociationsMixin<BoxScoreModel>;
|
|
31
|
+
setBoxScores: Sequelize.HasManySetAssociationsMixin<BoxScoreModel, BoxScoreId>;
|
|
32
|
+
addBoxScore: Sequelize.HasManyAddAssociationMixin<BoxScoreModel, BoxScoreId>;
|
|
33
|
+
addBoxScores: Sequelize.HasManyAddAssociationsMixin<BoxScoreModel, BoxScoreId>;
|
|
34
|
+
createBoxScore: Sequelize.HasManyCreateAssociationMixin<BoxScoreModel>;
|
|
35
|
+
removeBoxScore: Sequelize.HasManyRemoveAssociationMixin<BoxScoreModel, BoxScoreId>;
|
|
36
|
+
removeBoxScores: Sequelize.HasManyRemoveAssociationsMixin<BoxScoreModel, BoxScoreId>;
|
|
37
|
+
hasBoxScore: Sequelize.HasManyHasAssociationMixin<BoxScoreModel, BoxScoreId>;
|
|
38
|
+
hasBoxScores: Sequelize.HasManyHasAssociationsMixin<BoxScoreModel, BoxScoreId>;
|
|
39
|
+
countBoxScores: Sequelize.HasManyCountAssociationsMixin;
|
|
40
40
|
SetStatsPlayers: PlayerModel[];
|
|
41
41
|
getSetStatsPlayers: Sequelize.BelongsToManyGetAssociationsMixin<PlayerModel>;
|
|
42
42
|
setSetStatsPlayers: Sequelize.BelongsToManySetAssociationsMixin<PlayerModel, PlayerId>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
|
-
import { CountryId, CountryModel, DraftPickId, DraftPickModel, MatchSetId, MatchSetModel,
|
|
3
|
+
import { BoxScoreAttributes, BoxScoreId, BoxScoreModel, CountryId, CountryModel, DraftPickId, DraftPickModel, MatchSetId, MatchSetModel, PerformanceStatsAttributes, PerformanceStatsId, PerformanceStatsModel, PlayerTeamId, PlayerTeamModel, SetPositionId, SetPositionModel, TeamId, TeamModel } from '.';
|
|
4
4
|
import { Rarity, Role, Trait } from '../../service';
|
|
5
5
|
export interface PlayerAttributes {
|
|
6
6
|
player_id: string;
|
|
@@ -11,7 +11,7 @@ export interface PlayerAttributes {
|
|
|
11
11
|
last_name: string;
|
|
12
12
|
country_id: string;
|
|
13
13
|
PerformanceStat?: PerformanceStatsAttributes;
|
|
14
|
-
|
|
14
|
+
BoxScores?: BoxScoreAttributes[];
|
|
15
15
|
}
|
|
16
16
|
export type PlayerPk = 'player_id';
|
|
17
17
|
export type PlayerId = PlayerModel[PlayerPk];
|
|
@@ -54,17 +54,17 @@ export declare class PlayerModel extends Model<PlayerAttributes, PlayerCreationA
|
|
|
54
54
|
hasSetPositionSet: Sequelize.BelongsToManyHasAssociationMixin<MatchSetModel, MatchSetId>;
|
|
55
55
|
hasSetPositionSets: Sequelize.BelongsToManyHasAssociationsMixin<MatchSetModel, MatchSetId>;
|
|
56
56
|
countSetPositionSets: Sequelize.BelongsToManyCountAssociationsMixin;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
BoxScores: BoxScoreModel[];
|
|
58
|
+
getBoxScores: Sequelize.HasManyGetAssociationsMixin<BoxScoreModel>;
|
|
59
|
+
setBoxScores: Sequelize.HasManySetAssociationsMixin<BoxScoreModel, BoxScoreId>;
|
|
60
|
+
addBoxScore: Sequelize.HasManyAddAssociationMixin<BoxScoreModel, BoxScoreId>;
|
|
61
|
+
addBoxScores: Sequelize.HasManyAddAssociationsMixin<BoxScoreModel, BoxScoreId>;
|
|
62
|
+
createBoxScore: Sequelize.HasManyCreateAssociationMixin<BoxScoreModel>;
|
|
63
|
+
removeBoxScore: Sequelize.HasManyRemoveAssociationMixin<BoxScoreModel, BoxScoreId>;
|
|
64
|
+
removeBoxScores: Sequelize.HasManyRemoveAssociationsMixin<BoxScoreModel, BoxScoreId>;
|
|
65
|
+
hasBoxScore: Sequelize.HasManyHasAssociationMixin<BoxScoreModel, BoxScoreId>;
|
|
66
|
+
hasBoxScores: Sequelize.HasManyHasAssociationsMixin<BoxScoreModel, BoxScoreId>;
|
|
67
|
+
countBoxScores: Sequelize.HasManyCountAssociationsMixin;
|
|
68
68
|
PerformanceStat: PerformanceStatsModel;
|
|
69
69
|
getPerformanceStat: Sequelize.HasOneGetAssociationMixin<PerformanceStatsModel>;
|
|
70
70
|
setPerformanceStat: Sequelize.HasOneSetAssociationMixin<PerformanceStatsModel, PerformanceStatsId>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { BoxScoreAttributes, BoxScoreModel } from '../models';
|
|
2
|
+
import { BoxScore } from '../../service';
|
|
3
|
+
declare function transformToAttributes(boxScore: BoxScore): BoxScoreAttributes;
|
|
4
|
+
declare function transformToObject(model: BoxScoreModel): BoxScore;
|
|
5
|
+
export { transformToObject as transformToBoxScore, transformToAttributes as transformFromBoxScore };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.transformFromBoxScore = exports.transformToBoxScore = void 0;
|
|
4
|
+
function transformToAttributes(boxScore) {
|
|
5
|
+
return {
|
|
6
|
+
player_id: boxScore.playerId,
|
|
7
|
+
match_set_id: boxScore.matchSetId,
|
|
8
|
+
attack_attempts: boxScore.attack.attempts,
|
|
9
|
+
attack_kills: boxScore.attack.kills,
|
|
10
|
+
attack_errors: boxScore.attack.errors,
|
|
11
|
+
serve_attempts: boxScore.serve.attempts,
|
|
12
|
+
serve_aces: boxScore.serve.aces,
|
|
13
|
+
serve_errors: boxScore.serve.errors,
|
|
14
|
+
reception_attempts: boxScore.reception.attempts,
|
|
15
|
+
reception_perfect: boxScore.reception.perfect,
|
|
16
|
+
reception_positive: boxScore.reception.positive,
|
|
17
|
+
reception_overpasses: boxScore.reception.overpasses,
|
|
18
|
+
reception_errors: boxScore.reception.errors,
|
|
19
|
+
block_solo: boxScore.block.solo,
|
|
20
|
+
block_assists: boxScore.block.assists,
|
|
21
|
+
block_errors: boxScore.block.errors,
|
|
22
|
+
setting_assists: boxScore.setting.assists,
|
|
23
|
+
setting_errors: boxScore.setting.errors,
|
|
24
|
+
defense_digs: boxScore.defense.digs,
|
|
25
|
+
defense_errors: boxScore.defense.errors,
|
|
26
|
+
misc_points_played: boxScore.misc.pointsPlayed,
|
|
27
|
+
misc_points_won_on_court: boxScore.misc.pointsWonOnCourt,
|
|
28
|
+
misc_serve_turns: boxScore.misc.serveTurns,
|
|
29
|
+
misc_sideout_opportunities: boxScore.misc.sideoutOpportunities,
|
|
30
|
+
misc_successful_sideouts: boxScore.misc.successfulSideouts
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
exports.transformFromBoxScore = transformToAttributes;
|
|
34
|
+
function transformToObject(model) {
|
|
35
|
+
return {
|
|
36
|
+
playerId: model.player_id,
|
|
37
|
+
matchSetId: model.match_set_id,
|
|
38
|
+
attack: {
|
|
39
|
+
attempts: model.attack_attempts,
|
|
40
|
+
kills: model.attack_kills,
|
|
41
|
+
errors: model.attack_errors
|
|
42
|
+
},
|
|
43
|
+
serve: {
|
|
44
|
+
attempts: model.serve_attempts,
|
|
45
|
+
aces: model.serve_aces,
|
|
46
|
+
errors: model.serve_errors
|
|
47
|
+
},
|
|
48
|
+
reception: {
|
|
49
|
+
attempts: model.reception_attempts,
|
|
50
|
+
perfect: model.reception_perfect,
|
|
51
|
+
positive: model.reception_positive,
|
|
52
|
+
overpasses: model.reception_overpasses,
|
|
53
|
+
errors: model.reception_errors
|
|
54
|
+
},
|
|
55
|
+
block: {
|
|
56
|
+
solo: model.block_solo,
|
|
57
|
+
assists: model.block_assists,
|
|
58
|
+
errors: model.block_errors
|
|
59
|
+
},
|
|
60
|
+
setting: {
|
|
61
|
+
assists: model.setting_assists,
|
|
62
|
+
errors: model.setting_errors
|
|
63
|
+
},
|
|
64
|
+
defense: {
|
|
65
|
+
digs: model.defense_digs,
|
|
66
|
+
errors: model.defense_errors
|
|
67
|
+
},
|
|
68
|
+
misc: {
|
|
69
|
+
pointsPlayed: model.misc_points_played,
|
|
70
|
+
pointsWonOnCourt: model.misc_points_won_on_court,
|
|
71
|
+
serveTurns: model.misc_serve_turns,
|
|
72
|
+
sideoutOpportunities: model.misc_sideout_opportunities,
|
|
73
|
+
successfulSideouts: model.misc_successful_sideouts
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
exports.transformToBoxScore = transformToObject;
|
|
@@ -11,7 +11,7 @@ export * from './tournament-match';
|
|
|
11
11
|
export * from './stage';
|
|
12
12
|
export * from './match';
|
|
13
13
|
export * from './match-set';
|
|
14
|
-
export * from './
|
|
14
|
+
export * from './box-score';
|
|
15
15
|
export * from './performance-stats';
|
|
16
16
|
export * from './player';
|
|
17
17
|
export * from './rally';
|
|
@@ -27,7 +27,7 @@ __exportStar(require("./tournament-match"), exports);
|
|
|
27
27
|
__exportStar(require("./stage"), exports);
|
|
28
28
|
__exportStar(require("./match"), exports);
|
|
29
29
|
__exportStar(require("./match-set"), exports);
|
|
30
|
-
__exportStar(require("./
|
|
30
|
+
__exportStar(require("./box-score"), exports);
|
|
31
31
|
__exportStar(require("./performance-stats"), exports);
|
|
32
32
|
__exportStar(require("./player"), exports);
|
|
33
33
|
__exportStar(require("./rally"), exports);
|
|
@@ -14,7 +14,7 @@ function transformToAttributes(set, matchId) {
|
|
|
14
14
|
home_score: set.homeScore,
|
|
15
15
|
away_score: set.awayScore,
|
|
16
16
|
SetPositions: [...homeSetPositions, ...awaySetPositions],
|
|
17
|
-
|
|
17
|
+
BoxScores: (set.boxScores ?? []).map(_1.transformFromBoxScore),
|
|
18
18
|
Rallies: (set.rallies ?? []).map((rally) => (0, _1.transformFromRally)(rally, set.id))
|
|
19
19
|
};
|
|
20
20
|
}
|
|
@@ -22,7 +22,6 @@ exports.transformFromMatchSet = transformToAttributes;
|
|
|
22
22
|
function transformToObject(model) {
|
|
23
23
|
const homePlayerPosition = (model.SetPositions ?? []).filter((p) => p.side === 'HOME').map(_1.transformToPlayerPosition);
|
|
24
24
|
const awayPlayerPosition = (model.SetPositions ?? []).filter((p) => p.side === 'AWAY').map(_1.transformToPlayerPosition);
|
|
25
|
-
const stats = (model.MatchSetStats ?? []).map(_1.transformToMatchSetStats);
|
|
26
25
|
const rallies = (model.Rallies ?? []).map(_1.transformToRally).sort((r1, r2) => r1.order - r2.order);
|
|
27
26
|
return new service_1.MatchSet({
|
|
28
27
|
id: model.match_id,
|
|
@@ -30,10 +29,10 @@ function transformToObject(model) {
|
|
|
30
29
|
homeScore: model.home_score,
|
|
31
30
|
awayScore: model.away_score,
|
|
32
31
|
isTieBreak: model.is_tie_break,
|
|
32
|
+
boxScores: (model.BoxScores ?? []).map(_1.transformToBoxScore),
|
|
33
33
|
homePlayerPosition,
|
|
34
34
|
awayPlayerPosition,
|
|
35
|
-
rallies
|
|
36
|
-
stats
|
|
35
|
+
rallies
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
38
|
exports.transformToMatchSet = transformToObject;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { PlayerAttributes, PlayerModel } from '../models';
|
|
2
|
-
import { Player
|
|
2
|
+
import { Player } from '../../service';
|
|
3
3
|
declare function transformToAttributes(player: Player): PlayerAttributes;
|
|
4
4
|
declare function transformToObject(model: PlayerModel): Player;
|
|
5
|
-
export declare function calculateMatchStats(gameStats: SetStatistics[]): SetStatistics;
|
|
6
|
-
export declare function reduceStatsFn(acc: SetStatistics, current: SetStatistics): SetStatistics;
|
|
7
5
|
export { transformToObject as transformToPlayer, transformToAttributes as transformFromPlayer };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformFromPlayer = exports.transformToPlayer =
|
|
3
|
+
exports.transformFromPlayer = exports.transformToPlayer = void 0;
|
|
4
4
|
const service_1 = require("../../service");
|
|
5
5
|
const _1 = require(".");
|
|
6
6
|
function transformToAttributes(player) {
|
|
@@ -17,10 +17,6 @@ function transformToAttributes(player) {
|
|
|
17
17
|
}
|
|
18
18
|
exports.transformFromPlayer = transformToAttributes;
|
|
19
19
|
function transformToObject(model) {
|
|
20
|
-
const gameStats = (model.MatchSetStats ?? []).map(_1.transformToMatchSetStats);
|
|
21
|
-
if (gameStats.length > 0) {
|
|
22
|
-
gameStats.push(calculateMatchStats(gameStats));
|
|
23
|
-
}
|
|
24
20
|
return new service_1.Player({
|
|
25
21
|
id: model.player_id,
|
|
26
22
|
name: {
|
|
@@ -32,50 +28,7 @@ function transformToObject(model) {
|
|
|
32
28
|
traits: model.traits,
|
|
33
29
|
stats: (0, _1.transformToPerformanceStats)(model.PerformanceStat),
|
|
34
30
|
rarity: model.rarity,
|
|
35
|
-
|
|
31
|
+
boxScores: (model.BoxScores ?? []).map(_1.transformToBoxScore)
|
|
36
32
|
});
|
|
37
33
|
}
|
|
38
34
|
exports.transformToPlayer = transformToObject;
|
|
39
|
-
function calculateMatchStats(gameStats) {
|
|
40
|
-
const emptyStats = {
|
|
41
|
-
playerId: gameStats[0].playerId,
|
|
42
|
-
attempts: 0,
|
|
43
|
-
contacts: 0,
|
|
44
|
-
ralliesPlayed: 0,
|
|
45
|
-
serve: { success: 0, error: 0 },
|
|
46
|
-
reception: { success: 0, error: 0 },
|
|
47
|
-
set: { success: 0, error: 0 },
|
|
48
|
-
attack: { success: 0, error: 0 },
|
|
49
|
-
block: { success: 0, error: 0 },
|
|
50
|
-
kills: 0,
|
|
51
|
-
killBlocks: 0,
|
|
52
|
-
ace: 0,
|
|
53
|
-
assists: 0,
|
|
54
|
-
order: gameStats.length,
|
|
55
|
-
setsPlayed: 0
|
|
56
|
-
};
|
|
57
|
-
return gameStats.reduce(reduceStatsFn, emptyStats);
|
|
58
|
-
}
|
|
59
|
-
exports.calculateMatchStats = calculateMatchStats;
|
|
60
|
-
function reduceStatsFn(acc, current) {
|
|
61
|
-
acc.attempts += current.attempts;
|
|
62
|
-
acc.contacts += current.contacts;
|
|
63
|
-
acc.ralliesPlayed += current.ralliesPlayed;
|
|
64
|
-
acc.kills += current.kills;
|
|
65
|
-
acc.killBlocks += current.killBlocks;
|
|
66
|
-
acc.ace += current.ace;
|
|
67
|
-
acc.assists += current.assists;
|
|
68
|
-
acc.serve.success += current.serve.success;
|
|
69
|
-
acc.serve.error += current.serve.error;
|
|
70
|
-
acc.reception.success += current.reception.success;
|
|
71
|
-
acc.reception.error += current.reception.error;
|
|
72
|
-
acc.set.success += current.set.success;
|
|
73
|
-
acc.set.error += current.set.error;
|
|
74
|
-
acc.attack.success += current.attack.success;
|
|
75
|
-
acc.attack.error += current.attack.error;
|
|
76
|
-
acc.block.success += current.block.success;
|
|
77
|
-
acc.block.error += current.block.error;
|
|
78
|
-
acc.setsPlayed++;
|
|
79
|
-
return acc;
|
|
80
|
-
}
|
|
81
|
-
exports.reduceStatsFn = reduceStatsFn;
|