jp.ms.common.modules 1.0.29 → 1.0.31

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 (226) hide show
  1. package/dist/dto/app-screen/index.d.ts +1 -0
  2. package/dist/dto/app-screen/index.js +3 -1
  3. package/dist/dto/app-screen/index.js.map +1 -1
  4. package/dist/dto/{table-game/cards → app-table}/card.dto.d.ts +2 -2
  5. package/dist/dto/app-table/card.dto.js.map +1 -0
  6. package/dist/dto/app-table/cards-deck.dto.d.ts +6 -0
  7. package/dist/dto/app-table/cards-deck.dto.js +38 -0
  8. package/dist/dto/app-table/cards-deck.dto.js.map +1 -0
  9. package/dist/dto/{table-game/cards/card-pair-slot.dto.d.ts → app-table/cards-pair-slots-item.dto.d.ts} +2 -2
  10. package/dist/dto/{table-game/cards/card-pair-slot.dto.js → app-table/cards-pair-slots-item.dto.js} +9 -9
  11. package/dist/dto/app-table/cards-pair-slots-item.dto.js.map +1 -0
  12. package/dist/dto/app-table/cards-pair-slots.dto.d.ts +5 -0
  13. package/dist/dto/app-table/cards-pair-slots.dto.js +27 -0
  14. package/dist/dto/app-table/cards-pair-slots.dto.js.map +1 -0
  15. package/dist/dto/app-table/cards-panel.dto.d.ts +10 -0
  16. package/dist/dto/{table-game/cards → app-table}/cards-panel.dto.js +4 -4
  17. package/dist/dto/app-table/cards-panel.dto.js.map +1 -0
  18. package/dist/dto/app-table/cards-player.dto.d.ts +6 -0
  19. package/dist/dto/{table-game/cards/card-player.dto.js → app-table/cards-player.dto.js} +6 -6
  20. package/dist/dto/app-table/cards-player.dto.js.map +1 -0
  21. package/dist/dto/app-table/index.d.ts +11 -0
  22. package/dist/dto/app-table/index.js +26 -0
  23. package/dist/dto/app-table/index.js.map +1 -0
  24. package/dist/dto/app-table/moves-panel-button.dto.d.ts +5 -0
  25. package/dist/dto/{table-game/base/base-table-yours-action.dto.js → app-table/moves-panel-button.dto.js} +6 -6
  26. package/dist/dto/app-table/moves-panel-button.dto.js.map +1 -0
  27. package/dist/dto/app-table/moves-panel.dto.d.ts +6 -0
  28. package/dist/dto/{table-game/base/base-table-moves-panel.dto.js → app-table/moves-panel.dto.js} +9 -9
  29. package/dist/dto/app-table/moves-panel.dto.js.map +1 -0
  30. package/dist/dto/{table-game/base/game-player.dto.d.ts → app-table/player.dto.d.ts} +2 -2
  31. package/dist/dto/{table-game/base/game-player.dto.js → app-table/player.dto.js} +11 -11
  32. package/dist/dto/app-table/player.dto.js.map +1 -0
  33. package/dist/dto/app-table/summary-item.dto.d.ts +8 -0
  34. package/dist/dto/{table-game/base/base-table-summary-item.dto.js → app-table/summary-item.dto.js} +9 -9
  35. package/dist/dto/app-table/summary-item.dto.js.map +1 -0
  36. package/dist/dto/app-table/summary.dto.d.ts +5 -0
  37. package/dist/dto/{table-game/base/base-table-summary.dto.js → app-table/summary.dto.js} +7 -7
  38. package/dist/dto/app-table/summary.dto.js.map +1 -0
  39. package/dist/dto/games/fool/fool-player.dto.d.ts +3 -0
  40. package/dist/dto/games/fool/fool-player.dto.js +8 -0
  41. package/dist/dto/games/fool/fool-player.dto.js.map +1 -0
  42. package/dist/dto/games/fool/fool-table.dto.d.ts +18 -0
  43. package/dist/dto/games/fool/fool-table.dto.js +105 -0
  44. package/dist/dto/games/fool/fool-table.dto.js.map +1 -0
  45. package/dist/dto/games/index.d.ts +1 -0
  46. package/dist/dto/games/index.js +18 -0
  47. package/dist/dto/games/index.js.map +1 -0
  48. package/dist/dto/index.d.ts +2 -1
  49. package/dist/dto/index.js +2 -1
  50. package/dist/dto/index.js.map +1 -1
  51. package/dist/exception/error-code.enum.d.ts +4 -0
  52. package/dist/exception/error-code.enum.js +9 -0
  53. package/dist/exception/error-code.enum.js.map +1 -0
  54. package/dist/exception/global-exception-filter.d.ts +5 -0
  55. package/dist/exception/global-exception-filter.js +53 -0
  56. package/dist/exception/global-exception-filter.js.map +1 -0
  57. package/dist/exception/http-exception-wth-snackbar.d.ts +12 -0
  58. package/dist/exception/http-exception-wth-snackbar.js +17 -0
  59. package/dist/exception/http-exception-wth-snackbar.js.map +1 -0
  60. package/dist/exception/index.d.ts +4 -0
  61. package/dist/exception/index.js +12 -0
  62. package/dist/exception/index.js.map +1 -0
  63. package/dist/exception/not-enough-money-for-purchase.exception.d.ts +5 -0
  64. package/dist/exception/not-enough-money-for-purchase.exception.js +12 -0
  65. package/dist/exception/not-enough-money-for-purchase.exception.js.map +1 -0
  66. package/dist/exception/not-found-free-room-for-fast-game.exception.d.ts +5 -0
  67. package/dist/exception/not-found-free-room-for-fast-game.exception.js +12 -0
  68. package/dist/exception/not-found-free-room-for-fast-game.exception.js.map +1 -0
  69. package/dist/index.d.ts +2 -1
  70. package/dist/index.js +2 -1
  71. package/dist/index.js.map +1 -1
  72. package/dist/modules/events/events.gateway.js +1 -1
  73. package/dist/modules/events/events.gateway.js.map +1 -1
  74. package/dist/modules/main/main-tables-list-screen.view.d.ts +11 -1
  75. package/dist/modules/main/main-tables-list-screen.view.js +97 -14
  76. package/dist/modules/main/main-tables-list-screen.view.js.map +1 -1
  77. package/dist/modules/main/main.controller.d.ts +4 -3
  78. package/dist/modules/main/main.controller.js +15 -3
  79. package/dist/modules/main/main.controller.js.map +1 -1
  80. package/dist/modules/main/main.module.js +2 -2
  81. package/dist/modules/main/main.module.js.map +1 -1
  82. package/dist/modules/main/main.service.d.ts +5 -4
  83. package/dist/modules/main/main.service.js +38 -12
  84. package/dist/modules/main/main.service.js.map +1 -1
  85. package/dist/modules/many-tables-tournament/many-tables-tournament-status-screen.view.d.ts +4 -0
  86. package/dist/modules/many-tables-tournament/many-tables-tournament-status-screen.view.js +56 -4
  87. package/dist/modules/many-tables-tournament/many-tables-tournament-status-screen.view.js.map +1 -1
  88. package/dist/modules/many-tables-tournament/many-tables-tournament-tables-list-screen.view.js +3 -3
  89. package/dist/modules/many-tables-tournament/many-tables-tournament-tables-list-screen.view.js.map +1 -1
  90. package/dist/modules/many-tables-tournament/many-tables-tournament.controller.d.ts +6 -7
  91. package/dist/modules/many-tables-tournament/many-tables-tournament.controller.js +5 -17
  92. package/dist/modules/many-tables-tournament/many-tables-tournament.controller.js.map +1 -1
  93. package/dist/modules/many-tables-tournament/many-tables-tournament.service.d.ts +6 -7
  94. package/dist/modules/many-tables-tournament/many-tables-tournament.service.js +20 -27
  95. package/dist/modules/many-tables-tournament/many-tables-tournament.service.js.map +1 -1
  96. package/dist/modules/menu/menu.service.js +1 -2
  97. package/dist/modules/menu/menu.service.js.map +1 -1
  98. package/dist/modules/one-table-tournament/one-table-tournament-status-screen.view.d.ts +1 -0
  99. package/dist/modules/one-table-tournament/one-table-tournament-status-screen.view.js +18 -5
  100. package/dist/modules/one-table-tournament/one-table-tournament-status-screen.view.js.map +1 -1
  101. package/dist/modules/one-table-tournament/one-table-tournament.controller.d.ts +3 -3
  102. package/dist/modules/one-table-tournament/one-table-tournament.controller.js.map +1 -1
  103. package/dist/modules/one-table-tournament/one-table-tournament.service.d.ts +3 -3
  104. package/dist/modules/one-table-tournament/one-table-tournament.service.js +1 -2
  105. package/dist/modules/one-table-tournament/one-table-tournament.service.js.map +1 -1
  106. package/dist/modules/simple-rooms/simple-rooms.controller.d.ts +5 -5
  107. package/dist/modules/simple-rooms/simple-rooms.service.d.ts +5 -5
  108. package/dist/modules/simple-rooms-manager/simple-rooms-manager.service.js.map +1 -1
  109. package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.module.d.ts +3 -1
  110. package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.module.js +14 -3
  111. package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.module.js.map +1 -1
  112. package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.service.d.ts +4 -3
  113. package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.service.js +49 -25
  114. package/dist/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.service.js.map +1 -1
  115. package/dist/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.service.js +9 -6
  116. package/dist/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.service.js.map +1 -1
  117. package/dist/tsconfig.tsbuildinfo +1 -1
  118. package/dist/utils/game-table-result.d.ts +1 -2
  119. package/dist/utils/game-table-result.js +0 -13
  120. package/dist/utils/game-table-result.js.map +1 -1
  121. package/dist/views/index.d.ts +3 -0
  122. package/dist/views/index.js +7 -1
  123. package/dist/views/index.js.map +1 -1
  124. package/dist/views/many-tables-tournament-conifrm-exit-dialog.view.d.ts +4 -0
  125. package/dist/views/many-tables-tournament-conifrm-exit-dialog.view.js +11 -0
  126. package/dist/views/many-tables-tournament-conifrm-exit-dialog.view.js.map +1 -0
  127. package/dist/views/one-table-tournament-conifrm-exit-dialog.view.d.ts +4 -0
  128. package/dist/views/one-table-tournament-conifrm-exit-dialog.view.js +11 -0
  129. package/dist/views/one-table-tournament-conifrm-exit-dialog.view.js.map +1 -0
  130. package/dist/views/table-summary.view.d.ts +11 -0
  131. package/dist/views/table-summary.view.js +47 -0
  132. package/dist/views/table-summary.view.js.map +1 -0
  133. package/dist/views/tournament-buy-ticket-dialog.view.js +1 -1
  134. package/dist/views/tournament-buy-ticket-dialog.view.js.map +1 -1
  135. package/package.json +4 -4
  136. package/src/dto/app-screen/index.ts +1 -0
  137. package/src/dto/{table-game/cards → app-table}/card.dto.ts +2 -2
  138. package/src/dto/app-table/cards-deck.dto.ts +22 -0
  139. package/src/dto/{table-game/cards/card-pair-slot.dto.ts → app-table/cards-pair-slots-item.dto.ts} +2 -2
  140. package/src/dto/app-table/cards-pair-slots.dto.ts +13 -0
  141. package/src/dto/{table-game/cards → app-table}/cards-panel.dto.ts +5 -6
  142. package/src/dto/app-table/cards-player.dto.ts +14 -0
  143. package/src/dto/app-table/index.ts +11 -0
  144. package/src/dto/{table-game/base/base-table-yours-action.dto.ts → app-table/moves-panel-button.dto.ts} +2 -3
  145. package/src/dto/{table-game/base/base-table-moves-panel.dto.ts → app-table/moves-panel.dto.ts} +5 -5
  146. package/src/dto/{table-game/base/game-player.dto.ts → app-table/player.dto.ts} +2 -2
  147. package/src/dto/{table-game/base/base-table-summary-item.dto.ts → app-table/summary-item.dto.ts} +2 -3
  148. package/src/dto/app-table/summary.dto.ts +13 -0
  149. package/src/dto/games/fool/fool-player.dto.ts +3 -0
  150. package/src/dto/games/fool/fool-table.dto.ts +79 -0
  151. package/src/dto/games/index.ts +1 -0
  152. package/src/dto/index.ts +2 -1
  153. package/src/exception/error-code.enum.ts +4 -0
  154. package/src/exception/global-exception-filter.ts +50 -0
  155. package/src/exception/http-exception-wth-snackbar.ts +23 -0
  156. package/src/exception/index.ts +4 -0
  157. package/src/exception/not-enough-money-for-purchase.exception.ts +15 -0
  158. package/src/exception/not-found-free-room-for-fast-game.exception.ts +15 -0
  159. package/src/index.ts +2 -1
  160. package/src/modules/events/events.gateway.ts +1 -1
  161. package/src/modules/main/main-tables-list-screen.view.ts +177 -55
  162. package/src/modules/main/main.controller.ts +23 -10
  163. package/src/modules/main/main.module.ts +2 -2
  164. package/src/modules/main/main.service.ts +53 -19
  165. package/src/modules/many-tables-tournament/many-tables-tournament-status-screen.view.ts +97 -31
  166. package/src/modules/many-tables-tournament/many-tables-tournament-tables-list-screen.view.ts +25 -17
  167. package/src/modules/many-tables-tournament/many-tables-tournament.controller.ts +8 -17
  168. package/src/modules/many-tables-tournament/many-tables-tournament.service.ts +46 -58
  169. package/src/modules/menu/menu.service.ts +6 -9
  170. package/src/modules/one-table-tournament/one-table-tournament-status-screen.view.ts +43 -17
  171. package/src/modules/one-table-tournament/one-table-tournament.controller.ts +3 -4
  172. package/src/modules/one-table-tournament/one-table-tournament.service.ts +9 -12
  173. package/src/modules/simple-rooms/simple-rooms.controller.ts +5 -5
  174. package/src/modules/simple-rooms/simple-rooms.service.ts +5 -5
  175. package/src/modules/simple-rooms-manager/simple-rooms-manager.service.ts +0 -2
  176. package/src/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.module.ts +17 -9
  177. package/src/modules/tournament-many-tables-rooms-manager/tournament-many-tables-rooms-manager.service.ts +57 -26
  178. package/src/modules/tournament-one-table-rooms-manager/tournament-one-table-rooms-manager.service.ts +10 -7
  179. package/src/utils/game-table-result.ts +1 -16
  180. package/src/views/index.ts +4 -1
  181. package/src/views/many-tables-tournament-conifrm-exit-dialog.view.ts +21 -0
  182. package/src/views/one-table-tournament-conifrm-exit-dialog.view.ts +21 -0
  183. package/src/views/table-summary.view.ts +87 -0
  184. package/src/views/tournament-buy-ticket-dialog.view.ts +4 -4
  185. package/dist/adapter/base-table-game-state-adapter.d.ts +0 -36
  186. package/dist/adapter/base-table-game-state-adapter.js +0 -183
  187. package/dist/adapter/base-table-game-state-adapter.js.map +0 -1
  188. package/dist/adapter/card-table-game-state-adapter.d.ts +0 -14
  189. package/dist/adapter/card-table-game-state-adapter.js +0 -51
  190. package/dist/adapter/card-table-game-state-adapter.js.map +0 -1
  191. package/dist/adapter/index.d.ts +0 -1
  192. package/dist/adapter/index.js +0 -6
  193. package/dist/adapter/index.js.map +0 -1
  194. package/dist/dto/table-game/base/base-table-game-state.dto.d.ts +0 -17
  195. package/dist/dto/table-game/base/base-table-game-state.dto.js +0 -128
  196. package/dist/dto/table-game/base/base-table-game-state.dto.js.map +0 -1
  197. package/dist/dto/table-game/base/base-table-moves-panel.dto.d.ts +0 -6
  198. package/dist/dto/table-game/base/base-table-moves-panel.dto.js.map +0 -1
  199. package/dist/dto/table-game/base/base-table-summary-item.dto.d.ts +0 -8
  200. package/dist/dto/table-game/base/base-table-summary-item.dto.js.map +0 -1
  201. package/dist/dto/table-game/base/base-table-summary.dto.d.ts +0 -5
  202. package/dist/dto/table-game/base/base-table-summary.dto.js.map +0 -1
  203. package/dist/dto/table-game/base/base-table-yours-action.dto.d.ts +0 -5
  204. package/dist/dto/table-game/base/base-table-yours-action.dto.js.map +0 -1
  205. package/dist/dto/table-game/base/game-player.dto.js.map +0 -1
  206. package/dist/dto/table-game/cards/card-pair-slot.dto.js.map +0 -1
  207. package/dist/dto/table-game/cards/card-player.dto.d.ts +0 -6
  208. package/dist/dto/table-game/cards/card-player.dto.js.map +0 -1
  209. package/dist/dto/table-game/cards/card-table-game-state.dto.d.ts +0 -16
  210. package/dist/dto/table-game/cards/card-table-game-state.dto.js +0 -68
  211. package/dist/dto/table-game/cards/card-table-game-state.dto.js.map +0 -1
  212. package/dist/dto/table-game/cards/card.dto.js.map +0 -1
  213. package/dist/dto/table-game/cards/cards-panel.dto.d.ts +0 -10
  214. package/dist/dto/table-game/cards/cards-panel.dto.js.map +0 -1
  215. package/dist/dto/table-game/index.d.ts +0 -1
  216. package/dist/dto/table-game/index.js +0 -6
  217. package/dist/dto/table-game/index.js.map +0 -1
  218. package/src/adapter/base-table-game-state-adapter.ts +0 -272
  219. package/src/adapter/card-table-game-state-adapter.ts +0 -78
  220. package/src/adapter/index.ts +0 -1
  221. package/src/dto/table-game/base/base-table-game-state.dto.ts +0 -95
  222. package/src/dto/table-game/base/base-table-summary.dto.ts +0 -13
  223. package/src/dto/table-game/cards/card-player.dto.ts +0 -15
  224. package/src/dto/table-game/cards/card-table-game-state.dto.ts +0 -50
  225. package/src/dto/table-game/index.ts +0 -2
  226. /package/dist/dto/{table-game/cards → app-table}/card.dto.js +0 -0
