volleyballsimtypes 0.0.523 → 0.0.525

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 (79) hide show
  1. package/dist/cjs/src/api/index.d.ts +16 -0
  2. package/dist/cjs/src/data/init-models.js +35 -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 +6 -0
  6. package/dist/cjs/src/data/models/index.js +6 -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/match-input-snapshot.d.ts +19 -0
  10. package/dist/cjs/src/data/models/match-input-snapshot.js +34 -0
  11. package/dist/cjs/src/data/models/national-team-claim.d.ts +21 -0
  12. package/dist/cjs/src/data/models/national-team-claim.js +36 -0
  13. package/dist/cjs/src/data/models/national-team.d.ts +22 -0
  14. package/dist/cjs/src/data/models/national-team.js +31 -0
  15. package/dist/cjs/src/data/models/wnl-callup.d.ts +31 -0
  16. package/dist/cjs/src/data/models/wnl-callup.js +45 -0
  17. package/dist/cjs/src/data/models/wnl-season.d.ts +24 -0
  18. package/dist/cjs/src/data/models/wnl-season.js +34 -0
  19. package/dist/cjs/src/data/models/wnl-squad.d.ts +40 -0
  20. package/dist/cjs/src/data/models/wnl-squad.js +59 -0
  21. package/dist/cjs/src/service/match/index.d.ts +1 -0
  22. package/dist/cjs/src/service/match/index.js +8 -0
  23. package/dist/cjs/src/service/match/match-generator.d.ts +5 -1
  24. package/dist/cjs/src/service/match/match-generator.js +6 -4
  25. package/dist/cjs/src/service/notification/catalog/en.json +29 -0
  26. package/dist/cjs/src/service/notification/catalog/es.json +29 -0
  27. package/dist/cjs/src/service/notification/catalog/fr.json +29 -0
  28. package/dist/cjs/src/service/notification/catalog/it.json +29 -0
  29. package/dist/cjs/src/service/notification/catalog/pl.json +29 -0
  30. package/dist/cjs/src/service/notification/catalog/pt-BR.json +29 -0
  31. package/dist/cjs/src/service/notification/catalog/tr.json +29 -0
  32. package/dist/cjs/src/service/notification/notification-type.d.ts +1 -1
  33. package/dist/cjs/src/service/notification/notification-type.js +8 -1
  34. package/dist/cjs/src/service/notification/notification.test.js +18 -0
  35. package/dist/cjs/src/service/notification/payloads.d.ts +7 -1
  36. package/dist/cjs/src/service/notification/registry.d.ts +5 -1
  37. package/dist/cjs/src/service/notification/registry.js +90 -3
  38. package/dist/cjs/src/service/premium/premium-tier.d.ts +2 -0
  39. package/dist/cjs/src/service/premium/premium-tier.js +8 -1
  40. package/dist/esm/src/api/index.d.ts +16 -0
  41. package/dist/esm/src/data/init-models.js +36 -1
  42. package/dist/esm/src/data/models/competition.d.ts +1 -1
  43. package/dist/esm/src/data/models/competition.js +1 -1
  44. package/dist/esm/src/data/models/index.d.ts +6 -0
  45. package/dist/esm/src/data/models/index.js +6 -0
  46. package/dist/esm/src/data/models/jersey-badge.d.ts +1 -1
  47. package/dist/esm/src/data/models/jersey-badge.js +1 -1
  48. package/dist/esm/src/data/models/match-input-snapshot.d.ts +19 -0
  49. package/dist/esm/src/data/models/match-input-snapshot.js +30 -0
  50. package/dist/esm/src/data/models/national-team-claim.d.ts +21 -0
  51. package/dist/esm/src/data/models/national-team-claim.js +32 -0
  52. package/dist/esm/src/data/models/national-team.d.ts +22 -0
  53. package/dist/esm/src/data/models/national-team.js +27 -0
  54. package/dist/esm/src/data/models/wnl-callup.d.ts +31 -0
  55. package/dist/esm/src/data/models/wnl-callup.js +41 -0
  56. package/dist/esm/src/data/models/wnl-season.d.ts +24 -0
  57. package/dist/esm/src/data/models/wnl-season.js +30 -0
  58. package/dist/esm/src/data/models/wnl-squad.d.ts +40 -0
  59. package/dist/esm/src/data/models/wnl-squad.js +55 -0
  60. package/dist/esm/src/service/match/index.d.ts +1 -0
  61. package/dist/esm/src/service/match/index.js +3 -0
  62. package/dist/esm/src/service/match/match-generator.d.ts +5 -1
  63. package/dist/esm/src/service/match/match-generator.js +6 -4
  64. package/dist/esm/src/service/notification/catalog/en.json +29 -0
  65. package/dist/esm/src/service/notification/catalog/es.json +29 -0
  66. package/dist/esm/src/service/notification/catalog/fr.json +29 -0
  67. package/dist/esm/src/service/notification/catalog/it.json +29 -0
  68. package/dist/esm/src/service/notification/catalog/pl.json +29 -0
  69. package/dist/esm/src/service/notification/catalog/pt-BR.json +29 -0
  70. package/dist/esm/src/service/notification/catalog/tr.json +29 -0
  71. package/dist/esm/src/service/notification/notification-type.d.ts +1 -1
  72. package/dist/esm/src/service/notification/notification-type.js +8 -1
  73. package/dist/esm/src/service/notification/notification.test.js +19 -1
  74. package/dist/esm/src/service/notification/payloads.d.ts +7 -1
  75. package/dist/esm/src/service/notification/registry.d.ts +5 -1
  76. package/dist/esm/src/service/notification/registry.js +88 -3
  77. package/dist/esm/src/service/premium/premium-tier.d.ts +2 -0
  78. package/dist/esm/src/service/premium/premium-tier.js +6 -0
  79. package/package.json +1 -1
