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.
Files changed (75) hide show
  1. package/dist/cjs/src/api/index.d.ts +17 -1
  2. package/dist/cjs/src/data/init-models.js +14 -0
  3. package/dist/cjs/src/data/models/competition.d.ts +1 -1
  4. package/dist/cjs/src/data/models/competition.js +1 -1
  5. package/dist/cjs/src/data/models/index.d.ts +5 -0
  6. package/dist/cjs/src/data/models/index.js +5 -0
  7. package/dist/cjs/src/data/models/jersey-badge.d.ts +1 -1
  8. package/dist/cjs/src/data/models/jersey-badge.js +1 -1
  9. package/dist/cjs/src/data/models/national-team-claim.d.ts +21 -0
  10. package/dist/cjs/src/data/models/national-team-claim.js +44 -0
  11. package/dist/cjs/src/data/models/national-team.d.ts +16 -0
  12. package/dist/cjs/src/data/models/national-team.js +31 -0
  13. package/dist/cjs/src/data/models/wnl-callup.d.ts +21 -0
  14. package/dist/cjs/src/data/models/wnl-callup.js +45 -0
  15. package/dist/cjs/src/data/models/wnl-season.d.ts +17 -0
  16. package/dist/cjs/src/data/models/wnl-season.js +34 -0
  17. package/dist/cjs/src/data/models/wnl-squad.d.ts +27 -0
  18. package/dist/cjs/src/data/models/wnl-squad.js +59 -0
  19. package/dist/cjs/src/service/match/index.d.ts +1 -0
  20. package/dist/cjs/src/service/match/index.js +8 -0
  21. package/dist/cjs/src/service/match/match-generator.d.ts +5 -1
  22. package/dist/cjs/src/service/match/match-generator.js +6 -4
  23. package/dist/cjs/src/service/notification/catalog/en.json +42 -0
  24. package/dist/cjs/src/service/notification/catalog/es.json +42 -0
  25. package/dist/cjs/src/service/notification/catalog/fr.json +42 -0
  26. package/dist/cjs/src/service/notification/catalog/it.json +42 -0
  27. package/dist/cjs/src/service/notification/catalog/pl.json +42 -0
  28. package/dist/cjs/src/service/notification/catalog/pt-BR.json +42 -0
  29. package/dist/cjs/src/service/notification/catalog/tr.json +42 -0
  30. package/dist/cjs/src/service/notification/notification-type.d.ts +1 -1
  31. package/dist/cjs/src/service/notification/notification-type.js +11 -1
  32. package/dist/cjs/src/service/notification/notification.test.js +18 -0
  33. package/dist/cjs/src/service/notification/payloads.d.ts +13 -1
  34. package/dist/cjs/src/service/notification/registry.d.ts +6 -3
  35. package/dist/cjs/src/service/notification/registry.js +134 -20
  36. package/dist/cjs/src/service/premium/premium-tier.d.ts +2 -0
  37. package/dist/cjs/src/service/premium/premium-tier.js +8 -1
  38. package/dist/esm/src/api/index.d.ts +17 -1
  39. package/dist/esm/src/data/init-models.js +15 -1
  40. package/dist/esm/src/data/models/competition.d.ts +1 -1
  41. package/dist/esm/src/data/models/competition.js +1 -1
  42. package/dist/esm/src/data/models/index.d.ts +5 -0
  43. package/dist/esm/src/data/models/index.js +5 -0
  44. package/dist/esm/src/data/models/jersey-badge.d.ts +1 -1
  45. package/dist/esm/src/data/models/jersey-badge.js +1 -1
  46. package/dist/esm/src/data/models/national-team-claim.d.ts +21 -0
  47. package/dist/esm/src/data/models/national-team-claim.js +40 -0
  48. package/dist/esm/src/data/models/national-team.d.ts +16 -0
  49. package/dist/esm/src/data/models/national-team.js +27 -0
  50. package/dist/esm/src/data/models/wnl-callup.d.ts +21 -0
  51. package/dist/esm/src/data/models/wnl-callup.js +41 -0
  52. package/dist/esm/src/data/models/wnl-season.d.ts +17 -0
  53. package/dist/esm/src/data/models/wnl-season.js +30 -0
  54. package/dist/esm/src/data/models/wnl-squad.d.ts +27 -0
  55. package/dist/esm/src/data/models/wnl-squad.js +55 -0
  56. package/dist/esm/src/service/match/index.d.ts +1 -0
  57. package/dist/esm/src/service/match/index.js +3 -0
  58. package/dist/esm/src/service/match/match-generator.d.ts +5 -1
  59. package/dist/esm/src/service/match/match-generator.js +6 -4
  60. package/dist/esm/src/service/notification/catalog/en.json +42 -0
  61. package/dist/esm/src/service/notification/catalog/es.json +42 -0
  62. package/dist/esm/src/service/notification/catalog/fr.json +42 -0
  63. package/dist/esm/src/service/notification/catalog/it.json +42 -0
  64. package/dist/esm/src/service/notification/catalog/pl.json +42 -0
  65. package/dist/esm/src/service/notification/catalog/pt-BR.json +42 -0
  66. package/dist/esm/src/service/notification/catalog/tr.json +42 -0
  67. package/dist/esm/src/service/notification/notification-type.d.ts +1 -1
  68. package/dist/esm/src/service/notification/notification-type.js +11 -1
  69. package/dist/esm/src/service/notification/notification.test.js +19 -1
  70. package/dist/esm/src/service/notification/payloads.d.ts +13 -1
  71. package/dist/esm/src/service/notification/registry.d.ts +6 -3
  72. package/dist/esm/src/service/notification/registry.js +132 -20
  73. package/dist/esm/src/service/premium/premium-tier.d.ts +2 -0
  74. package/dist/esm/src/service/premium/premium-tier.js +6 -0
  75. 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
  };
