Advertisement
Guest User

Untitled

a guest
Oct 14th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. // @flow
  2.  
  3. /*
  4. * Core Structure for CasinoGames redux store
  5. */
  6.  
  7. type CasinoGamesStore = {
  8. categories: Object<CategoryId, Category>,
  9. currencies: Object<CurrencyId, Currency>,
  10. games: Object<GameId, Game>,
  11. jackpots: Object<JackpotId, Jackpot>,
  12. langPack: LanguagePack<string, string>,
  13. lastUpdated: Object<ApiId, ApiLastUpdated>,
  14. winners: Winner[],
  15. };
  16.  
  17. /*
  18. * Games Reducer
  19. */
  20. type GameId = mixed;
  21.  
  22. type Game = {
  23. title: string,
  24. description: string,
  25. thumbnail: GameThumbnail,
  26. type: ?string,
  27. width: ?number,
  28. height: ?number,
  29. sticker: ?string,
  30. jackpotGroup: ?JackpotId,
  31. featured: ?boolean,
  32. };
  33.  
  34. type GameThumbnail = {
  35. default: string,
  36. featured: ?string,
  37. video: ?string,
  38. };
  39.  
  40. type GameStub = {
  41. id: GameId,
  42. sticker: ?string,
  43. featured: ?boolean,
  44. };
  45.  
  46. /*
  47. * Categories Reducer
  48. */
  49. type CategoryId = mixed;
  50.  
  51. type Category = {
  52. title: string,
  53. isDefault: ?boolean,
  54. position: number,
  55. games: GameStub[],
  56. };
  57.  
  58. /*
  59. * Jackpots Reducer
  60. */
  61. type JackpotId = mixed;
  62.  
  63. type Jackpot = {
  64. title: string,
  65. amount: number,
  66. currency: CurrencyId,
  67. subJackpots: SubJackpot[],
  68. games: GameStub[],
  69. };
  70.  
  71. type SubJackpot = {
  72. title: string,
  73. amount: number,
  74. };
  75.  
  76. /*
  77. * Winners Reducer
  78. */
  79. type Winner = {
  80. username: string,
  81. game: GameId,
  82. amount: number,
  83. currency: CurrencyId,
  84. timestamp: number, // time converted to ms since epoch, can then be converted to date object as necessary
  85. };
  86.  
  87. /*
  88. * Currencies Reducer
  89. */
  90. type CurrencyId = String;
  91.  
  92. type Currency = {
  93. format: string,
  94. symbol: string,
  95. symbolBefore: boolean,
  96. };
  97.  
  98. /*
  99. * LangPack Reducer
  100. */
  101. type LanguagePack = {
  102. playNow: string,
  103. showMore: string,
  104. addToFavourites: string,
  105. recentWinners: string,
  106. favourites: string,
  107. search: string,
  108. searchPlaceholder: string,
  109. sort: string,
  110. sortGrid: string,
  111. sortList: string,
  112. sortAlphabetically: string,
  113. sortPopular: string,
  114. winnersUsername: string,
  115. winnersAmount: string,
  116. winnersTimestamp: string,
  117. winnersGame: string,
  118. };
  119.  
  120. /*
  121. * Api Metadata Reducer
  122. */
  123. type ApiId = String;
  124.  
  125. type ApiLastUpdated = {
  126. lastUpdated: ?number,
  127. lastRequested: ?number,
  128. };
  129.  
  130. /*
  131. * Core Structure for User redux store
  132. */
  133.  
  134. type UserStore = {
  135. id: ?UserId,
  136. username: ?string,
  137. balances: Balance[],
  138. recommendedGames: GameId[],
  139. favouriteGames: GameId[],
  140. recentGames: RecentGame,
  141. sessionId: ?string,
  142. }
  143.  
  144. /*
  145. * id reducer
  146. */
  147. type UserId = number;
  148.  
  149. /*
  150. * Balances reducer
  151. */
  152. type Balance = {
  153. balance: number,
  154. currency: CurrencyId,
  155. type: string,
  156. };
  157.  
  158. /*
  159. * Recent games reducer
  160. */
  161. type RecentGame = {
  162. id: GameId,
  163. lastPlayed: number, // timestamp
  164. playCount: number,
  165. score: number,
  166. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement