@gamelobby/common 1.0.377 → 1.0.379

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,5 @@
1
- export declare type TournamentType = 'single' | 'double' | 'swiss' | 'roundRobin';
1
+ import { TiebreakerConfig } from './groupStage.interface';
2
+ export declare type TournamentType = 'single' | 'double' | 'swiss' | 'roundRobin' | 'groupStageOnly';
2
3
  export interface BracketConfig {
3
4
  _id?: string;
4
5
  name?: string;
@@ -18,4 +19,12 @@ export interface BracketConfig {
18
19
  bestOf?: number;
19
20
  matchDurationMinutes?: number;
20
21
  breakBetweenMatchesMinutes?: number;
22
+ groupStageOnly?: boolean;
23
+ groupCalculationMode?: 'manual' | 'automatic';
24
+ minTeamsPerGroup?: number;
25
+ maxTeamsPerGroup?: number;
26
+ tiebreakerCriteria?: TiebreakerConfig;
27
+ pointsForWin?: number;
28
+ pointsForDraw?: number;
29
+ pointsForLoss?: number;
21
30
  }
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Group Stage Tournament Interfaces
3
+ * For tournaments where champion is determined by points only (no playoffs)
4
+ */
5
+ export declare type TiebreakerCriteria = 'score_difference' | 'score_for' | 'score_against' | 'head_to_head' | 'wins';
6
+ export declare type GroupMatchStatus = 'pending' | 'in_progress' | 'completed' | 'forfeited';
7
+ export declare type FormResult = 'W' | 'D' | 'L';
8
+ /**
9
+ * Configuration for tiebreakers
10
+ */
11
+ export interface TiebreakerConfig {
12
+ criteria: TiebreakerCriteria[];
13
+ customOrder: boolean;
14
+ }
15
+ /**
16
+ * Team info within a group
17
+ */
18
+ export interface GroupTeam {
19
+ teamId: number | string;
20
+ teamName: string;
21
+ logo?: string;
22
+ captain?: string;
23
+ players?: any[];
24
+ }
25
+ /**
26
+ * Standing for a team in a group
27
+ */
28
+ export interface GroupStanding {
29
+ position: number;
30
+ teamId: number | string;
31
+ teamName: string;
32
+ logo?: string;
33
+ played: number;
34
+ wins: number;
35
+ draws: number;
36
+ losses: number;
37
+ scoreFor: number;
38
+ scoreAgainst: number;
39
+ scoreDifference: number;
40
+ points: number;
41
+ form: FormResult[];
42
+ isChampion?: boolean;
43
+ isLeader?: boolean;
44
+ }
45
+ /**
46
+ * Group configuration
47
+ */
48
+ export interface GroupConfiguration {
49
+ groupId: string;
50
+ groupName: string;
51
+ teams: GroupTeam[];
52
+ }
53
+ /**
54
+ * Single match in group stage
55
+ */
56
+ export interface GroupMatch {
57
+ matchId: string | number;
58
+ roomId: number | string;
59
+ groupId: string;
60
+ matchday: number;
61
+ homeTeamId: number | string;
62
+ homeTeamName: string;
63
+ homeTeamLogo?: string;
64
+ awayTeamId: number | string;
65
+ awayTeamName: string;
66
+ awayTeamLogo?: string;
67
+ homeScore: number | null;
68
+ awayScore: number | null;
69
+ status: GroupMatchStatus;
70
+ winnerId?: number | string | null;
71
+ scheduledAt?: string;
72
+ completedAt?: string;
73
+ gameDayId?: string;
74
+ }
75
+ /**
76
+ * Matchday containing all matches for that day
77
+ */
78
+ export interface GroupMatchday {
79
+ matchday: number;
80
+ matches: GroupMatch[];
81
+ isComplete: boolean;
82
+ }
83
+ /**
84
+ * Complete group stage structure
85
+ */
86
+ export interface GroupStageStructure {
87
+ roomId: number | string;
88
+ numGroups: number;
89
+ groups: GroupConfiguration[];
90
+ matchdays: GroupMatchday[];
91
+ standings: Record<string, GroupStanding[]>;
92
+ tiebreakerConfig: TiebreakerConfig;
93
+ pointsForWin: number;
94
+ pointsForDraw: number;
95
+ pointsForLoss: number;
96
+ isComplete: boolean;
97
+ championTeamId?: number | string;
98
+ championTeamName?: string;
99
+ finalStandings?: GroupStanding[];
100
+ }
101
+ /**
102
+ * DTO for generating group stage
103
+ */
104
+ export interface GenerateGroupStageDTO {
105
+ roomId: number | string;
106
+ participants: GroupTeam[];
107
+ numGroups?: number;
108
+ groupAssignments?: Record<string, (number | string)[]>;
109
+ tiebreakerConfig?: TiebreakerConfig;
110
+ gameDayId?: string;
111
+ }
112
+ /**
113
+ * DTO for reporting a match result
114
+ */
115
+ export interface ReportGroupMatchResultDTO {
116
+ roomId: number | string;
117
+ matchId: string | number;
118
+ homeScore: number;
119
+ awayScore: number;
120
+ }
121
+ /**
122
+ * DTO for editing a match result (admin)
123
+ */
124
+ export interface EditGroupMatchResultDTO {
125
+ roomId: number | string;
126
+ matchId: string | number;
127
+ homeScore: number;
128
+ awayScore: number;
129
+ reason?: string;
130
+ }
131
+ /**
132
+ * Group stage configuration in room/bracket config
133
+ */
134
+ export interface GroupStageConfig {
135
+ enabled: boolean;
136
+ calculationMode: 'manual' | 'automatic';
137
+ minTeamsPerGroup: number;
138
+ maxTeamsPerGroup: number;
139
+ tiebreakerConfig: TiebreakerConfig;
140
+ pointsForWin: number;
141
+ pointsForDraw: number;
142
+ pointsForLoss: number;
143
+ }
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ /**
3
+ * Group Stage Tournament Interfaces
4
+ * For tournaments where champion is determined by points only (no playoffs)
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -77,3 +77,5 @@ export * from './imageGallery.interface';
77
77
  export * from './gameDayStatus.interface';
78
78
  export * from './gameDay.interface';
79
79
  export * from './prizePool.interface';
80
+ export * from './groupStage.interface';
81
+ export * from './roomType.enum';
@@ -89,3 +89,5 @@ __exportStar(require("./imageGallery.interface"), exports);
89
89
  __exportStar(require("./gameDayStatus.interface"), exports);
90
90
  __exportStar(require("./gameDay.interface"), exports);
91
91
  __exportStar(require("./prizePool.interface"), exports);
92
+ __exportStar(require("./groupStage.interface"), exports);
93
+ __exportStar(require("./roomType.enum"), exports);
@@ -4,5 +4,6 @@ export declare enum RoomType {
4
4
  GAMEDAYS = "GAMEDAYS",
5
5
  SINGLE = "SINGLE-ELIMINATION",
6
6
  DOUBLE = "DOUBLE-ELIMINATION",
7
- BATTLE = "BATTLE-ROYAL"
7
+ BATTLE = "BATTLE-ROYAL",
8
+ GROUP_STAGE = "GROUP-STAGE"
8
9
  }
@@ -9,4 +9,5 @@ var RoomType;
9
9
  RoomType["SINGLE"] = "SINGLE-ELIMINATION";
10
10
  RoomType["DOUBLE"] = "DOUBLE-ELIMINATION";
11
11
  RoomType["BATTLE"] = "BATTLE-ROYAL";
12
+ RoomType["GROUP_STAGE"] = "GROUP-STAGE";
12
13
  })(RoomType = exports.RoomType || (exports.RoomType = {}));
@@ -11,4 +11,5 @@ export interface Team {
11
11
  categoriaId?: number;
12
12
  players?: Player[];
13
13
  ranking?: number;
14
+ logo?: string;
14
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamelobby/common",
3
- "version": "1.0.377",
3
+ "version": "1.0.379",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",