@@ -1,4 +1,4 @@
1
- import { AuthIdentityModel, AuthSessionModel, AuthUserModel, BoxScoreModel, CoachModel, ScoutModel, PhysicianModel, PhysiotherapistModel, BoxScoreTotalsModel, CompetitionChampionModel, JerseyBadgeModel, CurrencyTransactionModel, GachaPityModel, GachaPullHistoryModel, WishlistModel, UserSettingsModel, UserAchievementsModel, UserDeviceTokenModel, BasePositionPresetModel, CompetitionMatchModel, CompetitionMVPModel, CompetitionModel, CompetitionStandingsMatchModel, CompetitionStandingsModel, CompetitionTeamsModel, CountryModel, DivisionModel, DivisionSeasonModel, IterationModel, LeagueModel, MatchModel, MatchRatingModel, MatchResultModel, MatchSetModel, PerformanceStatsModel, PlayerModel, PlayerImprovementLogModel, PlayerDeclineLogModel, PlayerTeamModel, RetiredPlayerModel, PromotionMatchModel, FriendlyModel, RegionQualifierModel, NationalCountryModel, RallyModel, MatchInputSnapshotModel, TacticsModel, TeamJerseyModel, LineupPresetModel, MatchPresetModel, EventModel, EventCompetitionModel, EventSquadModel, EventPackModel, EventPackPlayerModel, EventResultModel, EventBotTeamModel, TeamModel, TeamReplacementModel, UserCurrencyModel, UserPlayerProgressModel, UserPullGrantModel, PremiumGrantModel, UserTeamModel, VPERModel, NotificationModel, AppConfigModel, LegacyTeamFlagModel } from './models';
1
+ import { AuthIdentityModel, AuthSessionModel, AuthUserModel, BoxScoreModel, CoachModel, ScoutModel, PhysicianModel, PhysiotherapistModel, BoxScoreTotalsModel, CompetitionChampionModel, JerseyBadgeModel, CurrencyTransactionModel, GachaPityModel, GachaPullHistoryModel, WishlistModel, UserSettingsModel, UserAchievementsModel, UserDeviceTokenModel, BasePositionPresetModel, CompetitionMatchModel, CompetitionMVPModel, CompetitionModel, CompetitionStandingsMatchModel, CompetitionStandingsModel, CompetitionTeamsModel, CountryModel, DivisionModel, DivisionSeasonModel, IterationModel, LeagueModel, MatchModel, MatchRatingModel, MatchResultModel, MatchSetModel, PerformanceStatsModel, PlayerModel, PlayerImprovementLogModel, PlayerDeclineLogModel, PlayerTeamModel, RetiredPlayerModel, PromotionMatchModel, FriendlyModel, RegionQualifierModel, NationalCountryModel, NationalTeamModel, NationalTeamClaimModel, WnlSquadModel, WnlCallupModel, WnlSeasonModel, RallyModel, MatchInputSnapshotModel, TacticsModel, TeamJerseyModel, LineupPresetModel, MatchPresetModel, EventModel, EventCompetitionModel, EventSquadModel, EventPackModel, EventPackPlayerModel, EventResultModel, EventBotTeamModel, TeamModel, TeamReplacementModel, UserCurrencyModel, UserPlayerProgressModel, UserPullGrantModel, PremiumGrantModel, UserTeamModel, VPERModel, NotificationModel, AppConfigModel, LegacyTeamFlagModel } from './models';
2
2
  export function initModels(sequelize) {
3
3
  const Coach = CoachModel.initModel(sequelize);
4
4
  const Scout = ScoutModel.initModel(sequelize);
@@ -63,6 +63,11 @@ export function initModels(sequelize) {
63
63
  const Friendly = FriendlyModel.initModel(sequelize);
64
64
  const RegionQualifier = RegionQualifierModel.initModel(sequelize);
65
65
  const NationalCountry = NationalCountryModel.initModel(sequelize);
66
+ const NationalTeam = NationalTeamModel.initModel(sequelize);
67
+ const NationalTeamClaim = NationalTeamClaimModel.initModel(sequelize);
68
+ const WnlSquad = WnlSquadModel.initModel(sequelize);
69
+ const WnlCallup = WnlCallupModel.initModel(sequelize);
70
+ const WnlSeason = WnlSeasonModel.initModel(sequelize);
66
71
  const Team = TeamModel.initModel(sequelize);
67
72
  const TeamReplacement = TeamReplacementModel.initModel(sequelize);
68
73
  const LegacyTeamFlag = LegacyTeamFlagModel.initModel(sequelize);
@@ -228,6 +233,10 @@ export function initModels(sequelize) {
228
233
  Competition.hasOne(NationalCountry, { as: 'NationalCountry', foreignKey: 'competition_id' });
229
234
  Country.hasMany(NationalCountry, { as: 'NationalCountries', foreignKey: 'country_id' });
230
235
  Iteration.hasMany(NationalCountry, { as: 'NationalCountries', foreignKey: 'iteration' });
236
+ // National teams (WNL): NO associations on purpose. Every consumer of the five WNL tables (Sim scheduler,
237
+ // API /wnl routes) reads them with direct model queries or raw SQL joins; the alias wiring that once lived
238
+ // here was confirmed unused in all four repos and removed as dead code (review fleet 2026-08-28). Add an
239
+ // association back only together with the include that uses it.
231
240
  VPER.belongsTo(Player, { as: 'Player', foreignKey: 'player_id' });
232
241
  VPER.belongsTo(Match, { as: 'Match', foreignKey: 'match_id' });
233
242
  Team.hasOne(Coach, { as: 'Coach', foreignKey: 'team_id' });
@@ -351,6 +360,11 @@ export function initModels(sequelize) {
351
360
  Friendly,
352
361
  RegionQualifier,
353
362
  NationalCountry,
363
+ NationalTeam,
364
+ NationalTeamClaim,
365
+ WnlSquad,
366
+ WnlCallup,
367
+ WnlSeason,
354
368
  Rally,
355
369
  Team,
356
370
  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 {
@@ -18,7 +18,7 @@ export class CompetitionModel extends Model {
18
18
  }
19
19
  },
20
20
  type: {
21
- type: DataTypes.ENUM('LEAGUE', 'TOURNAMENT', 'QUALIFIER', 'NATIONAL', 'EVENT'),
21
+ type: DataTypes.ENUM('LEAGUE', 'TOURNAMENT', 'QUALIFIER', 'NATIONAL', 'EVENT', 'WNL', 'WNLF'),
22
22
  allowNull: false
23
23
  },
24
24
  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';
@@ -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';
@@ -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;
@@ -20,7 +20,7 @@ export class JerseyBadgeModel extends Model {
20
20
  }
21
21
  },
22
22
  badge: {
23
- type: DataTypes.ENUM('LEAGUE', 'NATIONALS', 'REGIONALS', 'WCC'),
23
+ type: DataTypes.ENUM('LEAGUE', 'NATIONALS', 'REGIONALS', 'WCC', 'WNL'),
24
24
  allowNull: false
25
25
  },
26
26
  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,40 @@
1
+ import { DataTypes, Model } from 'sequelize';
2
+ export class NationalTeamClaimModel extends Model {
3
+ static initModel(sequelize) {
4
+ return NationalTeamClaimModel.init({
5
+ country_id: {
6
+ type: DataTypes.UUID,
7
+ allowNull: false,
8
+ primaryKey: true,
9
+ references: { model: 'NationalTeam', key: 'country_id' }
10
+ },
11
+ user_id: {
12
+ type: DataTypes.UUID,
13
+ allowNull: false,
14
+ references: { model: 'AuthUser', key: 'user_id' }
15
+ },
16
+ claimed_at: {
17
+ type: DataTypes.DATE,
18
+ allowNull: false,
19
+ defaultValue: DataTypes.NOW
20
+ },
21
+ revoke_at: {
22
+ type: DataTypes.DATE,
23
+ allowNull: true
24
+ },
25
+ warned_step: {
26
+ type: DataTypes.SMALLINT,
27
+ allowNull: true
28
+ }
29
+ }, {
30
+ sequelize,
31
+ tableName: 'NationalTeamClaim',
32
+ schema: 'public',
33
+ timestamps: false,
34
+ indexes: [
35
+ { name: 'NationalTeamClaim_pk', unique: true, fields: [{ name: 'country_id' }] },
36
+ { name: 'NationalTeamClaim_user_id_uq', unique: true, fields: [{ name: 'user_id' }] }
37
+ ]
38
+ });
39
+ }
40
+ }
@@ -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,27 @@
1
+ import { DataTypes, Model } from 'sequelize';
2
+ export class NationalTeamModel extends Model {
3
+ static initModel(sequelize) {
4
+ return NationalTeamModel.init({
5
+ country_id: {
6
+ type: DataTypes.UUID,
7
+ allowNull: false,
8
+ primaryKey: true,
9
+ references: { model: 'Country', key: 'country_id' }
10
+ },
11
+ team_id: {
12
+ type: DataTypes.UUID,
13
+ allowNull: false,
14
+ references: { model: 'Team', key: 'team_id' }
15
+ }
16
+ }, {
17
+ sequelize,
18
+ tableName: 'NationalTeam',
19
+ schema: 'public',
20
+ timestamps: false,
21
+ indexes: [
22
+ { name: 'NationalTeam_pk', unique: true, fields: [{ name: 'country_id' }] },
23
+ { name: 'NationalTeam_team_id_uq', unique: true, fields: [{ name: 'team_id' }] }
24
+ ]
25
+ });
26
+ }
27
+ }
@@ -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,41 @@
1
+ import { DataTypes, Model } from 'sequelize';
2
+ export class WnlCallupModel extends Model {
3
+ static initModel(sequelize) {
4
+ return WnlCallupModel.init({
5
+ competition_id: {
6
+ type: DataTypes.UUID,
7
+ allowNull: false,
8
+ primaryKey: true,
9
+ references: { model: 'Competition', key: 'competition_id' }
10
+ },
11
+ player_id: {
12
+ type: DataTypes.UUID,
13
+ allowNull: false,
14
+ primaryKey: true,
15
+ references: { model: 'Player', key: 'player_id' }
16
+ },
17
+ country_id: {
18
+ type: DataTypes.UUID,
19
+ allowNull: false,
20
+ references: { model: 'Country', key: 'country_id' }
21
+ },
22
+ role: {
23
+ type: DataTypes.ENUM('SELECTION', 'BACKUP'),
24
+ allowNull: false
25
+ },
26
+ slot_order: {
27
+ type: DataTypes.INTEGER,
28
+ allowNull: false
29
+ }
30
+ }, {
31
+ sequelize,
32
+ tableName: 'WnlCallup',
33
+ schema: 'public',
34
+ timestamps: false,
35
+ indexes: [
36
+ { name: 'WnlCallup_pk', unique: true, fields: [{ name: 'competition_id' }, { name: 'player_id' }] },
37
+ { name: 'WnlCallup_competition_country_idx', fields: [{ name: 'competition_id' }, { name: 'country_id' }] }
38
+ ]
39
+ });
40
+ }
41
+ }
@@ -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,30 @@
1
+ import { DataTypes, Model } from 'sequelize';
2
+ export class WnlSeasonModel extends Model {
3
+ static initModel(sequelize) {
4
+ return WnlSeasonModel.init({
5
+ competition_id: {
6
+ type: DataTypes.UUID,
7
+ allowNull: false,
8
+ primaryKey: true,
9
+ references: { model: 'Competition', key: 'competition_id' }
10
+ },
11
+ season_index: {
12
+ type: DataTypes.INTEGER,
13
+ allowNull: false
14
+ },
15
+ finals_competition_id: {
16
+ type: DataTypes.UUID,
17
+ allowNull: true,
18
+ references: { model: 'Competition', key: 'competition_id' }
19
+ }
20
+ }, {
21
+ sequelize,
22
+ tableName: 'WnlSeason',
23
+ schema: 'public',
24
+ timestamps: false,
25
+ indexes: [
26
+ { name: 'WnlSeason_pk', unique: true, fields: [{ name: 'competition_id' }] }
27
+ ]
28
+ });
29
+ }
30
+ }
@@ -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,55 @@
1
+ import { DataTypes, Model } from 'sequelize';
2
+ export class WnlSquadModel extends Model {
3
+ static initModel(sequelize) {
4
+ return WnlSquadModel.init({
5
+ competition_id: {
6
+ type: DataTypes.UUID,
7
+ allowNull: false,
8
+ primaryKey: true,
9
+ references: { model: 'Competition', key: 'competition_id' }
10
+ },
11
+ country_id: {
12
+ type: DataTypes.UUID,
13
+ allowNull: false,
14
+ primaryKey: true,
15
+ references: { model: 'Country', key: 'country_id' }
16
+ },
17
+ team_id: {
18
+ type: DataTypes.UUID,
19
+ allowNull: false,
20
+ references: { model: 'Team', key: 'team_id' }
21
+ },
22
+ manager_user_id: {
23
+ type: DataTypes.UUID,
24
+ allowNull: true,
25
+ references: { model: 'AuthUser', key: 'user_id' }
26
+ },
27
+ manager_name: {
28
+ type: DataTypes.TEXT,
29
+ allowNull: true
30
+ },
31
+ auto: {
32
+ type: DataTypes.BOOLEAN,
33
+ allowNull: false,
34
+ defaultValue: false
35
+ },
36
+ finalized: {
37
+ type: DataTypes.BOOLEAN,
38
+ allowNull: false,
39
+ defaultValue: false
40
+ },
41
+ finalized_at: {
42
+ type: DataTypes.DATE,
43
+ allowNull: true
44
+ }
45
+ }, {
46
+ sequelize,
47
+ tableName: 'WnlSquad',
48
+ schema: 'public',
49
+ timestamps: false,
50
+ indexes: [
51
+ { name: 'WnlSquad_pk', unique: true, fields: [{ name: 'competition_id' }, { name: 'country_id' }] }
52
+ ]
53
+ });
54
+ }
55
+ }
@@ -1,6 +1,7 @@
1
1
  export * from './box-score';
2
2
  export * from './match';
3
3
  export * from './match-generator';
4
+ export { default as MatchGenerator } from './match-generator';
4
5
  export * from './match-rating';
5
6
  export * from './match-set';
6
7
  export * from './rally';
@@ -1,6 +1,9 @@
1
1
  export * from './box-score';
2
2
  export * from './match';
3
3
  export * from './match-generator';
4
+ // The default export (the class itself) is not surfaced by `export *`; re-export it by name so consumers (e.g. the
5
+ // engine's WNL scheduler) can call MatchGenerator.generateMatches with custom spacing/start-hour options.
6
+ export { default as MatchGenerator } from './match-generator';
4
7
  export * from './match-rating';
5
8
  export * from './match-set';
6
9
  export * from './rally';
@@ -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
  }
@@ -11,12 +11,14 @@ dayjs.extend(utc);
11
11
  const MATCH_SPACING_MINUTES = 30;
12
12
  // eslint-disable-next-line @typescript-eslint/no-extraneous-class
13
13
  export default class MatchGenerator {
14
- static generateMatches(teams, baseDate) {
14
+ static generateMatches(teams, baseDate, options = {}) {
15
+ const spacingMinutes = options.spacingMinutes ?? MATCH_SPACING_MINUTES;
16
+ const startHourUTC = options.startHourUTC ?? 0;
15
17
  const t = new Set(teams.map(x => x.id));
16
- // Anchor the first match to 00:00 UTC of the iteration's start day (Monday), so league rounds fall on the
18
+ // Anchor the first match to `startHourUTC`:00 UTC of the iteration's start day (Monday), so rounds fall on the
17
19
  // same wall-clock time everywhere regardless of the host timezone. startOf('day') in UTC avoids the
18
20
  // local-timezone roll the old startOf('hour') was exposed to on a fractional-hour-offset host.
19
- let date = dayjs.utc(baseDate).startOf('day');
21
+ let date = dayjs.utc(baseDate).startOf('day').add(startHourUTC, 'hour');
20
22
  if (t.size !== teams.length) {
21
23
  throw new Error('DUPLICATE_TEAMS');
22
24
  }
@@ -25,7 +27,7 @@ export default class MatchGenerator {
25
27
  }
26
28
  const nextDate = () => {
27
29
  const scheduledDate = date.toDate();
28
- date = date.add(MATCH_SPACING_MINUTES, 'minutes');
30
+ date = date.add(spacingMinutes, 'minutes');
29
31
  return scheduledDate;
30
32
  };
31
33
  // 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
  }