volleyballsimtypes 0.0.524 → 0.0.526
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/api/index.d.ts +17 -1
- package/dist/cjs/src/data/init-models.js +14 -0
- package/dist/cjs/src/data/models/competition.d.ts +1 -1
- package/dist/cjs/src/data/models/competition.js +1 -1
- package/dist/cjs/src/data/models/index.d.ts +5 -0
- package/dist/cjs/src/data/models/index.js +5 -0
- package/dist/cjs/src/data/models/jersey-badge.d.ts +1 -1
- package/dist/cjs/src/data/models/jersey-badge.js +1 -1
- package/dist/cjs/src/data/models/national-team-claim.d.ts +21 -0
- package/dist/cjs/src/data/models/national-team-claim.js +44 -0
- package/dist/cjs/src/data/models/national-team.d.ts +16 -0
- package/dist/cjs/src/data/models/national-team.js +31 -0
- package/dist/cjs/src/data/models/wnl-callup.d.ts +21 -0
- package/dist/cjs/src/data/models/wnl-callup.js +45 -0
- package/dist/cjs/src/data/models/wnl-season.d.ts +17 -0
- package/dist/cjs/src/data/models/wnl-season.js +34 -0
- package/dist/cjs/src/data/models/wnl-squad.d.ts +27 -0
- package/dist/cjs/src/data/models/wnl-squad.js +59 -0
- package/dist/cjs/src/service/match/index.d.ts +1 -0
- package/dist/cjs/src/service/match/index.js +8 -0
- package/dist/cjs/src/service/match/match-generator.d.ts +5 -1
- package/dist/cjs/src/service/match/match-generator.js +6 -4
- package/dist/cjs/src/service/notification/catalog/en.json +42 -0
- package/dist/cjs/src/service/notification/catalog/es.json +42 -0
- package/dist/cjs/src/service/notification/catalog/fr.json +42 -0
- package/dist/cjs/src/service/notification/catalog/it.json +42 -0
- package/dist/cjs/src/service/notification/catalog/pl.json +42 -0
- package/dist/cjs/src/service/notification/catalog/pt-BR.json +42 -0
- package/dist/cjs/src/service/notification/catalog/tr.json +42 -0
- package/dist/cjs/src/service/notification/notification-type.d.ts +1 -1
- package/dist/cjs/src/service/notification/notification-type.js +11 -1
- package/dist/cjs/src/service/notification/notification.test.js +18 -0
- package/dist/cjs/src/service/notification/payloads.d.ts +13 -1
- package/dist/cjs/src/service/notification/registry.d.ts +6 -3
- package/dist/cjs/src/service/notification/registry.js +134 -20
- package/dist/cjs/src/service/premium/premium-tier.d.ts +2 -0
- package/dist/cjs/src/service/premium/premium-tier.js +8 -1
- package/dist/esm/src/api/index.d.ts +17 -1
- package/dist/esm/src/data/init-models.js +15 -1
- package/dist/esm/src/data/models/competition.d.ts +1 -1
- package/dist/esm/src/data/models/competition.js +1 -1
- package/dist/esm/src/data/models/index.d.ts +5 -0
- package/dist/esm/src/data/models/index.js +5 -0
- package/dist/esm/src/data/models/jersey-badge.d.ts +1 -1
- package/dist/esm/src/data/models/jersey-badge.js +1 -1
- package/dist/esm/src/data/models/national-team-claim.d.ts +21 -0
- package/dist/esm/src/data/models/national-team-claim.js +40 -0
- package/dist/esm/src/data/models/national-team.d.ts +16 -0
- package/dist/esm/src/data/models/national-team.js +27 -0
- package/dist/esm/src/data/models/wnl-callup.d.ts +21 -0
- package/dist/esm/src/data/models/wnl-callup.js +41 -0
- package/dist/esm/src/data/models/wnl-season.d.ts +17 -0
- package/dist/esm/src/data/models/wnl-season.js +30 -0
- package/dist/esm/src/data/models/wnl-squad.d.ts +27 -0
- package/dist/esm/src/data/models/wnl-squad.js +55 -0
- package/dist/esm/src/service/match/index.d.ts +1 -0
- package/dist/esm/src/service/match/index.js +3 -0
- package/dist/esm/src/service/match/match-generator.d.ts +5 -1
- package/dist/esm/src/service/match/match-generator.js +6 -4
- package/dist/esm/src/service/notification/catalog/en.json +42 -0
- package/dist/esm/src/service/notification/catalog/es.json +42 -0
- package/dist/esm/src/service/notification/catalog/fr.json +42 -0
- package/dist/esm/src/service/notification/catalog/it.json +42 -0
- package/dist/esm/src/service/notification/catalog/pl.json +42 -0
- package/dist/esm/src/service/notification/catalog/pt-BR.json +42 -0
- package/dist/esm/src/service/notification/catalog/tr.json +42 -0
- package/dist/esm/src/service/notification/notification-type.d.ts +1 -1
- package/dist/esm/src/service/notification/notification-type.js +11 -1
- package/dist/esm/src/service/notification/notification.test.js +19 -1
- package/dist/esm/src/service/notification/payloads.d.ts +13 -1
- package/dist/esm/src/service/notification/registry.d.ts +6 -3
- package/dist/esm/src/service/notification/registry.js +132 -20
- package/dist/esm/src/service/premium/premium-tier.d.ts +2 -0
- package/dist/esm/src/service/premium/premium-tier.js +6 -0
- package/package.json +1 -1
|
@@ -17,7 +17,7 @@ export interface Results {
|
|
|
17
17
|
away: number[];
|
|
18
18
|
}
|
|
19
19
|
export interface MatchCompetition {
|
|
20
|
-
type: 'LEAGUE' | 'NATIONAL' | 'QUALIFIER' | 'TOURNAMENT' | 'EVENT';
|
|
20
|
+
type: 'LEAGUE' | 'NATIONAL' | 'QUALIFIER' | 'TOURNAMENT' | 'EVENT' | 'WNL' | 'WNLF';
|
|
21
21
|
countryName?: string;
|
|
22
22
|
countryAlpha2?: string;
|
|
23
23
|
countryAlpha3?: string;
|
|
@@ -70,6 +70,8 @@ export type ChampionBadgeSpec = {
|
|
|
70
70
|
region: ChampionRegion;
|
|
71
71
|
} | {
|
|
72
72
|
type: 'wcc';
|
|
73
|
+
} | {
|
|
74
|
+
type: 'wnl';
|
|
73
75
|
};
|
|
74
76
|
export type Player = Omit<DataProps<_Player>, 'stats' | 'birthAge' | 'birthIteration' | 'declineProfile' | 'nickname' | 'injuryProneProfile' | 'injury'> & {
|
|
75
77
|
-readonly [K in 'birthAge' | 'birthIteration']?: DataProps<_Player>[K];
|
|
@@ -83,6 +85,7 @@ export type Player = Omit<DataProps<_Player>, 'stats' | 'birthAge' | 'birthItera
|
|
|
83
85
|
nickname?: string;
|
|
84
86
|
jerseyConfig?: JerseyConfig;
|
|
85
87
|
championBadge?: ChampionBadgeSpec;
|
|
88
|
+
nationalFlagAlpha2?: string;
|
|
86
89
|
};
|
|
87
90
|
export interface StartingLineup {
|
|
88
91
|
[CourtPosition.LEFT_FRONT]: string;
|
|
@@ -189,6 +192,12 @@ export type Team = Omit<DataProps<_Team>, 'roster' | '_rating' | 'rating' | 'tac
|
|
|
189
192
|
};
|
|
190
193
|
nationalCountryName?: string;
|
|
191
194
|
isEvent?: boolean;
|
|
195
|
+
isNational?: boolean;
|
|
196
|
+
nationalManager?: {
|
|
197
|
+
displayName: string;
|
|
198
|
+
teamId: string;
|
|
199
|
+
teamShortName: string;
|
|
200
|
+
};
|
|
192
201
|
};
|
|
193
202
|
export type Standing = DataProps<_Standing> & {
|
|
194
203
|
position: number;
|
|
@@ -255,4 +264,11 @@ export type TotalBoxScore = Omit<DataProps<BoxScore>, 'misc' | 'playerId' | 'mat
|
|
|
255
264
|
setsPlayed: number;
|
|
256
265
|
matchesPlayed: number;
|
|
257
266
|
};
|
|
267
|
+
national?: {
|
|
268
|
+
alpha2: string;
|
|
269
|
+
matchesPlayed: number;
|
|
270
|
+
matchesWon: number;
|
|
271
|
+
pointsPlayed: number;
|
|
272
|
+
pointsWon: number;
|
|
273
|
+
};
|
|
258
274
|
};
|
|
@@ -66,6 +66,11 @@ function initModels(sequelize) {
|
|
|
66
66
|
const Friendly = models_1.FriendlyModel.initModel(sequelize);
|
|
67
67
|
const RegionQualifier = models_1.RegionQualifierModel.initModel(sequelize);
|
|
68
68
|
const NationalCountry = models_1.NationalCountryModel.initModel(sequelize);
|
|
69
|
+
const NationalTeam = models_1.NationalTeamModel.initModel(sequelize);
|
|
70
|
+
const NationalTeamClaim = models_1.NationalTeamClaimModel.initModel(sequelize);
|
|
71
|
+
const WnlSquad = models_1.WnlSquadModel.initModel(sequelize);
|
|
72
|
+
const WnlCallup = models_1.WnlCallupModel.initModel(sequelize);
|
|
73
|
+
const WnlSeason = models_1.WnlSeasonModel.initModel(sequelize);
|
|
69
74
|
const Team = models_1.TeamModel.initModel(sequelize);
|
|
70
75
|
const TeamReplacement = models_1.TeamReplacementModel.initModel(sequelize);
|
|
71
76
|
const LegacyTeamFlag = models_1.LegacyTeamFlagModel.initModel(sequelize);
|
|
@@ -231,6 +236,10 @@ function initModels(sequelize) {
|
|
|
231
236
|
Competition.hasOne(NationalCountry, { as: 'NationalCountry', foreignKey: 'competition_id' });
|
|
232
237
|
Country.hasMany(NationalCountry, { as: 'NationalCountries', foreignKey: 'country_id' });
|
|
233
238
|
Iteration.hasMany(NationalCountry, { as: 'NationalCountries', foreignKey: 'iteration' });
|
|
239
|
+
// National teams (WNL): NO associations on purpose. Every consumer of the five WNL tables (Sim scheduler,
|
|
240
|
+
// API /wnl routes) reads them with direct model queries or raw SQL joins; the alias wiring that once lived
|
|
241
|
+
// here was confirmed unused in all four repos and removed as dead code (review fleet 2026-08-28). Add an
|
|
242
|
+
// association back only together with the include that uses it.
|
|
234
243
|
VPER.belongsTo(Player, { as: 'Player', foreignKey: 'player_id' });
|
|
235
244
|
VPER.belongsTo(Match, { as: 'Match', foreignKey: 'match_id' });
|
|
236
245
|
Team.hasOne(Coach, { as: 'Coach', foreignKey: 'team_id' });
|
|
@@ -354,6 +363,11 @@ function initModels(sequelize) {
|
|
|
354
363
|
Friendly,
|
|
355
364
|
RegionQualifier,
|
|
356
365
|
NationalCountry,
|
|
366
|
+
NationalTeam,
|
|
367
|
+
NationalTeamClaim,
|
|
368
|
+
WnlSquad,
|
|
369
|
+
WnlCallup,
|
|
370
|
+
WnlSeason,
|
|
357
371
|
Rally,
|
|
358
372
|
Team,
|
|
359
373
|
TeamReplacement,
|
|
@@ -21,7 +21,7 @@ export interface CompetitionAttributes {
|
|
|
21
21
|
LowerPromotionMatches?: PromotionMatchAttributes[];
|
|
22
22
|
}
|
|
23
23
|
export type CompetitionPk = 'competition_id';
|
|
24
|
-
export type CompetitionType = 'LEAGUE' | 'TOURNAMENT' | 'QUALIFIER' | 'NATIONAL' | 'EVENT';
|
|
24
|
+
export type CompetitionType = 'LEAGUE' | 'TOURNAMENT' | 'QUALIFIER' | 'NATIONAL' | 'EVENT' | 'WNL' | 'WNLF';
|
|
25
25
|
export type CompetitionId = CompetitionModel[CompetitionPk];
|
|
26
26
|
export type CompetitionCreationAttributes = CompetitionAttributes;
|
|
27
27
|
export declare class CompetitionModel extends Model<CompetitionAttributes, CompetitionCreationAttributes> implements CompetitionAttributes {
|
|
@@ -21,7 +21,7 @@ class CompetitionModel extends sequelize_1.Model {
|
|
|
21
21
|
}
|
|
22
22
|
},
|
|
23
23
|
type: {
|
|
24
|
-
type: sequelize_1.DataTypes.ENUM('LEAGUE', 'TOURNAMENT', 'QUALIFIER', 'NATIONAL', 'EVENT'),
|
|
24
|
+
type: sequelize_1.DataTypes.ENUM('LEAGUE', 'TOURNAMENT', 'QUALIFIER', 'NATIONAL', 'EVENT', 'WNL', 'WNLF'),
|
|
25
25
|
allowNull: false
|
|
26
26
|
},
|
|
27
27
|
status: {
|
|
@@ -32,6 +32,11 @@ export * from './promotion-match';
|
|
|
32
32
|
export * from './friendly';
|
|
33
33
|
export * from './region-qualifier';
|
|
34
34
|
export * from './national-country';
|
|
35
|
+
export * from './national-team';
|
|
36
|
+
export * from './national-team-claim';
|
|
37
|
+
export * from './wnl-squad';
|
|
38
|
+
export * from './wnl-callup';
|
|
39
|
+
export * from './wnl-season';
|
|
35
40
|
export * from './coach';
|
|
36
41
|
export * from './scout';
|
|
37
42
|
export * from './physician';
|
|
@@ -48,6 +48,11 @@ __exportStar(require("./promotion-match"), exports);
|
|
|
48
48
|
__exportStar(require("./friendly"), exports);
|
|
49
49
|
__exportStar(require("./region-qualifier"), exports);
|
|
50
50
|
__exportStar(require("./national-country"), exports);
|
|
51
|
+
__exportStar(require("./national-team"), exports);
|
|
52
|
+
__exportStar(require("./national-team-claim"), exports);
|
|
53
|
+
__exportStar(require("./wnl-squad"), exports);
|
|
54
|
+
__exportStar(require("./wnl-callup"), exports);
|
|
55
|
+
__exportStar(require("./wnl-season"), exports);
|
|
51
56
|
__exportStar(require("./coach"), exports);
|
|
52
57
|
__exportStar(require("./scout"), exports);
|
|
53
58
|
__exportStar(require("./physician"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as Sequelize from 'sequelize';
|
|
2
2
|
import { Model } from 'sequelize';
|
|
3
3
|
import { CompetitionId, CompetitionModel, TeamId, TeamModel } from '.';
|
|
4
|
-
export type JerseyBadgeKind = 'LEAGUE' | 'NATIONALS' | 'REGIONALS' | 'WCC';
|
|
4
|
+
export type JerseyBadgeKind = 'LEAGUE' | 'NATIONALS' | 'REGIONALS' | 'WCC' | 'WNL';
|
|
5
5
|
export interface JerseyBadgeAttributes {
|
|
6
6
|
competition_id: string;
|
|
7
7
|
team_id: string;
|
|
@@ -23,7 +23,7 @@ class JerseyBadgeModel extends sequelize_1.Model {
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
badge: {
|
|
26
|
-
type: sequelize_1.DataTypes.ENUM('LEAGUE', 'NATIONALS', 'REGIONALS', 'WCC'),
|
|
26
|
+
type: sequelize_1.DataTypes.ENUM('LEAGUE', 'NATIONALS', 'REGIONALS', 'WCC', 'WNL'),
|
|
27
27
|
allowNull: false
|
|
28
28
|
},
|
|
29
29
|
region: {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model, Optional } from 'sequelize';
|
|
3
|
+
export interface NationalTeamClaimAttributes {
|
|
4
|
+
country_id: string;
|
|
5
|
+
user_id: string;
|
|
6
|
+
claimed_at: Date;
|
|
7
|
+
revoke_at?: Date | null;
|
|
8
|
+
warned_step?: number | null;
|
|
9
|
+
}
|
|
10
|
+
export type NationalTeamClaimPk = 'country_id';
|
|
11
|
+
export type NationalTeamClaimId = NationalTeamClaimModel[NationalTeamClaimPk];
|
|
12
|
+
export type NationalTeamClaimOptionalAttributes = 'claimed_at' | 'revoke_at' | 'warned_step';
|
|
13
|
+
export type NationalTeamClaimCreationAttributes = Optional<NationalTeamClaimAttributes, NationalTeamClaimOptionalAttributes>;
|
|
14
|
+
export declare class NationalTeamClaimModel extends Model<NationalTeamClaimAttributes, NationalTeamClaimCreationAttributes> implements NationalTeamClaimAttributes {
|
|
15
|
+
country_id: string;
|
|
16
|
+
user_id: string;
|
|
17
|
+
claimed_at: Date;
|
|
18
|
+
revoke_at?: Date | null;
|
|
19
|
+
warned_step?: number | null;
|
|
20
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof NationalTeamClaimModel;
|
|
21
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NationalTeamClaimModel = void 0;
|
|
4
|
+
const sequelize_1 = require("sequelize");
|
|
5
|
+
class NationalTeamClaimModel extends sequelize_1.Model {
|
|
6
|
+
static initModel(sequelize) {
|
|
7
|
+
return NationalTeamClaimModel.init({
|
|
8
|
+
country_id: {
|
|
9
|
+
type: sequelize_1.DataTypes.UUID,
|
|
10
|
+
allowNull: false,
|
|
11
|
+
primaryKey: true,
|
|
12
|
+
references: { model: 'NationalTeam', key: 'country_id' }
|
|
13
|
+
},
|
|
14
|
+
user_id: {
|
|
15
|
+
type: sequelize_1.DataTypes.UUID,
|
|
16
|
+
allowNull: false,
|
|
17
|
+
references: { model: 'AuthUser', key: 'user_id' }
|
|
18
|
+
},
|
|
19
|
+
claimed_at: {
|
|
20
|
+
type: sequelize_1.DataTypes.DATE,
|
|
21
|
+
allowNull: false,
|
|
22
|
+
defaultValue: sequelize_1.DataTypes.NOW
|
|
23
|
+
},
|
|
24
|
+
revoke_at: {
|
|
25
|
+
type: sequelize_1.DataTypes.DATE,
|
|
26
|
+
allowNull: true
|
|
27
|
+
},
|
|
28
|
+
warned_step: {
|
|
29
|
+
type: sequelize_1.DataTypes.SMALLINT,
|
|
30
|
+
allowNull: true
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
sequelize,
|
|
34
|
+
tableName: 'NationalTeamClaim',
|
|
35
|
+
schema: 'public',
|
|
36
|
+
timestamps: false,
|
|
37
|
+
indexes: [
|
|
38
|
+
{ name: 'NationalTeamClaim_pk', unique: true, fields: [{ name: 'country_id' }] },
|
|
39
|
+
{ name: 'NationalTeamClaim_user_id_uq', unique: true, fields: [{ name: 'user_id' }] }
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.NationalTeamClaimModel = NationalTeamClaimModel;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model } from 'sequelize';
|
|
3
|
+
import { TeamAttributes } from '.';
|
|
4
|
+
export interface NationalTeamAttributes {
|
|
5
|
+
country_id: string;
|
|
6
|
+
team_id: string;
|
|
7
|
+
team?: TeamAttributes;
|
|
8
|
+
}
|
|
9
|
+
export type NationalTeamPk = 'country_id';
|
|
10
|
+
export type NationalTeamId = NationalTeamModel[NationalTeamPk];
|
|
11
|
+
export type NationalTeamCreationAttributes = NationalTeamAttributes;
|
|
12
|
+
export declare class NationalTeamModel extends Model<NationalTeamAttributes, NationalTeamCreationAttributes> implements NationalTeamAttributes {
|
|
13
|
+
country_id: string;
|
|
14
|
+
team_id: string;
|
|
15
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof NationalTeamModel;
|
|
16
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NationalTeamModel = void 0;
|
|
4
|
+
const sequelize_1 = require("sequelize");
|
|
5
|
+
class NationalTeamModel extends sequelize_1.Model {
|
|
6
|
+
static initModel(sequelize) {
|
|
7
|
+
return NationalTeamModel.init({
|
|
8
|
+
country_id: {
|
|
9
|
+
type: sequelize_1.DataTypes.UUID,
|
|
10
|
+
allowNull: false,
|
|
11
|
+
primaryKey: true,
|
|
12
|
+
references: { model: 'Country', key: 'country_id' }
|
|
13
|
+
},
|
|
14
|
+
team_id: {
|
|
15
|
+
type: sequelize_1.DataTypes.UUID,
|
|
16
|
+
allowNull: false,
|
|
17
|
+
references: { model: 'Team', key: 'team_id' }
|
|
18
|
+
}
|
|
19
|
+
}, {
|
|
20
|
+
sequelize,
|
|
21
|
+
tableName: 'NationalTeam',
|
|
22
|
+
schema: 'public',
|
|
23
|
+
timestamps: false,
|
|
24
|
+
indexes: [
|
|
25
|
+
{ name: 'NationalTeam_pk', unique: true, fields: [{ name: 'country_id' }] },
|
|
26
|
+
{ name: 'NationalTeam_team_id_uq', unique: true, fields: [{ name: 'team_id' }] }
|
|
27
|
+
]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.NationalTeamModel = NationalTeamModel;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model } from 'sequelize';
|
|
3
|
+
export type WnlCallupRole = 'SELECTION' | 'BACKUP';
|
|
4
|
+
export interface WnlCallupAttributes {
|
|
5
|
+
competition_id: string;
|
|
6
|
+
player_id: string;
|
|
7
|
+
country_id: string;
|
|
8
|
+
role: WnlCallupRole;
|
|
9
|
+
slot_order: number;
|
|
10
|
+
}
|
|
11
|
+
export type WnlCallupPk = 'competition_id' | 'player_id';
|
|
12
|
+
export type WnlCallupId = WnlCallupModel[WnlCallupPk];
|
|
13
|
+
export type WnlCallupCreationAttributes = WnlCallupAttributes;
|
|
14
|
+
export declare class WnlCallupModel extends Model<WnlCallupAttributes, WnlCallupCreationAttributes> implements WnlCallupAttributes {
|
|
15
|
+
competition_id: string;
|
|
16
|
+
player_id: string;
|
|
17
|
+
country_id: string;
|
|
18
|
+
role: WnlCallupRole;
|
|
19
|
+
slot_order: number;
|
|
20
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof WnlCallupModel;
|
|
21
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WnlCallupModel = void 0;
|
|
4
|
+
const sequelize_1 = require("sequelize");
|
|
5
|
+
class WnlCallupModel extends sequelize_1.Model {
|
|
6
|
+
static initModel(sequelize) {
|
|
7
|
+
return WnlCallupModel.init({
|
|
8
|
+
competition_id: {
|
|
9
|
+
type: sequelize_1.DataTypes.UUID,
|
|
10
|
+
allowNull: false,
|
|
11
|
+
primaryKey: true,
|
|
12
|
+
references: { model: 'Competition', key: 'competition_id' }
|
|
13
|
+
},
|
|
14
|
+
player_id: {
|
|
15
|
+
type: sequelize_1.DataTypes.UUID,
|
|
16
|
+
allowNull: false,
|
|
17
|
+
primaryKey: true,
|
|
18
|
+
references: { model: 'Player', key: 'player_id' }
|
|
19
|
+
},
|
|
20
|
+
country_id: {
|
|
21
|
+
type: sequelize_1.DataTypes.UUID,
|
|
22
|
+
allowNull: false,
|
|
23
|
+
references: { model: 'Country', key: 'country_id' }
|
|
24
|
+
},
|
|
25
|
+
role: {
|
|
26
|
+
type: sequelize_1.DataTypes.ENUM('SELECTION', 'BACKUP'),
|
|
27
|
+
allowNull: false
|
|
28
|
+
},
|
|
29
|
+
slot_order: {
|
|
30
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
31
|
+
allowNull: false
|
|
32
|
+
}
|
|
33
|
+
}, {
|
|
34
|
+
sequelize,
|
|
35
|
+
tableName: 'WnlCallup',
|
|
36
|
+
schema: 'public',
|
|
37
|
+
timestamps: false,
|
|
38
|
+
indexes: [
|
|
39
|
+
{ name: 'WnlCallup_pk', unique: true, fields: [{ name: 'competition_id' }, { name: 'player_id' }] },
|
|
40
|
+
{ name: 'WnlCallup_competition_country_idx', fields: [{ name: 'competition_id' }, { name: 'country_id' }] }
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.WnlCallupModel = WnlCallupModel;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model, Optional } from 'sequelize';
|
|
3
|
+
export interface WnlSeasonAttributes {
|
|
4
|
+
competition_id: string;
|
|
5
|
+
season_index: number;
|
|
6
|
+
finals_competition_id: string | null;
|
|
7
|
+
}
|
|
8
|
+
export type WnlSeasonPk = 'competition_id';
|
|
9
|
+
export type WnlSeasonId = WnlSeasonModel[WnlSeasonPk];
|
|
10
|
+
export type WnlSeasonOptionalAttributes = 'finals_competition_id';
|
|
11
|
+
export type WnlSeasonCreationAttributes = Optional<WnlSeasonAttributes, WnlSeasonOptionalAttributes>;
|
|
12
|
+
export declare class WnlSeasonModel extends Model<WnlSeasonAttributes, WnlSeasonCreationAttributes> implements WnlSeasonAttributes {
|
|
13
|
+
competition_id: string;
|
|
14
|
+
season_index: number;
|
|
15
|
+
finals_competition_id: string | null;
|
|
16
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof WnlSeasonModel;
|
|
17
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WnlSeasonModel = void 0;
|
|
4
|
+
const sequelize_1 = require("sequelize");
|
|
5
|
+
class WnlSeasonModel extends sequelize_1.Model {
|
|
6
|
+
static initModel(sequelize) {
|
|
7
|
+
return WnlSeasonModel.init({
|
|
8
|
+
competition_id: {
|
|
9
|
+
type: sequelize_1.DataTypes.UUID,
|
|
10
|
+
allowNull: false,
|
|
11
|
+
primaryKey: true,
|
|
12
|
+
references: { model: 'Competition', key: 'competition_id' }
|
|
13
|
+
},
|
|
14
|
+
season_index: {
|
|
15
|
+
type: sequelize_1.DataTypes.INTEGER,
|
|
16
|
+
allowNull: false
|
|
17
|
+
},
|
|
18
|
+
finals_competition_id: {
|
|
19
|
+
type: sequelize_1.DataTypes.UUID,
|
|
20
|
+
allowNull: true,
|
|
21
|
+
references: { model: 'Competition', key: 'competition_id' }
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
sequelize,
|
|
25
|
+
tableName: 'WnlSeason',
|
|
26
|
+
schema: 'public',
|
|
27
|
+
timestamps: false,
|
|
28
|
+
indexes: [
|
|
29
|
+
{ name: 'WnlSeason_pk', unique: true, fields: [{ name: 'competition_id' }] }
|
|
30
|
+
]
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.WnlSeasonModel = WnlSeasonModel;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as Sequelize from 'sequelize';
|
|
2
|
+
import { Model, Optional } from 'sequelize';
|
|
3
|
+
export interface WnlSquadAttributes {
|
|
4
|
+
competition_id: string;
|
|
5
|
+
country_id: string;
|
|
6
|
+
team_id: string;
|
|
7
|
+
manager_user_id: string | null;
|
|
8
|
+
manager_name: string | null;
|
|
9
|
+
auto: boolean;
|
|
10
|
+
finalized: boolean;
|
|
11
|
+
finalized_at: Date | null;
|
|
12
|
+
}
|
|
13
|
+
export type WnlSquadPk = 'competition_id' | 'country_id';
|
|
14
|
+
export type WnlSquadId = WnlSquadModel[WnlSquadPk];
|
|
15
|
+
export type WnlSquadOptionalAttributes = 'manager_user_id' | 'manager_name' | 'auto' | 'finalized' | 'finalized_at';
|
|
16
|
+
export type WnlSquadCreationAttributes = Optional<WnlSquadAttributes, WnlSquadOptionalAttributes>;
|
|
17
|
+
export declare class WnlSquadModel extends Model<WnlSquadAttributes, WnlSquadCreationAttributes> implements WnlSquadAttributes {
|
|
18
|
+
competition_id: string;
|
|
19
|
+
country_id: string;
|
|
20
|
+
team_id: string;
|
|
21
|
+
manager_user_id: string | null;
|
|
22
|
+
manager_name: string | null;
|
|
23
|
+
auto: boolean;
|
|
24
|
+
finalized: boolean;
|
|
25
|
+
finalized_at: Date | null;
|
|
26
|
+
static initModel(sequelize: Sequelize.Sequelize): typeof WnlSquadModel;
|
|
27
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WnlSquadModel = void 0;
|
|
4
|
+
const sequelize_1 = require("sequelize");
|
|
5
|
+
class WnlSquadModel extends sequelize_1.Model {
|
|
6
|
+
static initModel(sequelize) {
|
|
7
|
+
return WnlSquadModel.init({
|
|
8
|
+
competition_id: {
|
|
9
|
+
type: sequelize_1.DataTypes.UUID,
|
|
10
|
+
allowNull: false,
|
|
11
|
+
primaryKey: true,
|
|
12
|
+
references: { model: 'Competition', key: 'competition_id' }
|
|
13
|
+
},
|
|
14
|
+
country_id: {
|
|
15
|
+
type: sequelize_1.DataTypes.UUID,
|
|
16
|
+
allowNull: false,
|
|
17
|
+
primaryKey: true,
|
|
18
|
+
references: { model: 'Country', key: 'country_id' }
|
|
19
|
+
},
|
|
20
|
+
team_id: {
|
|
21
|
+
type: sequelize_1.DataTypes.UUID,
|
|
22
|
+
allowNull: false,
|
|
23
|
+
references: { model: 'Team', key: 'team_id' }
|
|
24
|
+
},
|
|
25
|
+
manager_user_id: {
|
|
26
|
+
type: sequelize_1.DataTypes.UUID,
|
|
27
|
+
allowNull: true,
|
|
28
|
+
references: { model: 'AuthUser', key: 'user_id' }
|
|
29
|
+
},
|
|
30
|
+
manager_name: {
|
|
31
|
+
type: sequelize_1.DataTypes.TEXT,
|
|
32
|
+
allowNull: true
|
|
33
|
+
},
|
|
34
|
+
auto: {
|
|
35
|
+
type: sequelize_1.DataTypes.BOOLEAN,
|
|
36
|
+
allowNull: false,
|
|
37
|
+
defaultValue: false
|
|
38
|
+
},
|
|
39
|
+
finalized: {
|
|
40
|
+
type: sequelize_1.DataTypes.BOOLEAN,
|
|
41
|
+
allowNull: false,
|
|
42
|
+
defaultValue: false
|
|
43
|
+
},
|
|
44
|
+
finalized_at: {
|
|
45
|
+
type: sequelize_1.DataTypes.DATE,
|
|
46
|
+
allowNull: true
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
sequelize,
|
|
50
|
+
tableName: 'WnlSquad',
|
|
51
|
+
schema: 'public',
|
|
52
|
+
timestamps: false,
|
|
53
|
+
indexes: [
|
|
54
|
+
{ name: 'WnlSquad_pk', unique: true, fields: [{ name: 'competition_id' }, { name: 'country_id' }] }
|
|
55
|
+
]
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.WnlSquadModel = WnlSquadModel;
|
|
@@ -13,10 +13,18 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
16
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.MatchGenerator = void 0;
|
|
17
21
|
__exportStar(require("./box-score"), exports);
|
|
18
22
|
__exportStar(require("./match"), exports);
|
|
19
23
|
__exportStar(require("./match-generator"), exports);
|
|
24
|
+
// The default export (the class itself) is not surfaced by `export *`; re-export it by name so consumers (e.g. the
|
|
25
|
+
// engine's WNL scheduler) can call MatchGenerator.generateMatches with custom spacing/start-hour options.
|
|
26
|
+
var match_generator_1 = require("./match-generator");
|
|
27
|
+
Object.defineProperty(exports, "MatchGenerator", { enumerable: true, get: function () { return __importDefault(match_generator_1).default; } });
|
|
20
28
|
__exportStar(require("./match-rating"), exports);
|
|
21
29
|
__exportStar(require("./match-set"), exports);
|
|
22
30
|
__exportStar(require("./rally"), exports);
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Team } from '../team';
|
|
2
2
|
import { Match } from './match';
|
|
3
|
+
export interface GenerateMatchesOptions {
|
|
4
|
+
spacingMinutes?: number;
|
|
5
|
+
startHourUTC?: number;
|
|
6
|
+
}
|
|
3
7
|
export default class MatchGenerator {
|
|
4
|
-
static generateMatches(teams: Team[], baseDate: Date): Match[];
|
|
8
|
+
static generateMatches(teams: Team[], baseDate: Date, options?: GenerateMatchesOptions): Match[];
|
|
5
9
|
}
|
|
@@ -16,12 +16,14 @@ dayjs_1.default.extend(utc_1.default);
|
|
|
16
16
|
const MATCH_SPACING_MINUTES = 30;
|
|
17
17
|
// eslint-disable-next-line @typescript-eslint/no-extraneous-class
|
|
18
18
|
class MatchGenerator {
|
|
19
|
-
static generateMatches(teams, baseDate) {
|
|
19
|
+
static generateMatches(teams, baseDate, options = {}) {
|
|
20
|
+
const spacingMinutes = options.spacingMinutes ?? MATCH_SPACING_MINUTES;
|
|
21
|
+
const startHourUTC = options.startHourUTC ?? 0;
|
|
20
22
|
const t = new Set(teams.map(x => x.id));
|
|
21
|
-
// Anchor the first match to 00
|
|
23
|
+
// Anchor the first match to `startHourUTC`:00 UTC of the iteration's start day (Monday), so rounds fall on the
|
|
22
24
|
// same wall-clock time everywhere regardless of the host timezone. startOf('day') in UTC avoids the
|
|
23
25
|
// local-timezone roll the old startOf('hour') was exposed to on a fractional-hour-offset host.
|
|
24
|
-
let date = dayjs_1.default.utc(baseDate).startOf('day');
|
|
26
|
+
let date = dayjs_1.default.utc(baseDate).startOf('day').add(startHourUTC, 'hour');
|
|
25
27
|
if (t.size !== teams.length) {
|
|
26
28
|
throw new Error('DUPLICATE_TEAMS');
|
|
27
29
|
}
|
|
@@ -30,7 +32,7 @@ class MatchGenerator {
|
|
|
30
32
|
}
|
|
31
33
|
const nextDate = () => {
|
|
32
34
|
const scheduledDate = date.toDate();
|
|
33
|
-
date = date.add(
|
|
35
|
+
date = date.add(spacingMinutes, 'minutes');
|
|
34
36
|
return scheduledDate;
|
|
35
37
|
};
|
|
36
38
|
// First leg: one pass of the round robin, matches laid out back to back in round order.
|
|
@@ -62,5 +62,47 @@
|
|
|
62
62
|
"regionRelocation": {
|
|
63
63
|
"title": "Your team is moving",
|
|
64
64
|
"body": "Your team has been chosen to be moved to the new region: Kyorin. Nothing has changed in terms of the team you manage, your players or anything else."
|
|
65
|
+
},
|
|
66
|
+
"wnlCallupOpen": {
|
|
67
|
+
"title": "National call-up open",
|
|
68
|
+
"body": "The national call-up phase has begun! You have until {{date}} to select your team to participate in the next edition of the WNL."
|
|
69
|
+
},
|
|
70
|
+
"wnlCallupDeadline": {
|
|
71
|
+
"title": "Call-up deadline today",
|
|
72
|
+
"body": "The national call-up deadline is today. Make sure you have selected the players that will participate in the next edition of the WNL."
|
|
73
|
+
},
|
|
74
|
+
"wnlCallupClosed": {
|
|
75
|
+
"title": "National call-up closed",
|
|
76
|
+
"body": "The national call-up phase has ended. You can edit your line-up to prepare for the WNL starting next Monday!"
|
|
77
|
+
},
|
|
78
|
+
"wnlLeagueStart": {
|
|
79
|
+
"title": "WNL league started",
|
|
80
|
+
"body": "The WNL League phase has started!"
|
|
81
|
+
},
|
|
82
|
+
"wnlFinalsStart": {
|
|
83
|
+
"title": "WNL finals started",
|
|
84
|
+
"body": "The WNL finals have started!"
|
|
85
|
+
},
|
|
86
|
+
"wnlChampion": {
|
|
87
|
+
"title": "WNL champions crowned",
|
|
88
|
+
"body": "The WNL edition has ended. {{team}} are the WNL champions!",
|
|
89
|
+
"bodyUnnamed": "The WNL edition has ended. The champions have been crowned!"
|
|
90
|
+
},
|
|
91
|
+
"wnlPlayerCalledUp": {
|
|
92
|
+
"title": "Players called up",
|
|
93
|
+
"body": "One or more of your players have been called-up to their national team!"
|
|
94
|
+
},
|
|
95
|
+
"nationalTrialGranted": {
|
|
96
|
+
"title": "National team unlocked",
|
|
97
|
+
"body": "You have free National access until {{date}}. Claim a national team and lead it in the World Nations League."
|
|
98
|
+
},
|
|
99
|
+
"nationalAccessExpiring": {
|
|
100
|
+
"title": "National team access ending",
|
|
101
|
+
"bodyDays": "Your national team will be released in {{days}} days unless you subscribe to the National tier on Patreon.",
|
|
102
|
+
"bodyLastDay": "Your national team will be released tomorrow unless you subscribe to the National tier on Patreon."
|
|
103
|
+
},
|
|
104
|
+
"nationalTeamRevoked": {
|
|
105
|
+
"title": "National team released",
|
|
106
|
+
"body": "Your national team has been released and is now available for someone else to claim. Subscribe to the National tier on Patreon to claim one again."
|
|
65
107
|
}
|
|
66
108
|
}
|
|
@@ -62,5 +62,47 @@
|
|
|
62
62
|
"regionRelocation": {
|
|
63
63
|
"title": "Tu equipo se traslada",
|
|
64
64
|
"body": "Tu equipo ha sido elegido para trasladarse a la nueva región: Kyorin. No cambia nada en cuanto al equipo que gestionas, tus jugadores ni nada más."
|
|
65
|
+
},
|
|
66
|
+
"wnlCallupOpen": {
|
|
67
|
+
"title": "Convocatoria nacional abierta",
|
|
68
|
+
"body": "¡La fase de convocatoria nacional ha comenzado! Tienes hasta el {{date}} para seleccionar tu equipo y participar en la próxima edición de la WNL."
|
|
69
|
+
},
|
|
70
|
+
"wnlCallupDeadline": {
|
|
71
|
+
"title": "La convocatoria cierra hoy",
|
|
72
|
+
"body": "El plazo de la convocatoria nacional termina hoy. Asegúrate de haber seleccionado a los jugadores que participarán en la próxima edición de la WNL."
|
|
73
|
+
},
|
|
74
|
+
"wnlCallupClosed": {
|
|
75
|
+
"title": "Convocatoria nacional cerrada",
|
|
76
|
+
"body": "La fase de convocatoria nacional ha terminado. ¡Puedes editar tu alineación para preparar la WNL que empieza el próximo lunes!"
|
|
77
|
+
},
|
|
78
|
+
"wnlLeagueStart": {
|
|
79
|
+
"title": "La liga WNL ha empezado",
|
|
80
|
+
"body": "¡La fase de liga de la WNL ha comenzado!"
|
|
81
|
+
},
|
|
82
|
+
"wnlFinalsStart": {
|
|
83
|
+
"title": "Las finales de la WNL han empezado",
|
|
84
|
+
"body": "¡Las finales de la WNL han comenzado!"
|
|
85
|
+
},
|
|
86
|
+
"wnlChampion": {
|
|
87
|
+
"title": "Campeones de la WNL",
|
|
88
|
+
"body": "La edición de la WNL ha terminado. ¡{{team}} son los campeones de la WNL!",
|
|
89
|
+
"bodyUnnamed": "La edición de la WNL ha terminado. ¡Ya hay campeones!"
|
|
90
|
+
},
|
|
91
|
+
"wnlPlayerCalledUp": {
|
|
92
|
+
"title": "Jugadores convocados",
|
|
93
|
+
"body": "¡Uno o más de tus jugadores han sido convocados por su selección nacional!"
|
|
94
|
+
},
|
|
95
|
+
"nationalTrialGranted": {
|
|
96
|
+
"title": "Selección nacional desbloqueada",
|
|
97
|
+
"body": "Tienes acceso National gratuito hasta el {{date}}. Reclama una selección nacional y dirígela en la WNL."
|
|
98
|
+
},
|
|
99
|
+
"nationalAccessExpiring": {
|
|
100
|
+
"title": "Tu acceso a la selección nacional termina",
|
|
101
|
+
"bodyDays": "Tu selección nacional quedará libre en {{days}} días a menos que te suscribas al nivel National en Patreon.",
|
|
102
|
+
"bodyLastDay": "Tu selección nacional quedará libre mañana a menos que te suscribas al nivel National en Patreon."
|
|
103
|
+
},
|
|
104
|
+
"nationalTeamRevoked": {
|
|
105
|
+
"title": "Selección nacional liberada",
|
|
106
|
+
"body": "Tu selección nacional ha quedado libre y ahora otra persona puede reclamarla. Suscríbete al nivel National en Patreon para volver a reclamar una."
|
|
65
107
|
}
|
|
66
108
|
}
|