@@ -27,10 +27,16 @@ export * from './player-decline-log';
27
27
  export * from './player-team';
28
28
  export * from './retired-player';
29
29
  export * from './rally';
30
+ export * from './match-input-snapshot';
30
31
  export * from './promotion-match';
31
32
  export * from './friendly';
32
33
  export * from './region-qualifier';
33
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';
34
40
  export * from './coach';
35
41
  export * from './scout';
36
42
  export * from './physician';
@@ -27,10 +27,16 @@ export * from './player-decline-log';
27
27
  export * from './player-team';
28
28
  export * from './retired-player';
29
29
  export * from './rally';
30
+ export * from './match-input-snapshot';
30
31
  export * from './promotion-match';
31
32
  export * from './friendly';
32
33
  export * from './region-qualifier';
33
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';
34
40
  export * from './coach';
35
41
  export * from './scout';
36
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,19 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model } from 'sequelize';
3
+ import { MatchId, MatchModel } from '.';
4
+ export interface MatchInputSnapshotAttributes {
5
+ match_id: string;
6
+ snapshot: object;
7
+ }
8
+ export type MatchInputSnapshotPk = 'match_id';
9
+ export type MatchInputSnapshotId = MatchInputSnapshotModel[MatchInputSnapshotPk];
10
+ export type MatchInputSnapshotCreationAttributes = MatchInputSnapshotAttributes;
11
+ export declare class MatchInputSnapshotModel extends Model<MatchInputSnapshotAttributes, MatchInputSnapshotCreationAttributes> implements MatchInputSnapshotAttributes {
12
+ match_id: string;
13
+ snapshot: object;
14
+ Match: MatchModel;
15
+ getMatch: Sequelize.BelongsToGetAssociationMixin<MatchModel>;
16
+ setMatch: Sequelize.BelongsToSetAssociationMixin<MatchModel, MatchId>;
17
+ createMatch: Sequelize.BelongsToCreateAssociationMixin<MatchModel>;
18
+ static initModel(sequelize: Sequelize.Sequelize): typeof MatchInputSnapshotModel;
19
+ }
@@ -0,0 +1,30 @@
1
+ import { DataTypes, Model } from 'sequelize';
2
+ export class MatchInputSnapshotModel extends Model {
3
+ static initModel(sequelize) {
4
+ return MatchInputSnapshotModel.init({
5
+ match_id: {
6
+ type: DataTypes.UUID,
7
+ allowNull: false,
8
+ primaryKey: true,
9
+ references: {
10
+ model: 'Match',
11
+ key: 'match_id'
12
+ }
13
+ },
14
+ snapshot: {
15
+ type: DataTypes.JSONB,
16
+ allowNull: false
17
+ }
18
+ }, {
19
+ sequelize,
20
+ tableName: 'MatchInputSnapshot',
21
+ schema: 'public',
22
+ timestamps: false,
23
+ indexes: [{
24
+ name: 'MatchInputSnapshot_pk',
25
+ unique: true,
26
+ fields: [{ name: 'match_id' }]
27
+ }]
28
+ });
29
+ }
30
+ }
@@ -0,0 +1,21 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model, Optional } from 'sequelize';
3
+ import { AuthUserId, AuthUserModel } from '.';
4
+ export interface NationalTeamClaimAttributes {
5
+ country_id: string;
6
+ user_id: string;
7
+ claimed_at: Date;
8
+ }
9
+ export type NationalTeamClaimPk = 'country_id';
10
+ export type NationalTeamClaimId = NationalTeamClaimModel[NationalTeamClaimPk];
11
+ export type NationalTeamClaimOptionalAttributes = 'claimed_at';
12
+ export type NationalTeamClaimCreationAttributes = Optional<NationalTeamClaimAttributes, NationalTeamClaimOptionalAttributes>;
13
+ export declare class NationalTeamClaimModel extends Model<NationalTeamClaimAttributes, NationalTeamClaimCreationAttributes> implements NationalTeamClaimAttributes {
14
+ country_id: string;
15
+ user_id: string;
16
+ claimed_at: Date;
17
+ user: AuthUserModel;
18
+ getUser: Sequelize.BelongsToGetAssociationMixin<AuthUserModel>;
19
+ setUser: Sequelize.BelongsToSetAssociationMixin<AuthUserModel, AuthUserId>;
20
+ static initModel(sequelize: Sequelize.Sequelize): typeof NationalTeamClaimModel;
21
+ }
@@ -0,0 +1,32 @@
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
+ }, {
22
+ sequelize,
23
+ tableName: 'NationalTeamClaim',
24
+ schema: 'public',
25
+ timestamps: false,
26
+ indexes: [
27
+ { name: 'NationalTeamClaim_pk', unique: true, fields: [{ name: 'country_id' }] },
28
+ { name: 'NationalTeamClaim_user_id_uq', unique: true, fields: [{ name: 'user_id' }] }
29
+ ]
30
+ });
31
+ }
32
+ }
@@ -0,0 +1,22 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model } from 'sequelize';
3
+ import { CountryId, CountryModel, TeamAttributes, TeamId, TeamModel } 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
+ country: CountryModel;
16
+ getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
17
+ setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
18
+ team: TeamModel;
19
+ getTeam: Sequelize.BelongsToGetAssociationMixin<TeamModel>;
20
+ setTeam: Sequelize.BelongsToSetAssociationMixin<TeamModel, TeamId>;
21
+ static initModel(sequelize: Sequelize.Sequelize): typeof NationalTeamModel;
22
+ }
@@ -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,31 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model } from 'sequelize';
3
+ import { CompetitionId, CompetitionModel, CountryId, CountryModel, PlayerId, PlayerModel } from '.';
4
+ export type WnlCallupRole = 'SELECTION' | 'BACKUP';
5
+ export interface WnlCallupAttributes {
6
+ competition_id: string;
7
+ player_id: string;
8
+ country_id: string;
9
+ role: WnlCallupRole;
10
+ slot_order: number;
11
+ }
12
+ export type WnlCallupPk = 'competition_id' | 'player_id';
13
+ export type WnlCallupId = WnlCallupModel[WnlCallupPk];
14
+ export type WnlCallupCreationAttributes = WnlCallupAttributes;
15
+ export declare class WnlCallupModel extends Model<WnlCallupAttributes, WnlCallupCreationAttributes> implements WnlCallupAttributes {
16
+ competition_id: string;
17
+ player_id: string;
18
+ country_id: string;
19
+ role: WnlCallupRole;
20
+ slot_order: number;
21
+ competition: CompetitionModel;
22
+ getCompetition: Sequelize.BelongsToGetAssociationMixin<CompetitionModel>;
23
+ setCompetition: Sequelize.BelongsToSetAssociationMixin<CompetitionModel, CompetitionId>;
24
+ player: PlayerModel;
25
+ getPlayer: Sequelize.BelongsToGetAssociationMixin<PlayerModel>;
26
+ setPlayer: Sequelize.BelongsToSetAssociationMixin<PlayerModel, PlayerId>;
27
+ country: CountryModel;
28
+ getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
29
+ setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
30
+ static initModel(sequelize: Sequelize.Sequelize): typeof WnlCallupModel;
31
+ }
@@ -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,24 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model, Optional } from 'sequelize';
3
+ import { CompetitionId, CompetitionModel } from '.';
4
+ export interface WnlSeasonAttributes {
5
+ competition_id: string;
6
+ season_index: number;
7
+ finals_competition_id: string | null;
8
+ }
9
+ export type WnlSeasonPk = 'competition_id';
10
+ export type WnlSeasonId = WnlSeasonModel[WnlSeasonPk];
11
+ export type WnlSeasonOptionalAttributes = 'finals_competition_id';
12
+ export type WnlSeasonCreationAttributes = Optional<WnlSeasonAttributes, WnlSeasonOptionalAttributes>;
13
+ export declare class WnlSeasonModel extends Model<WnlSeasonAttributes, WnlSeasonCreationAttributes> implements WnlSeasonAttributes {
14
+ competition_id: string;
15
+ season_index: number;
16
+ finals_competition_id: string | null;
17
+ competition: CompetitionModel;
18
+ getCompetition: Sequelize.BelongsToGetAssociationMixin<CompetitionModel>;
19
+ setCompetition: Sequelize.BelongsToSetAssociationMixin<CompetitionModel, CompetitionId>;
20
+ finalsCompetition: CompetitionModel;
21
+ getFinalsCompetition: Sequelize.BelongsToGetAssociationMixin<CompetitionModel>;
22
+ setFinalsCompetition: Sequelize.BelongsToSetAssociationMixin<CompetitionModel, CompetitionId>;
23
+ static initModel(sequelize: Sequelize.Sequelize): typeof WnlSeasonModel;
24
+ }
@@ -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,40 @@
1
+ import * as Sequelize from 'sequelize';
2
+ import { Model, Optional } from 'sequelize';
3
+ import { AuthUserId, AuthUserModel, CompetitionId, CompetitionModel, CountryId, CountryModel, TeamId, TeamModel } from '.';
4
+ export interface WnlSquadAttributes {
5
+ competition_id: string;
6
+ country_id: string;
7
+ team_id: string;
8
+ manager_user_id: string | null;
9
+ manager_name: string | null;
10
+ auto: boolean;
11
+ finalized: boolean;
12
+ finalized_at: Date | null;
13
+ }
14
+ export type WnlSquadPk = 'competition_id' | 'country_id';
15
+ export type WnlSquadId = WnlSquadModel[WnlSquadPk];
16
+ export type WnlSquadOptionalAttributes = 'manager_user_id' | 'manager_name' | 'auto' | 'finalized' | 'finalized_at';
17
+ export type WnlSquadCreationAttributes = Optional<WnlSquadAttributes, WnlSquadOptionalAttributes>;
18
+ export declare class WnlSquadModel extends Model<WnlSquadAttributes, WnlSquadCreationAttributes> implements WnlSquadAttributes {
19
+ competition_id: string;
20
+ country_id: string;
21
+ team_id: string;
22
+ manager_user_id: string | null;
23
+ manager_name: string | null;
24
+ auto: boolean;
25
+ finalized: boolean;
26
+ finalized_at: Date | null;
27
+ competition: CompetitionModel;
28
+ getCompetition: Sequelize.BelongsToGetAssociationMixin<CompetitionModel>;
29
+ setCompetition: Sequelize.BelongsToSetAssociationMixin<CompetitionModel, CompetitionId>;
30
+ country: CountryModel;
31
+ getCountry: Sequelize.BelongsToGetAssociationMixin<CountryModel>;
32
+ setCountry: Sequelize.BelongsToSetAssociationMixin<CountryModel, CountryId>;
33
+ team: TeamModel;
34
+ getTeam: Sequelize.BelongsToGetAssociationMixin<TeamModel>;
35
+ setTeam: Sequelize.BelongsToSetAssociationMixin<TeamModel, TeamId>;
36
+ manager: AuthUserModel;
37
+ getManager: Sequelize.BelongsToGetAssociationMixin<AuthUserModel>;
38
+ setManager: Sequelize.BelongsToSetAssociationMixin<AuthUserModel, AuthUserId>;
39
+ static initModel(sequelize: Sequelize.Sequelize): typeof WnlSquadModel;
40
+ }
@@ -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,34 @@
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!"
65
94
  }
