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.
Files changed (56) hide show
  1. package/dist/index.d.ts +10 -4
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +13 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/models/tournament-participant.interface.d.ts +6 -0
  6. package/dist/models/tournament-participant.interface.d.ts.map +1 -0
  7. package/dist/models/tournament-participant.interface.js +3 -0
  8. package/dist/models/tournament-participant.interface.js.map +1 -0
  9. package/dist/models/tournament-status.enum.d.ts +7 -0
  10. package/dist/models/tournament-status.enum.d.ts.map +1 -0
  11. package/dist/models/tournament-status.enum.js +11 -0
  12. package/dist/models/tournament-status.enum.js.map +1 -0
  13. package/dist/models/tournament-winner.interface.d.ts +8 -0
  14. package/dist/models/tournament-winner.interface.d.ts.map +1 -0
  15. package/dist/models/tournament-winner.interface.js +3 -0
  16. package/dist/models/tournament-winner.interface.js.map +1 -0
  17. package/dist/repositories/index.d.ts +4 -1
  18. package/dist/repositories/index.d.ts.map +1 -1
  19. package/dist/repositories/index.js +7 -1
  20. package/dist/repositories/index.js.map +1 -1
  21. package/dist/repositories/simple-rooms.repository.d.ts +8 -0
  22. package/dist/repositories/simple-rooms.repository.d.ts.map +1 -0
  23. package/dist/repositories/simple-rooms.repository.js +36 -0
  24. package/dist/repositories/simple-rooms.repository.js.map +1 -0
  25. package/dist/repositories/tournament-many-tables-rooms.repository.d.ts +18 -0
  26. package/dist/repositories/tournament-many-tables-rooms.repository.d.ts.map +1 -0
  27. package/dist/repositories/tournament-many-tables-rooms.repository.js +84 -0
  28. package/dist/repositories/tournament-many-tables-rooms.repository.js.map +1 -0
  29. package/dist/repositories/tournament-one-table-rooms.repository.d.ts +16 -0
  30. package/dist/repositories/tournament-one-table-rooms.repository.d.ts.map +1 -0
  31. package/dist/repositories/tournament-one-table-rooms.repository.js +76 -0
  32. package/dist/repositories/tournament-one-table-rooms.repository.js.map +1 -0
  33. package/dist/schemas/simple_rooms.schema.d.ts +125 -0
  34. package/dist/schemas/simple_rooms.schema.d.ts.map +1 -0
  35. package/dist/schemas/simple_rooms.schema.js +65 -0
  36. package/dist/schemas/simple_rooms.schema.js.map +1 -0
  37. package/dist/schemas/tournament_many_tables_rooms.schema.d.ts +237 -0
  38. package/dist/schemas/tournament_many_tables_rooms.schema.d.ts.map +1 -0
  39. package/dist/schemas/tournament_many_tables_rooms.schema.js +109 -0
  40. package/dist/schemas/tournament_many_tables_rooms.schema.js.map +1 -0
  41. package/dist/schemas/tournament_one_table_rooms.schema.d.ts +237 -0
  42. package/dist/schemas/tournament_one_table_rooms.schema.d.ts.map +1 -0
  43. package/dist/schemas/tournament_one_table_rooms.schema.js +109 -0
  44. package/dist/schemas/tournament_one_table_rooms.schema.js.map +1 -0
  45. package/package.json +1 -1
  46. package/src/index.ts +21 -0
  47. package/src/models/tournament-participant.interface.ts +5 -0
  48. package/src/models/tournament-status.enum.ts +6 -0
  49. package/src/models/tournament-winner.interface.ts +7 -0
  50. package/src/repositories/index.ts +6 -0
  51. package/src/repositories/simple-rooms.repository.ts +17 -0
  52. package/src/repositories/tournament-many-tables-rooms.repository.ts +89 -0
  53. package/src/repositories/tournament-one-table-rooms.repository.ts +71 -0
  54. package/src/schemas/simple_rooms.schema.ts +43 -0
  55. package/src/schemas/tournament_many_tables_rooms.schema.ts +81 -0
  56. package/src/schemas/tournament_one_table_rooms.schema.ts +81 -0
