@common_ch/common 1.0.81 → 1.0.83
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,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Model, Document } from 'mongoose';
|
|
2
2
|
export interface RateAttrs {
|
|
3
3
|
userId: string;
|
|
4
4
|
aiId: string;
|
|
@@ -7,10 +7,10 @@ export interface RateAttrs {
|
|
|
7
7
|
createdAt?: number;
|
|
8
8
|
updatedAt?: number;
|
|
9
9
|
}
|
|
10
|
-
interface RateModel extends
|
|
10
|
+
interface RateModel extends Model<RateDoc> {
|
|
11
11
|
build(attrs: RateAttrs): RateDoc;
|
|
12
12
|
}
|
|
13
|
-
export interface RateDoc extends
|
|
13
|
+
export interface RateDoc extends Document {
|
|
14
14
|
_id: string;
|
|
15
15
|
userId: string;
|
|
16
16
|
aiId: string;
|
package/build/models/app/rate.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.Rate = void 0;
|
|
7
|
-
const mongoose_1 =
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
8
5
|
const mongoose_update_if_current_1 = require("mongoose-update-if-current");
|
|
9
|
-
const rateSchema = new mongoose_1.
|
|
6
|
+
const rateSchema = new mongoose_1.Schema({
|
|
10
7
|
userId: {
|
|
11
|
-
type: mongoose_1.
|
|
8
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
12
9
|
ref: 'User',
|
|
13
10
|
required: true,
|
|
14
11
|
},
|
|
15
12
|
aiId: {
|
|
16
|
-
type: mongoose_1.
|
|
13
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
17
14
|
ref: 'Ai',
|
|
18
15
|
required: true,
|
|
19
16
|
},
|
|
@@ -35,10 +32,10 @@ const rateSchema = new mongoose_1.default.Schema({
|
|
|
35
32
|
// default: RateStatusEnum.notChecked,
|
|
36
33
|
// },
|
|
37
34
|
createdAt: {
|
|
38
|
-
type: mongoose_1.
|
|
35
|
+
type: mongoose_1.Schema.Types.Date,
|
|
39
36
|
},
|
|
40
37
|
updatedAt: {
|
|
41
|
-
type: mongoose_1.
|
|
38
|
+
type: mongoose_1.Schema.Types.Date,
|
|
42
39
|
},
|
|
43
40
|
}, {
|
|
44
41
|
timestamps: true,
|
|
@@ -49,5 +46,5 @@ rateSchema.index({ userId: 1, planId: 1 }, { unique: true });
|
|
|
49
46
|
rateSchema.statics.build = (attrs) => {
|
|
50
47
|
return new Rate(attrs);
|
|
51
48
|
};
|
|
52
|
-
const Rate = mongoose_1.
|
|
49
|
+
const Rate = (0, mongoose_1.model)('Rate', rateSchema);
|
|
53
50
|
exports.Rate = Rate;
|