66
95
  }
@@ -62,5 +62,34 @@
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!"
65
94
  }
66
95
  }
@@ -62,5 +62,34 @@
62
62
  "regionRelocation": {
63
63
  "title": "Votre équipe déménage",
64
64
  "body": "Votre équipe a été choisie pour être transférée vers la nouvelle région : Kyorin. Rien ne change concernant l'équipe que vous gérez, vos joueurs ni quoi que ce soit d'autre."
65
+ },
66
+ "wnlCallupOpen": {
67
+ "title": "Convocation nationale ouverte",
68
+ "body": "La phase de convocation nationale a commencé ! Vous avez jusqu'au {{date}} pour sélectionner votre équipe et participer à la prochaine édition de la WNL."
69
+ },
70
+ "wnlCallupDeadline": {
71
+ "title": "La convocation se termine aujourd'hui",
72
+ "body": "La date limite de la convocation nationale est aujourd'hui. Assurez-vous d'avoir sélectionné les joueurs qui participeront à la prochaine édition de la WNL."
73
+ },
74
+ "wnlCallupClosed": {
75
+ "title": "Convocation nationale terminée",
76
+ "body": "La phase de convocation nationale est terminée. Vous pouvez modifier votre composition pour préparer la WNL qui commence lundi prochain !"
77
+ },
78
+ "wnlLeagueStart": {
79
+ "title": "La ligue WNL a commencé",
80
+ "body": "La phase de ligue de la WNL a commencé !"
81
+ },
82
+ "wnlFinalsStart": {
83
+ "title": "Les finales de la WNL ont commencé",
84
+ "body": "Les finales de la WNL ont commencé !"
85
+ },
86
+ "wnlChampion": {
87
+ "title": "Champions de la WNL",
88
+ "body": "L'édition de la WNL est terminée. {{team}} sont les champions de la WNL !",
89
+ "bodyUnnamed": "L'édition de la WNL est terminée. Les champions sont couronnés !"
90
+ },
91
+ "wnlPlayerCalledUp": {
92
+ "title": "Joueurs convoqués",
93
+ "body": "Un ou plusieurs de vos joueurs ont été convoqués par leur équipe nationale !"
65
94
  }
