jp.db.schemas 2.0.0 → 2.0.2

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 (111) hide show
  1. package/dist/index.d.ts +12 -4
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +17 -1
  4. package/dist/index.js.map +1 -1
  5. package/dist/repositories/index.d.ts +5 -1
  6. package/dist/repositories/index.d.ts.map +1 -1
  7. package/dist/repositories/index.js +9 -1
  8. package/dist/repositories/index.js.map +1 -1
  9. package/dist/repositories/simple-rooms.repository.d.ts +8 -0
  10. package/dist/repositories/simple-rooms.repository.d.ts.map +1 -0
  11. package/dist/repositories/simple-rooms.repository.js +36 -0
  12. package/dist/repositories/simple-rooms.repository.js.map +1 -0
  13. package/dist/repositories/tournament-many-tables-rooms.repository.d.ts +8 -0
  14. package/dist/repositories/tournament-many-tables-rooms.repository.d.ts.map +1 -0
  15. package/dist/repositories/tournament-many-tables-rooms.repository.js +36 -0
  16. package/dist/repositories/tournament-many-tables-rooms.repository.js.map +1 -0
  17. package/dist/repositories/tournament-one-table-rooms.repository.d.ts +8 -0
  18. package/dist/repositories/tournament-one-table-rooms.repository.d.ts.map +1 -0
  19. package/dist/repositories/tournament-one-table-rooms.repository.js +36 -0
  20. package/dist/repositories/tournament-one-table-rooms.repository.js.map +1 -0
  21. package/dist/repositories/tournament-result.repository.d.ts +9 -0
  22. package/dist/repositories/tournament-result.repository.d.ts.map +1 -0
  23. package/dist/repositories/tournament-result.repository.js +39 -0
  24. package/dist/repositories/tournament-result.repository.js.map +1 -0
  25. package/dist/schemas/achievement.schema.js +1 -1
  26. package/dist/schemas/achievement.schema.js.map +1 -1
  27. package/dist/schemas/admin.schema.js +1 -1
  28. package/dist/schemas/admin.schema.js.map +1 -1
  29. package/dist/schemas/article.schema.js +1 -1
  30. package/dist/schemas/article.schema.js.map +1 -1
  31. package/dist/schemas/balance_history.schema.js +1 -1
  32. package/dist/schemas/balance_history.schema.js.map +1 -1
  33. package/dist/schemas/banner.schema.js +1 -1
  34. package/dist/schemas/banner.schema.js.map +1 -1
  35. package/dist/schemas/channel_message.schema.js +1 -1
  36. package/dist/schemas/channel_message.schema.js.map +1 -1
  37. package/dist/schemas/complain.schema.js +1 -1
  38. package/dist/schemas/complain.schema.js.map +1 -1
  39. package/dist/schemas/feature.schema.js +1 -1
  40. package/dist/schemas/feature.schema.js.map +1 -1
  41. package/dist/schemas/game_result.schema.js +1 -1
  42. package/dist/schemas/game_result.schema.js.map +1 -1
  43. package/dist/schemas/menu.schema.js +1 -1
  44. package/dist/schemas/menu.schema.js.map +1 -1
  45. package/dist/schemas/notification.schema.js +1 -1
  46. package/dist/schemas/notification.schema.js.map +1 -1
  47. package/dist/schemas/product.schema.js +1 -1
  48. package/dist/schemas/product.schema.js.map +1 -1
  49. package/dist/schemas/purchase.schema.js +1 -1
  50. package/dist/schemas/purchase.schema.js.map +1 -1
  51. package/dist/schemas/purchase_channel.schema.js +1 -1
  52. package/dist/schemas/purchase_channel.schema.js.map +1 -1
  53. package/dist/schemas/rating.schema.js +1 -1
  54. package/dist/schemas/rating.schema.js.map +1 -1
  55. package/dist/schemas/rooms.schema.js +1 -1
  56. package/dist/schemas/rooms.schema.js.map +1 -1
  57. package/dist/schemas/scheduled_tournament.schema.js +1 -1
  58. package/dist/schemas/scheduled_tournament.schema.js.map +1 -1
  59. package/dist/schemas/server.schema.js +1 -1
  60. package/dist/schemas/server.schema.js.map +1 -1
  61. package/dist/schemas/setting.schema.js +1 -1
  62. package/dist/schemas/setting.schema.js.map +1 -1
  63. package/dist/schemas/simple_rooms.schema.d.ts +125 -0
  64. package/dist/schemas/simple_rooms.schema.d.ts.map +1 -0
  65. package/dist/schemas/simple_rooms.schema.js +65 -0
  66. package/dist/schemas/simple_rooms.schema.js.map +1 -0
  67. package/dist/schemas/tournament_many_tables_rooms.schema.d.ts +200 -0
  68. package/dist/schemas/tournament_many_tables_rooms.schema.d.ts.map +1 -0
  69. package/dist/schemas/tournament_many_tables_rooms.schema.js +93 -0
  70. package/dist/schemas/tournament_many_tables_rooms.schema.js.map +1 -0
  71. package/dist/schemas/tournament_one_table_rooms.schema.d.ts +125 -0
  72. package/dist/schemas/tournament_one_table_rooms.schema.d.ts.map +1 -0
  73. package/dist/schemas/tournament_one_table_rooms.schema.js +65 -0
  74. package/dist/schemas/tournament_one_table_rooms.schema.js.map +1 -0
  75. package/dist/schemas/tournament_result.schema.d.ts +82 -0
  76. package/dist/schemas/tournament_result.schema.d.ts.map +1 -0
  77. package/dist/schemas/tournament_result.schema.js +45 -0
  78. package/dist/schemas/tournament_result.schema.js.map +1 -0
  79. package/dist/schemas/user.schema.js +1 -1
  80. package/dist/schemas/user.schema.js.map +1 -1
  81. package/package.json +1 -1
  82. package/src/index.ts +28 -0
  83. package/src/repositories/index.ts +8 -0
  84. package/src/repositories/simple-rooms.repository.ts +17 -0
  85. package/src/repositories/tournament-many-tables-rooms.repository.ts +17 -0
  86. package/src/repositories/tournament-one-table-rooms.repository.ts +17 -0
  87. package/src/repositories/tournament-result.repository.ts +21 -0
  88. package/src/schemas/achievement.schema.ts +1 -1
  89. package/src/schemas/admin.schema.ts +1 -1
  90. package/src/schemas/article.schema.ts +1 -1
  91. package/src/schemas/balance_history.schema.ts +1 -1
  92. package/src/schemas/banner.schema.ts +1 -1
  93. package/src/schemas/channel_message.schema.ts +1 -1
  94. package/src/schemas/complain.schema.ts +1 -1
  95. package/src/schemas/feature.schema.ts +1 -1
  96. package/src/schemas/game_result.schema.ts +1 -1
  97. package/src/schemas/menu.schema.ts +1 -1
  98. package/src/schemas/notification.schema.ts +1 -1
  99. package/src/schemas/product.schema.ts +1 -1
  100. package/src/schemas/purchase.schema.ts +1 -1
  101. package/src/schemas/purchase_channel.schema.ts +1 -1
  102. package/src/schemas/rating.schema.ts +1 -1
  103. package/src/schemas/rooms.schema.ts +1 -1
  104. package/src/schemas/scheduled_tournament.schema.ts +1 -1
  105. package/src/schemas/server.schema.ts +1 -1
  106. package/src/schemas/setting.schema.ts +1 -1
  107. package/src/schemas/simple_rooms.schema.ts +43 -0
  108. package/src/schemas/tournament_many_tables_rooms.schema.ts +70 -0
  109. package/src/schemas/tournament_one_table_rooms.schema.ts +43 -0
  110. package/src/schemas/tournament_result.schema.ts +36 -0
  111. package/src/schemas/user.schema.ts +1 -1
