ballrush-core 0.7.0 → 0.7.10

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.
@@ -15,8 +15,12 @@ export interface AchievementDoc {
15
15
  createdAt: Date;
16
16
  updatedAt: Date;
17
17
  }
18
- export declare function createAchievementSchema(): Schema<AchievementDoc, import("mongoose").Model<AchievementDoc, any, any, any, import("mongoose").Document<unknown, any, AchievementDoc> & AchievementDoc & Required<{
18
+ export declare function createAchievementSchema(): Schema<AchievementDoc, import("mongoose").Model<AchievementDoc, any, any, any, import("mongoose").Document<unknown, any, AchievementDoc, any, {}> & AchievementDoc & Required<{
19
19
  _id: string;
20
- }>, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, AchievementDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<AchievementDoc>> & import("mongoose").FlatRecord<AchievementDoc> & Required<{
20
+ }> & {
21
+ __v: number;
22
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, AchievementDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<AchievementDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<AchievementDoc> & Required<{
21
23
  _id: string;
22
- }>>;
24
+ }> & {
25
+ __v: number;
26
+ }>;
@@ -17,8 +17,12 @@ export interface EventTemplateDoc {
17
17
  maxPlayers: number;
18
18
  createdAt: Date;
19
19
  }
20
- export declare function createEventTemplateSchema(): Schema<EventTemplateDoc, import("mongoose").Model<EventTemplateDoc, any, any, any, import("mongoose").Document<unknown, any, EventTemplateDoc> & EventTemplateDoc & {
20
+ export declare function createEventTemplateSchema(): Schema<EventTemplateDoc, import("mongoose").Model<EventTemplateDoc, any, any, any, import("mongoose").Document<unknown, any, EventTemplateDoc, any, {}> & EventTemplateDoc & {
21
21
  _id: import("mongoose").Types.ObjectId;
22
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EventTemplateDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<EventTemplateDoc>> & import("mongoose").FlatRecord<EventTemplateDoc> & {
22
+ } & {
23
+ __v: number;
24
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EventTemplateDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<EventTemplateDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<EventTemplateDoc> & {
23
25
  _id: import("mongoose").Types.ObjectId;
26
+ } & {
27
+ __v: number;
24
28
  }>;
@@ -1,5 +1,5 @@
1
1
  import { Schema } from "mongoose";
2
- import { EventStatus, Match, ParticipantEvent, Team } from "../../types";
2
+ import { EventStatus, Match, MatchEvent, ParticipantEvent, Team } from "../../types";
3
3
  export interface EventDoc {
4
4
  eventId: number;
5
5
  groupId: number;
@@ -15,23 +15,48 @@ export interface EventDoc {
15
15
  isRatingApplied: boolean;
16
16
  reportMessageId?: number;
17
17
  }
18
- export declare function createParticipantEventSchema(): Schema<ParticipantEvent, import("mongoose").Model<ParticipantEvent, any, any, any, import("mongoose").Document<unknown, any, ParticipantEvent> & ParticipantEvent & {
18
+ export declare function createParticipantEventSchema(): Schema<ParticipantEvent, import("mongoose").Model<ParticipantEvent, any, any, any, import("mongoose").Document<unknown, any, ParticipantEvent, any, {}> & ParticipantEvent & {
19
19
  _id: import("mongoose").Types.ObjectId;
20
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ParticipantEvent, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ParticipantEvent>> & import("mongoose").FlatRecord<ParticipantEvent> & {
20
+ } & {
21
+ __v: number;
22
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ParticipantEvent, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ParticipantEvent>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ParticipantEvent> & {
21
23
  _id: import("mongoose").Types.ObjectId;
24
+ } & {
25
+ __v: number;
22
26
  }>;
23
- export declare function createTeamSchema(): Schema<Team, import("mongoose").Model<Team, any, any, any, import("mongoose").Document<unknown, any, Team> & Team & {
27
+ export declare function createTeamSchema(): Schema<Team, import("mongoose").Model<Team, any, any, any, import("mongoose").Document<unknown, any, Team, any, {}> & Team & {
24
28
  _id: import("mongoose").Types.ObjectId;
25
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Team, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Team>> & import("mongoose").FlatRecord<Team> & {
29
+ } & {
30
+ __v: number;
31
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Team, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Team>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Team> & {
26
32
  _id: import("mongoose").Types.ObjectId;
33
+ } & {
34
+ __v: number;
27
35
  }>;
28
- export declare function createMatchSchema(): Schema<Match, import("mongoose").Model<Match, any, any, any, import("mongoose").Document<unknown, any, Match> & Match & {
36
+ export declare function createMatchEventSchema(): Schema<MatchEvent, import("mongoose").Model<MatchEvent, any, any, any, import("mongoose").Document<unknown, any, MatchEvent, any, {}> & MatchEvent & {
29
37
  _id: import("mongoose").Types.ObjectId;
30
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Match, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Match>> & import("mongoose").FlatRecord<Match> & {
38
+ } & {
39
+ __v: number;
40
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, MatchEvent, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<MatchEvent>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<MatchEvent> & {
31
41
  _id: import("mongoose").Types.ObjectId;
42
+ } & {
43
+ __v: number;
32
44
  }>;
33
- export declare function createEventSchema(): Schema<EventDoc, import("mongoose").Model<EventDoc, any, any, any, import("mongoose").Document<unknown, any, EventDoc> & EventDoc & {
45
+ export declare function createMatchSchema(): Schema<Match, import("mongoose").Model<Match, any, any, any, import("mongoose").Document<unknown, any, Match, any, {}> & Match & {
34
46
  _id: import("mongoose").Types.ObjectId;
35
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EventDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<EventDoc>> & import("mongoose").FlatRecord<EventDoc> & {
47
+ } & {
48
+ __v: number;
49
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Match, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<Match>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<Match> & {
36
50
  _id: import("mongoose").Types.ObjectId;
51
+ } & {
52
+ __v: number;
53
+ }>;
54
+ export declare function createEventSchema(): Schema<EventDoc, import("mongoose").Model<EventDoc, any, any, any, import("mongoose").Document<unknown, any, EventDoc, any, {}> & EventDoc & {
55
+ _id: import("mongoose").Types.ObjectId;
56
+ } & {
57
+ __v: number;
58
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, EventDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<EventDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<EventDoc> & {
59
+ _id: import("mongoose").Types.ObjectId;
60
+ } & {
61
+ __v: number;
37
62
  }>;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createParticipantEventSchema = createParticipantEventSchema;
4
4
  exports.createTeamSchema = createTeamSchema;
5
+ exports.createMatchEventSchema = createMatchEventSchema;
5
6
  exports.createMatchSchema = createMatchSchema;
6
7
  exports.createEventSchema = createEventSchema;
7
8
  const mongoose_1 = require("mongoose");
@@ -20,13 +21,23 @@ function createTeamSchema() {
20
21
  players: { type: [Number], required: true },
21
22
  });
22
23
  }
24
+ function createMatchEventSchema() {
25
+ return new mongoose_1.Schema({
26
+ type: { type: String, enum: ['goal', 'assist', 'own_goal'], required: true },
27
+ playerId: { type: Number, required: true },
28
+ teamId: { type: Number, required: true },
29
+ timestamp: { type: Date, required: true, default: Date.now },
30
+ }, { _id: false });
31
+ }
23
32
  function createMatchSchema() {
33
+ const MatchEventSchema = createMatchEventSchema();
24
34
  return new mongoose_1.Schema({
25
35
  matchId: { type: Number, required: true },
26
36
  team1Id: { type: Number, required: true },
27
37
  team2Id: { type: Number, required: true },
28
38
  score: { type: [Number], required: true },
29
39
  matchDate: { type: Date, required: true },
40
+ events: { type: [MatchEventSchema], default: [] },
30
41
  });
31
42
  }
32
43
  function createEventSchema() {
@@ -11,18 +11,30 @@ export interface GroupDoc {
11
11
  createdAt?: Date;
12
12
  updatedAt?: Date;
13
13
  }
14
- export declare function createRatingPointSchema(): Schema<RatingPoint, import("mongoose").Model<RatingPoint, any, any, any, import("mongoose").Document<unknown, any, RatingPoint> & RatingPoint & {
14
+ export declare function createRatingPointSchema(): Schema<RatingPoint, import("mongoose").Model<RatingPoint, any, any, any, import("mongoose").Document<unknown, any, RatingPoint, any, {}> & RatingPoint & {
15
15
  _id: import("mongoose").Types.ObjectId;
16
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, RatingPoint, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<RatingPoint>> & import("mongoose").FlatRecord<RatingPoint> & {
16
+ } & {
17
+ __v: number;
18
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, RatingPoint, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<RatingPoint>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<RatingPoint> & {
17
19
  _id: import("mongoose").Types.ObjectId;
20
+ } & {
21
+ __v: number;
18
22
  }>;
19
- export declare function createParticipantSchema(): Schema<ParticipantGroup, import("mongoose").Model<ParticipantGroup, any, any, any, import("mongoose").Document<unknown, any, ParticipantGroup> & ParticipantGroup & {
23
+ export declare function createParticipantSchema(): Schema<ParticipantGroup, import("mongoose").Model<ParticipantGroup, any, any, any, import("mongoose").Document<unknown, any, ParticipantGroup, any, {}> & ParticipantGroup & {
20
24
  _id: import("mongoose").Types.ObjectId;
21
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ParticipantGroup, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ParticipantGroup>> & import("mongoose").FlatRecord<ParticipantGroup> & {
25
+ } & {
26
+ __v: number;
27
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ParticipantGroup, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<ParticipantGroup>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<ParticipantGroup> & {
22
28
  _id: import("mongoose").Types.ObjectId;
29
+ } & {
30
+ __v: number;
23
31
  }>;
24
- export declare function createGroupSchema(): Schema<GroupDoc, import("mongoose").Model<GroupDoc, any, any, any, import("mongoose").Document<unknown, any, GroupDoc> & GroupDoc & {
32
+ export declare function createGroupSchema(): Schema<GroupDoc, import("mongoose").Model<GroupDoc, any, any, any, import("mongoose").Document<unknown, any, GroupDoc, any, {}> & GroupDoc & {
25
33
  _id: import("mongoose").Types.ObjectId;
26
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, GroupDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<GroupDoc>> & import("mongoose").FlatRecord<GroupDoc> & {
34
+ } & {
35
+ __v: number;
36
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, GroupDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<GroupDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<GroupDoc> & {
27
37
  _id: import("mongoose").Types.ObjectId;
38
+ } & {
39
+ __v: number;
28
40
  }>;
@@ -15,8 +15,12 @@ export interface SeasonDoc {
15
15
  createdAt: Date;
16
16
  updatedAt: Date;
17
17
  }
18
- export declare function createSeasonSchema(): Schema<SeasonDoc, import("mongoose").Model<SeasonDoc, any, any, any, import("mongoose").Document<unknown, any, SeasonDoc> & SeasonDoc & {
18
+ export declare function createSeasonSchema(): Schema<SeasonDoc, import("mongoose").Model<SeasonDoc, any, any, any, import("mongoose").Document<unknown, any, SeasonDoc, any, {}> & SeasonDoc & {
19
19
  _id: import("mongoose").Types.ObjectId;
20
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, SeasonDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<SeasonDoc>> & import("mongoose").FlatRecord<SeasonDoc> & {
20
+ } & {
21
+ __v: number;
22
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, SeasonDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<SeasonDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<SeasonDoc> & {
21
23
  _id: import("mongoose").Types.ObjectId;
24
+ } & {
25
+ __v: number;
22
26
  }>;
@@ -89,8 +89,12 @@ export interface StatEventDoc {
89
89
  * Factory function to create StatEvent schema
90
90
  * Collection: stat_events
91
91
  */
92
- export declare function createStatEventSchema(): Schema<StatEventDoc, import("mongoose").Model<StatEventDoc, any, any, any, import("mongoose").Document<unknown, any, StatEventDoc> & StatEventDoc & {
92
+ export declare function createStatEventSchema(): Schema<StatEventDoc, import("mongoose").Model<StatEventDoc, any, any, any, import("mongoose").Document<unknown, any, StatEventDoc, any, {}> & StatEventDoc & {
93
93
  _id: import("mongoose").Types.ObjectId;
94
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatEventDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatEventDoc>> & import("mongoose").FlatRecord<StatEventDoc> & {
94
+ } & {
95
+ __v: number;
96
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatEventDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatEventDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<StatEventDoc> & {
95
97
  _id: import("mongoose").Types.ObjectId;
98
+ } & {
99
+ __v: number;
96
100
  }>;
@@ -20,8 +20,12 @@ export interface StatGroupActivityChartDoc {
20
20
  * Factory function to create StatGroupActivityChart schema
21
21
  * Collection: stat_group_activity_charts
22
22
  */
23
- export declare function createStatGroupActivityChartSchema(): Schema<StatGroupActivityChartDoc, import("mongoose").Model<StatGroupActivityChartDoc, any, any, any, import("mongoose").Document<unknown, any, StatGroupActivityChartDoc> & StatGroupActivityChartDoc & {
23
+ export declare function createStatGroupActivityChartSchema(): Schema<StatGroupActivityChartDoc, import("mongoose").Model<StatGroupActivityChartDoc, any, any, any, import("mongoose").Document<unknown, any, StatGroupActivityChartDoc, any, {}> & StatGroupActivityChartDoc & {
24
24
  _id: import("mongoose").Types.ObjectId;
25
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatGroupActivityChartDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatGroupActivityChartDoc>> & import("mongoose").FlatRecord<StatGroupActivityChartDoc> & {
25
+ } & {
26
+ __v: number;
27
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatGroupActivityChartDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatGroupActivityChartDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<StatGroupActivityChartDoc> & {
26
28
  _id: import("mongoose").Types.ObjectId;
29
+ } & {
30
+ __v: number;
27
31
  }>;
@@ -26,8 +26,12 @@ export interface StatGroupLast100GamesDoc {
26
26
  * Factory function to create StatGroupLast100Games schema
27
27
  * Collection: stat_group_last_100_games
28
28
  */
29
- export declare function createStatGroupLast100GamesSchema(): Schema<StatGroupLast100GamesDoc, import("mongoose").Model<StatGroupLast100GamesDoc, any, any, any, import("mongoose").Document<unknown, any, StatGroupLast100GamesDoc> & StatGroupLast100GamesDoc & {
29
+ export declare function createStatGroupLast100GamesSchema(): Schema<StatGroupLast100GamesDoc, import("mongoose").Model<StatGroupLast100GamesDoc, any, any, any, import("mongoose").Document<unknown, any, StatGroupLast100GamesDoc, any, {}> & StatGroupLast100GamesDoc & {
30
30
  _id: import("mongoose").Types.ObjectId;
31
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatGroupLast100GamesDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatGroupLast100GamesDoc>> & import("mongoose").FlatRecord<StatGroupLast100GamesDoc> & {
31
+ } & {
32
+ __v: number;
33
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatGroupLast100GamesDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatGroupLast100GamesDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<StatGroupLast100GamesDoc> & {
32
34
  _id: import("mongoose").Types.ObjectId;
35
+ } & {
36
+ __v: number;
33
37
  }>;
@@ -20,8 +20,12 @@ export interface StatGroupProfileDoc {
20
20
  * Factory function to create StatGroupProfile schema
21
21
  * Collection: stat_group_profiles
22
22
  */
23
- export declare function createStatGroupProfileSchema(): Schema<StatGroupProfileDoc, import("mongoose").Model<StatGroupProfileDoc, any, any, any, import("mongoose").Document<unknown, any, StatGroupProfileDoc> & StatGroupProfileDoc & {
23
+ export declare function createStatGroupProfileSchema(): Schema<StatGroupProfileDoc, import("mongoose").Model<StatGroupProfileDoc, any, any, any, import("mongoose").Document<unknown, any, StatGroupProfileDoc, any, {}> & StatGroupProfileDoc & {
24
24
  _id: import("mongoose").Types.ObjectId;
25
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatGroupProfileDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatGroupProfileDoc>> & import("mongoose").FlatRecord<StatGroupProfileDoc> & {
25
+ } & {
26
+ __v: number;
27
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatGroupProfileDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatGroupProfileDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<StatGroupProfileDoc> & {
26
28
  _id: import("mongoose").Types.ObjectId;
29
+ } & {
30
+ __v: number;
27
31
  }>;
@@ -13,6 +13,9 @@ export interface StatGroupSeasonParticipantDoc {
13
13
  winPercentage: number;
14
14
  skillRating: number;
15
15
  score: number;
16
+ totalXP?: number;
17
+ currentLevel?: number;
18
+ stars?: number;
16
19
  }
17
20
  /**
18
21
  * Mongoose document interface for StatGroupSeason
@@ -35,8 +38,12 @@ export interface StatGroupSeasonDoc {
35
38
  * Factory function to create StatGroupSeason schema
36
39
  * Collection: stat_group_seasons
37
40
  */
38
- export declare function createStatGroupSeasonSchema(): Schema<StatGroupSeasonDoc, import("mongoose").Model<StatGroupSeasonDoc, any, any, any, import("mongoose").Document<unknown, any, StatGroupSeasonDoc> & StatGroupSeasonDoc & {
41
+ export declare function createStatGroupSeasonSchema(): Schema<StatGroupSeasonDoc, import("mongoose").Model<StatGroupSeasonDoc, any, any, any, import("mongoose").Document<unknown, any, StatGroupSeasonDoc, any, {}> & StatGroupSeasonDoc & {
39
42
  _id: import("mongoose").Types.ObjectId;
40
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatGroupSeasonDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatGroupSeasonDoc>> & import("mongoose").FlatRecord<StatGroupSeasonDoc> & {
43
+ } & {
44
+ __v: number;
45
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatGroupSeasonDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatGroupSeasonDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<StatGroupSeasonDoc> & {
41
46
  _id: import("mongoose").Types.ObjectId;
47
+ } & {
48
+ __v: number;
42
49
  }>;
@@ -18,6 +18,9 @@ function createStatGroupSeasonSchema() {
18
18
  winPercentage: { type: Number, required: true, min: 0, max: 100, default: 0 },
19
19
  skillRating: { type: Number, required: true, min: 0, default: 0 },
20
20
  score: { type: Number, required: true, min: 0, default: 0 },
21
+ totalXP: { type: Number, required: false, min: 0, default: 0 },
22
+ currentLevel: { type: Number, required: false, min: 1, default: 1 },
23
+ stars: { type: Number, required: false, min: 0, max: 3, default: 0 },
21
24
  }, { _id: false });
22
25
  const StatGroupSeasonSchema = new mongoose_1.Schema({
23
26
  groupId: { type: Number, required: true, index: true },
@@ -8,8 +8,12 @@ export interface StatGroupDoc {
8
8
  participantsCount: number;
9
9
  updatedAt: Date;
10
10
  }
11
- export declare function createStatGroupSchema(): Schema<StatGroupDoc, import("mongoose").Model<StatGroupDoc, any, any, any, import("mongoose").Document<unknown, any, StatGroupDoc> & StatGroupDoc & {
11
+ export declare function createStatGroupSchema(): Schema<StatGroupDoc, import("mongoose").Model<StatGroupDoc, any, any, any, import("mongoose").Document<unknown, any, StatGroupDoc, any, {}> & StatGroupDoc & {
12
12
  _id: import("mongoose").Types.ObjectId;
13
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatGroupDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatGroupDoc>> & import("mongoose").FlatRecord<StatGroupDoc> & {
13
+ } & {
14
+ __v: number;
15
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatGroupDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatGroupDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<StatGroupDoc> & {
14
16
  _id: import("mongoose").Types.ObjectId;
17
+ } & {
18
+ __v: number;
15
19
  }>;
@@ -17,8 +17,12 @@ export interface StatUserMatchHistoryDoc {
17
17
  * Factory function to create StatUserMatchHistory schema
18
18
  * Collection: stat_user_match_history
19
19
  */
20
- export declare function createStatUserMatchHistorySchema(): Schema<StatUserMatchHistoryDoc, import("mongoose").Model<StatUserMatchHistoryDoc, any, any, any, import("mongoose").Document<unknown, any, StatUserMatchHistoryDoc> & StatUserMatchHistoryDoc & {
20
+ export declare function createStatUserMatchHistorySchema(): Schema<StatUserMatchHistoryDoc, import("mongoose").Model<StatUserMatchHistoryDoc, any, any, any, import("mongoose").Document<unknown, any, StatUserMatchHistoryDoc, any, {}> & StatUserMatchHistoryDoc & {
21
21
  _id: import("mongoose").Types.ObjectId;
22
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatUserMatchHistoryDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatUserMatchHistoryDoc>> & import("mongoose").FlatRecord<StatUserMatchHistoryDoc> & {
22
+ } & {
23
+ __v: number;
24
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatUserMatchHistoryDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatUserMatchHistoryDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<StatUserMatchHistoryDoc> & {
23
25
  _id: import("mongoose").Types.ObjectId;
26
+ } & {
27
+ __v: number;
24
28
  }>;
@@ -1,11 +1,12 @@
1
1
  import { Schema } from "mongoose";
2
+ import { RatingSource } from "../../types";
2
3
  /**
3
4
  * Mongoose sub-schema for SkillHistoryPoint
4
5
  */
5
6
  export interface SkillHistoryPointDoc {
6
7
  date: Date;
7
- earnedRating: number | null;
8
- manualAdjustment: number | null;
8
+ value: number;
9
+ source: RatingSource;
9
10
  }
10
11
  /**
11
12
  * Mongoose sub-schema for ProfileAchievement
@@ -15,6 +16,7 @@ export interface ProfileAchievementDoc {
15
16
  name: string;
16
17
  description: string;
17
18
  count: number;
19
+ achievementId?: string;
18
20
  }
19
21
  /**
20
22
  * Mongoose document interface for StatUserProfile
@@ -38,14 +40,19 @@ export interface StatUserProfileDoc {
38
40
  eventsCount: number;
39
41
  skillHistory: SkillHistoryPointDoc[];
40
42
  achievements: ProfileAchievementDoc[];
43
+ totalXP: number;
41
44
  lastUpdated: Date;
42
45
  }
43
46
  /**
44
47
  * Factory function to create StatUserProfile schema
45
48
  * Collection: stat_user_profile
46
49
  */
47
- export declare function createStatUserProfileSchema(): Schema<StatUserProfileDoc, import("mongoose").Model<StatUserProfileDoc, any, any, any, import("mongoose").Document<unknown, any, StatUserProfileDoc> & StatUserProfileDoc & {
50
+ export declare function createStatUserProfileSchema(): Schema<StatUserProfileDoc, import("mongoose").Model<StatUserProfileDoc, any, any, any, import("mongoose").Document<unknown, any, StatUserProfileDoc, any, {}> & StatUserProfileDoc & {
48
51
  _id: import("mongoose").Types.ObjectId;
49
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatUserProfileDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatUserProfileDoc>> & import("mongoose").FlatRecord<StatUserProfileDoc> & {
52
+ } & {
53
+ __v: number;
54
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, StatUserProfileDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<StatUserProfileDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<StatUserProfileDoc> & {
50
55
  _id: import("mongoose").Types.ObjectId;
56
+ } & {
57
+ __v: number;
51
58
  }>;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createStatUserProfileSchema = createStatUserProfileSchema;
4
4
  const mongoose_1 = require("mongoose");
5
+ const types_1 = require("../../types");
5
6
  /**
6
7
  * Factory function to create StatUserProfile schema
7
8
  * Collection: stat_user_profile
@@ -9,14 +10,15 @@ const mongoose_1 = require("mongoose");
9
10
  function createStatUserProfileSchema() {
10
11
  const SkillHistoryPointSchema = new mongoose_1.Schema({
11
12
  date: { type: Date, required: true },
12
- earnedRating: { type: Number, default: null },
13
- manualAdjustment: { type: Number, default: null },
13
+ value: { type: Number, required: true },
14
+ source: { type: String, enum: types_1.RatingSource, default: types_1.RatingSource.SYSTEM },
14
15
  }, { _id: false });
15
16
  const ProfileAchievementSchema = new mongoose_1.Schema({
16
17
  icon: { type: String, required: true },
17
18
  name: { type: String, required: true },
18
19
  description: { type: String, required: true },
19
20
  count: { type: Number, required: true, min: 0, default: 0 },
21
+ achievementId: { type: String, required: false },
20
22
  }, { _id: false });
21
23
  const StatUserProfileSchema = new mongoose_1.Schema({
22
24
  userId: { type: Number, required: true, index: true },
@@ -37,6 +39,7 @@ function createStatUserProfileSchema() {
37
39
  eventsCount: { type: Number, required: true, min: 0, default: 0 },
38
40
  skillHistory: { type: [SkillHistoryPointSchema], default: [] },
39
41
  achievements: { type: [ProfileAchievementSchema], default: [] },
42
+ totalXP: { type: Number, required: true, min: 0, default: 0 },
40
43
  lastUpdated: { type: Date, default: Date.now },
41
44
  }, {
42
45
  collection: 'stat_user_profile',
@@ -8,8 +8,12 @@ export interface UserDoc {
8
8
  avatarUrl?: string;
9
9
  telegramAvatarId?: string;
10
10
  }
11
- export declare function createUserSchema(): Schema<UserDoc, import("mongoose").Model<UserDoc, any, any, any, import("mongoose").Document<unknown, any, UserDoc> & UserDoc & {
11
+ export declare function createUserSchema(): Schema<UserDoc, import("mongoose").Model<UserDoc, any, any, any, import("mongoose").Document<unknown, any, UserDoc, any, {}> & UserDoc & {
12
12
  _id: import("mongoose").Types.ObjectId;
13
- }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, UserDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<UserDoc>> & import("mongoose").FlatRecord<UserDoc> & {
13
+ } & {
14
+ __v: number;
15
+ }, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, UserDoc, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<UserDoc>, {}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & import("mongoose").FlatRecord<UserDoc> & {
14
16
  _id: import("mongoose").Types.ObjectId;
17
+ } & {
18
+ __v: number;
15
19
  }>;
@@ -41,6 +41,9 @@ class MongoStatGroupSeasonRepository {
41
41
  winPercentage: p.winPercentage,
42
42
  skillRating: p.skillRating,
43
43
  score: p.score,
44
+ totalXP: p.totalXP,
45
+ currentLevel: p.currentLevel,
46
+ stars: p.stars,
44
47
  })),
45
48
  startDate: doc.startDate,
46
49
  endDate: doc.endDate,
@@ -43,15 +43,17 @@ class MongoStatUserProfileRepository {
43
43
  eventsCount: doc.eventsCount,
44
44
  skillHistory: doc.skillHistory.map(point => ({
45
45
  date: point.date,
46
- earnedRating: point.earnedRating,
47
- manualAdjustment: point.manualAdjustment,
46
+ value: point.value,
47
+ source: point.source,
48
48
  })),
49
49
  achievements: doc.achievements.map(achievement => ({
50
50
  icon: achievement.icon,
51
51
  name: achievement.name,
52
52
  description: achievement.description,
53
53
  count: achievement.count,
54
+ achievementId: achievement.achievementId,
54
55
  })),
56
+ totalXP: doc.totalXP ?? 0,
55
57
  lastUpdated: doc.lastUpdated,
56
58
  };
57
59
  }
@@ -90,6 +92,7 @@ class MongoStatUserProfileRepository {
90
92
  eventsCount: profile.eventsCount,
91
93
  skillHistory: profile.skillHistory,
92
94
  achievements: profile.achievements,
95
+ totalXP: profile.totalXP,
93
96
  lastUpdated: profile.lastUpdated,
94
97
  },
95
98
  }, { upsert: true });
@@ -31,12 +31,20 @@ export interface Team {
31
31
  teamName: string;
32
32
  players: number[];
33
33
  }
34
+ export type MatchEventType = 'goal' | 'assist' | 'own_goal';
35
+ export interface MatchEvent {
36
+ type: MatchEventType;
37
+ playerId: number;
38
+ teamId: number;
39
+ timestamp: Date;
40
+ }
34
41
  export interface Match {
35
42
  matchId: number;
36
43
  team1Id: number;
37
44
  team2Id: number;
38
45
  score: [number, number];
39
46
  matchDate: Date;
47
+ events: MatchEvent[];
40
48
  }
41
49
  export interface TeamStats {
42
50
  teamId: number;
@@ -13,6 +13,9 @@ export interface StatGroupSeasonParticipant {
13
13
  winPercentage: number;
14
14
  skillRating: number;
15
15
  score: number;
16
+ totalXP?: number;
17
+ currentLevel?: number;
18
+ stars?: number;
16
19
  }
17
20
  export interface StatGroupSeason {
18
21
  groupId: number;
@@ -2,16 +2,18 @@
2
2
  * Statistics: User Profile Types
3
3
  * Pre-aggregated user profile data for ballrush-api
4
4
  */
5
+ import { RatingSource } from "./shared";
5
6
  export interface SkillHistoryPoint {
6
7
  date: Date;
7
- earnedRating: number | null;
8
- manualAdjustment: number | null;
8
+ value: number;
9
+ source: RatingSource;
9
10
  }
10
11
  export interface ProfileAchievement {
11
12
  icon: string;
12
13
  name: string;
13
14
  description: string;
14
15
  count: number;
16
+ achievementId?: string;
15
17
  }
16
18
  export interface StatUserProfile {
17
19
  userId: number;
@@ -32,5 +34,6 @@ export interface StatUserProfile {
32
34
  eventsCount: number;
33
35
  skillHistory: SkillHistoryPoint[];
34
36
  achievements: ProfileAchievement[];
37
+ totalXP: number;
35
38
  lastUpdated: Date;
36
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ballrush-core",
3
- "version": "0.7.0",
3
+ "version": "0.7.10",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -24,17 +24,17 @@
24
24
  "release:dry": "./release.sh patch --dry"
25
25
  },
26
26
  "peerDependencies": {
27
- "mongoose": "^7.0.0 || ^8.0.0"
27
+ "mongoose": "^8.0.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/jest": "^30.0.0",
31
31
  "baseline-browser-mapping": "^2.8.30",
32
32
  "jest": "^30.1.3",
33
- "mongoose": "^7.8.7",
33
+ "mongoose": "^8.19.2",
34
34
  "rimraf": "^5.0.0",
35
35
  "ts-jest": "^29.4.4",
36
36
  "ts-node": "^10.9.2",
37
- "typescript": "^5.9.2"
37
+ "typescript": "^5.9.3"
38
38
  },
39
39
  "publishConfig": {
40
40
  "access": "public"