jp.db.schemas 2.0.2 → 2.0.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.
- package/dist/index.d.ts +4 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/models/tournament-participant.interface.d.ts +6 -0
- package/dist/models/tournament-participant.interface.d.ts.map +1 -0
- package/dist/models/tournament-participant.interface.js +3 -0
- package/dist/models/tournament-participant.interface.js.map +1 -0
- package/dist/models/tournament-status.enum.d.ts +7 -0
- package/dist/models/tournament-status.enum.d.ts.map +1 -0
- package/dist/models/tournament-status.enum.js +11 -0
- package/dist/models/tournament-status.enum.js.map +1 -0
- package/dist/models/tournament-winner.interface.d.ts +8 -0
- package/dist/models/tournament-winner.interface.d.ts.map +1 -0
- package/dist/models/tournament-winner.interface.js +3 -0
- package/dist/models/tournament-winner.interface.js.map +1 -0
- package/dist/repositories/index.d.ts +1 -2
- package/dist/repositories/index.d.ts.map +1 -1
- package/dist/repositories/index.js +1 -3
- package/dist/repositories/index.js.map +1 -1
- package/dist/repositories/tournament-many-tables-rooms.repository.d.ts +14 -4
- package/dist/repositories/tournament-many-tables-rooms.repository.d.ts.map +1 -1
- package/dist/repositories/tournament-many-tables-rooms.repository.js +53 -5
- package/dist/repositories/tournament-many-tables-rooms.repository.js.map +1 -1
- package/dist/repositories/tournament-one-table-rooms.repository.d.ts +12 -4
- package/dist/repositories/tournament-one-table-rooms.repository.d.ts.map +1 -1
- package/dist/repositories/tournament-one-table-rooms.repository.js +45 -5
- package/dist/repositories/tournament-one-table-rooms.repository.js.map +1 -1
- package/dist/schemas/tournament_many_tables_rooms.schema.d.ts +52 -15
- package/dist/schemas/tournament_many_tables_rooms.schema.d.ts.map +1 -1
- package/dist/schemas/tournament_many_tables_rooms.schema.js +23 -7
- package/dist/schemas/tournament_many_tables_rooms.schema.js.map +1 -1
- package/dist/schemas/tournament_one_table_rooms.schema.d.ts +114 -2
- package/dist/schemas/tournament_one_table_rooms.schema.d.ts.map +1 -1
- package/dist/schemas/tournament_one_table_rooms.schema.js +45 -1
- package/dist/schemas/tournament_one_table_rooms.schema.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +0 -7
- package/src/models/tournament-participant.interface.ts +5 -0
- package/src/models/tournament-status.enum.ts +6 -0
- package/src/models/tournament-winner.interface.ts +7 -0
- package/src/repositories/index.ts +0 -2
- package/src/repositories/tournament-many-tables-rooms.repository.ts +77 -5
- package/src/repositories/tournament-one-table-rooms.repository.ts +58 -4
- package/src/schemas/tournament_many_tables_rooms.schema.ts +22 -11
- package/src/schemas/tournament_one_table_rooms.schema.ts +39 -1
- package/dist/repositories/tournament-result.repository.d.ts +0 -9
- package/dist/repositories/tournament-result.repository.d.ts.map +0 -1
- package/dist/repositories/tournament-result.repository.js +0 -39
- package/dist/repositories/tournament-result.repository.js.map +0 -1
- package/dist/schemas/tournament_result.schema.d.ts +0 -82
- package/dist/schemas/tournament_result.schema.d.ts.map +0 -1
- package/dist/schemas/tournament_result.schema.js +0 -45
- package/dist/schemas/tournament_result.schema.js.map +0 -1
- package/src/repositories/tournament-result.repository.ts +0 -21
- package/src/schemas/tournament_result.schema.ts +0 -36
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Model } from 'mongoose';
|
|
2
|
-
import { TournamentResult, TournamentResultDocument } from '../';
|
|
3
|
-
export declare class TournamentResultRepository {
|
|
4
|
-
private resultModel;
|
|
5
|
-
constructor(resultModel: Model<TournamentResultDocument>);
|
|
6
|
-
findByTournamentId(tournamentId: string): Promise<TournamentResultDocument | null>;
|
|
7
|
-
createResult(result: Partial<TournamentResult>): Promise<TournamentResult>;
|
|
8
|
-
}
|
|
9
|
-
//# sourceMappingURL=tournament-result.repository.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tournament-result.repository.d.ts","sourceRoot":"","sources":["../../src/repositories/tournament-result.repository.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAQ,MAAM,KAAK,CAAC;AAEvE,qBACa,0BAA0B;IACc,OAAO,CAAC,WAAW;gBAAX,WAAW,EAAE,KAAK,CAAC,wBAAwB,CAAC;IAG/F,kBAAkB,CAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC;IAMnF,YAAY,CAAE,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAGpF"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.TournamentResultRepository = void 0;
|
|
16
|
-
const common_1 = require("@nestjs/common");
|
|
17
|
-
const mongoose_1 = require("@nestjs/mongoose");
|
|
18
|
-
const mongoose_2 = require("mongoose");
|
|
19
|
-
const __1 = require("../");
|
|
20
|
-
let TournamentResultRepository = class TournamentResultRepository {
|
|
21
|
-
constructor(resultModel) {
|
|
22
|
-
this.resultModel = resultModel;
|
|
23
|
-
}
|
|
24
|
-
async findByTournamentId(tournamentId) {
|
|
25
|
-
return this.resultModel
|
|
26
|
-
.findOne({ tournamentId })
|
|
27
|
-
.exec();
|
|
28
|
-
}
|
|
29
|
-
async createResult(result) {
|
|
30
|
-
return this.resultModel.create(result);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
exports.TournamentResultRepository = TournamentResultRepository;
|
|
34
|
-
exports.TournamentResultRepository = TournamentResultRepository = __decorate([
|
|
35
|
-
(0, common_1.Injectable)(),
|
|
36
|
-
__param(0, (0, mongoose_1.InjectModel)(__1.TournamentResult.name)),
|
|
37
|
-
__metadata("design:paramtypes", [mongoose_2.Model])
|
|
38
|
-
], TournamentResultRepository);
|
|
39
|
-
//# sourceMappingURL=tournament-result.repository.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tournament-result.repository.js","sourceRoot":"","sources":["../../src/repositories/tournament-result.repository.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAA+C;AAC/C,uCAAiC;AAEjC,2BAAuE;AAGhE,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACnC,YAAyD,WAA4C;QAA5C,gBAAW,GAAX,WAAW,CAAiC;IACrG,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAE,YAAoB;QAC1C,OAAO,IAAI,CAAC,WAAW;aAClB,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;aACzB,IAAI,EAAE,CAAC;IAChB,CAAC;IAED,KAAK,CAAC,YAAY,CAAE,MAAiC;QACjD,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;CACJ,CAAA;AAbY,gEAA0B;qCAA1B,0BAA0B;IADtC,IAAA,mBAAU,GAAE;IAEK,WAAA,IAAA,sBAAW,EAAC,oBAAgB,CAAC,IAAI,CAAC,CAAA;qCAAsB,gBAAK;GADlE,0BAA0B,CAatC"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { Document, HydratedDocument } from 'mongoose';
|
|
2
|
-
export type TournamentResultDocument = HydratedDocument<TournamentResult>;
|
|
3
|
-
export interface IWinner {
|
|
4
|
-
userId: string;
|
|
5
|
-
userName: string;
|
|
6
|
-
userAvatarUrl: string;
|
|
7
|
-
profit: number;
|
|
8
|
-
rank: number;
|
|
9
|
-
}
|
|
10
|
-
export declare class TournamentResult {
|
|
11
|
-
readonly resultId: string;
|
|
12
|
-
tournamentId: String;
|
|
13
|
-
gameType: String;
|
|
14
|
-
winners: Array<IWinner>;
|
|
15
|
-
createDate: Date;
|
|
16
|
-
}
|
|
17
|
-
export declare const TournamentResultSchema: import("mongoose").Schema<TournamentResult, import("mongoose").Model<TournamentResult, any, any, any, (Document<unknown, any, TournamentResult, any, import("mongoose").DefaultSchemaOptions> & TournamentResult & {
|
|
18
|
-
_id: import("mongoose").Types.ObjectId;
|
|
19
|
-
} & {
|
|
20
|
-
__v: number;
|
|
21
|
-
} & {
|
|
22
|
-
id: string;
|
|
23
|
-
}) | (Document<unknown, any, TournamentResult, any, import("mongoose").DefaultSchemaOptions> & TournamentResult & {
|
|
24
|
-
_id: import("mongoose").Types.ObjectId;
|
|
25
|
-
} & {
|
|
26
|
-
__v: number;
|
|
27
|
-
}), any, TournamentResult>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TournamentResult, Document<unknown, {}, TournamentResult, {
|
|
28
|
-
id: string;
|
|
29
|
-
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentResult & {
|
|
30
|
-
_id: import("mongoose").Types.ObjectId;
|
|
31
|
-
} & {
|
|
32
|
-
__v: number;
|
|
33
|
-
}, "id"> & {
|
|
34
|
-
id: string;
|
|
35
|
-
}, {
|
|
36
|
-
readonly resultId?: import("mongoose").SchemaDefinitionProperty<string, TournamentResult, Document<unknown, {}, TournamentResult, {
|
|
37
|
-
id: string;
|
|
38
|
-
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentResult & {
|
|
39
|
-
_id: import("mongoose").Types.ObjectId;
|
|
40
|
-
} & {
|
|
41
|
-
__v: number;
|
|
42
|
-
}, "id"> & {
|
|
43
|
-
id: string;
|
|
44
|
-
}>;
|
|
45
|
-
tournamentId?: import("mongoose").SchemaDefinitionProperty<String, TournamentResult, Document<unknown, {}, TournamentResult, {
|
|
46
|
-
id: string;
|
|
47
|
-
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentResult & {
|
|
48
|
-
_id: import("mongoose").Types.ObjectId;
|
|
49
|
-
} & {
|
|
50
|
-
__v: number;
|
|
51
|
-
}, "id"> & {
|
|
52
|
-
id: string;
|
|
53
|
-
}>;
|
|
54
|
-
gameType?: import("mongoose").SchemaDefinitionProperty<String, TournamentResult, Document<unknown, {}, TournamentResult, {
|
|
55
|
-
id: string;
|
|
56
|
-
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentResult & {
|
|
57
|
-
_id: import("mongoose").Types.ObjectId;
|
|
58
|
-
} & {
|
|
59
|
-
__v: number;
|
|
60
|
-
}, "id"> & {
|
|
61
|
-
id: string;
|
|
62
|
-
}>;
|
|
63
|
-
winners?: import("mongoose").SchemaDefinitionProperty<IWinner[], TournamentResult, Document<unknown, {}, TournamentResult, {
|
|
64
|
-
id: string;
|
|
65
|
-
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentResult & {
|
|
66
|
-
_id: import("mongoose").Types.ObjectId;
|
|
67
|
-
} & {
|
|
68
|
-
__v: number;
|
|
69
|
-
}, "id"> & {
|
|
70
|
-
id: string;
|
|
71
|
-
}>;
|
|
72
|
-
createDate?: import("mongoose").SchemaDefinitionProperty<Date, TournamentResult, Document<unknown, {}, TournamentResult, {
|
|
73
|
-
id: string;
|
|
74
|
-
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentResult & {
|
|
75
|
-
_id: import("mongoose").Types.ObjectId;
|
|
76
|
-
} & {
|
|
77
|
-
__v: number;
|
|
78
|
-
}, "id"> & {
|
|
79
|
-
id: string;
|
|
80
|
-
}>;
|
|
81
|
-
}, TournamentResult>;
|
|
82
|
-
//# sourceMappingURL=tournament_result.schema.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tournament_result.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/tournament_result.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEtD,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;AAE1E,MAAM,WAAW,OAAO;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,qBACa,gBAAgB;IAMzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAG1B,YAAY,EAAE,MAAM,CAAC;IAGrB,QAAQ,EAAE,MAAM,CAAC;IAGjB,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAGxB,UAAU,EAAE,IAAI,CAAC;CACpB;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAiD,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.TournamentResultSchema = exports.TournamentResult = void 0;
|
|
13
|
-
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
-
let TournamentResult = class TournamentResult {
|
|
15
|
-
};
|
|
16
|
-
exports.TournamentResult = TournamentResult;
|
|
17
|
-
__decorate([
|
|
18
|
-
(0, mongoose_1.Virtual)({
|
|
19
|
-
get: function () {
|
|
20
|
-
return this._id.toString();
|
|
21
|
-
},
|
|
22
|
-
}),
|
|
23
|
-
__metadata("design:type", String)
|
|
24
|
-
], TournamentResult.prototype, "resultId", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, mongoose_1.Prop)(),
|
|
27
|
-
__metadata("design:type", String)
|
|
28
|
-
], TournamentResult.prototype, "tournamentId", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, mongoose_1.Prop)(),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], TournamentResult.prototype, "gameType", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, mongoose_1.Prop)(),
|
|
35
|
-
__metadata("design:type", Array)
|
|
36
|
-
], TournamentResult.prototype, "winners", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, mongoose_1.Prop)(),
|
|
39
|
-
__metadata("design:type", Date)
|
|
40
|
-
], TournamentResult.prototype, "createDate", void 0);
|
|
41
|
-
exports.TournamentResult = TournamentResult = __decorate([
|
|
42
|
-
(0, mongoose_1.Schema)({ collection: 'tournament_results' })
|
|
43
|
-
], TournamentResult);
|
|
44
|
-
exports.TournamentResultSchema = mongoose_1.SchemaFactory.createForClass(TournamentResult);
|
|
45
|
-
//# sourceMappingURL=tournament_result.schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tournament_result.schema.js","sourceRoot":"","sources":["../../src/schemas/tournament_result.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAwE;AAcjE,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;CAmB5B,CAAA;AAnBY,4CAAgB;AAMhB;IALR,IAAA,kBAAO,EAAC;QACL,GAAG,EAAE;YACD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC/B,CAAC;KACJ,CAAC;;kDACwB;AAG1B;IADC,IAAA,eAAI,GAAE;8BACO,MAAM;sDAAC;AAGrB;IADC,IAAA,eAAI,GAAE;8BACG,MAAM;kDAAC;AAGjB;IADC,IAAA,eAAI,GAAE;8BACE,KAAK;iDAAU;AAGxB;IADC,IAAA,eAAI,GAAE;8BACK,IAAI;oDAAC;2BAlBR,gBAAgB;IAD5B,IAAA,iBAAM,EAAC,EAAE,UAAU,EAAE,oBAAoB,EAAE,CAAC;GAChC,gBAAgB,CAmB5B;AAEY,QAAA,sBAAsB,GAAG,wBAAa,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@nestjs/common';
|
|
2
|
-
import { InjectModel } from '@nestjs/mongoose';
|
|
3
|
-
import { Model } from 'mongoose';
|
|
4
|
-
|
|
5
|
-
import { TournamentResult, TournamentResultDocument, User } from '../';
|
|
6
|
-
|
|
7
|
-
@Injectable()
|
|
8
|
-
export class TournamentResultRepository {
|
|
9
|
-
constructor (@InjectModel(TournamentResult.name) private resultModel: Model<TournamentResultDocument>) {
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
async findByTournamentId (tournamentId: string): Promise<TournamentResultDocument | null> {
|
|
13
|
-
return this.resultModel
|
|
14
|
-
.findOne({ tournamentId })
|
|
15
|
-
.exec();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
async createResult (result: Partial<TournamentResult>): Promise<TournamentResult> {
|
|
19
|
-
return this.resultModel.create(result);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { Prop, Schema, SchemaFactory, Virtual } from '@nestjs/mongoose';
|
|
2
|
-
import { Document, HydratedDocument } from 'mongoose';
|
|
3
|
-
|
|
4
|
-
export type TournamentResultDocument = HydratedDocument<TournamentResult>;
|
|
5
|
-
|
|
6
|
-
export interface IWinner {
|
|
7
|
-
userId: string;
|
|
8
|
-
userName: string;
|
|
9
|
-
userAvatarUrl: string;
|
|
10
|
-
profit: number;
|
|
11
|
-
rank: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@Schema({ collection: 'tournament_results' })
|
|
15
|
-
export class TournamentResult {
|
|
16
|
-
@Virtual({
|
|
17
|
-
get: function (this: Document) {
|
|
18
|
-
return this._id.toString();
|
|
19
|
-
},
|
|
20
|
-
})
|
|
21
|
-
readonly resultId: string;
|
|
22
|
-
|
|
23
|
-
@Prop()
|
|
24
|
-
tournamentId: String;
|
|
25
|
-
|
|
26
|
-
@Prop()
|
|
27
|
-
gameType: String;
|
|
28
|
-
|
|
29
|
-
@Prop()
|
|
30
|
-
winners: Array<IWinner>;
|
|
31
|
-
|
|
32
|
-
@Prop()
|
|
33
|
-
createDate: Date;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const TournamentResultSchema = SchemaFactory.createForClass(TournamentResult);
|