@@ -7,7 +7,7 @@ export type PurchaseDocument = HydratedDocument<Purchase>;
7
7
  export class Purchase {
8
8
  @Virtual({
9
9
  get: function (this: Document) {
10
- return this._id;
10
+ return this._id.toString();
11
11
  },
12
12
  })
13
13
  readonly purchaseId: string;
@@ -7,7 +7,7 @@ export type PurchaseChannelDocument = HydratedDocument<PurchaseChannel>;
7
7
  export class PurchaseChannel {
8
8
  @Virtual({
9
9
  get: function (this: Document) {
10
- return this._id;
10
+ return this._id.toString();
11
11
  },
12
12
  })
13
13
  readonly achievementId: string;
@@ -7,7 +7,7 @@ export type RatingDocument = HydratedDocument<Rating>;
7
7
  export class Rating {
8
8
  @Virtual({
9
9
  get: function (this: Document) {
10
- return this._id;
10
+ return this._id.toString();
11
11
  },
12
12
  })
13
13
  readonly achievementId: string;
@@ -12,7 +12,7 @@ export interface Locale {
12
12
  export class Room {
13
13
  @Virtual({
14
14
  get: function (this: Document) {
15
- return this._id;
15
+ return this._id.toString();
16
16
  },
17
17
  })
18
18
  readonly roomId: string;
@@ -21,7 +21,7 @@ export interface IScheduledTournamentParticipant {
21
21
  export class ScheduledTournament {
22
22
  @Virtual({
23
23
  get: function (this: Document) {
24
- return this._id;
24
+ return this._id.toString();
25
25
  },
26
26
  })
27
27
  readonly tournamentId: string;
@@ -7,7 +7,7 @@ export type ServerDocument = HydratedDocument<Server>;
7
7
  export class Server {
8
8
  @Virtual({
9
9
  get: function (this: Document) {
10
- return this._id;
10
+ return this._id.toString();
11
11
  },
12
12
  })
13
13
  readonly serverId: string;
@@ -7,7 +7,7 @@ export type SettingDocument = HydratedDocument<Setting>;
7
7
  export class Setting {
8
8
  @Virtual({
9
9
  get: function (this: Document) {
10
- return this._id;
10
+ return this._id.toString();
11
11
  },
12
12
  })
13
13
  readonly settingId: string;
@@ -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,70 @@
1
+ import { Prop, Schema, SchemaFactory, Virtual } from '@nestjs/mongoose';
2
+ import { Document, HydratedDocument } from 'mongoose';
3
+
4
+ export type TournamentManyTablesRoomDocument = HydratedDocument<TournamentManyTablesRoom>;
5
+
6
+ export interface IParticipant {
7
+ userId: string;
8
+ userName: string;
9
+ userAvatarUrl: string;
10
+ }
11
+
12
+ @Schema({ collection: 'tournament_many_tables_rooms' })
13
+ export class TournamentManyTablesRoom {
14
+ @Virtual({
15
+ get: function (this: Document) {
16
+ return this._id.toString();
17
+ },
18
+ })
19
+ readonly roomId: string;
20
+
21
+ @Prop({ type: Object })
22
+ title: Record<string, string>;
23
+
24
+ @Prop({ type: Object })
25
+ subtitle: Record<string, string>;
26
+
27
+ @Prop()
28
+ tableSize: number;
29
+
30
+ @Prop()
31
+ bet: number;
32
+
33
+ @Prop()
34
+ ticketPrice: number;
35
+
36
+ @Prop()
37
+ roomType: string;
38
+
39
+ @Prop()
40
+ gameType: string;
41
+
42
+ @Prop()
43
+ rulesType: string;
44
+
45
+ @Prop()
46
+ deckType?: string;
47
+
48
+ @Prop()
49
+ createDate: Date;
50
+
51
+ @Prop()
52
+ startDate: Date;
53
+
54
+ @Prop({ type: Object })
55
+ description: Record<string, string>;
56
+
57
+ @Prop()
58
+ participants: Array<IParticipant>;
59
+
60
+ @Prop()
61
+ maxParticipants: number;
62
+
63
+ @Prop()
64
+ status: string;
65
+
66
+ @Prop()
67
+ type: string;
68
+ }
69
+
70
+ export const TournamentManyTablesRoomSchema = SchemaFactory.createForClass(TournamentManyTablesRoom);
@@ -0,0 +1,43 @@
1
+ import { Prop, Schema, SchemaFactory, Virtual } from '@nestjs/mongoose';
2
+ import { Document, HydratedDocument } from 'mongoose';
3
+
4
+ export type TournamentOneTableRoomDocument = HydratedDocument<TournamentOneTableRoom>;
5
+
6
+ @Schema({ collection: 'tournament_one_table_rooms' })
7
+ export class TournamentOneTableRoom {
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 TournamentOneTableRoomSchema = SchemaFactory.createForClass(TournamentOneTableRoom);
@@ -0,0 +1,36 @@
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);
@@ -62,7 +62,7 @@ export type IGameStatistics = {
62
62
  export class User {
63
63
  @Virtual({
64
64
  get: function (this: Document) {
65
- return this._id;
65
+ return this._id.toString();
66
66
  },
67
67
  })
68
68
  readonly userId: string;