ballrush-core 0.7.0 → 0.7.4

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,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
@@ -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,8 +10,8 @@ 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 },
@@ -43,8 +43,8 @@ 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,
@@ -2,10 +2,11 @@
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ballrush-core",
3
- "version": "0.7.0",
3
+ "version": "0.7.4",
4
4
  "private": false,
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
@@ -34,7 +34,7 @@
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"