@@ -1,6 +1,6 @@
1
1
  import { Connection } from 'mongoose';
2
- import { BaseGameEvent, GameMaster, GameTournamentPlayerLeavedTheTournamentEvent, TournamentMaster } from 'jp.ms.common.engine';
3
2
  import { GameResultRepository, TournamentManyTablesRoomsRepository, TournamentOneTableRoomsRepository, UsersRepository } from 'jp.db.schemas';
3
+ import { GameMaster, TournamentMaster } from 'jp.ms.common.engine';
4
4
  export declare function getGameTableResults(master: GameMaster): {
5
5
  gameType: string;
6
6
  gameId: string;
@@ -37,4 +37,3 @@ export declare function getGameTableResults(master: GameMaster): {
37
37
  };
38
38
  export declare function saveGameTablesResult(master: GameMaster, connection: Connection, gameResultRepository: GameResultRepository, usersRepository: UsersRepository, saveNewBalance: boolean): Promise<void>;
39
39
  export declare function saveTournamentResult(master: TournamentMaster, connection: Connection, tournamentRepository: TournamentManyTablesRoomsRepository | TournamentOneTableRoomsRepository, usersRepository: UsersRepository): Promise<void>;
40
- export declare function isUpdateTounrmanentRoomEvent(event: BaseGameEvent): GameTournamentPlayerLeavedTheTournamentEvent | null;
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getGameTableResults = getGameTableResults;
4
4
  exports.saveGameTablesResult = saveGameTablesResult;
5
5
  exports.saveTournamentResult = saveTournamentResult;
6
- exports.isUpdateTounrmanentRoomEvent = isUpdateTounrmanentRoomEvent;
7
- const jp_ms_common_engine_1 = require("jp.ms.common.engine");
8
6
  function getGameTableResults(master) {
9
7
  return {
10
8
  gameType: master.getRoom().getGameType(),
@@ -89,15 +87,4 @@ async function saveTournamentResult(master, connection, tournamentRepository, us
89
87
  await session.endSession();
90
88
  }
91
89
  }
92
- function isUpdateTounrmanentRoomEvent(event) {
93
- if (event instanceof jp_ms_common_engine_1.GameTournamentPlayerJoinedTheTournamentEvent &&
94
- event instanceof jp_ms_common_engine_1.GameTournamentPlayerLeavedTheTournamentEvent &&
95
- event instanceof jp_ms_common_engine_1.GameTournamentCancelledEvent &&
96
- event instanceof jp_ms_common_engine_1.GameTournamentWaitedEvent &&
97
- event instanceof jp_ms_common_engine_1.GameTournamentStartedEvent &&
98
- event instanceof jp_ms_common_engine_1.GameTournamentFinishedEvent) {
99
- return event;
100
- }
101
- return null;
102
- }
103
90
  //# sourceMappingURL=game-table-result.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"game-table-result.js","sourceRoot":"","sources":["../../src/utils/game-table-result.ts"],"names":[],"mappings":";;AASA,kDAmCC;AAED,oDA8BC;AAED,oDA+BC;AAED,oEAaC;AA3HD,6DAAsT;AAQtT,SAAgB,mBAAmB,CAAE,MAAkB;IACnD,OAAO;QACH,QAAQ,EAAE,M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,2 +1,5 @@
1
1
  export { TournamentBuyTicketDialogView } from './tournament-buy-ticket-dialog.view';
2
2
  export { SimpleRoomConfirmExitDialogView } from './simple-room-conifrm-exit-dialog.view';
3
+ export { ManyTablesTournamentConfirmExitDialogView } from './many-tables-tournament-conifrm-exit-dialog.view';
4
+ export { OneTableTournamentConfirmExitDialogView } from './one-table-tournament-conifrm-exit-dialog.view';
5
+ export { TableSummaryView } from './table-summary.view';
@@ -1,8 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SimpleRoomConfirmExitDialogView = exports.TournamentBuyTicketDialogView = void 0;
3
+ exports.TableSummaryView = exports.OneTableTournamentConfirmExitDialogView = exports.ManyTablesTournamentConfirmExitDialogView = exports.SimpleRoomConfirmExitDialogView = exports.TournamentBuyTicketDialogView = void 0;
4
4
  var tournament_buy_ticket_dialog_view_1 = require("./tournament-buy-ticket-dialog.view");
5
5
  Object.defineProperty(exports, "TournamentBuyTicketDialogView", { enumerable: true, get: function () { return tournament_buy_ticket_dialog_view_1.TournamentBuyTicketDialogView; } });
6
6
  var simple_room_conifrm_exit_dialog_view_1 = require("./simple-room-conifrm-exit-dialog.view");
7
7
  Object.defineProperty(exports, "SimpleRoomConfirmExitDialogView", { enumerable: true, get: function () { return simple_room_conifrm_exit_dialog_view_1.SimpleRoomConfirmExitDialogView; } });
8
+ var many_tables_tournament_conifrm_exit_dialog_view_1 = require("./many-tables-tournament-conifrm-exit-dialog.view");
9
+ Object.defineProperty(exports, "ManyTablesTournamentConfirmExitDialogView", { enumerable: true, get: function () { return many_tables_tournament_conifrm_exit_dialog_view_1.ManyTablesTournamentConfirmExitDialogView; } });
10
+ var one_table_tournament_conifrm_exit_dialog_view_1 = require("./one-table-tournament-conifrm-exit-dialog.view");
11
+ Object.defineProperty(exports, "OneTableTournamentConfirmExitDialogView", { enumerable: true, get: function () { return one_table_tournament_conifrm_exit_dialog_view_1.OneTableTournamentConfirmExitDialogView; } });
12
+ var table_summary_view_1 = require("./table-summary.view");
13
+ Object.defineProperty(exports, "TableSummaryView", { enumerable: true, get: function () { return table_summary_view_1.TableSummaryView; } });
8
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/views/index.ts"],"names":[],"mappings":";;;AAAA,yFAAoF;AAA3E,kJAAA,6BAA6B,OAAA;AACtC,+FAAyF;AAAhF,uJAAA,+BAA+B,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/views/index.ts"],"names":[],"mappings":";;;AAAA,yFAAoF;AAA3E,kJAAA,6BAA6B,OAAA;AACtC,+FAAyF;AAAhF,uJAAA,+BAA+B,OAAA;AACxC,qHAA8G;AAArG,4KAAA,yCAAyC,OAAA;AAClD,iHAA0G;AAAjG,wKAAA,uCAAuC,OAAA;AAChD,2DAAuD;AAA9C,sHAAA,gBAAgB,OAAA"}
@@ -0,0 +1,4 @@
1
+ import { UniversalScreenDialogView, StandardDialogComponent } from "jp.common.models";
2
+ export declare class ManyTablesTournamentConfirmExitDialogView extends UniversalScreenDialogView {
3
+ build(): StandardDialogComponent;
4
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ManyTablesTournamentConfirmExitDialogView = void 0;
4
+ const jp_common_models_1 = require("jp.common.models");
5
+ class ManyTablesTournamentConfirmExitDialogView extends jp_common_models_1.UniversalScreenDialogView {
6
+ build() {
7
+ return new jp_common_models_1.StandardDialogComponent(jp_common_models_1.AppScreenDialogIdEnum.DIALOG_MANY_TABLES_TOURNAMENT_CONFIRM_EXIT, this.localeService.t('common.room.screen.dialog.confirm.exit.game.title', { lang: this.lang }), this.localeService.t('common.room.screen.dialog.confirm.exit.game.message', { lang: this.lang }), new jp_common_models_1.FullButtonsButtonsComponent(new jp_common_models_1.TextButtonComponent(this.localeService.t('common.room.screen.dialog.confirm.exit.game.ok', { lang: this.lang })), new jp_common_models_1.TextButtonComponent(this.localeService.t('common.room.screen.dialog.confirm.exit.game.cancel', { lang: this.lang }))));
8
+ }
9
+ }
10
+ exports.ManyTablesTournamentConfirmExitDialogView = ManyTablesTournamentConfirmExitDialogView;
11
+ //# sourceMappingURL=many-tables-tournament-conifrm-exit-dialog.view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"many-tables-tournament-conifrm-exit-dialog.view.js","sourceRoot":"","sources":["../../src/views/many-tables-tournament-conifrm-exit-dialog.view.ts"],"names":[],"mappings":";;;AAAA,uDAM0B;AAE1B,MAAa,yCAA0C,SAAQ,4CAAyB;IACpF,KAAK;QACD,OAAO,IAAI,0CAAuB,CAC9B,wCAAqB,CAAC,0CAA0C,EAChE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,mDAAmD,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAC9F,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,qDAAqD,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAChG,IAAI,8CAA2B,CAC3B,IAAI,sCAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,gDAAgD,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,EACpH,IAAI,sCAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,oDAAoD,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAC3H,CACJ,CAAC;IACN,CAAC;CACJ;AAZD,8FAYC"}
@@ -0,0 +1,4 @@
1
+ import { UniversalScreenDialogView, StandardDialogComponent } from "jp.common.models";
2
+ export declare class OneTableTournamentConfirmExitDialogView extends UniversalScreenDialogView {
3
+ build(): StandardDialogComponent;
4
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OneTableTournamentConfirmExitDialogView = void 0;
4
+ const jp_common_models_1 = require("jp.common.models");
5
+ class OneTableTournamentConfirmExitDialogView extends jp_common_models_1.UniversalScreenDialogView {
6
+ build() {
7
+ return new jp_common_models_1.StandardDialogComponent(jp_common_models_1.AppScreenDialogIdEnum.DIALOG_ONE_TABLE_TOURNAMENT_CONFIRM_EXIT, this.localeService.t('common.room.screen.dialog.confirm.exit.game.title', { lang: this.lang }), this.localeService.t('common.room.screen.dialog.confirm.exit.game.message', { lang: this.lang }), new jp_common_models_1.FullButtonsButtonsComponent(new jp_common_models_1.TextButtonComponent(this.localeService.t('common.room.screen.dialog.confirm.exit.game.ok', { lang: this.lang })), new jp_common_models_1.TextButtonComponent(this.localeService.t('common.room.screen.dialog.confirm.exit.game.cancel', { lang: this.lang }))));
8
+ }
9
+ }
10
+ exports.OneTableTournamentConfirmExitDialogView = OneTableTournamentConfirmExitDialogView;
11
+ //# sourceMappingURL=one-table-tournament-conifrm-exit-dialog.view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"one-table-tournament-conifrm-exit-dialog.view.js","sourceRoot":"","sources":["../../src/views/one-table-tournament-conifrm-exit-dialog.view.ts"],"names":[],"mappings":";;;AAAA,uDAM0B;AAE1B,MAAa,uCAAwC,SAAQ,4CAAyB;IAClF,KAAK;QACD,OAAO,IAAI,0CAAuB,CAC9B,wCAAqB,CAAC,wCAAwC,EAC9D,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,mDAAmD,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAC9F,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,qDAAqD,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAChG,IAAI,8CAA2B,CAC3B,IAAI,sCAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,gDAAgD,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,EACpH,IAAI,sCAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,oDAAoD,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAC3H,CACJ,CAAC;IACN,CAAC;CACJ;AAZD,0FAYC"}
@@ -0,0 +1,11 @@
1
+ import { IAppTableSummary, ILocaleService, UniversalView } from "jp.common.models";
2
+ import { GameMaster } from "jp.ms.common.engine";
3
+ export declare class TableSummaryView extends UniversalView {
4
+ private readonly gameMaster;
5
+ constructor(localeService: ILocaleService, lang: string, gameMaster: GameMaster);
6
+ build(): IAppTableSummary;
7
+ private getSummaryTechBreak;
8
+ private getSummaryPlaying;
9
+ private getSummaryWaiting;
10
+ private getSummaryEnd;
11
+ }
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TableSummaryView = void 0;
4
+ const jp_common_models_1 = require("jp.common.models");
5
+ const jp_common_utils_1 = require("jp.common.utils");
6
+ class TableSummaryView extends jp_common_models_1.UniversalView {
7
+ gameMaster;
8
+ constructor(localeService, lang, gameMaster) {
9
+ super(localeService, lang);
10
+ this.gameMaster = gameMaster;
11
+ }
12
+ build() {
13
+ if (this.gameMaster.isInProgress()) {
14
+ return this.getSummaryPlaying();
15
+ }
16
+ else if (this.gameMaster.isTechBreak()) {
17
+ return this.getSummaryTechBreak();
18
+ }
19
+ else if (this.gameMaster.isWaiting()) {
20
+ return this.getSummaryWaiting();
21
+ }
22
+ else if (this.gameMaster.isFinish()) {
23
+ return this.getSummaryEnd();
24
+ }
25
+ return new jp_common_models_1.SummaryComponent([]);
26
+ }
27
+ getSummaryTechBreak() {
28
+ return new jp_common_models_1.OneLineSummaryComponent(new jp_common_models_1.BodyMdSummaryItemComponent('tech-break', this.localeService.t('room.screen.tech.break.message', { lang: this.lang })));
29
+ }
30
+ getSummaryPlaying() {
31
+ return new jp_common_models_1.OneLineSummaryComponent(new jp_common_models_1.TitleMdSummaryItemComponent('pot', this.localeService.t('room.screen.summary.pot', {
32
+ lang: this.lang,
33
+ args: { POT: (0, jp_common_utils_1.formatChips)(this.gameMaster?.getGameRound()?.getPot() ?? 0, this.lang, true) },
34
+ })));
35
+ }
36
+ getSummaryWaiting() {
37
+ return new jp_common_models_1.OneLineSummaryComponent(new jp_common_models_1.BodyMdSummaryItemComponent('waiting', this.localeService.t('room.screen.waiting.for.the.players', { lang: this.lang })));
38
+ }
39
+ getSummaryEnd() {
40
+ return new jp_common_models_1.SummaryComponent([
41
+ new jp_common_models_1.BodySmSummaryItemComponent('WINNER', this.localeService.t('room.screen.summary.winner', { lang: this.lang }), this.gameMaster.getGameResultHelper()?.getWinnersName() ?? ''),
42
+ new jp_common_models_1.BodySmSummaryItemComponent('NEW_GAME', this.localeService.t('room.screen.summary.new.game', { lang: this.lang }), this.localeService.t('room.screen.summary.new.game.value', { lang: this.lang }))
43
+ ]);
44
+ }
45
+ }
46
+ exports.TableSummaryView = TableSummaryView;
47
+ //# sourceMappingURL=table-summary.view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-summary.view.js","sourceRoot":"","sources":["../../src/views/table-summary.view.ts"],"names":[],"mappings":";;;AAAA,uDAS0B;AAC1B,qDAA8C;AAG9C,MAAa,gBAAiB,SAAQ,gCAAa;IAC9B,UAAU,CAAa;IAExC,YACI,aAA6B,EAC7B,IAAY,EACZ,UAAsB;QAEtB,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QAC3B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED,KAAK;QACD,IAAI,IAAI,CAAC,UAAU,CAAC,YAAY,EAAE,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACpC,CAAC;aAAM,IAAI,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,EAAE,CAAC;YACvC,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACtC,CAAC;aAAM,IAAI,IAAI,CAAC,UA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,EAAE,CAAC,EACvE,IAAI,CAAC,UAAU,CAAC,mBAAmB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE,CAChE;YACD,IAAI,6CAA0B,CAC1B,UAAU,EACV,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EACzE,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,oCAAoC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAClF;SACJ,CACJ,CAAC;IACN,CAAC;CACJ;AAzED,4CAyEC"}
@@ -4,7 +4,7 @@ exports.TournamentBuyTicketDialogView = void 0;
4
4
  const jp_common_models_1 = require("jp.common.models");
5
5
  class TournamentBuyTicketDialogView extends jp_common_models_1.UniversalScreenDialogView {
6
6
  build() {
7
- return new jp_common_models_1.StandardDialogComponent(jp_common_models_1.AppScreenDialogIdEnum.DIALOG_TOURNAMENT_BUY_TICKET, this.localeService.t('common.rooms.screen.buyTicket.title', { lang: this.lang }), this.localeService.t('common.rooms.screen.buyTicket.description', { lang: this.lang }), new jp_common_models_1.FullButtonsButtonsComponent(new jp_common_models_1.TextButtonComponent(this.localeService.t('common.rooms.screen.buyTicket.button.ok', { lang: this.lang })), new jp_common_models_1.TextButtonComponent(this.localeService.t('common.rooms.screen.buyTicket.button.cancel', { lang: this.lang }))));
7
+ return new jp_common_models_1.StandardDialogComponent(jp_common_models_1.AppScreenDialogIdEnum.DIALOG_TOURNAMENT_BUY_TICKET, this.localeService.t('common.rooms.screen.dialog.buy.ticket.title', { lang: this.lang }), this.localeService.t('common.rooms.screen.dialog.buy.ticket.description', { lang: this.lang }), new jp_common_models_1.FullButtonsButtonsComponent(new jp_common_models_1.TextButtonComponent(this.localeService.t('common.rooms.screen.dialog.buy.ticket.ok', { lang: this.lang })), new jp_common_models_1.TextButtonComponent(this.localeService.t('common.rooms.screen.dialog.buy.ticket.cancel', { lang: this.lang }))));
8
8
  }
9
9
  }
10
10
  exports.TournamentBuyTicketDialogView = TournamentBuyTicketDialogView;
@@ -1 +1 @@
1
- {"version":3,"file":"tournament-buy-ticket-dialog.view.js","sourceRoot":"","sources":["../../src/views/tournament-buy-ticket-dialog.view.ts"],"names":[],"mappings":";;;AAAA,uDAM0B;AAE1B,MAAa,6BAA8B,SAAQ,4CAAyB;IACxE,KAAK;QACD,OAAO,IAAI,0CAAuB,CAC9B,wCAAqB,CAAC,4BAA4B,EAClD,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,qCAAqC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAChF,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,2CAA2C,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EACtF,IAAI,8CAA2B,CAC3B,IAAI,sCAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,yCAAyC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,EAC7G,IAAI,sCAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,6CAA6C,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CACpH,CACJ,CAAC;IACN,CAAC;CACJ;AAZD,sEAYC"}
1
+ {"version":3,"file":"tournament-buy-ticket-dialog.view.js","sourceRoot":"","sources":["../../src/views/tournament-buy-ticket-dialog.view.ts"],"names":[],"mappings":";;;AAAA,uDAM0B;AAE1B,MAAa,6BAA8B,SAAQ,4CAAyB;IACxE,KAAK;QACD,OAAO,IAAI,0CAAuB,CAC9B,wCAAqB,CAAC,4BAA4B,EAClD,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,6CAA6C,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EACxF,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,mDAAmD,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,EAC9F,IAAI,8CAA2B,CAC3B,IAAI,sCAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,0CAA0C,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,EAC9G,IAAI,sCAAmB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,8CAA8C,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CACrH,CACJ,CAAC;IACN,CAAC;CACJ;AAZD,sEAYC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jp.ms.common.modules",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -13,10 +13,10 @@
13
13
  "@nestjs/mongoose": "11.0.4",
14
14
  "@nestjs/websockets": "11.1.9",
15
15
  "dayjs": "1.11.18",
16
- "jp.common.models": "1.1.12",
16
+ "jp.common.models": "1.1.24",
17
17
  "jp.common.utils": "1.0.4",
18
- "jp.db.schemas": "2.2.3",
19
- "jp.ms.common.engine": "3.0.12",
18
+ "jp.db.schemas": "2.2.8",
19
+ "jp.ms.common.engine": "3.0.14",
20
20
  "mongoose": "9.1.5",
21
21
  "nestjs-i18n": "10.5.1",
22
22
  "node-schedule": "2.1.1",
@@ -7,3 +7,4 @@ export { AppScreenSectionButtonsDto } from './app-screen-section-buttons.dto';
7
7
  export { AppScreenSectionImageDto } from './app-screen-section-image.dto';
8
8
  export { AppScreenSectionListItemDto } from './app-screen-section-list-item.dto';
9
9
  export { AppScreenSectionReqDto } from './app-screen-section-req.dto';
10
+ export { AppScreenDialogDto } from './app-screen-dialog.dto';
@@ -1,9 +1,9 @@
1
1
  import { ApiProperty } from '@nestjs/swagger';
2
2
  import { Expose, Type } from 'class-transformer';
3
3
  import { IsString, IsNumber, IsBoolean, IsArray, ValidateNested } from 'class-validator';
4
- import { ICardState } from 'jp.common.models';
4
+ import { IAppTableCard } from 'jp.common.models';
5
5
 
6
- export class CardDto implements ICardState {
6
+ export class CardDto implements IAppTableCard {
7
7
  @ApiProperty({
8
8
  description: 'card ID',
9
9
  required: true,
@@ -0,0 +1,22 @@
1
+ import { Type, Expose } from "class-transformer";
2
+ import { IsString, ValidateNested } from "class-validator";
3
+ import { ApiProperty } from "@nestjs/swagger";
4
+ import { IAppTableCardsDeck } from "jp.common.models";
5
+
6
+ import { CardDto } from "./card.dto";
7
+
8
+ export class CardsDeckDto implements IAppTableCardsDeck {
9
+ @ApiProperty({
10
+ description: 'trumpSuit',
11
+ required: true,
12
+ type: String,
13
+ })
14
+ @Expose()
15
+ @IsString()
16
+ trumpSuit: string;
17
+
18
+ @ValidateNested()
19
+ @Type(() => CardDto)
20
+ @Expose()
21
+ trump?: CardDto | undefined;
22
+ }
@@ -1,11 +1,11 @@
1
1
  import { Expose, Type } from 'class-transformer';
2
2
  import { IsBoolean, IsNumber, ValidateNested } from 'class-validator';
3
- import { ICardPairSlotState } from 'jp.common.models';
4
3
  import { ApiProperty } from '@nestjs/swagger';
4
+ import { IAppTableCardsPairSlotsItem } from 'jp.common.models';
5
5
 
6
6
  import { CardDto } from './card.dto';
7
7
 
8
- export class CardPairSlotDto implements ICardPairSlotState {
8
+ export class CardPairSlotItemDto implements IAppTableCardsPairSlotsItem {
9
9
  @ApiProperty({
10
10
  description: 'id',
11
11
  required: true,
@@ -0,0 +1,13 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { IsArray, ValidateNested } from 'class-validator';
3
+ import { IAppTableCardsPairSlots } from 'jp.common.models';
4
+
5
+ import { CardPairSlotItemDto } from './cards-pair-slots-item.dto';
6
+
7
+ export class CardsPairSlotsDto implements IAppTableCardsPairSlots {
8
+ @IsArray()
9
+ @ValidateNested({ each: true })
10
+ @Type(() => CardPairSlotItemDto)
11
+ @Expose()
12
+ slots: Array<CardPairSlotItemDto>;
13
+ }
@@ -1,13 +1,12 @@
1
1
  import { Expose, Type } from 'class-transformer';
2
2
  import { IsArray, IsBoolean, IsString, ValidateNested } from 'class-validator';
3
- import { ICardsPanelState } from 'jp.common.models';
4
3
  import { ApiProperty } from '@nestjs/swagger';
5
-
6
- import { BaseTableYoursActionDto } from '../base/base-table-yours-action.dto';
4
+ import { IAppTableCardsPanel } from 'jp.common.models';
7
5
 
8
6
  import { CardDto } from './card.dto';
7
+ import { MovesPanelButtonDto } from './moves-panel-button.dto';
9
8
 
10
- export class CardsPanelDto implements ICardsPanelState {
9
+ export class CardsPanelDto implements IAppTableCardsPanel {
11
10
  @ApiProperty({
12
11
  description: 'isOpen',
13
12
  required: true,
@@ -28,9 +27,9 @@ export class CardsPanelDto implements ICardsPanelState {
28
27
 
29
28
  @IsArray()
30
29
  @ValidateNested({ each: true })
31
- @Type(() => BaseTableYoursActionDto)
30
+ @Type(() => MovesPanelButtonDto)
32
31
  @Expose()
33
- moves: Array<BaseTableYoursActionDto>;
32
+ buttons: Array<MovesPanelButtonDto>;
34
33
 
35
34
  @IsArray()
36
35
  @ValidateNested({ each: true })
@@ -0,0 +1,14 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { IsArray, ValidateNested } from 'class-validator';
3
+ import { IAppTableCardsPlayer } from 'jp.common.models';
4
+
5
+ import { CardDto } from './card.dto';
6
+ import { PlayerDto } from './player.dto';
7
+
8
+ export class CardsPlayerDto extends PlayerDto implements IAppTableCardsPlayer {
9
+ @IsArray()
10
+ @ValidateNested({ each: true })
11
+ @Type(() => CardDto)
12
+ @Expose()
13
+ cards: Array<CardDto>;
14
+ }
@@ -0,0 +1,11 @@
1
+ export { CardDto } from './card.dto';
2
+ export { CardsDeckDto } from './cards-deck.dto';
3
+ export { CardPairSlotItemDto } from './cards-pair-slots-item.dto';
4
+ export { CardsPairSlotsDto } from './cards-pair-slots.dto';
5
+ export { CardsPanelDto } from './cards-panel.dto';
6
+ export { CardsPlayerDto } from './cards-player.dto';
7
+ export { MovesPanelButtonDto } from './moves-panel-button.dto';
8
+ export { MovesPanelDto } from './moves-panel.dto';
9
+ export { PlayerDto } from './player.dto';
10
+ export { SummaryDto } from './summary.dto';
11
+ export { SummaryItemDto } from './summary-item.dto';
@@ -1,10 +1,9 @@
1
1
  import { ApiProperty } from '@nestjs/swagger';
2
2
  import { Expose } from 'class-transformer';
3
3
  import { IsString } from 'class-validator';
4
+ import { IAppTableMovesPanelButton } from 'jp.common.models';
4
5
 
5
- import { IBaseTableGameStateYoursActionItem } from 'jp.common.models';
6
-
7
- export class BaseTableYoursActionDto implements IBaseTableGameStateYoursActionItem {
6
+ export class MovesPanelButtonDto implements IAppTableMovesPanelButton {
8
7
  @ApiProperty({
9
8
  description: 'ID',
10
9
  required: true,
@@ -1,11 +1,11 @@
1
1
  import { Expose, Type } from 'class-transformer';
2
2
  import { IsArray, IsBoolean, ValidateNested } from 'class-validator';
3
- import { IBaseTableGameStateMovesPanel } from 'jp.common.models';
3
+ import { IAppTableMovesPanel } from 'jp.common.models';
4
4
  import { ApiProperty } from '@nestjs/swagger';
5
5
 
6
- import { BaseTableYoursActionDto } from './base-table-yours-action.dto';
6
+ import { MovesPanelButtonDto } from './moves-panel-button.dto';
7
7
 
8
- export class BaseTableMovesPanelDto implements IBaseTableGameStateMovesPanel {
8
+ export class MovesPanelDto implements IAppTableMovesPanel {
9
9
  @ApiProperty({
10
10
  description: 'isOpen',
11
11
  required: true,
@@ -17,7 +17,7 @@ export class BaseTableMovesPanelDto implements IBaseTableGameStateMovesPanel {
17
17
 
18
18
  @IsArray()
19
19
  @ValidateNested({ each: true })
20
- @Type(() => BaseTableYoursActionDto)
20
+ @Type(() => MovesPanelButtonDto)
21
21
  @Expose()
22
- moves: Array<BaseTableYoursActionDto>;
22
+ buttons: Array<MovesPanelButtonDto>;
23
23
  }
@@ -1,9 +1,9 @@
1
1
  import { ApiProperty } from '@nestjs/swagger';
2
2
  import { Expose } from 'class-transformer';
3
3
  import { IsString, IsNumber, IsBoolean } from 'class-validator';
4
- import { IBaseTableGameStatePlayer } from 'jp.common.models';
4
+ import { IAppTablePlayer } from 'jp.common.models';
5
5
 
6
- export class GamePlayerDto implements IBaseTableGameStatePlayer {
6
+ export class PlayerDto implements IAppTablePlayer {
7
7
  @ApiProperty({
8
8
  description: 'user ID',
9
9
  required: true,
@@ -1,10 +1,9 @@
1
1
  import { ApiProperty } from '@nestjs/swagger';
2
2
  import { Expose } from 'class-transformer';
3
3
  import { IsString } from 'class-validator';
4
+ import { IAppTableSummaryItem } from 'jp.common.models';
4
5
 
5
- import { IBaseTableGameStateSummaryItem } from 'jp.common.models';
6
-
7
- export class BaseTableSummaryItemDto implements IBaseTableGameStateSummaryItem {
6
+ export class SummaryItemDto implements IAppTableSummaryItem {
8
7
  @ApiProperty({
9
8
  description: 'id',
10
9
  required: true,
@@ -0,0 +1,13 @@
1
+ import { Expose, Type } from 'class-transformer';
2
+ import { IsArray, ValidateNested } from 'class-validator';
3
+ import { IAppTableSummary } from 'jp.common.models';
4
+
5
+ import { SummaryItemDto } from './summary-item.dto';
6
+
7
+ export class SummaryDto implements IAppTableSummary {
8
+ @IsArray()
9
+ @ValidateNested({ each: true })
10
+ @Type(() => SummaryItemDto)
11
+ @Expose()
12
+ list: Array<SummaryItemDto>;
13
+ }
@@ -0,0 +1,3 @@
1
+ import { CardsPlayerDto } from "../../app-table";
2
+
3
+ export class FoolPlayerDto extends CardsPlayerDto { }
@@ -0,0 +1,79 @@
1
+ import { ApiProperty } from "@nestjs/swagger";
2
+ import { Expose, plainToInstance, Type } from "class-transformer";
3
+ import { IsArray, IsNumber, ValidateNested } from "class-validator";
4
+ import { IFoolTable } from "jp.common.models";
5
+
6
+ import { AppScreenAppBarDto, AppScreenDialogDto } from "../../app-screen";
7
+ import {
8
+ CardsPairSlotsDto,
9
+ CardsDeckDto,
10
+ CardsPanelDto,
11
+ MovesPanelDto,
12
+ SummaryDto,
13
+ } from "../../app-table";
14
+
15
+ import { FoolPlayerDto } from "./fool-player.dto";
16
+
17
+ export class FoolTableDto implements IFoolTable {
18
+ @Type(() => AppScreenAppBarDto)
19
+ @Expose()
20
+ appBar: AppScreenAppBarDto;
21
+
22
+ @Type(() => AppScreenDialogDto)
23
+ @Expose()
24
+ confirmExitDialog: AppScreenDialogDto | undefined;
25
+
26
+ @ApiProperty({
27
+ description: 'Player Turn Timer Remain',
28
+ type: Number,
29
+ })
30
+ @IsNumber()
31
+ @Expose()
32
+ playersTurnTimer: number | undefined;
33
+
34
+ @ApiProperty({
35
+ description: 'Restart Timer Remain',
36
+ type: Number,
37
+ })
38
+ @IsNumber()
39
+ @Expose()
40
+ restartTimer: number | undefined;
41
+
42
+ @ApiProperty({
43
+ description: 'Table size',
44
+ type: Number,
45
+ })
46
+ @IsNumber()
47
+ @Expose()
48
+ tableSize: number;
49
+
50
+ @IsArray()
51
+ @ValidateNested({ each: true })
52
+ @Type(() => FoolPlayerDto)
53
+ @Expose()
54
+ players: FoolPlayerDto[];
55
+
56
+ @Type(() => CardsPairSlotsDto)
57
+ @Expose()
58
+ cardsSlots: CardsPairSlotsDto;
59
+
60
+ @Type(() => CardsDeckDto)
61
+ @Expose()
62
+ cardsDeck: CardsDeckDto;
63
+
64
+ @Type(() => SummaryDto)
65
+ @Expose()
66
+ summary: SummaryDto;
67
+
68
+ @Type(() => CardsPanelDto)
69
+ @Expose()
70
+ cardsPanel: CardsPanelDto;
71
+
72
+ @Type(() => MovesPanelDto)
73
+ @Expose()
74
+ movesPanel: MovesPanelDto;
75
+
76
+ constructor(entity: IFoolTable) {
77
+ return plainToInstance(FoolTableDto, entity, { excludeExtraneousValues: true })
78
+ }
79
+ }
@@ -0,0 +1 @@
1
+ export * from './fool/fool-table.dto';
package/src/dto/index.ts CHANGED
@@ -1,3 +1,4 @@
1
- export * from './table-game'
1
+ export * from './app-table'
2
2
  export * from './app-screen'
3
3
  export * from './common'
4
+ export * from './games';
@@ -0,0 +1,4 @@
1
+ export enum ErrorCodeEnum {
2
+ NOT_ENOUGH_MONEY_FOR_PURCHASE = '1001',
3
+ NOT_FOUND_FREE_ROOM_FOR_FAST_GAME = '1002',
4
+ }
@@ -0,0 +1,50 @@
1
+ import { ExceptionFilter, Catch, ArgumentsHost, HttpException, HttpCode, HttpStatus } from '@nestjs/common';
2
+ import { Response } from 'express';
3
+
4
+ import { JpLoggerService } from '../modules';
5
+
6
+ import { ErrorResponseWithSnackbar, HttpExceptionWithSnackbar } from './http-exception-wth-snackbar';
7
+
8
+ @Catch(Error)
9
+ export class GlobalExceptionFilter implements ExceptionFilter {
10
+ private readonly logger = new JpLoggerService();
11
+
12
+ catch (exception: Error, host: ArgumentsHost) {
13
+ this.logger.error(exception);
14
+ const ctx = host.switchToHttp();
15
+ const response = ctx.getResponse<Response>();
16
+
17
+ if (exception instanceof HttpExceptionWithSnackbar) {
18
+ const data = exception.getResponse() as ErrorResponseWithSnackbar;
19
+ const status = exception.getStatus();
20
+
21
+ response
22
+ .status(status)
23
+ .json({
24
+ statusCode: status,
25
+ message: exception.message,
26
+ snackbar: data.snackbar,
27
+ });
28
+
29
+ return;
30
+ } else if (exception instanceof HttpException) {
31
+ const status = exception.getStatus();
32
+
33
+ response
34
+ .status(status)
35
+ .json({
36
+ statusCode: status,
37
+ message: exception.message,
38
+ });
39
+
40
+ return;
41
+ }
42
+
43
+ response
44
+ .status(HttpStatus.INTERNAL_SERVER_ERROR)
45
+ .json({
46
+ statusCode: HttpStatus.INTERNAL_SERVER_ERROR,
47
+ message: exception.message,
48
+ });
49
+ }
50
+ }
@@ -0,0 +1,23 @@
1
+ import { HttpException, HttpStatus } from '@nestjs/common';
2
+ import { IAppScreenSnackbar } from 'jp.common.models';
3
+
4
+ import { ErrorCodeEnum } from './error-code.enum';
5
+
6
+ export interface ErrorResponseWithSnackbar {
7
+ statusCode: number;
8
+ message: string;
9
+ errorCode: string;
10
+ snackbar: IAppScreenSnackbar;
11
+ }
12
+
13
+ export class HttpExceptionWithSnackbar extends HttpException {
14
+ constructor(message: string, errorCode: ErrorCodeEnum, snackbar: IAppScreenSnackbar) {
15
+ const response: ErrorResponseWithSnackbar = {
16
+ statusCode: HttpStatus.INTERNAL_SERVER_ERROR,
17
+ message,
18
+ errorCode,
19
+ snackbar,
20
+ };
21
+ super(response, HttpStatus.INTERNAL_SERVER_ERROR);
22
+ }
23
+ }