@@ -0,0 +1,43 @@
1
+ import { Prop, Schema, SchemaFactory, Virtual } from '@nestjs/mongoose';
2
+ import { Document, HydratedDocument } from 'mongoose';
3
+
4
+ export type SimpleRoomDocument = HydratedDocument<SimpleRoom>;
5
+
6
+ @Schema({ collection: 'simple_rooms' })
7
+ export class SimpleRoom {
8
+ @Virtual({
9
+ get: function (this: Document) {
10
+ return this._id.toString();
11
+ },
12
+ })
13
+ readonly roomId: string;
14
+
15
+ @Prop({ type: Object })
16
+ title: Record<string, string>;
17
+
18
+ @Prop({ type: Object })
19
+ subtitle: Record<string, string>;
20
+
21
+ @Prop()
22
+ tableSize: number;
23
+
24
+ @Prop()
25
+ bet: number;
26
+
27
+ @Prop()
28
+ ticketPrice: number;
29
+
30
+ @Prop()
31
+ roomType: string;
32
+
33
+ @Prop()
34
+ gameType: string;
35
+
36
+ @Prop()
37
+ rulesType: string;
38
+
39
+ @Prop()
40
+ deckType?: string;
41
+ }
42
+
43
+ export const SimpleRoomSchema = SchemaFactory.createForClass(SimpleRoom);
@@ -0,0 +1,81 @@
1
+ import { Prop, Schema, SchemaFactory, Virtual } from '@nestjs/mongoose';
2
+ import { Document, HydratedDocument } from 'mongoose';
3
+
4
+ import { ITournamentParticipant } from '../models/tournament-participant.interface';
5
+ import { ITournamentWinner } from '../models/tournament-winner.interface';
6
+
7
+ export type TournamentManyTablesRoomDocument = HydratedDocument<TournamentManyTablesRoom>;
8
+
9
+ @Schema({ collection: 'tournament_many_tables_rooms' })
10
+ export class TournamentManyTablesRoom {
11
+ @Virtual({
12
+ get: function (this: Document) {
13
+ return this._id.toString();
14
+ },
15
+ })
16
+ readonly tournamentId: string;
17
+
18
+ @Prop({ type: Object })
19
+ title: Record<string, string>;
20
+
21
+ @Prop({ type: Object })
22
+ subtitle: Record<string, string>;
23
+
24
+ @Prop()
25
+ tableSize: number;
26
+
27
+ @Prop()
28
+ bet: number;
29
+
30
+ @Prop()
31
+ ticketPrice: number;
32
+
33
+ @Prop()
34
+ roomType: string;
35
+
36
+ @Prop()
37
+ gameType: string;
38
+
39
+ @Prop()
40
+ rulesType: string;
41
+
42
+ @Prop()
43
+ deckType?: string;
44
+
45
+ // tournament props
46
+
47
+ @Prop()
48
+ isTemplate: boolean;
49
+
50
+ @Prop()
51
+ templateId?: string;
52
+
53
+ @Prop()
54
+ type: string;
55
+
56
+ @Prop({ type: Object })
57
+ description: Record<string, string>;
58
+
59
+ @Prop()
60
+ participants: Array<ITournamentParticipant>;
61
+
62
+ @Prop()
63
+ maxParticipants: number;
64
+
65
+ @Prop()
66
+ status: string;
67
+
68
+ @Prop()
69
+ winners: Array<ITournamentWinner>;
70
+
71
+ @Prop()
72
+ createDate: Date;
73
+
74
+ @Prop()
75
+ startDate: Date;
76
+
77
+ @Prop()
78
+ finishDate: Date;
79
+ }
80
+
81
+ export const TournamentManyTablesRoomSchema = SchemaFactory.createForClass(TournamentManyTablesRoom);
@@ -0,0 +1,81 @@
1
+ import { Prop, Schema, SchemaFactory, Virtual } from '@nestjs/mongoose';
2
+ import { Document, HydratedDocument } from 'mongoose';
3
+
4
+ import { ITournamentWinner } from '../models/tournament-winner.interface';
5
+ import { ITournamentParticipant } from '../models/tournament-participant.interface';
6
+
7
+ export type TournamentOneTableRoomDocument = HydratedDocument<TournamentOneTableRoom>;
8
+
9
+ @Schema({ collection: 'tournament_one_table_rooms' })
10
+ export class TournamentOneTableRoom {
11
+ @Virtual({
12
+ get: function (this: Document) {
13
+ return this._id.toString();
14
+ },
15
+ })
16
+ readonly tournamentId: string;
17
+
18
+ @Prop({ type: Object })
19
+ title: Record<string, string>;
20
+
21
+ @Prop({ type: Object })
22
+ subtitle: Record<string, string>;
23
+
24
+ @Prop()
25
+ tableSize: number;
26
+
27
+ @Prop()
28
+ bet: number;
29
+
30
+ @Prop()
31
+ ticketPrice: number;
32
+
33
+ @Prop()
34
+ roomType: string;
35
+
36
+ @Prop()
37
+ gameType: string;
38
+
39
+ @Prop()
40
+ rulesType: string;
41
+
42
+ @Prop()
43
+ deckType?: string;
44
+
45
+ // tournament props
46
+
47
+ @Prop()
48
+ isTemplate: boolean;
49
+
50
+ @Prop()
51
+ templateId?: string;
52
+
53
+ @Prop()
54
+ type: string;
55
+
56
+ @Prop({ type: Object })
57
+ description: Record<string, string>;
58
+
59
+ @Prop()
60
+ maxParticipants: number;
61
+
62
+ @Prop()
63
+ participants: Array<ITournamentParticipant>;
64
+
65
+ @Prop()
66
+ status: string;
67
+
68
+ @Prop()
69
+ winners: Array<ITournamentWinner>;
70
+
71
+ @Prop()
72
+ createDate: Date;
73
+
74
+ @Prop()
75
+ startDate: Date;
76
+
77
+ @Prop()
78
+ finishDate: Date;
79
+ }
80
+
81
+ export const TournamentOneTableRoomSchema = SchemaFactory.createForClass(TournamentOneTableRoom);