@duvdu-v1/duvdu 1.1.159 → 1.1.161

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.
@@ -60,7 +60,7 @@ const userSchema = new mongoose_1.Schema({
60
60
  ],
61
61
  address: { type: String, default: null },
62
62
  likes: { type: Number, default: 0 },
63
- rank: { title: { type: String, default: null }, nextRangPercentage: { type: Number, default: 0 } },
63
+ rank: { title: { type: String, default: null }, nextRankPercentage: { type: Number, default: 0 }, nextRankTitle: { type: String, default: null } },
64
64
  projectsView: { type: Number, default: 0 }
65
65
  }, {
66
66
  timestamps: true,
@@ -33,6 +33,7 @@ export declare enum ContractStatus {
33
33
  }
34
34
  export interface IproducerContarct {
35
35
  producer: Types.ObjectId | Iuser;
36
+ sp: Types.ObjectId | Iuser;
36
37
  user: Types.ObjectId | Iuser;
37
38
  platform: string;
38
39
  projectDetails: string;
@@ -13,6 +13,7 @@ var ContractStatus;
13
13
  })(ContractStatus || (exports.ContractStatus = ContractStatus = {}));
14
14
  exports.ProducerContract = (0, mongoose_1.model)(duvdu_1.MODELS.producerContract, new mongoose_1.Schema({
15
15
  producer: { type: mongoose_1.Schema.Types.ObjectId, ref: duvdu_1.MODELS.user },
16
+ sp: { type: mongoose_1.Schema.Types.ObjectId, ref: duvdu_1.MODELS.user },
16
17
  user: { type: mongoose_1.Schema.Types.ObjectId, ref: duvdu_1.MODELS.user },
17
18
  platform: { type: String, default: null },
18
19
  projectDetails: { type: String, default: null },
@@ -20,14 +20,16 @@ const updateRankForUser = (user) => __awaiter(void 0, void 0, void 0, function*
20
20
  const actionsNeeded = nextRank.actionCount - currentRank.actionCount;
21
21
  const actionsCompleted = user.acceptedProjectsCounter - currentRank.actionCount;
22
22
  user.rank.nextRangPercentage = (actionsCompleted / actionsNeeded) * 100;
23
+ user.rank.nextRankTitle = nextRank.rank;
23
24
  }
24
25
  else {
25
26
  user.rank.nextRangPercentage = 100;
26
27
  }
27
28
  }
28
29
  else {
29
- user.rank.title = '';
30
+ user.rank.title = null;
30
31
  user.rank.nextRangPercentage = 0;
32
+ user.rank.nextRankTitle = null;
31
33
  }
32
34
  return user.save();
33
35
  });
@@ -97,8 +97,9 @@ export interface Iuser {
97
97
  address: string;
98
98
  likes: number;
99
99
  rank: {
100
- title: string;
100
+ title: string | null;
101
101
  nextRangPercentage: number;
102
+ nextRankTitle: string | null;
102
103
  };
103
104
  projectsView: number;
104
105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duvdu-v1/duvdu",
3
- "version": "1.1.159",
3
+ "version": "1.1.161",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [