ballrush-core 0.5.2 → 0.5.3
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.
|
@@ -20,10 +20,15 @@ export interface StatGroupSeasonParticipantDoc {
|
|
|
20
20
|
export interface StatGroupSeasonDoc {
|
|
21
21
|
groupId: number;
|
|
22
22
|
seasonName: string;
|
|
23
|
+
totalMatches: number;
|
|
24
|
+
totalGoals: number;
|
|
25
|
+
averageGoalsPerMatch: number;
|
|
26
|
+
totalEvents: number;
|
|
27
|
+
totalParticipants: number;
|
|
23
28
|
participants: StatGroupSeasonParticipantDoc[];
|
|
24
29
|
startDate: Date;
|
|
25
30
|
endDate: Date | null;
|
|
26
|
-
status: 'in_progress' | '
|
|
31
|
+
status: 'upcoming' | 'in_progress' | 'ended';
|
|
27
32
|
updatedAt: Date;
|
|
28
33
|
}
|
|
29
34
|
/**
|
|
@@ -22,10 +22,15 @@ function createStatGroupSeasonSchema() {
|
|
|
22
22
|
const StatGroupSeasonSchema = new mongoose_1.Schema({
|
|
23
23
|
groupId: { type: Number, required: true, index: true },
|
|
24
24
|
seasonName: { type: String, required: true },
|
|
25
|
+
totalMatches: { type: Number, required: true, min: 0, default: 0 },
|
|
26
|
+
totalGoals: { type: Number, required: true, min: 0, default: 0 },
|
|
27
|
+
averageGoalsPerMatch: { type: Number, required: true, min: 0, default: 0 },
|
|
28
|
+
totalEvents: { type: Number, required: true, min: 0, default: 0 },
|
|
29
|
+
totalParticipants: { type: Number, required: true, min: 0, default: 0 },
|
|
25
30
|
participants: { type: [ParticipantSchema], default: [] },
|
|
26
31
|
startDate: { type: Date, required: true },
|
|
27
32
|
endDate: { type: Date, default: null },
|
|
28
|
-
status: { type: String, enum: ['in_progress', '
|
|
33
|
+
status: { type: String, enum: ['upcoming', 'in_progress', 'ended'], required: true },
|
|
29
34
|
updatedAt: { type: Date, default: Date.now },
|
|
30
35
|
}, {
|
|
31
36
|
collection: 'stat_group_seasons',
|
|
@@ -25,6 +25,11 @@ class MongoStatGroupSeasonRepository {
|
|
|
25
25
|
return docs.map(doc => ({
|
|
26
26
|
groupId: doc.groupId,
|
|
27
27
|
seasonName: doc.seasonName,
|
|
28
|
+
totalMatches: doc.totalMatches,
|
|
29
|
+
totalGoals: doc.totalGoals,
|
|
30
|
+
averageGoalsPerMatch: doc.averageGoalsPerMatch,
|
|
31
|
+
totalEvents: doc.totalEvents,
|
|
32
|
+
totalParticipants: doc.totalParticipants,
|
|
28
33
|
participants: doc.participants.map(p => ({
|
|
29
34
|
userId: p.userId,
|
|
30
35
|
playerName: p.playerName,
|
|
@@ -17,9 +17,14 @@ export interface StatGroupSeasonParticipant {
|
|
|
17
17
|
export interface StatGroupSeason {
|
|
18
18
|
groupId: number;
|
|
19
19
|
seasonName: string;
|
|
20
|
+
totalMatches: number;
|
|
21
|
+
totalGoals: number;
|
|
22
|
+
averageGoalsPerMatch: number;
|
|
23
|
+
totalEvents: number;
|
|
24
|
+
totalParticipants: number;
|
|
20
25
|
participants: StatGroupSeasonParticipant[];
|
|
21
26
|
startDate: Date;
|
|
22
27
|
endDate: Date | null;
|
|
23
|
-
status: 'in_progress' | '
|
|
28
|
+
status: 'upcoming' | 'in_progress' | 'ended';
|
|
24
29
|
updatedAt: Date;
|
|
25
30
|
}
|