66
95
  }
@@ -62,5 +62,34 @@
62
62
  "regionRelocation": {
63
63
  "title": "La tua squadra si trasferisce",
64
64
  "body": "La tua squadra è stata scelta per essere spostata nella nuova regione: Kyorin. Non cambia nulla riguardo alla squadra che gestisci, ai tuoi giocatori o a qualsiasi altra cosa."
65
+ },
66
+ "wnlCallupOpen": {
67
+ "title": "Convocazione nazionale aperta",
68
+ "body": "La fase di convocazione nazionale è iniziata! Hai tempo fino al {{date}} per selezionare la tua squadra e partecipare alla prossima edizione della WNL."
69
+ },
70
+ "wnlCallupDeadline": {
71
+ "title": "La convocazione scade oggi",
72
+ "body": "Il termine della convocazione nazionale è oggi. Assicurati di aver selezionato i giocatori che parteciperanno alla prossima edizione della WNL."
73
+ },
74
+ "wnlCallupClosed": {
75
+ "title": "Convocazione nazionale chiusa",
76
+ "body": "La fase di convocazione nazionale è terminata. Puoi modificare la tua formazione per preparare la WNL che inizia lunedì prossimo!"
77
+ },
78
+ "wnlLeagueStart": {
79
+ "title": "La lega WNL è iniziata",
80
+ "body": "La fase di lega della WNL è iniziata!"
81
+ },
82
+ "wnlFinalsStart": {
83
+ "title": "Le finali della WNL sono iniziate",
84
+ "body": "Le finali della WNL sono iniziate!"
85
+ },
86
+ "wnlChampion": {
87
+ "title": "Campioni della WNL",
88
+ "body": "L'edizione della WNL è terminata. {{team}} sono i campioni della WNL!",
89
+ "bodyUnnamed": "L'edizione della WNL è terminata. I campioni sono stati incoronati!"
90
+ },
91
+ "wnlPlayerCalledUp": {
92
+ "title": "Giocatori convocati",
93
+ "body": "Uno o più dei tuoi giocatori sono stati convocati dalla loro nazionale!"
65
94
  }
66
95
  }