jp.db.schemas 2.0.1 → 2.0.3
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 +10 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -1
- 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 +4 -1
- package/dist/repositories/index.d.ts.map +1 -1
- package/dist/repositories/index.js +7 -1
- package/dist/repositories/index.js.map +1 -1
- package/dist/repositories/simple-rooms.repository.d.ts +8 -0
- package/dist/repositories/simple-rooms.repository.d.ts.map +1 -0
- package/dist/repositories/simple-rooms.repository.js +36 -0
- package/dist/repositories/simple-rooms.repository.js.map +1 -0
- package/dist/repositories/tournament-many-tables-rooms.repository.d.ts +18 -0
- package/dist/repositories/tournament-many-tables-rooms.repository.d.ts.map +1 -0
- package/dist/repositories/tournament-many-tables-rooms.repository.js +84 -0
- package/dist/repositories/tournament-many-tables-rooms.repository.js.map +1 -0
- package/dist/repositories/tournament-one-table-rooms.repository.d.ts +16 -0
- package/dist/repositories/tournament-one-table-rooms.repository.d.ts.map +1 -0
- package/dist/repositories/tournament-one-table-rooms.repository.js +76 -0
- package/dist/repositories/tournament-one-table-rooms.repository.js.map +1 -0
- package/dist/schemas/simple_rooms.schema.d.ts +125 -0
- package/dist/schemas/simple_rooms.schema.d.ts.map +1 -0
- package/dist/schemas/simple_rooms.schema.js +65 -0
- package/dist/schemas/simple_rooms.schema.js.map +1 -0
- package/dist/schemas/tournament_many_tables_rooms.schema.d.ts +237 -0
- package/dist/schemas/tournament_many_tables_rooms.schema.d.ts.map +1 -0
- package/dist/schemas/tournament_many_tables_rooms.schema.js +109 -0
- package/dist/schemas/tournament_many_tables_rooms.schema.js.map +1 -0
- package/dist/schemas/tournament_one_table_rooms.schema.d.ts +237 -0
- package/dist/schemas/tournament_one_table_rooms.schema.d.ts.map +1 -0
- package/dist/schemas/tournament_one_table_rooms.schema.js +109 -0
- package/dist/schemas/tournament_one_table_rooms.schema.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +21 -0
- 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 +6 -0
- package/src/repositories/simple-rooms.repository.ts +17 -0
- package/src/repositories/tournament-many-tables-rooms.repository.ts +89 -0
- package/src/repositories/tournament-one-table-rooms.repository.ts +71 -0
- package/src/schemas/simple_rooms.schema.ts +43 -0
- package/src/schemas/tournament_many_tables_rooms.schema.ts +81 -0
- package/src/schemas/tournament_one_table_rooms.schema.ts +81 -0
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { Document, HydratedDocument } from 'mongoose';
|
|
2
|
+
import { ITournamentWinner } from '../models/tournament-winner.interface';
|
|
3
|
+
import { ITournamentParticipant } from '../models/tournament-participant.interface';
|
|
4
|
+
export type TournamentOneTableRoomDocument = HydratedDocument<TournamentOneTableRoom>;
|
|
5
|
+
export declare class TournamentOneTableRoom {
|
|
6
|
+
readonly tournamentId: string;
|
|
7
|
+
title: Record<string, string>;
|
|
8
|
+
subtitle: Record<string, string>;
|
|
9
|
+
tableSize: number;
|
|
10
|
+
bet: number;
|
|
11
|
+
ticketPrice: number;
|
|
12
|
+
roomType: string;
|
|
13
|
+
gameType: string;
|
|
14
|
+
rulesType: string;
|
|
15
|
+
deckType?: string;
|
|
16
|
+
isTemplate: boolean;
|
|
17
|
+
templateId?: string;
|
|
18
|
+
type: string;
|
|
19
|
+
description: Record<string, string>;
|
|
20
|
+
maxParticipants: number;
|
|
21
|
+
participants: Array<ITournamentParticipant>;
|
|
22
|
+
status: string;
|
|
23
|
+
winners: Array<ITournamentWinner>;
|
|
24
|
+
createDate: Date;
|
|
25
|
+
startDate: Date;
|
|
26
|
+
finishDate: Date;
|
|
27
|
+
}
|
|
28
|
+
export declare const TournamentOneTableRoomSchema: import("mongoose").Schema<TournamentOneTableRoom, import("mongoose").Model<TournamentOneTableRoom, any, any, any, (Document<unknown, any, TournamentOneTableRoom, any, import("mongoose").DefaultSchemaOptions> & TournamentOneTableRoom & {
|
|
29
|
+
_id: import("mongoose").Types.ObjectId;
|
|
30
|
+
} & {
|
|
31
|
+
__v: number;
|
|
32
|
+
} & {
|
|
33
|
+
id: string;
|
|
34
|
+
}) | (Document<unknown, any, TournamentOneTableRoom, any, import("mongoose").DefaultSchemaOptions> & TournamentOneTableRoom & {
|
|
35
|
+
_id: import("mongoose").Types.ObjectId;
|
|
36
|
+
} & {
|
|
37
|
+
__v: number;
|
|
38
|
+
}), any, TournamentOneTableRoom>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
39
|
+
id: string;
|
|
40
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
41
|
+
_id: import("mongoose").Types.ObjectId;
|
|
42
|
+
} & {
|
|
43
|
+
__v: number;
|
|
44
|
+
}, "id"> & {
|
|
45
|
+
id: string;
|
|
46
|
+
}, {
|
|
47
|
+
readonly tournamentId?: import("mongoose").SchemaDefinitionProperty<string, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
48
|
+
id: string;
|
|
49
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
50
|
+
_id: import("mongoose").Types.ObjectId;
|
|
51
|
+
} & {
|
|
52
|
+
__v: number;
|
|
53
|
+
}, "id"> & {
|
|
54
|
+
id: string;
|
|
55
|
+
}>;
|
|
56
|
+
title?: import("mongoose").SchemaDefinitionProperty<Record<string, string>, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
57
|
+
id: string;
|
|
58
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
59
|
+
_id: import("mongoose").Types.ObjectId;
|
|
60
|
+
} & {
|
|
61
|
+
__v: number;
|
|
62
|
+
}, "id"> & {
|
|
63
|
+
id: string;
|
|
64
|
+
}>;
|
|
65
|
+
subtitle?: import("mongoose").SchemaDefinitionProperty<Record<string, string>, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
66
|
+
id: string;
|
|
67
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
68
|
+
_id: import("mongoose").Types.ObjectId;
|
|
69
|
+
} & {
|
|
70
|
+
__v: number;
|
|
71
|
+
}, "id"> & {
|
|
72
|
+
id: string;
|
|
73
|
+
}>;
|
|
74
|
+
tableSize?: import("mongoose").SchemaDefinitionProperty<number, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
75
|
+
id: string;
|
|
76
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
77
|
+
_id: import("mongoose").Types.ObjectId;
|
|
78
|
+
} & {
|
|
79
|
+
__v: number;
|
|
80
|
+
}, "id"> & {
|
|
81
|
+
id: string;
|
|
82
|
+
}>;
|
|
83
|
+
bet?: import("mongoose").SchemaDefinitionProperty<number, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
84
|
+
id: string;
|
|
85
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
86
|
+
_id: import("mongoose").Types.ObjectId;
|
|
87
|
+
} & {
|
|
88
|
+
__v: number;
|
|
89
|
+
}, "id"> & {
|
|
90
|
+
id: string;
|
|
91
|
+
}>;
|
|
92
|
+
ticketPrice?: import("mongoose").SchemaDefinitionProperty<number, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
93
|
+
id: string;
|
|
94
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
95
|
+
_id: import("mongoose").Types.ObjectId;
|
|
96
|
+
} & {
|
|
97
|
+
__v: number;
|
|
98
|
+
}, "id"> & {
|
|
99
|
+
id: string;
|
|
100
|
+
}>;
|
|
101
|
+
roomType?: import("mongoose").SchemaDefinitionProperty<string, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
102
|
+
id: string;
|
|
103
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
104
|
+
_id: import("mongoose").Types.ObjectId;
|
|
105
|
+
} & {
|
|
106
|
+
__v: number;
|
|
107
|
+
}, "id"> & {
|
|
108
|
+
id: string;
|
|
109
|
+
}>;
|
|
110
|
+
gameType?: import("mongoose").SchemaDefinitionProperty<string, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
111
|
+
id: string;
|
|
112
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
113
|
+
_id: import("mongoose").Types.ObjectId;
|
|
114
|
+
} & {
|
|
115
|
+
__v: number;
|
|
116
|
+
}, "id"> & {
|
|
117
|
+
id: string;
|
|
118
|
+
}>;
|
|
119
|
+
rulesType?: import("mongoose").SchemaDefinitionProperty<string, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
120
|
+
id: string;
|
|
121
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
122
|
+
_id: import("mongoose").Types.ObjectId;
|
|
123
|
+
} & {
|
|
124
|
+
__v: number;
|
|
125
|
+
}, "id"> & {
|
|
126
|
+
id: string;
|
|
127
|
+
}>;
|
|
128
|
+
deckType?: import("mongoose").SchemaDefinitionProperty<string, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
129
|
+
id: string;
|
|
130
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
131
|
+
_id: import("mongoose").Types.ObjectId;
|
|
132
|
+
} & {
|
|
133
|
+
__v: number;
|
|
134
|
+
}, "id"> & {
|
|
135
|
+
id: string;
|
|
136
|
+
}>;
|
|
137
|
+
isTemplate?: import("mongoose").SchemaDefinitionProperty<boolean, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
138
|
+
id: string;
|
|
139
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
140
|
+
_id: import("mongoose").Types.ObjectId;
|
|
141
|
+
} & {
|
|
142
|
+
__v: number;
|
|
143
|
+
}, "id"> & {
|
|
144
|
+
id: string;
|
|
145
|
+
}>;
|
|
146
|
+
templateId?: import("mongoose").SchemaDefinitionProperty<string, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
147
|
+
id: string;
|
|
148
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
149
|
+
_id: import("mongoose").Types.ObjectId;
|
|
150
|
+
} & {
|
|
151
|
+
__v: number;
|
|
152
|
+
}, "id"> & {
|
|
153
|
+
id: string;
|
|
154
|
+
}>;
|
|
155
|
+
type?: import("mongoose").SchemaDefinitionProperty<string, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
156
|
+
id: string;
|
|
157
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
158
|
+
_id: import("mongoose").Types.ObjectId;
|
|
159
|
+
} & {
|
|
160
|
+
__v: number;
|
|
161
|
+
}, "id"> & {
|
|
162
|
+
id: string;
|
|
163
|
+
}>;
|
|
164
|
+
description?: import("mongoose").SchemaDefinitionProperty<Record<string, string>, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
165
|
+
id: string;
|
|
166
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
167
|
+
_id: import("mongoose").Types.ObjectId;
|
|
168
|
+
} & {
|
|
169
|
+
__v: number;
|
|
170
|
+
}, "id"> & {
|
|
171
|
+
id: string;
|
|
172
|
+
}>;
|
|
173
|
+
maxParticipants?: import("mongoose").SchemaDefinitionProperty<number, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
174
|
+
id: string;
|
|
175
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
176
|
+
_id: import("mongoose").Types.ObjectId;
|
|
177
|
+
} & {
|
|
178
|
+
__v: number;
|
|
179
|
+
}, "id"> & {
|
|
180
|
+
id: string;
|
|
181
|
+
}>;
|
|
182
|
+
participants?: import("mongoose").SchemaDefinitionProperty<ITournamentParticipant[], TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
183
|
+
id: string;
|
|
184
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
185
|
+
_id: import("mongoose").Types.ObjectId;
|
|
186
|
+
} & {
|
|
187
|
+
__v: number;
|
|
188
|
+
}, "id"> & {
|
|
189
|
+
id: string;
|
|
190
|
+
}>;
|
|
191
|
+
status?: import("mongoose").SchemaDefinitionProperty<string, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
192
|
+
id: string;
|
|
193
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
194
|
+
_id: import("mongoose").Types.ObjectId;
|
|
195
|
+
} & {
|
|
196
|
+
__v: number;
|
|
197
|
+
}, "id"> & {
|
|
198
|
+
id: string;
|
|
199
|
+
}>;
|
|
200
|
+
winners?: import("mongoose").SchemaDefinitionProperty<ITournamentWinner[], TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
201
|
+
id: string;
|
|
202
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
203
|
+
_id: import("mongoose").Types.ObjectId;
|
|
204
|
+
} & {
|
|
205
|
+
__v: number;
|
|
206
|
+
}, "id"> & {
|
|
207
|
+
id: string;
|
|
208
|
+
}>;
|
|
209
|
+
createDate?: import("mongoose").SchemaDefinitionProperty<Date, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
210
|
+
id: string;
|
|
211
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
212
|
+
_id: import("mongoose").Types.ObjectId;
|
|
213
|
+
} & {
|
|
214
|
+
__v: number;
|
|
215
|
+
}, "id"> & {
|
|
216
|
+
id: string;
|
|
217
|
+
}>;
|
|
218
|
+
startDate?: import("mongoose").SchemaDefinitionProperty<Date, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
219
|
+
id: string;
|
|
220
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
221
|
+
_id: import("mongoose").Types.ObjectId;
|
|
222
|
+
} & {
|
|
223
|
+
__v: number;
|
|
224
|
+
}, "id"> & {
|
|
225
|
+
id: string;
|
|
226
|
+
}>;
|
|
227
|
+
finishDate?: import("mongoose").SchemaDefinitionProperty<Date, TournamentOneTableRoom, Document<unknown, {}, TournamentOneTableRoom, {
|
|
228
|
+
id: string;
|
|
229
|
+
}, import("mongoose").ResolveSchemaOptions<import("mongoose").DefaultSchemaOptions>> & Omit<TournamentOneTableRoom & {
|
|
230
|
+
_id: import("mongoose").Types.ObjectId;
|
|
231
|
+
} & {
|
|
232
|
+
__v: number;
|
|
233
|
+
}, "id"> & {
|
|
234
|
+
id: string;
|
|
235
|
+
}>;
|
|
236
|
+
}, TournamentOneTableRoom>;
|
|
237
|
+
//# sourceMappingURL=tournament_one_table_rooms.schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tournament_one_table_rooms.schema.d.ts","sourceRoot":"","sources":["../../src/schemas/tournament_one_table_rooms.schema.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEpF,MAAM,MAAM,8BAA8B,GAAG,gBAAgB,CAAC,sBAAsB,CAAC,CAAC;AAEtF,qBACa,sBAAsB;IAM/B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAG9B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAG9B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAGjC,SAAS,EAAE,MAAM,CAAC;IAGlB,GAAG,EAAE,MAAM,CAAC;IAGZ,WAAW,EAAE,MAAM,CAAC;IAGpB,QAAQ,EAAE,MAAM,CAAC;IAGjB,QAAQ,EAAE,MAAM,CAAC;IAGjB,SAAS,EAAE,MAAM,CAAC;IAGlB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAKlB,UAAU,EAAE,OAAO,CAAC;IAGpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,IAAI,EAAE,MAAM,CAAC;IAGb,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAGpC,eAAe,EAAE,MAAM,CAAC;IAGxB,YAAY,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAG5C,MAAM,EAAE,MAAM,CAAC;IAGf,OAAO,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAGlC,UAAU,EAAE,IAAI,CAAC;IAGjB,SAAS,EAAE,IAAI,CAAC;IAGhB,UAAU,EAAE,IAAI,CAAC;CACpB;AAED,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAAuD,CAAC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
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.TournamentOneTableRoomSchema = exports.TournamentOneTableRoom = void 0;
|
|
13
|
+
const mongoose_1 = require("@nestjs/mongoose");
|
|
14
|
+
let TournamentOneTableRoom = class TournamentOneTableRoom {
|
|
15
|
+
};
|
|
16
|
+
exports.TournamentOneTableRoom = TournamentOneTableRoom;
|
|
17
|
+
__decorate([
|
|
18
|
+
(0, mongoose_1.Virtual)({
|
|
19
|
+
get: function () {
|
|
20
|
+
return this._id.toString();
|
|
21
|
+
},
|
|
22
|
+
}),
|
|
23
|
+
__metadata("design:type", String)
|
|
24
|
+
], TournamentOneTableRoom.prototype, "tournamentId", void 0);
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, mongoose_1.Prop)({ type: Object }),
|
|
27
|
+
__metadata("design:type", Object)
|
|
28
|
+
], TournamentOneTableRoom.prototype, "title", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, mongoose_1.Prop)({ type: Object }),
|
|
31
|
+
__metadata("design:type", Object)
|
|
32
|
+
], TournamentOneTableRoom.prototype, "subtitle", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, mongoose_1.Prop)(),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], TournamentOneTableRoom.prototype, "tableSize", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, mongoose_1.Prop)(),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], TournamentOneTableRoom.prototype, "bet", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, mongoose_1.Prop)(),
|
|
43
|
+
__metadata("design:type", Number)
|
|
44
|
+
], TournamentOneTableRoom.prototype, "ticketPrice", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, mongoose_1.Prop)(),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], TournamentOneTableRoom.prototype, "roomType", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, mongoose_1.Prop)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], TournamentOneTableRoom.prototype, "gameType", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, mongoose_1.Prop)(),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], TournamentOneTableRoom.prototype, "rulesType", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, mongoose_1.Prop)(),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], TournamentOneTableRoom.prototype, "deckType", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, mongoose_1.Prop)(),
|
|
63
|
+
__metadata("design:type", Boolean)
|
|
64
|
+
], TournamentOneTableRoom.prototype, "isTemplate", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, mongoose_1.Prop)(),
|
|
67
|
+
__metadata("design:type", String)
|
|
68
|
+
], TournamentOneTableRoom.prototype, "templateId", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
(0, mongoose_1.Prop)(),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], TournamentOneTableRoom.prototype, "type", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, mongoose_1.Prop)({ type: Object }),
|
|
75
|
+
__metadata("design:type", Object)
|
|
76
|
+
], TournamentOneTableRoom.prototype, "description", void 0);
|
|
77
|
+
__decorate([
|
|
78
|
+
(0, mongoose_1.Prop)(),
|
|
79
|
+
__metadata("design:type", Number)
|
|
80
|
+
], TournamentOneTableRoom.prototype, "maxParticipants", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, mongoose_1.Prop)(),
|
|
83
|
+
__metadata("design:type", Array)
|
|
84
|
+
], TournamentOneTableRoom.prototype, "participants", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, mongoose_1.Prop)(),
|
|
87
|
+
__metadata("design:type", String)
|
|
88
|
+
], TournamentOneTableRoom.prototype, "status", void 0);
|
|
89
|
+
__decorate([
|
|
90
|
+
(0, mongoose_1.Prop)(),
|
|
91
|
+
__metadata("design:type", Array)
|
|
92
|
+
], TournamentOneTableRoom.prototype, "winners", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
(0, mongoose_1.Prop)(),
|
|
95
|
+
__metadata("design:type", Date)
|
|
96
|
+
], TournamentOneTableRoom.prototype, "createDate", void 0);
|
|
97
|
+
__decorate([
|
|
98
|
+
(0, mongoose_1.Prop)(),
|
|
99
|
+
__metadata("design:type", Date)
|
|
100
|
+
], TournamentOneTableRoom.prototype, "startDate", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
(0, mongoose_1.Prop)(),
|
|
103
|
+
__metadata("design:type", Date)
|
|
104
|
+
], TournamentOneTableRoom.prototype, "finishDate", void 0);
|
|
105
|
+
exports.TournamentOneTableRoom = TournamentOneTableRoom = __decorate([
|
|
106
|
+
(0, mongoose_1.Schema)({ collection: 'tournament_one_table_rooms' })
|
|
107
|
+
], TournamentOneTableRoom);
|
|
108
|
+
exports.TournamentOneTableRoomSchema = mongoose_1.SchemaFactory.createForClass(TournamentOneTableRoom);
|
|
109
|
+
//# sourceMappingURL=tournament_one_table_rooms.schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tournament_one_table_rooms.schema.js","sourceRoot":"","sources":["../../src/schemas/tournament_one_table_rooms.schema.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAAwE;AASjE,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;CAqElC,CAAA;AArEY,wDAAsB;AAMtB;IALR,IAAA,kBAAO,EAAC;QACL,GAAG,EAAE;YACD,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QAC/B,CAAC;KACJ,CAAC;;4DAC4B;AAG9B;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;qDACO;AAG9B;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;wDACU;AAGjC;IADC,IAAA,eAAI,GAAE;;yDACW;AAGlB;IADC,IAAA,eAAI,GAAE;;mDACK;AAGZ;IADC,IAAA,eAAI,GAAE;;2DACa;AAGpB;IADC,IAAA,eAAI,GAAE;;wDACU;AAGjB;IADC,IAAA,eAAI,GAAE;;wDACU;AAGjB;IADC,IAAA,eAAI,GAAE;;yDACW;AAGlB;IADC,IAAA,eAAI,GAAE;;wDACW;AAKlB;IADC,IAAA,eAAI,GAAE;;0DACa;AAGpB;IADC,IAAA,eAAI,GAAE;;0DACa;AAGpB;IADC,IAAA,eAAI,GAAE;;oDACM;AAGb;IADC,IAAA,eAAI,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;2DACa;AAGpC;IADC,IAAA,eAAI,GAAE;;+DACiB;AAGxB;IADC,IAAA,eAAI,GAAE;8BACO,KAAK;4DAAyB;AAG5C;IADC,IAAA,eAAI,GAAE;;sDACQ;AAGf;IADC,IAAA,eAAI,GAAE;8BACE,KAAK;uDAAoB;AAGlC;IADC,IAAA,eAAI,GAAE;8BACK,IAAI;0DAAC;AAGjB;IADC,IAAA,eAAI,GAAE;8BACI,IAAI;yDAAC;AAGhB;IADC,IAAA,eAAI,GAAE;8BACK,IAAI;0DAAC;iCApER,sBAAsB;IADlC,IAAA,iBAAM,EAAC,EAAE,UAAU,EAAE,4BAA4B,EAAE,CAAC;GACxC,sBAAsB,CAqElC;AAEY,QAAA,4BAA4B,GAAG,wBAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -50,6 +50,12 @@ import { GameResult, GameResultSchema } from './schemas/game_result.schema';
|
|
|
50
50
|
import type { GameResultDocument } from './schemas/game_result.schema';
|
|
51
51
|
import { BalanceHistory, BalanceHistorySchema } from './schemas/balance_history.schema';
|
|
52
52
|
import type { BalanceHistoryDocument } from './schemas/balance_history.schema';
|
|
53
|
+
import { SimpleRoom, SimpleRoomSchema } from './schemas/simple_rooms.schema';
|
|
54
|
+
import type { SimpleRoomDocument } from './schemas/simple_rooms.schema';
|
|
55
|
+
import { TournamentOneTableRoom, TournamentOneTableRoomSchema, } from './schemas/tournament_one_table_rooms.schema';
|
|
56
|
+
import type { TournamentOneTableRoomDocument } from './schemas/tournament_one_table_rooms.schema';
|
|
57
|
+
import { TournamentManyTablesRoom, TournamentManyTablesRoomSchema } from './schemas/tournament_many_tables_rooms.schema';
|
|
58
|
+
import type { TournamentManyTablesRoomDocument } from './schemas/tournament_many_tables_rooms.schema';
|
|
53
59
|
|
|
54
60
|
import {
|
|
55
61
|
AdminRepository,
|
|
@@ -65,6 +71,9 @@ import {
|
|
|
65
71
|
RoomsRepository,
|
|
66
72
|
GameResultRepository,
|
|
67
73
|
BalanceHistoryRepository,
|
|
74
|
+
SimpleRoomsRepository,
|
|
75
|
+
TournamentOneTableRoomsRepository,
|
|
76
|
+
TournamentManyTablesRoomsRepository,
|
|
68
77
|
} from './repositories'
|
|
69
78
|
|
|
70
79
|
export type {
|
|
@@ -94,6 +103,9 @@ export type {
|
|
|
94
103
|
MenuDocument,
|
|
95
104
|
GameResultDocument,
|
|
96
105
|
BalanceHistoryDocument,
|
|
106
|
+
SimpleRoomDocument,
|
|
107
|
+
TournamentOneTableRoomDocument,
|
|
108
|
+
TournamentManyTablesRoomDocument,
|
|
97
109
|
}
|
|
98
110
|
|
|
99
111
|
export {
|
|
@@ -149,6 +161,12 @@ export {
|
|
|
149
161
|
GameResultSchema,
|
|
150
162
|
BalanceHistory,
|
|
151
163
|
BalanceHistorySchema,
|
|
164
|
+
SimpleRoom,
|
|
165
|
+
SimpleRoomSchema,
|
|
166
|
+
TournamentOneTableRoom,
|
|
167
|
+
TournamentOneTableRoomSchema,
|
|
168
|
+
TournamentManyTablesRoom,
|
|
169
|
+
TournamentManyTablesRoomSchema,
|
|
152
170
|
}
|
|
153
171
|
|
|
154
172
|
export {
|
|
@@ -165,4 +183,7 @@ export {
|
|
|
165
183
|
RoomsRepository,
|
|
166
184
|
GameResultRepository,
|
|
167
185
|
BalanceHistoryRepository,
|
|
186
|
+
SimpleRoomsRepository,
|
|
187
|
+
TournamentOneTableRoomsRepository,
|
|
188
|
+
TournamentManyTablesRoomsRepository,
|
|
168
189
|
}
|
|
@@ -11,6 +11,9 @@ import { MenuRepository } from './menu.repository';
|
|
|
11
11
|
import { RoomsRepository } from './rooms.repository';
|
|
12
12
|
import { GameResultRepository } from './game-result.repository';
|
|
13
13
|
import { BalanceHistoryRepository } from './balance-history.repository';
|
|
14
|
+
import { SimpleRoomsRepository } from './simple-rooms.repository';
|
|
15
|
+
import { TournamentOneTableRoomsRepository } from './tournament-one-table-rooms.repository';
|
|
16
|
+
import { TournamentManyTablesRoomsRepository } from './tournament-many-tables-rooms.repository';
|
|
14
17
|
|
|
15
18
|
export {
|
|
16
19
|
AdminRepository,
|
|
@@ -26,4 +29,7 @@ export {
|
|
|
26
29
|
RoomsRepository,
|
|
27
30
|
GameResultRepository,
|
|
28
31
|
BalanceHistoryRepository,
|
|
32
|
+
SimpleRoomsRepository,
|
|
33
|
+
TournamentOneTableRoomsRepository,
|
|
34
|
+
TournamentManyTablesRoomsRepository,
|
|
29
35
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { InjectModel } from '@nestjs/mongoose';
|
|
3
|
+
import { Model } from 'mongoose';
|
|
4
|
+
|
|
5
|
+
import { SimpleRoom, SimpleRoomDocument } from '../';
|
|
6
|
+
|
|
7
|
+
@Injectable()
|
|
8
|
+
export class SimpleRoomsRepository {
|
|
9
|
+
constructor (@InjectModel(SimpleRoom.name) private roomModel: Model<SimpleRoomDocument>) {
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async findRooms (gameType: string): Promise<Array<SimpleRoomDocument>> {
|
|
13
|
+
return this.roomModel
|
|
14
|
+
.find({ gameType })
|
|
15
|
+
.exec();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { InjectModel } from '@nestjs/mongoose';
|
|
3
|
+
import { Model } from 'mongoose';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Notification,
|
|
7
|
+
TournamentManyTablesRoom,
|
|
8
|
+
TournamentManyTablesRoomDocument, TournamentOneTableRoomDocument,
|
|
9
|
+
} from '../';
|
|
10
|
+
import { ITournamentParticipant } from '../models/tournament-participant.interface';
|
|
11
|
+
import { TournamentStatusEnum } from '../models/tournament-status.enum';
|
|
12
|
+
import { ITournamentWinner } from '../models/tournament-winner.interface';
|
|
13
|
+
|
|
14
|
+
@Injectable()
|
|
15
|
+
export class TournamentManyTablesRoomsRepository {
|
|
16
|
+
constructor (@InjectModel(TournamentManyTablesRoom.name) private tournamentModel: Model<TournamentManyTablesRoomDocument>) {
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async findTemplateById (templateId: string, gameType: string): Promise<TournamentOneTableRoomDocument | null> {
|
|
20
|
+
return this.tournamentModel
|
|
21
|
+
.findOne({ templateId, gameType })
|
|
22
|
+
.exec();
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async findTournamentById (tournamentId: string): Promise<TournamentManyTablesRoomDocument | null> {
|
|
26
|
+
return this.tournamentModel
|
|
27
|
+
.findById(tournamentId)
|
|
28
|
+
.exec();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async findTournaments (gameType: string): Promise<Array<TournamentManyTablesRoomDocument>> {
|
|
32
|
+
return this.tournamentModel
|
|
33
|
+
.find({ gameType, isTemplate: false })
|
|
34
|
+
.exec();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async createTournament (tournament: Partial<TournamentManyTablesRoom>): Promise<TournamentManyTablesRoomDocument> {
|
|
38
|
+
return this.tournamentModel.create(tournament)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
async updateTournament (tournamentId: string, tournament: Partial<TournamentManyTablesRoom>): Promise<void> {
|
|
42
|
+
await this.tournamentModel.findByIdAndUpdate(
|
|
43
|
+
tournamentId,
|
|
44
|
+
{
|
|
45
|
+
$set: {
|
|
46
|
+
...tournament,
|
|
47
|
+
},
|
|
48
|
+
}).exec();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
public async removeTournament (tournamentId: string): Promise<void> {
|
|
52
|
+
await this.tournamentModel.findByIdAndDelete(tournamentId);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async startTournament (tournamentId: string, participants: Array<ITournamentParticipant>): Promise<void> {
|
|
56
|
+
await this.tournamentModel.findByIdAndUpdate(
|
|
57
|
+
tournamentId,
|
|
58
|
+
{
|
|
59
|
+
$set: {
|
|
60
|
+
startDate: new Date(),
|
|
61
|
+
status: TournamentStatusEnum.STATE_IN_PROGRESS,
|
|
62
|
+
participants,
|
|
63
|
+
},
|
|
64
|
+
}).exec();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async cancelTournament (tournamentId: string): Promise<void> {
|
|
68
|
+
await this.tournamentModel.findByIdAndUpdate(
|
|
69
|
+
tournamentId,
|
|
70
|
+
{
|
|
71
|
+
$set: {
|
|
72
|
+
finishDate: new Date(),
|
|
73
|
+
status: TournamentStatusEnum.STATE_CANCELLED,
|
|
74
|
+
},
|
|
75
|
+
}).exec();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async finishTournament (tournamentId: string, winners: Array<ITournamentWinner>): Promise<void> {
|
|
79
|
+
await this.tournamentModel.findByIdAndUpdate(
|
|
80
|
+
tournamentId,
|
|
81
|
+
{
|
|
82
|
+
$set: {
|
|
83
|
+
finishDate: new Date(),
|
|
84
|
+
status: TournamentStatusEnum.STATE_FINISHED,
|
|
85
|
+
winners,
|
|
86
|
+
},
|
|
87
|
+
}).exec();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Injectable } from '@nestjs/common';
|
|
2
|
+
import { InjectModel } from '@nestjs/mongoose';
|
|
3
|
+
import { Model } from 'mongoose';
|
|
4
|
+
|
|
5
|
+
import { TournamentOneTableRoom, TournamentOneTableRoomDocument } from '../';
|
|
6
|
+
import { ITournamentParticipant } from '../models/tournament-participant.interface';
|
|
7
|
+
import { TournamentStatusEnum } from '../models/tournament-status.enum';
|
|
8
|
+
import { ITournamentWinner } from '../models/tournament-winner.interface';
|
|
9
|
+
|
|
10
|
+
@Injectable()
|
|
11
|
+
export class TournamentOneTableRoomsRepository {
|
|
12
|
+
constructor (@InjectModel(TournamentOneTableRoom.name) private tournamentModel: Model<TournamentOneTableRoomDocument>) {
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async findTemplateById (templateId: string, gameType: string): Promise<TournamentOneTableRoomDocument | null> {
|
|
16
|
+
return this.tournamentModel
|
|
17
|
+
.findOne({ templateId, gameType })
|
|
18
|
+
.exec();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async findTournamentById (tournamentId: string): Promise<TournamentOneTableRoomDocument | null> {
|
|
22
|
+
return this.tournamentModel
|
|
23
|
+
.findById(tournamentId)
|
|
24
|
+
.exec();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async findTournaments (gameType: string): Promise<Array<TournamentOneTableRoomDocument>> {
|
|
28
|
+
return this.tournamentModel
|
|
29
|
+
.find({ gameType, isTemplate: false })
|
|
30
|
+
.exec();
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async createTournament (tournament: Partial<TournamentOneTableRoom>): Promise<TournamentOneTableRoomDocument> {
|
|
34
|
+
return this.tournamentModel.create(tournament)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async startTournament (tournamentId: string, participants: Array<ITournamentParticipant>): Promise<void> {
|
|
38
|
+
await this.tournamentModel.findByIdAndUpdate(
|
|
39
|
+
tournamentId,
|
|
40
|
+
{
|
|
41
|
+
$set: {
|
|
42
|
+
startDate: new Date(),
|
|
43
|
+
status: TournamentStatusEnum.STATE_IN_PROGRESS,
|
|
44
|
+
participants,
|
|
45
|
+
},
|
|
46
|
+
}).exec();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async cancelTournament (tournamentId: string): Promise<void> {
|
|
50
|
+
await this.tournamentModel.findByIdAndUpdate(
|
|
51
|
+
tournamentId,
|
|
52
|
+
{
|
|
53
|
+
$set: {
|
|
54
|
+
finishDate: new Date(),
|
|
55
|
+
status: TournamentStatusEnum.STATE_CANCELLED,
|
|
56
|
+
},
|
|
57
|
+
}).exec();
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async finishTournament (tournamentId: string, winners: Array<ITournamentWinner>): Promise<void> {
|
|
61
|
+
await this.tournamentModel.findByIdAndUpdate(
|
|
62
|
+
tournamentId,
|
|
63
|
+
{
|
|
64
|
+
$set: {
|
|
65
|
+
finishDate: new Date(),
|
|
66
|
+
status: TournamentStatusEnum.STATE_FINISHED,
|
|
67
|
+
winners,
|
|
68
|
+
},
|
|
69
|
+
}).exec();
|
|
70
|
+
}
|
|
71
|
+
}
|