be-components 7.4.7 → 7.5.1

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 (596) hide show
  1. package/lib/commonjs/ApiOverrides/index.js +4 -0
  2. package/lib/commonjs/ApiOverrides/index.js.map +1 -1
  3. package/lib/commonjs/BetRouter/api/index.js +884 -0
  4. package/lib/commonjs/BetRouter/api/index.js.map +1 -0
  5. package/lib/commonjs/BetRouter/api/types.js +2 -0
  6. package/lib/commonjs/BetRouter/api/types.js.map +1 -0
  7. package/lib/commonjs/BetRouter/components/AccountManager.js +592 -0
  8. package/lib/commonjs/BetRouter/components/AccountManager.js.map +1 -0
  9. package/lib/commonjs/BetRouter/components/AdminPortal.js +51 -0
  10. package/lib/commonjs/BetRouter/components/AdminPortal.js.map +1 -0
  11. package/lib/commonjs/BetRouter/components/BuyOpportunities.js +550 -0
  12. package/lib/commonjs/BetRouter/components/BuyOpportunities.js.map +1 -0
  13. package/lib/commonjs/BetRouter/components/BuyOpportunityCard.js +320 -0
  14. package/lib/commonjs/BetRouter/components/BuyOpportunityCard.js.map +1 -0
  15. package/lib/commonjs/BetRouter/components/ContestLiquidity.js +666 -0
  16. package/lib/commonjs/BetRouter/components/ContestLiquidity.js.map +1 -0
  17. package/lib/commonjs/BetRouter/components/ContestSelector.js +193 -0
  18. package/lib/commonjs/BetRouter/components/ContestSelector.js.map +1 -0
  19. package/lib/commonjs/BetRouter/components/MyOpportunities.js +332 -0
  20. package/lib/commonjs/BetRouter/components/MyOpportunities.js.map +1 -0
  21. package/lib/commonjs/BetRouter/components/MyOpportunities.tsx.bak +440 -0
  22. package/lib/commonjs/BetRouter/components/OpportunityDetailModal.js +545 -0
  23. package/lib/commonjs/BetRouter/components/OpportunityDetailModal.js.map +1 -0
  24. package/lib/commonjs/BetRouter/components/OpportunityHistory.js +489 -0
  25. package/lib/commonjs/BetRouter/components/OpportunityHistory.js.map +1 -0
  26. package/lib/commonjs/BetRouter/components/PartnerCredentials.js +229 -0
  27. package/lib/commonjs/BetRouter/components/PartnerCredentials.js.map +1 -0
  28. package/lib/commonjs/BetRouter/components/PlacedOpportunityModal.js +262 -0
  29. package/lib/commonjs/BetRouter/components/PlacedOpportunityModal.js.map +1 -0
  30. package/lib/commonjs/BetRouter/components/admin/AutoFillView.js +380 -0
  31. package/lib/commonjs/BetRouter/components/admin/AutoFillView.js.map +1 -0
  32. package/lib/commonjs/BetRouter/components/admin/ConfigManager.js +814 -0
  33. package/lib/commonjs/BetRouter/components/admin/ConfigManager.js.map +1 -0
  34. package/lib/commonjs/BetRouter/components/admin/JobManager.js +895 -0
  35. package/lib/commonjs/BetRouter/components/admin/JobManager.js.map +1 -0
  36. package/lib/commonjs/BetRouter/components/admin/LeagueContests.js +2844 -0
  37. package/lib/commonjs/BetRouter/components/admin/LeagueContests.js.map +1 -0
  38. package/lib/commonjs/BetRouter/components/admin/LeagueInfo.js +378 -0
  39. package/lib/commonjs/BetRouter/components/admin/LeagueInfo.js.map +1 -0
  40. package/lib/commonjs/BetRouter/components/admin/LeagueParticipants.js +795 -0
  41. package/lib/commonjs/BetRouter/components/admin/LeagueParticipants.js.map +1 -0
  42. package/lib/commonjs/BetRouter/index.js +411 -0
  43. package/lib/commonjs/BetRouter/index.js.map +1 -0
  44. package/lib/commonjs/BetRouter/layouts/DesktopAdminLayout.js +312 -0
  45. package/lib/commonjs/BetRouter/layouts/DesktopAdminLayout.js.map +1 -0
  46. package/lib/commonjs/BetRouter/layouts/DesktopLayout.js +271 -0
  47. package/lib/commonjs/BetRouter/layouts/DesktopLayout.js.map +1 -0
  48. package/lib/commonjs/BetRouter/layouts/MobileAdminLayout.js +435 -0
  49. package/lib/commonjs/BetRouter/layouts/MobileAdminLayout.js.map +1 -0
  50. package/lib/commonjs/BetRouter/layouts/MobileLayout.js +293 -0
  51. package/lib/commonjs/BetRouter/layouts/MobileLayout.js.map +1 -0
  52. package/lib/commonjs/BetRouter/types/ADMIN_PORTAL.md +863 -0
  53. package/lib/commonjs/BetRouter/types/ADMIN_PORTAL_SIMPLIFIED.md +1881 -0
  54. package/lib/commonjs/BetRouter/types/CREDENTIALS_EXAMPLE.md +350 -0
  55. package/lib/commonjs/BetRouter/types/LIQUIDITY_CLIENT_GUIDE.md +399 -0
  56. package/lib/commonjs/BetRouter/types/MARKET_LINKING_WORKFLOW.md +682 -0
  57. package/lib/commonjs/BetRouter/types/MARKET_LINKING_WORKFLOW_V2.md +627 -0
  58. package/lib/commonjs/BetRouter/types/README.md +249 -0
  59. package/lib/commonjs/BetRouter/types/accounts.js +2 -0
  60. package/lib/commonjs/BetRouter/types/accounts.js.map +1 -0
  61. package/lib/commonjs/BetRouter/types/api-contracts.js +776 -0
  62. package/lib/commonjs/BetRouter/types/api-contracts.js.map +1 -0
  63. package/lib/commonjs/BetRouter/types/config.js +2 -0
  64. package/lib/commonjs/BetRouter/types/config.js.map +1 -0
  65. package/lib/commonjs/BetRouter/types/contests.js +2 -0
  66. package/lib/commonjs/BetRouter/types/contests.js.map +1 -0
  67. package/lib/commonjs/BetRouter/types/credentials.js +90 -0
  68. package/lib/commonjs/BetRouter/types/credentials.js.map +1 -0
  69. package/lib/commonjs/BetRouter/types/index.js +149 -0
  70. package/lib/commonjs/BetRouter/types/index.js.map +1 -0
  71. package/lib/commonjs/BetRouter/types/jobs.js +2 -0
  72. package/lib/commonjs/BetRouter/types/jobs.js.map +1 -0
  73. package/lib/commonjs/BetRouter/types/leagues.js +2 -0
  74. package/lib/commonjs/BetRouter/types/leagues.js.map +1 -0
  75. package/lib/commonjs/BetRouter/types/liquidity.js +2 -0
  76. package/lib/commonjs/BetRouter/types/liquidity.js.map +1 -0
  77. package/lib/commonjs/BetRouter/types/markets.js +2 -0
  78. package/lib/commonjs/BetRouter/types/markets.js.map +1 -0
  79. package/lib/commonjs/BetRouter/types/opportunities.js +6 -0
  80. package/lib/commonjs/BetRouter/types/opportunities.js.map +1 -0
  81. package/lib/commonjs/BetRouter/types/orders.js +2 -0
  82. package/lib/commonjs/BetRouter/types/orders.js.map +1 -0
  83. package/lib/commonjs/BetRouter/types/participants.js +2 -0
  84. package/lib/commonjs/BetRouter/types/participants.js.map +1 -0
  85. package/lib/commonjs/BetRouter/types/partners.js +2 -0
  86. package/lib/commonjs/BetRouter/types/partners.js.map +1 -0
  87. package/lib/commonjs/Charts/README.md +310 -0
  88. package/lib/commonjs/Charts/adapters/TradeChartAdapter.js +406 -0
  89. package/lib/commonjs/Charts/adapters/TradeChartAdapter.js.map +1 -0
  90. package/lib/commonjs/Charts/components/BaseLineChart.js +285 -0
  91. package/lib/commonjs/Charts/components/BaseLineChart.js.map +1 -0
  92. package/lib/commonjs/Charts/components/LivePriceChart.js +504 -0
  93. package/lib/commonjs/Charts/components/LivePriceChart.js.map +1 -0
  94. package/lib/commonjs/Charts/index.js +126 -0
  95. package/lib/commonjs/Charts/index.js.map +1 -0
  96. package/lib/commonjs/Charts/themes/chartTheme.js +141 -0
  97. package/lib/commonjs/Charts/themes/chartTheme.js.map +1 -0
  98. package/lib/commonjs/Charts/types.js +2 -0
  99. package/lib/commonjs/Charts/types.js.map +1 -0
  100. package/lib/commonjs/Charts/utils/formatters.js +194 -0
  101. package/lib/commonjs/Charts/utils/formatters.js.map +1 -0
  102. package/lib/commonjs/Components/Dropdown.js +5 -3
  103. package/lib/commonjs/Components/Dropdown.js.map +1 -1
  104. package/lib/commonjs/Components/Icons.js +24 -0
  105. package/lib/commonjs/Components/Icons.js.map +1 -1
  106. package/lib/commonjs/Components/index.js +34 -0
  107. package/lib/commonjs/Components/index.js.map +1 -1
  108. package/lib/commonjs/LocationTracker/LocationStatus.js +5 -2
  109. package/lib/commonjs/LocationTracker/LocationStatus.js.map +1 -1
  110. package/lib/commonjs/LocationTracker/api/index.js +2 -2
  111. package/lib/commonjs/LocationTracker/api/index.js.map +1 -1
  112. package/lib/commonjs/index.js +28 -0
  113. package/lib/commonjs/index.js.map +1 -1
  114. package/lib/commonjs/types.d.js +16 -0
  115. package/lib/commonjs/types.d.js.map +1 -1
  116. package/lib/module/ApiOverrides/index.js +4 -0
  117. package/lib/module/ApiOverrides/index.js.map +1 -1
  118. package/lib/module/BetRouter/api/index.js +873 -0
  119. package/lib/module/BetRouter/api/index.js.map +1 -0
  120. package/lib/module/BetRouter/api/types.js +2 -0
  121. package/lib/module/BetRouter/api/types.js.map +1 -0
  122. package/lib/module/BetRouter/components/AccountManager.js +584 -0
  123. package/lib/module/BetRouter/components/AccountManager.js.map +1 -0
  124. package/lib/module/BetRouter/components/AdminPortal.js +43 -0
  125. package/lib/module/BetRouter/components/AdminPortal.js.map +1 -0
  126. package/lib/module/BetRouter/components/BuyOpportunities.js +542 -0
  127. package/lib/module/BetRouter/components/BuyOpportunities.js.map +1 -0
  128. package/lib/module/BetRouter/components/BuyOpportunityCard.js +313 -0
  129. package/lib/module/BetRouter/components/BuyOpportunityCard.js.map +1 -0
  130. package/lib/module/BetRouter/components/ContestLiquidity.js +658 -0
  131. package/lib/module/BetRouter/components/ContestLiquidity.js.map +1 -0
  132. package/lib/module/BetRouter/components/ContestSelector.js +185 -0
  133. package/lib/module/BetRouter/components/ContestSelector.js.map +1 -0
  134. package/lib/module/BetRouter/components/MyOpportunities.js +324 -0
  135. package/lib/module/BetRouter/components/MyOpportunities.js.map +1 -0
  136. package/lib/module/BetRouter/components/MyOpportunities.tsx.bak +440 -0
  137. package/lib/module/BetRouter/components/OpportunityDetailModal.js +538 -0
  138. package/lib/module/BetRouter/components/OpportunityDetailModal.js.map +1 -0
  139. package/lib/module/BetRouter/components/OpportunityHistory.js +481 -0
  140. package/lib/module/BetRouter/components/OpportunityHistory.js.map +1 -0
  141. package/lib/module/BetRouter/components/PartnerCredentials.js +222 -0
  142. package/lib/module/BetRouter/components/PartnerCredentials.js.map +1 -0
  143. package/lib/module/BetRouter/components/PlacedOpportunityModal.js +255 -0
  144. package/lib/module/BetRouter/components/PlacedOpportunityModal.js.map +1 -0
  145. package/lib/module/BetRouter/components/admin/AutoFillView.js +372 -0
  146. package/lib/module/BetRouter/components/admin/AutoFillView.js.map +1 -0
  147. package/lib/module/BetRouter/components/admin/ConfigManager.js +806 -0
  148. package/lib/module/BetRouter/components/admin/ConfigManager.js.map +1 -0
  149. package/lib/module/BetRouter/components/admin/JobManager.js +888 -0
  150. package/lib/module/BetRouter/components/admin/JobManager.js.map +1 -0
  151. package/lib/module/BetRouter/components/admin/LeagueContests.js +2836 -0
  152. package/lib/module/BetRouter/components/admin/LeagueContests.js.map +1 -0
  153. package/lib/module/BetRouter/components/admin/LeagueInfo.js +372 -0
  154. package/lib/module/BetRouter/components/admin/LeagueInfo.js.map +1 -0
  155. package/lib/module/BetRouter/components/admin/LeagueParticipants.js +787 -0
  156. package/lib/module/BetRouter/components/admin/LeagueParticipants.js.map +1 -0
  157. package/lib/module/BetRouter/index.js +399 -0
  158. package/lib/module/BetRouter/index.js.map +1 -0
  159. package/lib/module/BetRouter/layouts/DesktopAdminLayout.js +304 -0
  160. package/lib/module/BetRouter/layouts/DesktopAdminLayout.js.map +1 -0
  161. package/lib/module/BetRouter/layouts/DesktopLayout.js +263 -0
  162. package/lib/module/BetRouter/layouts/DesktopLayout.js.map +1 -0
  163. package/lib/module/BetRouter/layouts/MobileAdminLayout.js +427 -0
  164. package/lib/module/BetRouter/layouts/MobileAdminLayout.js.map +1 -0
  165. package/lib/module/BetRouter/layouts/MobileLayout.js +285 -0
  166. package/lib/module/BetRouter/layouts/MobileLayout.js.map +1 -0
  167. package/lib/module/BetRouter/types/ADMIN_PORTAL.md +863 -0
  168. package/lib/module/BetRouter/types/ADMIN_PORTAL_SIMPLIFIED.md +1881 -0
  169. package/lib/module/BetRouter/types/CREDENTIALS_EXAMPLE.md +350 -0
  170. package/lib/module/BetRouter/types/LIQUIDITY_CLIENT_GUIDE.md +399 -0
  171. package/lib/module/BetRouter/types/MARKET_LINKING_WORKFLOW.md +682 -0
  172. package/lib/module/BetRouter/types/MARKET_LINKING_WORKFLOW_V2.md +627 -0
  173. package/lib/module/BetRouter/types/README.md +249 -0
  174. package/lib/module/BetRouter/types/accounts.js +2 -0
  175. package/lib/module/BetRouter/types/accounts.js.map +1 -0
  176. package/lib/module/BetRouter/types/api-contracts.js +770 -0
  177. package/lib/module/BetRouter/types/api-contracts.js.map +1 -0
  178. package/lib/module/BetRouter/types/config.js +2 -0
  179. package/lib/module/BetRouter/types/config.js.map +1 -0
  180. package/lib/module/BetRouter/types/contests.js +2 -0
  181. package/lib/module/BetRouter/types/contests.js.map +1 -0
  182. package/lib/module/BetRouter/types/credentials.js +78 -0
  183. package/lib/module/BetRouter/types/credentials.js.map +1 -0
  184. package/lib/module/BetRouter/types/index.js +17 -0
  185. package/lib/module/BetRouter/types/index.js.map +1 -0
  186. package/lib/module/BetRouter/types/jobs.js +2 -0
  187. package/lib/module/BetRouter/types/jobs.js.map +1 -0
  188. package/lib/module/BetRouter/types/leagues.js +2 -0
  189. package/lib/module/BetRouter/types/leagues.js.map +1 -0
  190. package/lib/module/BetRouter/types/liquidity.js +2 -0
  191. package/lib/module/BetRouter/types/liquidity.js.map +1 -0
  192. package/lib/module/BetRouter/types/markets.js +2 -0
  193. package/lib/module/BetRouter/types/markets.js.map +1 -0
  194. package/lib/module/BetRouter/types/opportunities.js +2 -0
  195. package/lib/module/BetRouter/types/opportunities.js.map +1 -0
  196. package/lib/module/BetRouter/types/orders.js +2 -0
  197. package/lib/module/BetRouter/types/orders.js.map +1 -0
  198. package/lib/module/BetRouter/types/participants.js +2 -0
  199. package/lib/module/BetRouter/types/participants.js.map +1 -0
  200. package/lib/module/BetRouter/types/partners.js +2 -0
  201. package/lib/module/BetRouter/types/partners.js.map +1 -0
  202. package/lib/module/Charts/README.md +310 -0
  203. package/lib/module/Charts/adapters/TradeChartAdapter.js +400 -0
  204. package/lib/module/Charts/adapters/TradeChartAdapter.js.map +1 -0
  205. package/lib/module/Charts/components/BaseLineChart.js +281 -0
  206. package/lib/module/Charts/components/BaseLineChart.js.map +1 -0
  207. package/lib/module/Charts/components/LivePriceChart.js +497 -0
  208. package/lib/module/Charts/components/LivePriceChart.js.map +1 -0
  209. package/lib/module/Charts/index.js +36 -0
  210. package/lib/module/Charts/index.js.map +1 -0
  211. package/lib/module/Charts/themes/chartTheme.js +134 -0
  212. package/lib/module/Charts/themes/chartTheme.js.map +1 -0
  213. package/lib/module/Charts/types.js +2 -0
  214. package/lib/module/Charts/types.js.map +1 -0
  215. package/lib/module/Charts/utils/formatters.js +178 -0
  216. package/lib/module/Charts/utils/formatters.js.map +1 -0
  217. package/lib/module/Components/Dropdown.js +5 -3
  218. package/lib/module/Components/Dropdown.js.map +1 -1
  219. package/lib/module/Components/Icons.js +24 -1
  220. package/lib/module/Components/Icons.js.map +1 -1
  221. package/lib/module/Components/index.js +3 -0
  222. package/lib/module/Components/index.js.map +1 -1
  223. package/lib/module/LocationTracker/LocationStatus.js +5 -2
  224. package/lib/module/LocationTracker/LocationStatus.js.map +1 -1
  225. package/lib/module/LocationTracker/api/index.js +2 -2
  226. package/lib/module/LocationTracker/api/index.js.map +1 -1
  227. package/lib/module/index.js +5 -1
  228. package/lib/module/index.js.map +1 -1
  229. package/lib/module/types.d.js +16 -0
  230. package/lib/module/types.d.js.map +1 -1
  231. package/lib/typescript/lib/commonjs/ApiOverrides/index.d.ts.map +1 -1
  232. package/lib/typescript/lib/commonjs/BetRouter/api/index.d.ts +109 -0
  233. package/lib/typescript/lib/commonjs/BetRouter/api/index.d.ts.map +1 -0
  234. package/lib/typescript/lib/commonjs/BetRouter/api/types.d.ts +2 -0
  235. package/lib/typescript/lib/commonjs/BetRouter/api/types.d.ts.map +1 -0
  236. package/lib/typescript/lib/commonjs/BetRouter/components/AccountManager.d.ts +16 -0
  237. package/lib/typescript/lib/commonjs/BetRouter/components/AccountManager.d.ts.map +1 -0
  238. package/lib/typescript/lib/commonjs/BetRouter/components/AdminPortal.d.ts +9 -0
  239. package/lib/typescript/lib/commonjs/BetRouter/components/AdminPortal.d.ts.map +1 -0
  240. package/lib/typescript/lib/commonjs/BetRouter/components/BuyOpportunities.d.ts +16 -0
  241. package/lib/typescript/lib/commonjs/BetRouter/components/BuyOpportunities.d.ts.map +1 -0
  242. package/lib/typescript/lib/commonjs/BetRouter/components/BuyOpportunityCard.d.ts +14 -0
  243. package/lib/typescript/lib/commonjs/BetRouter/components/BuyOpportunityCard.d.ts.map +1 -0
  244. package/lib/typescript/lib/commonjs/BetRouter/components/ContestLiquidity.d.ts +11 -0
  245. package/lib/typescript/lib/commonjs/BetRouter/components/ContestLiquidity.d.ts.map +1 -0
  246. package/lib/typescript/lib/commonjs/BetRouter/components/ContestSelector.d.ts +11 -0
  247. package/lib/typescript/lib/commonjs/BetRouter/components/ContestSelector.d.ts.map +1 -0
  248. package/lib/typescript/lib/commonjs/BetRouter/components/MyOpportunities.d.ts +8 -0
  249. package/lib/typescript/lib/commonjs/BetRouter/components/MyOpportunities.d.ts.map +1 -0
  250. package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityDetailModal.d.ts +14 -0
  251. package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityDetailModal.d.ts.map +1 -0
  252. package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityHistory.d.ts +9 -0
  253. package/lib/typescript/lib/commonjs/BetRouter/components/OpportunityHistory.d.ts.map +1 -0
  254. package/lib/typescript/lib/commonjs/BetRouter/components/PartnerCredentials.d.ts +10 -0
  255. package/lib/typescript/lib/commonjs/BetRouter/components/PartnerCredentials.d.ts.map +1 -0
  256. package/lib/typescript/lib/commonjs/BetRouter/components/PlacedOpportunityModal.d.ts +11 -0
  257. package/lib/typescript/lib/commonjs/BetRouter/components/PlacedOpportunityModal.d.ts.map +1 -0
  258. package/lib/typescript/lib/commonjs/BetRouter/components/admin/AutoFillView.d.ts +4 -0
  259. package/lib/typescript/lib/commonjs/BetRouter/components/admin/AutoFillView.d.ts.map +1 -0
  260. package/lib/typescript/lib/commonjs/BetRouter/components/admin/ConfigManager.d.ts +4 -0
  261. package/lib/typescript/lib/commonjs/BetRouter/components/admin/ConfigManager.d.ts.map +1 -0
  262. package/lib/typescript/lib/commonjs/BetRouter/components/admin/JobManager.d.ts +4 -0
  263. package/lib/typescript/lib/commonjs/BetRouter/components/admin/JobManager.d.ts.map +1 -0
  264. package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueContests.d.ts +7 -0
  265. package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueContests.d.ts.map +1 -0
  266. package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueInfo.d.ts +6 -0
  267. package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueInfo.d.ts.map +1 -0
  268. package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueParticipants.d.ts +6 -0
  269. package/lib/typescript/lib/commonjs/BetRouter/components/admin/LeagueParticipants.d.ts.map +1 -0
  270. package/lib/typescript/lib/commonjs/BetRouter/index.d.ts +8 -0
  271. package/lib/typescript/lib/commonjs/BetRouter/index.d.ts.map +1 -0
  272. package/lib/typescript/lib/commonjs/BetRouter/layouts/DesktopAdminLayout.d.ts +9 -0
  273. package/lib/typescript/lib/commonjs/BetRouter/layouts/DesktopAdminLayout.d.ts.map +1 -0
  274. package/lib/typescript/lib/commonjs/BetRouter/layouts/DesktopLayout.d.ts +20 -0
  275. package/lib/typescript/lib/commonjs/BetRouter/layouts/DesktopLayout.d.ts.map +1 -0
  276. package/lib/typescript/lib/commonjs/BetRouter/layouts/MobileAdminLayout.d.ts +9 -0
  277. package/lib/typescript/lib/commonjs/BetRouter/layouts/MobileAdminLayout.d.ts.map +1 -0
  278. package/lib/typescript/lib/commonjs/BetRouter/layouts/MobileLayout.d.ts +20 -0
  279. package/lib/typescript/lib/commonjs/BetRouter/layouts/MobileLayout.d.ts.map +1 -0
  280. package/lib/typescript/lib/commonjs/BetRouter/types/accounts.d.ts +2 -0
  281. package/lib/typescript/lib/commonjs/BetRouter/types/accounts.d.ts.map +1 -0
  282. package/lib/typescript/lib/commonjs/BetRouter/types/api-contracts.d.ts +743 -0
  283. package/lib/typescript/lib/commonjs/BetRouter/types/api-contracts.d.ts.map +1 -0
  284. package/lib/typescript/lib/commonjs/BetRouter/types/config.d.ts +2 -0
  285. package/lib/typescript/lib/commonjs/BetRouter/types/config.d.ts.map +1 -0
  286. package/lib/typescript/lib/commonjs/BetRouter/types/contests.d.ts +2 -0
  287. package/lib/typescript/lib/commonjs/BetRouter/types/contests.d.ts.map +1 -0
  288. package/lib/typescript/lib/commonjs/BetRouter/types/credentials.d.ts +56 -0
  289. package/lib/typescript/lib/commonjs/BetRouter/types/credentials.d.ts.map +1 -0
  290. package/lib/typescript/lib/commonjs/BetRouter/types/index.d.ts +2 -0
  291. package/lib/typescript/lib/commonjs/BetRouter/types/index.d.ts.map +1 -0
  292. package/lib/typescript/lib/commonjs/BetRouter/types/jobs.d.ts +2 -0
  293. package/lib/typescript/lib/commonjs/BetRouter/types/jobs.d.ts.map +1 -0
  294. package/lib/typescript/lib/commonjs/BetRouter/types/leagues.d.ts +2 -0
  295. package/lib/typescript/lib/commonjs/BetRouter/types/leagues.d.ts.map +1 -0
  296. package/lib/typescript/lib/commonjs/BetRouter/types/liquidity.d.ts +2 -0
  297. package/lib/typescript/lib/commonjs/BetRouter/types/liquidity.d.ts.map +1 -0
  298. package/lib/typescript/lib/commonjs/BetRouter/types/markets.d.ts +2 -0
  299. package/lib/typescript/lib/commonjs/BetRouter/types/markets.d.ts.map +1 -0
  300. package/lib/typescript/lib/commonjs/BetRouter/types/opportunities.d.ts +2 -0
  301. package/lib/typescript/lib/commonjs/BetRouter/types/opportunities.d.ts.map +1 -0
  302. package/lib/typescript/lib/commonjs/BetRouter/types/orders.d.ts +2 -0
  303. package/lib/typescript/lib/commonjs/BetRouter/types/orders.d.ts.map +1 -0
  304. package/lib/typescript/lib/commonjs/BetRouter/types/participants.d.ts +2 -0
  305. package/lib/typescript/lib/commonjs/BetRouter/types/participants.d.ts.map +1 -0
  306. package/lib/typescript/lib/commonjs/BetRouter/types/partners.d.ts +2 -0
  307. package/lib/typescript/lib/commonjs/BetRouter/types/partners.d.ts.map +1 -0
  308. package/lib/typescript/lib/commonjs/Charts/adapters/TradeChartAdapter.d.ts +87 -0
  309. package/lib/typescript/lib/commonjs/Charts/adapters/TradeChartAdapter.d.ts.map +1 -0
  310. package/lib/typescript/lib/commonjs/Charts/components/BaseLineChart.d.ts +31 -0
  311. package/lib/typescript/lib/commonjs/Charts/components/BaseLineChart.d.ts.map +1 -0
  312. package/lib/typescript/lib/commonjs/Charts/components/LivePriceChart.d.ts +45 -0
  313. package/lib/typescript/lib/commonjs/Charts/components/LivePriceChart.d.ts.map +1 -0
  314. package/lib/typescript/lib/commonjs/Charts/index.d.ts +95 -0
  315. package/lib/typescript/lib/commonjs/Charts/index.d.ts.map +1 -0
  316. package/lib/typescript/lib/commonjs/Charts/themes/chartTheme.d.ts +106 -0
  317. package/lib/typescript/lib/commonjs/Charts/themes/chartTheme.d.ts.map +1 -0
  318. package/lib/typescript/lib/commonjs/Charts/types.d.ts +2 -0
  319. package/lib/typescript/lib/commonjs/Charts/types.d.ts.map +1 -0
  320. package/lib/typescript/lib/commonjs/Charts/utils/formatters.d.ts +24 -0
  321. package/lib/typescript/lib/commonjs/Charts/utils/formatters.d.ts.map +1 -0
  322. package/lib/typescript/lib/commonjs/Components/Dropdown.d.ts.map +1 -1
  323. package/lib/typescript/lib/commonjs/Components/Icons.d.ts +5 -0
  324. package/lib/typescript/lib/commonjs/Components/Icons.d.ts.map +1 -1
  325. package/lib/typescript/lib/commonjs/LocationTracker/LocationStatus.d.ts +2 -1
  326. package/lib/typescript/lib/commonjs/LocationTracker/LocationStatus.d.ts.map +1 -1
  327. package/lib/typescript/lib/commonjs/LocationTracker/api/index.d.ts +1 -1
  328. package/lib/typescript/lib/commonjs/LocationTracker/api/index.d.ts.map +1 -1
  329. package/lib/typescript/lib/commonjs/index.d.ts +6 -1
  330. package/lib/typescript/lib/commonjs/index.d.ts.map +1 -1
  331. package/lib/typescript/lib/module/ApiOverrides/index.d.ts.map +1 -1
  332. package/lib/typescript/lib/module/BetRouter/api/index.d.ts +108 -0
  333. package/lib/typescript/lib/module/BetRouter/api/index.d.ts.map +1 -0
  334. package/lib/typescript/lib/module/BetRouter/api/types.d.ts +2 -0
  335. package/lib/typescript/lib/module/BetRouter/api/types.d.ts.map +1 -0
  336. package/lib/typescript/lib/module/BetRouter/components/AccountManager.d.ts +16 -0
  337. package/lib/typescript/lib/module/BetRouter/components/AccountManager.d.ts.map +1 -0
  338. package/lib/typescript/lib/module/BetRouter/components/AdminPortal.d.ts +9 -0
  339. package/lib/typescript/lib/module/BetRouter/components/AdminPortal.d.ts.map +1 -0
  340. package/lib/typescript/lib/module/BetRouter/components/BuyOpportunities.d.ts +16 -0
  341. package/lib/typescript/lib/module/BetRouter/components/BuyOpportunities.d.ts.map +1 -0
  342. package/lib/typescript/lib/module/BetRouter/components/BuyOpportunityCard.d.ts +14 -0
  343. package/lib/typescript/lib/module/BetRouter/components/BuyOpportunityCard.d.ts.map +1 -0
  344. package/lib/typescript/lib/module/BetRouter/components/ContestLiquidity.d.ts +11 -0
  345. package/lib/typescript/lib/module/BetRouter/components/ContestLiquidity.d.ts.map +1 -0
  346. package/lib/typescript/lib/module/BetRouter/components/ContestSelector.d.ts +11 -0
  347. package/lib/typescript/lib/module/BetRouter/components/ContestSelector.d.ts.map +1 -0
  348. package/lib/typescript/lib/module/BetRouter/components/MyOpportunities.d.ts +8 -0
  349. package/lib/typescript/lib/module/BetRouter/components/MyOpportunities.d.ts.map +1 -0
  350. package/lib/typescript/lib/module/BetRouter/components/OpportunityDetailModal.d.ts +15 -0
  351. package/lib/typescript/lib/module/BetRouter/components/OpportunityDetailModal.d.ts.map +1 -0
  352. package/lib/typescript/lib/module/BetRouter/components/OpportunityHistory.d.ts +9 -0
  353. package/lib/typescript/lib/module/BetRouter/components/OpportunityHistory.d.ts.map +1 -0
  354. package/lib/typescript/lib/module/BetRouter/components/PartnerCredentials.d.ts +11 -0
  355. package/lib/typescript/lib/module/BetRouter/components/PartnerCredentials.d.ts.map +1 -0
  356. package/lib/typescript/lib/module/BetRouter/components/PlacedOpportunityModal.d.ts +12 -0
  357. package/lib/typescript/lib/module/BetRouter/components/PlacedOpportunityModal.d.ts.map +1 -0
  358. package/lib/typescript/lib/module/BetRouter/components/admin/AutoFillView.d.ts +4 -0
  359. package/lib/typescript/lib/module/BetRouter/components/admin/AutoFillView.d.ts.map +1 -0
  360. package/lib/typescript/lib/module/BetRouter/components/admin/ConfigManager.d.ts +4 -0
  361. package/lib/typescript/lib/module/BetRouter/components/admin/ConfigManager.d.ts.map +1 -0
  362. package/lib/typescript/lib/module/BetRouter/components/admin/JobManager.d.ts +4 -0
  363. package/lib/typescript/lib/module/BetRouter/components/admin/JobManager.d.ts.map +1 -0
  364. package/lib/typescript/lib/module/BetRouter/components/admin/LeagueContests.d.ts +9 -0
  365. package/lib/typescript/lib/module/BetRouter/components/admin/LeagueContests.d.ts.map +1 -0
  366. package/lib/typescript/lib/module/BetRouter/components/admin/LeagueInfo.d.ts +6 -0
  367. package/lib/typescript/lib/module/BetRouter/components/admin/LeagueInfo.d.ts.map +1 -0
  368. package/lib/typescript/lib/module/BetRouter/components/admin/LeagueParticipants.d.ts +8 -0
  369. package/lib/typescript/lib/module/BetRouter/components/admin/LeagueParticipants.d.ts.map +1 -0
  370. package/lib/typescript/lib/module/BetRouter/index.d.ts +9 -0
  371. package/lib/typescript/lib/module/BetRouter/index.d.ts.map +1 -0
  372. package/lib/typescript/lib/module/BetRouter/layouts/DesktopAdminLayout.d.ts +9 -0
  373. package/lib/typescript/lib/module/BetRouter/layouts/DesktopAdminLayout.d.ts.map +1 -0
  374. package/lib/typescript/lib/module/BetRouter/layouts/DesktopLayout.d.ts +20 -0
  375. package/lib/typescript/lib/module/BetRouter/layouts/DesktopLayout.d.ts.map +1 -0
  376. package/lib/typescript/lib/module/BetRouter/layouts/MobileAdminLayout.d.ts +9 -0
  377. package/lib/typescript/lib/module/BetRouter/layouts/MobileAdminLayout.d.ts.map +1 -0
  378. package/lib/typescript/lib/module/BetRouter/layouts/MobileLayout.d.ts +20 -0
  379. package/lib/typescript/lib/module/BetRouter/layouts/MobileLayout.d.ts.map +1 -0
  380. package/lib/typescript/lib/module/BetRouter/types/accounts.d.ts +2 -0
  381. package/lib/typescript/lib/module/BetRouter/types/accounts.d.ts.map +1 -0
  382. package/lib/typescript/lib/module/BetRouter/types/api-contracts.d.ts +742 -0
  383. package/lib/typescript/lib/module/BetRouter/types/api-contracts.d.ts.map +1 -0
  384. package/lib/typescript/lib/module/BetRouter/types/config.d.ts +2 -0
  385. package/lib/typescript/lib/module/BetRouter/types/config.d.ts.map +1 -0
  386. package/lib/typescript/lib/module/BetRouter/types/contests.d.ts +2 -0
  387. package/lib/typescript/lib/module/BetRouter/types/contests.d.ts.map +1 -0
  388. package/lib/typescript/lib/module/BetRouter/types/credentials.d.ts +55 -0
  389. package/lib/typescript/lib/module/BetRouter/types/credentials.d.ts.map +1 -0
  390. package/lib/typescript/lib/module/BetRouter/types/index.d.ts +14 -0
  391. package/lib/typescript/lib/module/BetRouter/types/index.d.ts.map +1 -0
  392. package/lib/typescript/lib/module/BetRouter/types/jobs.d.ts +2 -0
  393. package/lib/typescript/lib/module/BetRouter/types/jobs.d.ts.map +1 -0
  394. package/lib/typescript/lib/module/BetRouter/types/leagues.d.ts +2 -0
  395. package/lib/typescript/lib/module/BetRouter/types/leagues.d.ts.map +1 -0
  396. package/lib/typescript/lib/module/BetRouter/types/liquidity.d.ts +2 -0
  397. package/lib/typescript/lib/module/BetRouter/types/liquidity.d.ts.map +1 -0
  398. package/lib/typescript/lib/module/BetRouter/types/markets.d.ts +2 -0
  399. package/lib/typescript/lib/module/BetRouter/types/markets.d.ts.map +1 -0
  400. package/lib/typescript/lib/module/BetRouter/types/opportunities.d.ts +2 -0
  401. package/lib/typescript/lib/module/BetRouter/types/opportunities.d.ts.map +1 -0
  402. package/lib/typescript/lib/module/BetRouter/types/orders.d.ts +2 -0
  403. package/lib/typescript/lib/module/BetRouter/types/orders.d.ts.map +1 -0
  404. package/lib/typescript/lib/module/BetRouter/types/participants.d.ts +2 -0
  405. package/lib/typescript/lib/module/BetRouter/types/participants.d.ts.map +1 -0
  406. package/lib/typescript/lib/module/BetRouter/types/partners.d.ts +2 -0
  407. package/lib/typescript/lib/module/BetRouter/types/partners.d.ts.map +1 -0
  408. package/lib/typescript/lib/module/Charts/adapters/TradeChartAdapter.d.ts +81 -0
  409. package/lib/typescript/lib/module/Charts/adapters/TradeChartAdapter.d.ts.map +1 -0
  410. package/lib/typescript/lib/module/Charts/components/BaseLineChart.d.ts +31 -0
  411. package/lib/typescript/lib/module/Charts/components/BaseLineChart.d.ts.map +1 -0
  412. package/lib/typescript/lib/module/Charts/components/LivePriceChart.d.ts +41 -0
  413. package/lib/typescript/lib/module/Charts/components/LivePriceChart.d.ts.map +1 -0
  414. package/lib/typescript/lib/module/Charts/index.d.ts +6 -0
  415. package/lib/typescript/lib/module/Charts/index.d.ts.map +1 -0
  416. package/lib/typescript/lib/module/Charts/themes/chartTheme.d.ts +102 -0
  417. package/lib/typescript/lib/module/Charts/themes/chartTheme.d.ts.map +1 -0
  418. package/lib/typescript/lib/module/Charts/types.d.ts +2 -0
  419. package/lib/typescript/lib/module/Charts/types.d.ts.map +1 -0
  420. package/lib/typescript/lib/module/Charts/utils/formatters.d.ts +14 -0
  421. package/lib/typescript/lib/module/Charts/utils/formatters.d.ts.map +1 -0
  422. package/lib/typescript/lib/module/Components/Dropdown.d.ts.map +1 -1
  423. package/lib/typescript/lib/module/Components/Icons.d.ts +5 -0
  424. package/lib/typescript/lib/module/Components/Icons.d.ts.map +1 -1
  425. package/lib/typescript/lib/module/Components/index.d.ts +1 -0
  426. package/lib/typescript/lib/module/Components/index.d.ts.map +1 -1
  427. package/lib/typescript/lib/module/LocationTracker/LocationStatus.d.ts +2 -1
  428. package/lib/typescript/lib/module/LocationTracker/LocationStatus.d.ts.map +1 -1
  429. package/lib/typescript/lib/module/LocationTracker/api/index.d.ts +1 -1
  430. package/lib/typescript/lib/module/index.d.ts +3 -1
  431. package/lib/typescript/lib/module/index.d.ts.map +1 -1
  432. package/lib/typescript/src/ApiOverrides/index.d.ts.map +1 -1
  433. package/lib/typescript/src/BetRouter/api/index.d.ts +115 -0
  434. package/lib/typescript/src/BetRouter/api/index.d.ts.map +1 -0
  435. package/lib/typescript/src/BetRouter/api/types.d.ts +2 -0
  436. package/lib/typescript/src/BetRouter/api/types.d.ts.map +1 -0
  437. package/lib/typescript/src/BetRouter/components/AccountManager.d.ts +18 -0
  438. package/lib/typescript/src/BetRouter/components/AccountManager.d.ts.map +1 -0
  439. package/lib/typescript/src/BetRouter/components/AdminPortal.d.ts +15 -0
  440. package/lib/typescript/src/BetRouter/components/AdminPortal.d.ts.map +1 -0
  441. package/lib/typescript/src/BetRouter/components/BuyOpportunities.d.ts +24 -0
  442. package/lib/typescript/src/BetRouter/components/BuyOpportunities.d.ts.map +1 -0
  443. package/lib/typescript/src/BetRouter/components/BuyOpportunityCard.d.ts +19 -0
  444. package/lib/typescript/src/BetRouter/components/BuyOpportunityCard.d.ts.map +1 -0
  445. package/lib/typescript/src/BetRouter/components/ContestLiquidity.d.ts +15 -0
  446. package/lib/typescript/src/BetRouter/components/ContestLiquidity.d.ts.map +1 -0
  447. package/lib/typescript/src/BetRouter/components/ContestSelector.d.ts +13 -0
  448. package/lib/typescript/src/BetRouter/components/ContestSelector.d.ts.map +1 -0
  449. package/lib/typescript/src/BetRouter/components/MyOpportunities.d.ts +16 -0
  450. package/lib/typescript/src/BetRouter/components/MyOpportunities.d.ts.map +1 -0
  451. package/lib/typescript/src/BetRouter/components/OpportunityDetailModal.d.ts +21 -0
  452. package/lib/typescript/src/BetRouter/components/OpportunityDetailModal.d.ts.map +1 -0
  453. package/lib/typescript/src/BetRouter/components/OpportunityHistory.d.ts +20 -0
  454. package/lib/typescript/src/BetRouter/components/OpportunityHistory.d.ts.map +1 -0
  455. package/lib/typescript/src/BetRouter/components/PartnerCredentials.d.ts +12 -0
  456. package/lib/typescript/src/BetRouter/components/PartnerCredentials.d.ts.map +1 -0
  457. package/lib/typescript/src/BetRouter/components/PlacedOpportunityModal.d.ts +18 -0
  458. package/lib/typescript/src/BetRouter/components/PlacedOpportunityModal.d.ts.map +1 -0
  459. package/lib/typescript/src/BetRouter/components/admin/AutoFillView.d.ts +4 -0
  460. package/lib/typescript/src/BetRouter/components/admin/AutoFillView.d.ts.map +1 -0
  461. package/lib/typescript/src/BetRouter/components/admin/ConfigManager.d.ts +4 -0
  462. package/lib/typescript/src/BetRouter/components/admin/ConfigManager.d.ts.map +1 -0
  463. package/lib/typescript/src/BetRouter/components/admin/JobManager.d.ts +4 -0
  464. package/lib/typescript/src/BetRouter/components/admin/JobManager.d.ts.map +1 -0
  465. package/lib/typescript/src/BetRouter/components/admin/LeagueContests.d.ts +9 -0
  466. package/lib/typescript/src/BetRouter/components/admin/LeagueContests.d.ts.map +1 -0
  467. package/lib/typescript/src/BetRouter/components/admin/LeagueInfo.d.ts +8 -0
  468. package/lib/typescript/src/BetRouter/components/admin/LeagueInfo.d.ts.map +1 -0
  469. package/lib/typescript/src/BetRouter/components/admin/LeagueParticipants.d.ts +8 -0
  470. package/lib/typescript/src/BetRouter/components/admin/LeagueParticipants.d.ts.map +1 -0
  471. package/lib/typescript/src/BetRouter/index.d.ts +16 -0
  472. package/lib/typescript/src/BetRouter/index.d.ts.map +1 -0
  473. package/lib/typescript/src/BetRouter/layouts/DesktopAdminLayout.d.ts +15 -0
  474. package/lib/typescript/src/BetRouter/layouts/DesktopAdminLayout.d.ts.map +1 -0
  475. package/lib/typescript/src/BetRouter/layouts/DesktopLayout.d.ts +44 -0
  476. package/lib/typescript/src/BetRouter/layouts/DesktopLayout.d.ts.map +1 -0
  477. package/lib/typescript/src/BetRouter/layouts/MobileAdminLayout.d.ts +15 -0
  478. package/lib/typescript/src/BetRouter/layouts/MobileAdminLayout.d.ts.map +1 -0
  479. package/lib/typescript/src/BetRouter/layouts/MobileLayout.d.ts +44 -0
  480. package/lib/typescript/src/BetRouter/layouts/MobileLayout.d.ts.map +1 -0
  481. package/lib/typescript/src/BetRouter/types/accounts.d.ts +19 -0
  482. package/lib/typescript/src/BetRouter/types/accounts.d.ts.map +1 -0
  483. package/lib/typescript/src/BetRouter/types/api-contracts.d.ts +1071 -0
  484. package/lib/typescript/src/BetRouter/types/api-contracts.d.ts.map +1 -0
  485. package/lib/typescript/src/BetRouter/types/config.d.ts +12 -0
  486. package/lib/typescript/src/BetRouter/types/config.d.ts.map +1 -0
  487. package/lib/typescript/src/BetRouter/types/contests.d.ts +34 -0
  488. package/lib/typescript/src/BetRouter/types/contests.d.ts.map +1 -0
  489. package/lib/typescript/src/BetRouter/types/credentials.d.ts +24 -0
  490. package/lib/typescript/src/BetRouter/types/credentials.d.ts.map +1 -0
  491. package/lib/typescript/src/BetRouter/types/index.d.ts +14 -0
  492. package/lib/typescript/src/BetRouter/types/index.d.ts.map +1 -0
  493. package/lib/typescript/src/BetRouter/types/jobs.d.ts +35 -0
  494. package/lib/typescript/src/BetRouter/types/jobs.d.ts.map +1 -0
  495. package/lib/typescript/src/BetRouter/types/leagues.d.ts +26 -0
  496. package/lib/typescript/src/BetRouter/types/leagues.d.ts.map +1 -0
  497. package/lib/typescript/src/BetRouter/types/liquidity.d.ts +14 -0
  498. package/lib/typescript/src/BetRouter/types/liquidity.d.ts.map +1 -0
  499. package/lib/typescript/src/BetRouter/types/markets.d.ts +87 -0
  500. package/lib/typescript/src/BetRouter/types/markets.d.ts.map +1 -0
  501. package/lib/typescript/src/BetRouter/types/opportunities.d.ts +88 -0
  502. package/lib/typescript/src/BetRouter/types/opportunities.d.ts.map +1 -0
  503. package/lib/typescript/src/BetRouter/types/orders.d.ts +34 -0
  504. package/lib/typescript/src/BetRouter/types/orders.d.ts.map +1 -0
  505. package/lib/typescript/src/BetRouter/types/participants.d.ts +33 -0
  506. package/lib/typescript/src/BetRouter/types/participants.d.ts.map +1 -0
  507. package/lib/typescript/src/BetRouter/types/partners.d.ts +11 -0
  508. package/lib/typescript/src/BetRouter/types/partners.d.ts.map +1 -0
  509. package/lib/typescript/src/Charts/adapters/TradeChartAdapter.d.ts +117 -0
  510. package/lib/typescript/src/Charts/adapters/TradeChartAdapter.d.ts.map +1 -0
  511. package/lib/typescript/src/Charts/components/BaseLineChart.d.ts +40 -0
  512. package/lib/typescript/src/Charts/components/BaseLineChart.d.ts.map +1 -0
  513. package/lib/typescript/src/Charts/components/LivePriceChart.d.ts +13 -0
  514. package/lib/typescript/src/Charts/components/LivePriceChart.d.ts.map +1 -0
  515. package/lib/typescript/src/Charts/index.d.ts +28 -0
  516. package/lib/typescript/src/Charts/index.d.ts.map +1 -0
  517. package/lib/typescript/src/Charts/themes/chartTheme.d.ts +78 -0
  518. package/lib/typescript/src/Charts/themes/chartTheme.d.ts.map +1 -0
  519. package/lib/typescript/src/Charts/types.d.ts +155 -0
  520. package/lib/typescript/src/Charts/types.d.ts.map +1 -0
  521. package/lib/typescript/src/Charts/utils/formatters.d.ts +66 -0
  522. package/lib/typescript/src/Charts/utils/formatters.d.ts.map +1 -0
  523. package/lib/typescript/src/Components/Dropdown.d.ts.map +1 -1
  524. package/lib/typescript/src/Components/Icons.d.ts +1 -0
  525. package/lib/typescript/src/Components/Icons.d.ts.map +1 -1
  526. package/lib/typescript/src/Components/index.d.ts +1 -0
  527. package/lib/typescript/src/Components/index.d.ts.map +1 -1
  528. package/lib/typescript/src/LocationTracker/LocationStatus.d.ts +2 -1
  529. package/lib/typescript/src/LocationTracker/LocationStatus.d.ts.map +1 -1
  530. package/lib/typescript/src/LocationTracker/api/index.d.ts +3 -1
  531. package/lib/typescript/src/LocationTracker/api/index.d.ts.map +1 -1
  532. package/lib/typescript/src/index.d.ts +4 -1
  533. package/lib/typescript/src/index.d.ts.map +1 -1
  534. package/package.json +4 -2
  535. package/src/ApiOverrides/index.ts +4 -0
  536. package/src/BetRouter/api/index.ts +854 -0
  537. package/src/BetRouter/api/types.ts +0 -0
  538. package/src/BetRouter/components/AccountManager.tsx +533 -0
  539. package/src/BetRouter/components/AdminPortal.tsx +44 -0
  540. package/src/BetRouter/components/BuyOpportunities.tsx +491 -0
  541. package/src/BetRouter/components/BuyOpportunityCard.tsx +331 -0
  542. package/src/BetRouter/components/ContestLiquidity.tsx +613 -0
  543. package/src/BetRouter/components/ContestSelector.tsx +179 -0
  544. package/src/BetRouter/components/MyOpportunities.tsx +279 -0
  545. package/src/BetRouter/components/MyOpportunities.tsx.bak +440 -0
  546. package/src/BetRouter/components/OpportunityDetailModal.tsx +360 -0
  547. package/src/BetRouter/components/OpportunityHistory.tsx +408 -0
  548. package/src/BetRouter/components/PartnerCredentials.tsx +212 -0
  549. package/src/BetRouter/components/PlacedOpportunityModal.tsx +192 -0
  550. package/src/BetRouter/components/admin/AutoFillView.tsx +275 -0
  551. package/src/BetRouter/components/admin/ConfigManager.tsx +596 -0
  552. package/src/BetRouter/components/admin/JobManager.tsx +758 -0
  553. package/src/BetRouter/components/admin/LeagueContests.tsx +2443 -0
  554. package/src/BetRouter/components/admin/LeagueInfo.tsx +253 -0
  555. package/src/BetRouter/components/admin/LeagueParticipants.tsx +662 -0
  556. package/src/BetRouter/index.tsx +453 -0
  557. package/src/BetRouter/layouts/DesktopAdminLayout.tsx +348 -0
  558. package/src/BetRouter/layouts/DesktopLayout.tsx +292 -0
  559. package/src/BetRouter/layouts/MobileAdminLayout.tsx +387 -0
  560. package/src/BetRouter/layouts/MobileLayout.tsx +325 -0
  561. package/src/BetRouter/types/ADMIN_PORTAL.md +863 -0
  562. package/src/BetRouter/types/ADMIN_PORTAL_SIMPLIFIED.md +1881 -0
  563. package/src/BetRouter/types/CREDENTIALS_EXAMPLE.md +350 -0
  564. package/src/BetRouter/types/LIQUIDITY_CLIENT_GUIDE.md +399 -0
  565. package/src/BetRouter/types/MARKET_LINKING_WORKFLOW.md +682 -0
  566. package/src/BetRouter/types/MARKET_LINKING_WORKFLOW_V2.md +627 -0
  567. package/src/BetRouter/types/README.md +249 -0
  568. package/src/BetRouter/types/accounts.ts +21 -0
  569. package/src/BetRouter/types/api-contracts.ts +1164 -0
  570. package/src/BetRouter/types/config.ts +12 -0
  571. package/src/BetRouter/types/contests.ts +37 -0
  572. package/src/BetRouter/types/credentials.ts +99 -0
  573. package/src/BetRouter/types/index.ts +16 -0
  574. package/src/BetRouter/types/jobs.ts +37 -0
  575. package/src/BetRouter/types/leagues.ts +29 -0
  576. package/src/BetRouter/types/liquidity.ts +15 -0
  577. package/src/BetRouter/types/markets.ts +94 -0
  578. package/src/BetRouter/types/opportunities.ts +107 -0
  579. package/src/BetRouter/types/orders.ts +51 -0
  580. package/src/BetRouter/types/participants.ts +34 -0
  581. package/src/BetRouter/types/partners.ts +10 -0
  582. package/src/Charts/README.md +310 -0
  583. package/src/Charts/adapters/TradeChartAdapter.ts +471 -0
  584. package/src/Charts/components/BaseLineChart.tsx +293 -0
  585. package/src/Charts/components/LivePriceChart.tsx +521 -0
  586. package/src/Charts/index.tsx +62 -0
  587. package/src/Charts/themes/chartTheme.ts +113 -0
  588. package/src/Charts/types.ts +160 -0
  589. package/src/Charts/utils/formatters.ts +182 -0
  590. package/src/Components/Dropdown.tsx +6 -3
  591. package/src/Components/Icons.tsx +12 -0
  592. package/src/Components/index.tsx +4 -0
  593. package/src/LocationTracker/LocationStatus.tsx +4 -3
  594. package/src/LocationTracker/api/index.tsx +2 -2
  595. package/src/index.tsx +6 -0
  596. package/src/types.d.ts +410 -2
@@ -0,0 +1,1881 @@
1
+ # BetRouter Admin Portal - Simplified Workflow Guide
2
+
3
+ This guide focuses on the **practical, entity-centric workflow** for managing BetRouter entities.
4
+
5
+ ## 🎯 Core Workflow
6
+
7
+ ### 1. **League Management** (Foundation Layer)
8
+
9
+ League linking establishes the foundation for all other entities. Before you can link contests, participants, or markets, you must first ensure leagues are properly connected to partners.
10
+
11
+ #### a) **League List** (Start Here)
12
+
13
+ **Endpoint:** `GET /leagues/router`
14
+
15
+ Display all router leagues as the entry point:
16
+
17
+ ```json
18
+ [
19
+ {
20
+ "router_league_id": "league-nba-123",
21
+ "name": "NBA",
22
+ "status": "active"
23
+ },
24
+ {
25
+ "router_league_id": "league-mlb-456",
26
+ "name": "MLB",
27
+ "status": "active"
28
+ }
29
+ ]
30
+ ```
31
+
32
+ **UI:** Simple list showing leagues with link status.
33
+
34
+ #### b) **League Detail & Linking** (Click on a League)
35
+
36
+ When admin clicks on a specific league, show the league detail page.
37
+
38
+ **Get League Info with Partner Status**
39
+
40
+ **Endpoint:** `GET /leagues/router` (filter by ID in client)
41
+
42
+ Shows the league and which partners are linked:
43
+
44
+ ```
45
+ ┌─────────────────────────────────────────────────────────────┐
46
+ │ NBA League │
47
+ │ Status: Active │
48
+ │ │
49
+ │ ┌───────────────────────────────────────────────────────┐ │
50
+ │ │ Partner Links │ │
51
+ │ ├───────────────────────────────────────────────────────┤ │
52
+ │ │ │ │
53
+ │ │ BettorEdge ✅ Linked (1 league) │ │
54
+ │ │ external_id: nba-league-2024 │ │
55
+ │ │ │ │
56
+ │ │ Kalshi ❌ Not Linked │ │
57
+ │ │ [Load Available Leagues] button │ │
58
+ │ │ │ │
59
+ │ │ BetOpenly ✅ Linked (1 league) │ │
60
+ │ │ external_id: nba-2024-season │ │
61
+ │ │ │ │
62
+ │ └───────────────────────────────────────────────────────┘ │
63
+ │ │
64
+ │ [Manage League Links] [View Contests] [View Participants] │
65
+ └─────────────────────────────────────────────────────────────┘
66
+ ```
67
+
68
+ #### c) **Load Available Raw Leagues for a Partner**
69
+
70
+ **NEW ENDPOINT:** `GET /leagues/:router_league_id/available-raw/:partner_id`
71
+
72
+ This shows available raw leagues from a specific partner that can be linked to this router league:
73
+
74
+ ```json
75
+ {
76
+ "router_league": {
77
+ "router_league_id": "league-nba-123",
78
+ "name": "NBA",
79
+ "status": "active"
80
+ },
81
+ "raw_leagues": [
82
+ {
83
+ "raw_league_id": "raw-kalshi-nba-1",
84
+ "partner_id": "kalshi-partner-id",
85
+ "external_id": "KXNBA",
86
+ "name": "NBA Basketball",
87
+ "status": "active"
88
+ },
89
+ {
90
+ "raw_league_id": "raw-kalshi-nba-2",
91
+ "partner_id": "kalshi-partner-id",
92
+ "external_id": "KXNBA-RS",
93
+ "name": "NBA Regular Season",
94
+ "status": "active"
95
+ }
96
+ ],
97
+ "already_linked": [
98
+ {
99
+ "raw_league_id": "raw-kalshi-nba-3",
100
+ "partner_id": "kalshi-partner-id",
101
+ "external_id": "KXNBA-PO",
102
+ "name": "NBA Playoffs",
103
+ "status": "active"
104
+ },
105
+ {
106
+ "raw_league_id": "raw-kalshi-nba-4",
107
+ "partner_id": "kalshi-partner-id",
108
+ "external_id": "KXNBA-ALL",
109
+ "name": "NBA All-Star",
110
+ "status": "active"
111
+ }
112
+ ]
113
+ }
114
+ ```
115
+
116
+ **Key Features:**
117
+ - Only shows raw leagues from the selected partner
118
+ - `raw_leagues` array contains leagues available to link (not yet linked)
119
+ - `already_linked` array contains leagues that are already linked
120
+ - **UI should display BOTH sections** so admin can see what's already connected
121
+
122
+ #### d) **Link Raw Leagues**
123
+
124
+ **Endpoint:** `POST /leagues/link`
125
+
126
+ ```json
127
+ {
128
+ "raw_league_ids": ["raw-kalshi-nba-1", "raw-kalshi-nba-2"],
129
+ "router_league_id": "league-nba-123"
130
+ }
131
+ ```
132
+
133
+ Response:
134
+
135
+ ```json
136
+ {
137
+ "message": "Successfully linked 2 partner league(s)",
138
+ "partnerLeagues": [
139
+ {
140
+ "partner_league_id": "pl-new-1",
141
+ "raw_league_id": "raw-kalshi-nba-1",
142
+ "router_league_id": "league-nba-123",
143
+ "partner_id": "kalshi-partner-id",
144
+ "external_id": "KXNBA"
145
+ },
146
+ {
147
+ "partner_league_id": "pl-new-2",
148
+ "raw_league_id": "raw-kalshi-nba-2",
149
+ "router_league_id": "league-nba-123",
150
+ "partner_id": "kalshi-partner-id",
151
+ "external_id": "KXNBA-RS"
152
+ }
153
+ ]
154
+ }
155
+ ```
156
+
157
+ **Why Multiple Leagues?**
158
+ Some partners (like Kalshi) have multiple series/leagues that map to a single router league. For example:
159
+ - Router League: "NBA"
160
+ - Kalshi Raw Leagues: "KXNBA" (general), "KXNBA-RS" (regular season), "KXNBA-PO" (playoffs)
161
+
162
+ All three Kalshi leagues should link to the same NBA router league.
163
+
164
+ #### e) **When "Load Available Leagues" is clicked:**
165
+
166
+ ```
167
+ ┌─────────────────────────────────────────────────────────────┐
168
+ │ Kalshi Leagues for "NBA" [Close X]│
169
+ │ │
170
+ │ ┌────────────────────────────────────────────────────────┐ │
171
+ │ │ Already Linked (2) │ │
172
+ │ ├────────────────────────────────────────────────────────┤ │
173
+ │ │ │ │
174
+ │ │ ✅ KXNBA-PO │ │
175
+ │ │ NBA Playoffs │ │
176
+ │ │ Status: Active │ │
177
+ │ │ [Unlink] │ │
178
+ │ │ │ │
179
+ │ │ ✅ KXNBA-ALL │ │
180
+ │ │ NBA All-Star │ │
181
+ │ │ Status: Active │ │
182
+ │ │ [Unlink] │ │
183
+ │ │ │ │
184
+ │ └────────────────────────────────────────────────────────┘ │
185
+ │ │
186
+ │ ┌────────────────────────────────────────────────────────┐ │
187
+ │ │ Available to Link (2) │ │
188
+ │ ├────────────────────────────────────────────────────────┤ │
189
+ │ │ │ │
190
+ │ │ ☑ KXNBA │ │
191
+ │ │ NBA Basketball │ │
192
+ │ │ Status: Active │ │
193
+ │ │ │ │
194
+ │ │ ☑ KXNBA-RS │ │
195
+ │ │ NBA Regular Season │ │
196
+ │ │ Status: Active │ │
197
+ │ │ │ │
198
+ │ └────────────────────────────────────────────────────────┘ │
199
+ │ │
200
+ │ [Link Selected] [Cancel] │
201
+ └─────────────────────────────────────────────────────────────┘
202
+ ```
203
+
204
+ ---
205
+
206
+ ### 2. **Load Contests for a League** (Admin Operation)
207
+
208
+ Before viewing contests, the admin needs to load them from partner APIs into the system.
209
+
210
+ #### a) **Load Router Contests from BettorEdge** (Primary Source)
211
+
212
+ **Endpoint:** `POST /contests/load`
213
+
214
+ BettorEdge is the primary source for router contests. Load contests for a specific league:
215
+
216
+ **Request:**
217
+ ```json
218
+ {
219
+ "router_league_id": "league-nba-123"
220
+ }
221
+ ```
222
+
223
+ **Response:**
224
+ ```json
225
+ {
226
+ "message": "Contests loaded successfully",
227
+ "count": 25,
228
+ "contests": [
229
+ {
230
+ "router_contest_id": "contest-123",
231
+ "router_league_id": "league-nba-123",
232
+ "contest_label": "NBA: Lakers vs Celtics",
233
+ "contest_id": "be-event-789",
234
+ "scheduled_datetime": "2025-10-30T19:00:00Z",
235
+ "status": "open"
236
+ }
237
+ ]
238
+ }
239
+ ```
240
+
241
+ **When to use:**
242
+ - When first setting up a league
243
+ - To load new/upcoming contests
244
+ - Periodically to refresh the contest list
245
+
246
+ **UI Flow:**
247
+ ```
248
+ ┌─────────────────────────────────────────────────────────────┐
249
+ │ NBA League │
250
+ │ Status: Active │
251
+ │ │
252
+ │ [Load Router Contests from BettorEdge] ← Button │
253
+ │ │
254
+ │ This will fetch all active NBA contests from BettorEdge │
255
+ │ and create router_contest records. │
256
+ └─────────────────────────────────────────────────────────────┘
257
+ ```
258
+
259
+ #### b) **Load Raw Contests from Other Partners**
260
+
261
+ **Endpoint:** `POST /contests/load-raw`
262
+
263
+ After loading router contests, load raw contests from each partner (Kalshi, BetOpenly):
264
+
265
+ **Request:**
266
+ ```json
267
+ {
268
+ "partner_id": "kalshi-partner-id",
269
+ "router_league_id": "league-nba-123"
270
+ }
271
+ ```
272
+
273
+ **Response:**
274
+ ```json
275
+ {
276
+ "message": "Raw contests loaded successfully",
277
+ "count": 30,
278
+ "raw_contests": [
279
+ {
280
+ "raw_contest_id": "raw-kalshi-1",
281
+ "partner_id": "kalshi-partner-id",
282
+ "external_id": "KXNBA-30OCT-LAL-BOS",
283
+ "pretty_title": "Lakers vs Celtics",
284
+ "scheduled_datetime": "2025-10-30T19:00:00Z",
285
+ "status": "active"
286
+ }
287
+ ]
288
+ }
289
+ ```
290
+
291
+ **When to use:**
292
+ - After loading router contests
293
+ - Before linking contests to partners
294
+ - To refresh available contests from a partner
295
+
296
+ **UI Flow:**
297
+ ```
298
+ ┌─────────────────────────────────────────────────────────────┐
299
+ │ NBA League - Partner Contest Loading │
300
+ │ │
301
+ │ Load raw contests from: │
302
+ │ │
303
+ │ ☐ Kalshi [Load Contests] │
304
+ │ ☐ BetOpenly [Load Contests] │
305
+ │ │
306
+ │ These will fetch contests from each partner's API and │
307
+ │ store them as raw_contest records ready for linking. │
308
+ └─────────────────────────────────────────────────────────────┘
309
+ ```
310
+
311
+ **Important:**
312
+ - Load router contests FIRST (from BettorEdge)
313
+ - Then load raw contests from other partners
314
+ - Finally, link raw contests to router contests using the linking workflow
315
+
316
+ ---
317
+
318
+ ### 3. **Contest List** (Within Selected League)
319
+
320
+ **Endpoint:** `GET /contests/open/:router_league_id?status=open&offset=0`
321
+
322
+ Once contests are loaded for a league, show contests based on status filter:
323
+
324
+ **Default Behavior (Active Contests):**
325
+ ```http
326
+ GET /contests/open/:router_league_id
327
+ GET /contests/open/:router_league_id?status=open
328
+ ```
329
+
330
+ Response:
331
+ ```json
332
+ {
333
+ "router_contests": [
334
+ {
335
+ "router_contest_id": "contest-123",
336
+ "contest_label": "NBA: Lakers vs Celtics",
337
+ "scheduled_datetime": "2025-10-30T19:00:00Z",
338
+ "status": "open"
339
+ }
340
+ ],
341
+ "total_count": 25,
342
+ "has_more": false
343
+ }
344
+ ```
345
+
346
+ **Closed Contests (Paginated):**
347
+ ```http
348
+ GET /contests/open/:router_league_id?status=closed&offset=0
349
+ GET /contests/open/:router_league_id?status=closed&offset=100 // Page 2
350
+ ```
351
+
352
+ Response (max 100 results):
353
+ ```json
354
+ {
355
+ "router_contests": [
356
+ {
357
+ "router_contest_id": "contest-456",
358
+ "contest_label": "NBA: Warriors vs Nets",
359
+ "scheduled_datetime": "2025-10-25T19:00:00Z",
360
+ "status": "closed"
361
+ }
362
+ // ... up to 100 contests
363
+ ],
364
+ "total_count": 250,
365
+ "has_more": true // More results available
366
+ }
367
+ ```
368
+
369
+ **Query Parameters:**
370
+ - `status` (optional): `'open'` (default) or `'closed'`
371
+ - `offset` (optional): Pagination offset for closed contests (default: 0)
372
+
373
+ **UI:** Table showing:
374
+ - Contest label (clickable to view details)
375
+ - Scheduled time
376
+ - Status
377
+ - Number of partners linked (badge showing "2/3 partners")
378
+ - **Pagination controls** (only when viewing closed contests)
379
+
380
+ **IMPORTANT:**
381
+ - Active contests: Returns ALL open contests (no pagination needed)
382
+ - Closed contests: Returns max 100 at a time with pagination
383
+ - Autolinking only processes ACTIVE contests
384
+
385
+ **UI Example - Pagination for Closed Contests:**
386
+ ```
387
+ ┌─────────────────────────────────────────────────────────────┐
388
+ │ NBA → Contests [Status: Closed ▼] │
389
+ │ │
390
+ │ Showing 100 of 250 closed contests │
391
+ │ │
392
+ │ [Contest List Table] │
393
+ │ │
394
+ │ ┌────────────────────────────────────────────────────────┐ │
395
+ │ │ Page: [1] 2 3 ... 25 [Previous] [Next] │ │
396
+ │ └────────────────────────────────────────────────────────┘ │
397
+ └─────────────────────────────────────────────────────────────┘
398
+
399
+ When user clicks page 2:
400
+ GET /contests/open/league-nba-123?status=closed&offset=100
401
+
402
+ When user clicks page 3:
403
+ GET /contests/open/league-nba-123?status=closed&offset=200
404
+ ```
405
+
406
+ ---
407
+
408
+ ### 3. **Contest Detail & Linking** (Click on a Contest)
409
+
410
+ When admin clicks on a specific contest, show the contest detail page.
411
+
412
+ #### a) Get Contest Info
413
+
414
+ **Endpoint:** `GET /contests/:router_contest_id`
415
+
416
+ Shows the contest and what's already linked:
417
+
418
+ ```json
419
+ {
420
+ "router_contest": {
421
+ "router_contest_id": "contest-123",
422
+ "contest_label": "NBA: Lakers vs Celtics",
423
+ "scheduled_datetime": "2025-10-30T19:00:00Z"
424
+ },
425
+ "partner_contests": [
426
+ {
427
+ "partner_contest_id": "pc-1",
428
+ "partner_id": "bettoredge-partner-id",
429
+ "external_id": "be-event-789"
430
+ }
431
+ ]
432
+ }
433
+ ```
434
+
435
+ #### b) Get Available Partners
436
+
437
+ **Endpoint:** `GET /partners`
438
+
439
+ Shows which partners are active:
440
+
441
+ ```json
442
+ [
443
+ {
444
+ "partner_id": "bettoredge-partner-id",
445
+ "name": "BettorEdge",
446
+ "status": "active"
447
+ },
448
+ {
449
+ "partner_id": "kalshi-partner-id",
450
+ "name": "Kalshi",
451
+ "status": "active"
452
+ },
453
+ {
454
+ "partner_id": "betopenly-partner-id",
455
+ "name": "BetOpenly",
456
+ "status": "active"
457
+ }
458
+ ]
459
+ ```
460
+
461
+ #### c) Load Raw Contests for a Partner
462
+
463
+ **NEW ENDPOINT:** `GET /contests/:router_contest_id/available-raw/:partner_id`
464
+
465
+ This shows available raw contests from a specific partner that can be linked to this contest:
466
+
467
+ ```json
468
+ {
469
+ "router_contest": {
470
+ "router_contest_id": "contest-123",
471
+ "contest_label": "NBA: Lakers vs Celtics"
472
+ },
473
+ "raw_contests": [
474
+ {
475
+ "raw_contest_id": "raw-kalshi-1",
476
+ "partner_id": "kalshi-partner-id",
477
+ "external_id": "KXNBA-30OCT-LAL-BOS",
478
+ "pretty_title": "Lakers vs Celtics",
479
+ "scheduled_datetime": "2025-10-30T19:00:00Z"
480
+ },
481
+ {
482
+ "raw_contest_id": "raw-kalshi-2",
483
+ "partner_id": "kalshi-partner-id",
484
+ "external_id": "KXNBA-30OCT-LAL-BOS-ALT",
485
+ "pretty_title": "Lakers @ Celtics",
486
+ "scheduled_datetime": "2025-10-30T19:00:00Z"
487
+ }
488
+ ],
489
+ "already_linked": []
490
+ }
491
+ ```
492
+
493
+ **Key Features:**
494
+ - Only shows raw contests from the selected partner for this league
495
+ - `raw_contests` array contains contests available to link (not yet linked to this router_contest)
496
+ - `already_linked` array shows raw contests already linked to this router_contest
497
+ - **UI should display BOTH sections** so admin can see what's already connected
498
+ - **IMPORTANT:** The "Link Contest" or "Load Available Contests" button should ALWAYS be available, even if raw contests are already linked. Admins need to be able to add additional raw contests from different partners over time.
499
+
500
+ #### d) Link Raw Contests
501
+
502
+ **Endpoint:** `POST /contests/link`
503
+
504
+ ```json
505
+ {
506
+ "raw_contest_ids": ["raw-kalshi-1"],
507
+ "router_contest_id": "contest-123"
508
+ }
509
+ ```
510
+
511
+ Response:
512
+
513
+ ```json
514
+ {
515
+ "message": "Contest linking completed",
516
+ "count": 1,
517
+ "partner_contests": [
518
+ {
519
+ "partner_contest_id": "pc-new",
520
+ "raw_contest_id": "raw-kalshi-1",
521
+ "router_contest_id": "contest-123",
522
+ "partner_id": "kalshi-partner-id",
523
+ "external_id": "KXNBA-30OCT-LAL-BOS"
524
+ }
525
+ ]
526
+ }
527
+ ```
528
+
529
+ ---
530
+
531
+ ### 4. **Auto-Link Contests** (Recommended for Bulk Linking)
532
+
533
+ Instead of manually linking contests one-by-one, use auto-linking to automatically match and link contests for a partner based on scheduled time and participant matching.
534
+
535
+ **IMPORTANT:** Auto-linking only processes ACTIVE router_contests (status='open'). This ensures:
536
+ - Stats only count active contests (e.g., "23/25 matched" means 23 out of 25 active contests)
537
+ - Closed or settled contests are excluded from the autolinking process
538
+ - Partner contest counts only reflect links to active router contests
539
+
540
+ #### **Endpoint:** `POST /autolinking/contests`
541
+
542
+ **When to use:**
543
+ - After loading raw contests from a partner
544
+ - When you have many contests to link at once
545
+ - To quickly connect a partner's contests without manual selection
546
+
547
+ **Request:**
548
+ ```json
549
+ {
550
+ "router_league_id": "league-nba-123",
551
+ "partner_id": "kalshi-partner-id"
552
+ }
553
+ ```
554
+
555
+ **Response:**
556
+ ```json
557
+ {
558
+ "message": "Auto-linking complete: 23/25 matched (23 created, 0 updated)",
559
+ "entity_type": "contest",
560
+ "partner_name": "Kalshi",
561
+ "total_router_entities": 25,
562
+ "matched_count": 23,
563
+ "created_count": 23,
564
+ "updated_count": 0,
565
+ "failed_count": 2,
566
+ "results": [
567
+ {
568
+ "success": true,
569
+ "router_entity_id": "contest-123",
570
+ "partner_id": "kalshi-partner-id",
571
+ "partner_name": "Kalshi",
572
+ "raw_entity_id": "raw-kalshi-1",
573
+ "partner_entity_id": "pc-new-1",
574
+ "confidence": 0.95,
575
+ "match_method": "date_and_participants"
576
+ },
577
+ {
578
+ "success": false,
579
+ "router_entity_id": "contest-456",
580
+ "partner_id": "kalshi-partner-id",
581
+ "partner_name": "Kalshi",
582
+ "confidence": 0,
583
+ "match_method": "none",
584
+ "error": "No matching raw contest found"
585
+ }
586
+ ]
587
+ }
588
+ ```
589
+
590
+ **UI Flow for Contest List:**
591
+ ```
592
+ ┌─────────────────────────────────────────────────────────────┐
593
+ │ NBA → Contests [🔗 Auto-Link] │
594
+ │ │
595
+ │ Showing 25 contests │
596
+ │ │
597
+ │ When clicked, show modal: │
598
+ │ ┌──────────────────────────────────────────────────────┐ │
599
+ │ │ Auto-Link Contests │ │
600
+ │ │ │ │
601
+ │ │ Select partner to auto-link: │ │
602
+ │ │ │ │
603
+ │ │ ○ Kalshi (0/25 contests linked) │ │
604
+ │ │ ○ BetOpenly (12/25 contests linked) │ │
605
+ │ │ │ │
606
+ │ │ This will attempt to automatically match and link │ │
607
+ │ │ contests based on scheduled time and participants. │ │
608
+ │ │ │ │
609
+ │ │ [Cancel] [Auto-Link Selected Partner] │ │
610
+ │ └──────────────────────────────────────────────────────┘ │
611
+ └─────────────────────────────────────────────────────────────┘
612
+
613
+ After auto-linking, show results:
614
+ ┌──────────────────────────────────────────────────────────┐
615
+ │ Auto-Link Results │
616
+ │ │
617
+ │ ✅ Successfully linked: 23/25 contests │
618
+ │ ❌ Failed: 2 contests │
619
+ │ │
620
+ │ Failed contests: │
621
+ │ • Lakers vs Celtics (Oct 30) - No match found │
622
+ │ • Warriors vs Nets (Oct 31) - No match found │
623
+ │ │
624
+ │ You can manually link these contests if needed. │
625
+ │ │
626
+ │ [Close] [View Failed Contests] │
627
+ └──────────────────────────────────────────────────────────┘
628
+ ```
629
+
630
+ **Response Fields Explained:**
631
+ - `total_router_entities`: Total number of ACTIVE router contests (status='open') checked for this league
632
+ - `matched_count`: Number of active contests successfully matched
633
+ - `created_count`: Number of new partner_contest records created
634
+ - `updated_count`: Number of existing partner_contest records updated
635
+ - `failed_count`: Number of active contests that couldn't be matched
636
+ - `results[]`: Array of individual match results with details (only for active contests)
637
+ - `confidence`: 0-1 score indicating match quality (>0.8 is good)
638
+ - `match_method`: How the match was made (e.g., "date_and_participants", "exact_title_match")
639
+ - `partner_entity_id`: The created `partner_contest_id`
640
+
641
+ **Best Practices:**
642
+ 1. **Load raw contests first** using `POST /contests/load-raw` before auto-linking
643
+ 2. **Review failed matches** - some contests may need manual linking
644
+ 3. **Run per partner** - auto-link one partner at a time to review results
645
+ 4. **Check confidence scores** - low confidence (<0.7) matches may need verification
646
+
647
+ ---
648
+
649
+ ## 🎨 Recommended UI Layout
650
+
651
+ ### Contest Detail Page
652
+
653
+ **⚠️ IMPORTANT UI REQUIREMENT:**
654
+ Each partner row should ALWAYS show a "Link Contest" or "Load Available Contests" button, regardless of whether a raw contest is already linked. This allows admins to:
655
+ - Add additional raw contests from the same partner if multiple exist
656
+ - Re-link if a contest was linked incorrectly
657
+ - Maintain flexibility in the linking process
658
+
659
+ **Never hide or disable the link button just because one raw contest is already linked.**
660
+
661
+ ```
662
+ ┌─────────────────────────────────────────────────────────────┐
663
+ │ ← Back to NBA Contests │
664
+ │ │
665
+ │ Lakers vs Celtics │
666
+ │ 📅 October 30, 2025 at 7:00 PM ET │
667
+ │ Status: Open │
668
+ │ │
669
+ │ ┌───────────────────────────────────────────────────────┐ │
670
+ │ │ Partner Links │ │
671
+ │ ├───────────────────────────────────────────────────────┤ │
672
+ │ │ │ │
673
+ │ │ BettorEdge ✅ Linked │ │
674
+ │ │ external_id: be-event-789 │ │
675
+ │ │ [+ Add Another] button ← ALWAYS show this │ │
676
+ │ │ │ │
677
+ │ │ Kalshi ❌ Not Linked │ │
678
+ │ │ [Load Available Contests] button │ │
679
+ │ │ │ │
680
+ │ │ BetOpenly ✅ Linked │ │
681
+ │ │ external_id: bo-game-456 │ │
682
+ │ │ [+ Add Another] button ← ALWAYS show this │ │
683
+ │ │ │ │
684
+ │ └───────────────────────────────────────────────────────┘ │
685
+ │ │
686
+ │ ┌───────────────────────────────────────────────────────┐ │
687
+ │ │ Markets │ │
688
+ │ ├───────────────────────────────────────────────────────┤ │
689
+ │ │ │ │
690
+ │ │ Moneyline 2 markets linked │ │
691
+ │ │ Spread 0 markets linked │ │
692
+ │ │ │ │
693
+ │ └───────────────────────────────────────────────────────┘ │
694
+ └─────────────────────────────────────────────────────────────┘
695
+ ```
696
+
697
+ ### When "Load Available Contests" is clicked:
698
+
699
+ ```
700
+ ┌─────────────────────────────────────────────────────────────┐
701
+ │ Kalshi Contests for "Lakers vs Celtics" [Close X] │
702
+ │ │
703
+ │ ┌────────────────────────────────────────────────────────┐ │
704
+ │ │ Already Linked (0) │ │
705
+ │ ├────────────────────────────────────────────────────────┤ │
706
+ │ │ No contests linked yet │ │
707
+ │ └────────────────────────────────────────────────────────┘ │
708
+ │ │
709
+ │ ┌────────────────────────────────────────────────────────┐ │
710
+ │ │ Available to Link (2) │ │
711
+ │ ├────────────────────────────────────────────────────────┤ │
712
+ │ │ │ │
713
+ │ │ ☑ KXNBA-30OCT-LAL-BOS │ │
714
+ │ │ Lakers vs Celtics │ │
715
+ │ │ Oct 30, 2025 7:00 PM │ │
716
+ │ │ │ │
717
+ │ │ ☑ KXNBA-30OCT-LAL-BOS-ALT │ │
718
+ │ │ Lakers @ Celtics │ │
719
+ │ │ Oct 30, 2025 7:00 PM │ │
720
+ │ │ │ │
721
+ │ └────────────────────────────────────────────────────────┘ │
722
+ │ │
723
+ │ [Link Selected] [Cancel] │
724
+ └─────────────────────────────────────────────────────────────┘
725
+ ```
726
+
727
+ ---
728
+
729
+ ## 🔄 Complete League Linking Flow
730
+
731
+ ```
732
+ 1. Admin views league list
733
+
734
+ 2. Admin clicks "NBA" league
735
+
736
+ 3. Page shows:
737
+ - League details
738
+ - Which partners are linked (✅ BettorEdge, ❌ Kalshi, ✅ BetOpenly)
739
+
740
+ 4. Admin clicks "Load Available Leagues" for Kalshi
741
+
742
+ 5. System calls: GET /leagues/:router_league_id/available-raw/:partner_id
743
+
744
+ 6. Modal/panel shows Kalshi raw leagues
745
+
746
+ 7. Admin selects matching league(s) - can select multiple (KXNBA, KXNBA-RS, etc.)
747
+
748
+ 8. Admin clicks "Link Selected"
749
+
750
+ 9. System calls: POST /leagues/link
751
+
752
+ 10. Success! Kalshi now shows ✅ Linked (2 leagues)
753
+ ```
754
+
755
+ ---
756
+
757
+ ## 🔄 Complete Contest Linking Flow
758
+
759
+ ```
760
+ 1. Admin selects "NBA" league (from league list)
761
+
762
+ 2. Admin clicks "View Contests" or navigates to contest list
763
+
764
+ 3. Admin sees list of contests (Lakers vs Celtics, etc.)
765
+
766
+ 4. Admin clicks "Lakers vs Celtics"
767
+
768
+ 5. Page shows:
769
+ - Contest details
770
+ - Which partners are linked (✅ BettorEdge, ❌ Kalshi, ✅ BetOpenly)
771
+
772
+ 6. Admin clicks "Load Available Contests" for Kalshi
773
+
774
+ 7. System calls: GET /contests/:router_contest_id/available-raw/:partner_id
775
+
776
+ 8. Modal/panel shows Kalshi contests from this league
777
+
778
+ 9. Admin selects matching contest(s)
779
+
780
+ 10. Admin clicks "Link Selected"
781
+
782
+ 11. System calls: POST /contests/link
783
+
784
+ 12. Success! Kalshi now shows ✅ Linked
785
+ ```
786
+
787
+ ---
788
+
789
+ ## 📋 Simplified Endpoint Summary
790
+
791
+ ### League Endpoints
792
+
793
+ | Method | Endpoint | Purpose |
794
+ |--------|----------|---------|
795
+ | GET | `/leagues/router` | List all leagues (entry point) |
796
+ | GET | `/leagues/:router_league_id/available-raw/:partner_id` | Get available raw leagues to link |
797
+ | POST | `/leagues/load-raw` | Load raw leagues from partner API |
798
+ | POST | `/leagues/link` | Link raw leagues to router league (supports multiple) |
799
+
800
+ ### Contest Endpoints
801
+
802
+ | Method | Endpoint | Purpose |
803
+ |--------|----------|---------|
804
+ | POST | `/contests/load` | Load router contests from BettorEdge for a league |
805
+ | POST | `/contests/load-raw` | Load raw contests from partner API for a league |
806
+ | GET | `/contests/open/:router_league_id?status=open&offset=0` | List contests. Default: ACTIVE (status='open'). Closed: paginated (max 100) |
807
+ | GET | `/contests/:router_contest_id` | Get contest details + existing links |
808
+ | GET | `/contests/:router_contest_id/available-raw/:partner_id` | Get available raw contests to link |
809
+ | POST | `/contests/link` | Link raw contests to router contest (manual) |
810
+ | POST | `/autolinking/contests` | **Auto-link ACTIVE contests for a partner** (recommended) |
811
+
812
+ ### Participant Endpoints
813
+
814
+ | Method | Endpoint | Purpose |
815
+ |--------|----------|---------|
816
+ | GET | `/participants/router?router_league_id=xxx` | List participants for a specific league |
817
+ | POST | `/participants/load` | Load router participants from BettorEdge for a league |
818
+ | POST | `/participants/load-raw` | Load raw participants from partner API for a league |
819
+ | GET | `/participants/:router_participant_id/available-raw/:partner_id/:router_league_id` | Get available raw participants to link |
820
+ | POST | `/participants/link` | Link raw participants to router participant |
821
+
822
+ ### Other Endpoints
823
+
824
+ | Method | Endpoint | Purpose |
825
+ |--------|----------|---------|
826
+ | GET | `/partners` | Get all active partners |
827
+
828
+ ---
829
+
830
+ ## 💡 Key Simplifications
831
+
832
+ ### What Changed:
833
+
834
+ **BEFORE (Too Broad):**
835
+ ```http
836
+ POST /contests/load-raw
837
+ {
838
+ "partner_id": "kalshi-partner-id",
839
+ "router_league_id": "league-nba-123"
840
+ }
841
+ ```
842
+ Returns **ALL** Kalshi contests for NBA (could be 100+)
843
+
844
+ **AFTER (Context-Specific):**
845
+ ```http
846
+ GET /contests/:router_contest_id/available-raw/:partner_id
847
+ ```
848
+ Returns only raw contests from that partner for that league, filtered to exclude already-linked ones
849
+
850
+ ### Why This is Better:
851
+
852
+ 1. **Scoped to context** - You're linking to a SPECIFIC contest, so you only see relevant raw contests
853
+ 2. **Already filtered** - Excludes raw contests that are already linked
854
+ 3. **Shows what you have** - Separate `already_linked` array so you know what's connected
855
+ 4. **Easier UI** - Can show directly in the contest detail page
856
+
857
+ ---
858
+
859
+ ## 🎯 Next Steps for Other Entities
860
+
861
+ ### 🏀 Participants (League-Level Management)
862
+
863
+ Participants are managed at the **league level** - you access them through the league context, not separately.
864
+
865
+ #### **Complete Participant Workflow**
866
+
867
+ ```
868
+ 1. Select league (NFL) from league list
869
+
870
+ 2. Click "View Participants" or navigate to Participants tab
871
+
872
+ 3. See list/search of router participants FOR THIS LEAGUE
873
+ - All NFL participants: Cowboys, 49ers, Mahomes, etc.
874
+ - Filter/search by name or type (team/athlete)
875
+ - Only shows participants belonging to the selected league
876
+
877
+ 4. Click on a router participant (e.g., "Dallas Cowboys")
878
+
879
+ 5. Participant detail page shows partner link status FOR THIS LEAGUE:
880
+ - BettorEdge: ✅ Linked in NFL (1 raw participant)
881
+ - Kalshi: ❌ Not Linked in NFL [Load & Link]
882
+ - BetOpenly: ✅ Linked in NFL (1 raw participant)
883
+
884
+ 6. Admin clicks "Load & Link" for Kalshi
885
+
886
+ 7. System calls: GET /participants/:router_participant_id/available-raw/:partner_id/:router_league_id
887
+ - Uses league context (NFL) to filter raw participants
888
+
889
+ 8. Modal shows:
890
+ - Already Linked in NFL section (if any)
891
+ - Available to Link in NFL section (raw participants from Kalshi for NFL)
892
+
893
+ 9. Admin selects matching raw participant(s)
894
+
895
+ 10. System calls: POST /participants/link
896
+
897
+ 11. Success! Kalshi now shows ✅ Linked in NFL
898
+ ```
899
+
900
+ **Key Point:** Router participants are **league-specific** - each participant belongs to exactly one league. "Dallas Cowboys" exists as a router participant in NFL, and "LA Lakers" exists as a separate router participant in NBA.
901
+
902
+ #### **Participant List Page (Accessed via League)**
903
+
904
+ **Endpoint:** `GET /participants/router?router_league_id=league-nfl-123`
905
+
906
+ ```
907
+ ┌─────────────────────────────────────────────────────────────┐
908
+ │ NFL → Participants [Search 🔍] │
909
+ │ │
910
+ │ Showing NFL participants (486 total) │
911
+ │ League: NFL │
912
+ │ │
913
+ │ Filter: [All Types ▼] [Active ▼] │
914
+ │ │
915
+ │ ┌────────────────────────────────────────────────────────┐ │
916
+ │ │ Dallas Cowboys (Team) │ │
917
+ │ │ Partner links in NFL: BettorEdge ✅ Kalshi ❌ BO ✅ │ │
918
+ │ │ [View Details] │ │
919
+ │ ├────────────────────────────────────────────────────────┤ │
920
+ │ │ San Francisco 49ers (Team) │ │
921
+ │ │ Partner links in NFL: BettorEdge ✅ Kalshi ✅ BO ✅ │ │
922
+ │ │ [View Details] │ │
923
+ │ ├────────────────────────────────────────────────────────┤ │
924
+ │ │ Patrick Mahomes (Athlete) │ │
925
+ │ │ Partner links in NFL: BettorEdge ✅ Kalshi ❌ BO ❌ │ │
926
+ │ │ [View Details] │ │
927
+ │ ├────────────────────────────────────────────────────────┤ │
928
+ │ │ LeBron James (Athlete) │ │
929
+ │ │ Partner links in NFL: None (belongs to NBA) │ │
930
+ │ │ [View Details] │ │
931
+ │ └────────────────────────────────────────────────────────┘ │
932
+ └─────────────────────────────────────────────────────────────┘
933
+ ```
934
+
935
+ **Note:** The list shows ALL router participants, but the link status shown is specific to the NFL league context. LeBron James would show up in the list, but with no NFL links since he belongs to NBA.
936
+
937
+ #### **Participant Detail Page UI**
938
+
939
+ ```
940
+ ┌─────────────────────────────────────────────────────────────┐
941
+ │ NFL → Participants → Dallas Cowboys │
942
+ │ │
943
+ │ Dallas Cowboys (Team) │
944
+ │ BettorEdge ID: team-dal-001 │
945
+ │ Tags: Dallas Cowboys, Cowboys, DAL │
946
+ │ │
947
+ │ ┌───────────────────────────────────────────────────────┐ │
948
+ │ │ Partner Links │ │
949
+ │ ├───────────────────────────────────────────────────────┤ │
950
+ │ │ │ │
951
+ │ │ BettorEdge ✅ Linked (1) │ │
952
+ │ │ raw_name: Dallas Cowboys │ │
953
+ │ │ external_id: team-dal-001 │ │
954
+ │ │ │ │
955
+ │ │ Kalshi ❌ Not Linked │ │
956
+ │ │ [Load & Link Participants] button │ │
957
+ │ │ │ │
958
+ │ │ BetOpenly ✅ Linked (2) │ │
959
+ │ │ raw_name: Dallas Cowboys │ │
960
+ │ │ external_id: dallas-cowboys-123 │ │
961
+ │ │ [View/Manage Links] │ │
962
+ │ │ │ │
963
+ │ └───────────────────────────────────────────────────────┘ │
964
+ └─────────────────────────────────────────────────────────────┘
965
+ ```
966
+
967
+ #### **When "Load & Link Participants" is clicked:**
968
+
969
+ ```
970
+ ┌─────────────────────────────────────────────────────────────┐
971
+ │ Kalshi Participants for "Dallas Cowboys" (NFL) [Close X] │
972
+ │ │
973
+ │ ┌────────────────────────────────────────────────────────┐ │
974
+ │ │ Already Linked (0) │ │
975
+ │ ├────────────────────────────────────────────────────────┤ │
976
+ │ │ No participants linked yet │ │
977
+ │ └────────────────────────────────────────────────────────┘ │
978
+ │ │
979
+ │ ┌────────────────────────────────────────────────────────┐ │
980
+ │ │ Available to Link (3) │ │
981
+ │ ├────────────────────────────────────────────────────────┤ │
982
+ │ │ │ │
983
+ │ │ ☑ kalshi-team-dallas-cowboys │ │
984
+ │ │ Dallas Cowboys │ │
985
+ │ │ Type: Team │ │
986
+ │ │ │ │
987
+ │ │ ☐ kalshi-team-dallas │ │
988
+ │ │ Dallas │ │
989
+ │ │ Type: Team │ │
990
+ │ │ │ │
991
+ │ │ ☐ kalshi-team-cowboys │ │
992
+ │ │ Cowboys │ │
993
+ │ │ Type: Team │ │
994
+ │ │ │ │
995
+ │ └────────────────────────────────────────────────────────┘ │
996
+ │ │
997
+ │ [Link Selected] [Cancel] │
998
+ └─────────────────────────────────────────────────────────────┘
999
+ ```
1000
+
1001
+ #### **Key Endpoints**
1002
+
1003
+ | Method | Endpoint | Purpose |
1004
+ |--------|----------|---------|
1005
+ | GET | `/participants/router` | Get ALL router participants (global, not filtered by league) |
1006
+ | GET | `/participants/:router_participant_id/available-raw/:partner_id/:router_league_id` | Get available raw participants to link. Returns `{ raw_participants: [], already_linked: [] }`. League context determines which raw participants are shown. |
1007
+ | POST | `/participants/load-raw` | Load raw participants from partner API (if needed). Body: `{ partner_id, router_league_id }` |
1008
+ | POST | `/participants/link` | Link raw participants to router participant. Body: `{ raw_participant_ids[], router_participant_id }` |
1009
+
1010
+ **Important:**
1011
+ - Router participants are **global entities** - the endpoint returns ALL of them
1012
+ - The league context (NFL, NBA, etc.) is only used when **viewing/linking raw participants** for a specific router participant
1013
+ - This allows admins to see all participants and manage their links across different leagues
1014
+
1015
+ #### **Why Access via League Context?**
1016
+
1017
+ - **League determines raw participants**: When linking, you need to know which league's raw participants to show
1018
+ - **Same name, different sports**: "Cowboys" might exist in NFL and college football - raw participants are scoped by league
1019
+ - **Participant types vary by sport**: NBA has teams + athletes, NFL has teams + athletes, horse racing has horses
1020
+ - **Workflow context**: Admin is managing NFL, so they access participants in that context
1021
+ - **BUT participants are global**: The router participant "Dallas Cowboys" exists once, can be linked to raw participants in multiple leagues if needed
1022
+
1023
+ ### Markets (Contest-Level)
1024
+
1025
+ Markets are loaded at the **contest level**:
1026
+
1027
+ ```
1028
+ 1. Select contest (Lakers vs Celtics)
1029
+
1030
+ 2. Go to "Markets" tab
1031
+
1032
+ 3. See list of router markets (Moneyline, Spread, etc.)
1033
+
1034
+ 4. For each router market:
1035
+ - Show which partners have raw markets
1036
+ - Button to load raw markets from missing partners
1037
+
1038
+ 5. Flow: GET /markets/:router_contest_id/:router_market_id/available-raw/:partner_id
1039
+ ```
1040
+
1041
+ ---
1042
+
1043
+ ---
1044
+
1045
+ ## 📊 Step 4: Market Management (Within Contest)
1046
+
1047
+ After contest linking, manage which markets are supported and link raw markets from partners.
1048
+
1049
+ ### Two-Step Market Process:
1050
+
1051
+ #### **Step 4a: Define Supported Markets (market_contests)**
1052
+
1053
+ **Get all available markets to manage:**
1054
+
1055
+ ```http
1056
+ GET /markets/available-to-support/:router_contest_id
1057
+ ```
1058
+
1059
+ Response shows all router markets and which are currently supported:
1060
+
1061
+ ```json
1062
+ {
1063
+ "message": "Successfully fetched available markets",
1064
+ "router_contest": {
1065
+ "router_contest_id": "contest-123",
1066
+ "contest_label": "Lakers vs Celtics"
1067
+ },
1068
+ "all_router_markets": [
1069
+ {
1070
+ "router_market_id": "rm-moneyline",
1071
+ "market_label": "Moneyline",
1072
+ "participant_type": "team"
1073
+ },
1074
+ {
1075
+ "router_market_id": "rm-spread",
1076
+ "market_label": "Spread",
1077
+ "participant_type": "team"
1078
+ },
1079
+ {
1080
+ "router_market_id": "rm-total",
1081
+ "market_label": "Total Points",
1082
+ "participant_type": "team"
1083
+ }
1084
+ ],
1085
+ "market_contests": [
1086
+ {
1087
+ "market_contest_id": "mc-1",
1088
+ "router_contest_id": "contest-123",
1089
+ "router_market_id": "rm-moneyline",
1090
+ "status": "open"
1091
+ }
1092
+ ]
1093
+ }
1094
+ ```
1095
+
1096
+ **UI Logic:**
1097
+ - Display all markets from `all_router_markets`
1098
+ - Check if each market is in `market_contests` to show as "supported" or "not supported"
1099
+ - Show add/remove buttons accordingly
1100
+
1101
+ **Add a Supported Market:**
1102
+
1103
+ ```http
1104
+ POST /markets/supported
1105
+ {
1106
+ "router_contest_id": "contest-123",
1107
+ "router_market_id": "rm-spread"
1108
+ }
1109
+ ```
1110
+
1111
+ **Remove a Supported Market:**
1112
+
1113
+ ```http
1114
+ DELETE /markets/supported/:market_contest_id
1115
+ ```
1116
+
1117
+ #### **Step 4b: Link Raw Markets for Each Supported Market**
1118
+
1119
+ **Endpoint:** `GET /markets/:router_contest_id/:router_market_id/available-raw/:partner_id`
1120
+
1121
+ Shows available raw markets from a partner for a specific router market:
1122
+
1123
+ ```json
1124
+ {
1125
+ "router_contest": { ... },
1126
+ "router_market": {
1127
+ "router_market_id": "rm-moneyline",
1128
+ "market_label": "Moneyline"
1129
+ },
1130
+ "raw_markets": [
1131
+ {
1132
+ "raw_market_id": "raw-be-moneyline",
1133
+ "external_id": "2",
1134
+ "pretty_title": "Winner"
1135
+ }
1136
+ ],
1137
+ "already_linked": []
1138
+ }
1139
+ ```
1140
+
1141
+ **Link Raw Market:**
1142
+
1143
+ ```http
1144
+ POST /markets/link
1145
+ {
1146
+ "raw_market_id": "raw-be-moneyline",
1147
+ "router_market_id": "rm-moneyline",
1148
+ "market_side_id": "side-home",
1149
+ "partner_participant_id": "pp-lakers-123",
1150
+ "timeframe_id": "tf-full-game",
1151
+ "variable": 0,
1152
+ "variable_type": "total",
1153
+ "price_key": "yes"
1154
+ }
1155
+ ```
1156
+
1157
+ **🎯 SIMPLIFIED WORKFLOW:**
1158
+
1159
+ **For Spread Markets:**
1160
+ - User enters the spread value **once** (e.g., `7` or `3.5`)
1161
+ - Single "Link Both Sides" button links both home and away
1162
+ - Client automatically:
1163
+ - Creates home side with negative variable: `-7` (favorite)
1164
+ - Creates away side with positive variable: `+7` (underdog)
1165
+ - Backend stores two separate signed variables
1166
+
1167
+ **For Total Markets:**
1168
+ - User enters the total value **once** (e.g., `220.5`)
1169
+ - Both over/under sides use the same variable
1170
+ - Single variable created, both sides link to it
1171
+
1172
+ **For Moneyline Markets:**
1173
+ - No variable needed (variable_required: false)
1174
+ - Link each side separately with just participant and timeframe
1175
+
1176
+ **Variable Type Auto-Detection:**
1177
+ Each `router_market` now has a `default_variable_type` field:
1178
+ - Spread markets → defaults to `'spread'`
1179
+ - Total markets → defaults to `'total'`
1180
+ - The client can use this to determine the variable type automatically
1181
+
1182
+ ---
1183
+
1184
+ ## 📋 Adding Multiple Variables to a Market
1185
+
1186
+ For markets that allow variables (like Spread), you can add **multiple variables** to the same market (e.g., -7, -3.5, -10).
1187
+
1188
+ ### New Endpoint: Variables and Raw Markets
1189
+
1190
+ **Endpoint:** `GET /markets/:router_contest_id/:router_market_id/variables-and-raw/:partner_id`
1191
+
1192
+ This endpoint shows:
1193
+ 1. All existing variables for this market
1194
+ 2. All available raw markets (can be linked with new variables)
1195
+ 3. Which raw markets are already linked to which variables
1196
+
1197
+ **Response:**
1198
+ ```json
1199
+ {
1200
+ "message": "Successfully fetched market variables and raw markets",
1201
+ "router_contest": { ... },
1202
+ "router_market": {
1203
+ "router_market_id": "rm-spread",
1204
+ "market_label": "Spread",
1205
+ "default_variable_type": "spread",
1206
+ ...
1207
+ },
1208
+ "existing_variables": [
1209
+ {
1210
+ "router_market_variable_id": "var-1",
1211
+ "variable": -7,
1212
+ "variable_type": "spread",
1213
+ "linked_count": 2 // 2 partner markets (home + away)
1214
+ },
1215
+ {
1216
+ "router_market_variable_id": "var-2",
1217
+ "variable": -3.5,
1218
+ "variable_type": "spread",
1219
+ "linked_count": 2
1220
+ }
1221
+ ],
1222
+ "raw_markets": [
1223
+ {
1224
+ "raw_market_id": "raw-be-spread-1",
1225
+ "external_id": "2000003|1",
1226
+ "pretty_title": "Spread",
1227
+ ...
1228
+ }
1229
+ ],
1230
+ "already_linked_by_variable": {
1231
+ "var-1": ["raw-be-spread-1"], // This variable is already linked to this raw market
1232
+ "var-2": ["raw-be-spread-1"] // Same raw market can be linked multiple times
1233
+ }
1234
+ }
1235
+ ```
1236
+
1237
+ ### UI Workflow: Adding a Variable
1238
+
1239
+ ```
1240
+ ┌─────────────────────────────────────────────────────────┐
1241
+ │ Spread Market - Lakers vs Celtics │
1242
+ ├─────────────────────────────────────────────────────────┤
1243
+ │ │
1244
+ │ Existing Variables: │
1245
+ │ • -7.0 (2 sides linked) ✓ │
1246
+ │ • -3.5 (2 sides linked) ✓ │
1247
+ │ │
1248
+ │ [+ Add Variable] ← Button to add new variable │
1249
+ │ │
1250
+ └─────────────────────────────────────────────────────────┘
1251
+
1252
+ When "+ Add Variable" is clicked:
1253
+
1254
+ ┌─────────────────────────────────────────────────────────┐
1255
+ │ Add New Variable to Spread Market │
1256
+ ├─────────────────────────────────────────────────────────┤
1257
+ │ │
1258
+ │ Variable: [10] ← User enters new variable value │
1259
+ │ │
1260
+ │ Raw Market: │
1261
+ │ Partner: BettorEdge │
1262
+ │ Market: Spread (GAME:Spread:Game) │
1263
+ │ │
1264
+ │ Home Side: │
1265
+ │ Participant: [Lakers ▼] │
1266
+ │ Timeframe: [Full Game ▼] │
1267
+ │ Price Key: [yes ▼] │
1268
+ │ │
1269
+ │ Away Side: │
1270
+ │ Participant: [Celtics ▼] │
1271
+ │ Timeframe: [Full Game ▼] │
1272
+ │ Price Key: [no ▼] │
1273
+ │ │
1274
+ │ [Link Both Sides] [Cancel] │
1275
+ └─────────────────────────────────────────────────────────┘
1276
+ ```
1277
+
1278
+ **What happens:**
1279
+ 1. Client makes 2 API calls to `POST /markets/link`:
1280
+ - First call: variable = `-10`, side = home
1281
+ - Second call: variable = `+10`, side = away
1282
+ 2. Backend automatically creates new `router_market_variable` records if they don't exist
1283
+ 3. Backend creates `partner_market` records linking to the raw market
1284
+
1285
+ **Result:** The same raw market is now linked 3 times:
1286
+ - With variable -7 (home) and +7 (away)
1287
+ - With variable -3.5 (home) and +3.5 (away)
1288
+ - With variable -10 (home) and +10 (away)
1289
+
1290
+ ---
1291
+
1292
+ ## 🏀 Multiple Participants for Prop Markets
1293
+
1294
+ For **player prop markets** (like Passing Yards, Points, Rebounds), the `allow_multiple_participants` field enables linking multiple players to the same market.
1295
+
1296
+ ### How It Works
1297
+
1298
+ **Market Setup:**
1299
+ ```typescript
1300
+ {
1301
+ "market_key": "passing_yards",
1302
+ "market_label": "Passing Yards",
1303
+ "category": "player_stat",
1304
+ "participant_type": "player",
1305
+ "variable_required": true,
1306
+ "default_variable_type": "total",
1307
+ "allow_multiple_participants": true // ← Key feature
1308
+ }
1309
+ ```
1310
+
1311
+ ### Endpoint Response
1312
+
1313
+ The same `GET /markets/:router_contest_id/:router_market_id/variables-and-raw/:partner_id` endpoint now includes participant information:
1314
+
1315
+ ```json
1316
+ {
1317
+ "router_market": {
1318
+ "market_label": "Passing Yards",
1319
+ "allow_multiple_participants": true,
1320
+ ...
1321
+ },
1322
+ "existing_variables": [
1323
+ {
1324
+ "router_market_variable_id": "var-1",
1325
+ "variable": 250.5,
1326
+ "variable_type": "total",
1327
+ "linked_count": 2 // over + under
1328
+ },
1329
+ {
1330
+ "router_market_variable_id": "var-2",
1331
+ "variable": 275.5,
1332
+ "variable_type": "total",
1333
+ "linked_count": 2
1334
+ }
1335
+ ],
1336
+ "existing_participants": [
1337
+ {
1338
+ "partner_participant_id": "pp-mahomes",
1339
+ "name": "Patrick Mahomes",
1340
+ "participant_type": "player",
1341
+ "linked_count": 2, // over + under
1342
+ "variables": [250.5] // This player is linked with this variable
1343
+ },
1344
+ {
1345
+ "partner_participant_id": "pp-allen",
1346
+ "name": "Josh Allen",
1347
+ "participant_type": "player",
1348
+ "linked_count": 2,
1349
+ "variables": [275.5]
1350
+ }
1351
+ ],
1352
+ "raw_markets": [
1353
+ {
1354
+ "raw_market_id": "raw-be-passing-yards",
1355
+ "external_id": "2000005|3",
1356
+ "pretty_title": "Passing Yards",
1357
+ ...
1358
+ }
1359
+ ]
1360
+ }
1361
+ ```
1362
+
1363
+ ### UI Workflow: Adding a Participant
1364
+
1365
+ ```
1366
+ ┌─────────────────────────────────────────────────────────┐
1367
+ │ Passing Yards - Chiefs vs Bills │
1368
+ ├─────────────────────────────────────────────────────────┤
1369
+ │ │
1370
+ │ Existing Participants: │
1371
+ │ • Patrick Mahomes (250.5 yards) ✓ │
1372
+ │ • Josh Allen (275.5 yards) ✓ │
1373
+ │ │
1374
+ │ [+ Add Participant] ← Button to add new participant │
1375
+ │ │
1376
+ └─────────────────────────────────────────────────────────┘
1377
+
1378
+ When "+ Add Participant" is clicked:
1379
+
1380
+ ┌─────────────────────────────────────────────────────────┐
1381
+ │ Add Participant to Passing Yards Market │
1382
+ ├─────────────────────────────────────────────────────────┤
1383
+ │ │
1384
+ │ Select Participant: │
1385
+ │ [Joe Burrow ▼] │
1386
+ │ │
1387
+ │ Variable (Total): [265.5] │
1388
+ │ │
1389
+ │ Raw Market: │
1390
+ │ Partner: BettorEdge │
1391
+ │ Market: Passing Yards (2000005|3) │
1392
+ │ │
1393
+ │ Over Side: │
1394
+ │ Market Side: [Over ▼] │
1395
+ │ Timeframe: [Full Game ▼] │
1396
+ │ Price Key: [yes ▼] │
1397
+ │ │
1398
+ │ Under Side: │
1399
+ │ Market Side: [Under ▼] │
1400
+ │ Timeframe: [Full Game ▼] │
1401
+ │ Price Key: [no ▼] │
1402
+ │ │
1403
+ │ [Link Both Sides] [Cancel] │
1404
+ └─────────────────────────────────────────────────────────┘
1405
+ ```
1406
+
1407
+ **What happens:**
1408
+ 1. Client makes 2 API calls to `POST /markets/link`:
1409
+ - First call: Joe Burrow, over, variable = 265.5
1410
+ - Second call: Joe Burrow, under, variable = 265.5
1411
+ 2. Backend creates `router_market_variable` if it doesn't exist
1412
+ 3. Backend creates `partner_market` records
1413
+
1414
+ **Result:** The same raw market now has 3 participants:
1415
+ ```
1416
+ Patrick Mahomes:
1417
+ - Over 250.5 yards
1418
+ - Under 250.5 yards
1419
+
1420
+ Josh Allen:
1421
+ - Over 275.5 yards
1422
+ - Under 275.5 yards
1423
+
1424
+ Joe Burrow:
1425
+ - Over 265.5 yards
1426
+ - Under 265.5 yards
1427
+ ```
1428
+
1429
+ ### Key Benefits
1430
+
1431
+ ✅ **Same raw market, multiple participants** - Efficient linking
1432
+ ✅ **Each participant has their own variable** - Different lines for different players
1433
+ ✅ **Track existing participants** - See who's already linked
1434
+ ✅ **Easy to add more** - Just select participant and enter variable
1435
+ ✅ **Automatic variable management** - Backend handles variable creation
1436
+
1437
+ ### UI Layout - Markets Tab
1438
+
1439
+ **Step 1: Manage Supported Markets**
1440
+
1441
+ Click "Manage Markets" button to show modal:
1442
+
1443
+ ```
1444
+ ┌─────────────────────────────────────────────────────────────┐
1445
+ │ Manage Markets for Lakers vs Celtics [Close X] │
1446
+ │ │
1447
+ │ Select which markets are supported for this contest: │
1448
+ │ │
1449
+ │ ☑ Moneyline [Currently Active]│
1450
+ │ ☐ Spread │
1451
+ │ ☐ Total Points │
1452
+ │ ☐ Player Props - Points │
1453
+ │ ☐ Player Props - Rebounds │
1454
+ │ ☐ Player Props - Assists │
1455
+ │ │
1456
+ │ [Save Changes] [Cancel] │
1457
+ └─────────────────────────────────────────────────────────────┘
1458
+ ```
1459
+
1460
+ **Step 2: Link Raw Markets for Supported Markets**
1461
+
1462
+ Main markets view after managing:
1463
+
1464
+ ```
1465
+ ┌─────────────────────────────────────────────────────────────┐
1466
+ │ Lakers vs Celtics - Markets [Manage Markets]│
1467
+ │ │
1468
+ │ ✅ Moneyline │
1469
+ │ BettorEdge: ✅ Linked (2 sides) │
1470
+ │ Kalshi: ❌ Not Linked [Link Markets] │
1471
+ │ BetOpenly: ✅ Linked (2 sides) │
1472
+ │ │
1473
+ │ ✅ Spread │
1474
+ │ BettorEdge: ❌ Not Linked [Link Markets] │
1475
+ │ Kalshi: ❌ Not Linked [Link Markets] │
1476
+ │ BetOpenly: ❌ Not Linked [Link Markets] │
1477
+ │ │
1478
+ └─────────────────────────────────────────────────────────────┘
1479
+ ```
1480
+
1481
+ **📖 For detailed market linking guide, see:** [MARKET_LINKING_WORKFLOW.md](./MARKET_LINKING_WORKFLOW.md)
1482
+
1483
+ ---
1484
+
1485
+ ## 📋 Job Manager
1486
+
1487
+ The Job Manager allows admins to manage automated background jobs that handle data loading, autolinking, and other scheduled tasks.
1488
+
1489
+ ### **Job List View**
1490
+
1491
+ **Endpoint:** `GET /jobs`
1492
+
1493
+ View all configured jobs in the system:
1494
+
1495
+ ```json
1496
+ {
1497
+ "message": "Jobs retrieved successfully",
1498
+ "count": 5,
1499
+ "jobs": [
1500
+ {
1501
+ "router_job_id": "job-001",
1502
+ "job_key": "loadContests",
1503
+ "name": "Load Contests",
1504
+ "description": "Loads contests for all active leagues",
1505
+ "frequency": 15,
1506
+ "frequency_type": "minutes",
1507
+ "last_success_datetime": "2025-11-03T10:30:00Z",
1508
+ "create_datetime": "2025-11-01T00:00:00Z"
1509
+ }
1510
+ ]
1511
+ }
1512
+ ```
1513
+
1514
+ **UI Display:**
1515
+ ```
1516
+ ┌─────────────────────────────────────────────────────────────┐
1517
+ │ Job Manager [+ New Job] │
1518
+ │ │
1519
+ │ ┌────────────────────────────────────────────────────────┐ │
1520
+ │ │ Load Contests [Run Now] │ │
1521
+ │ │ Runs every 15 minutes [Edit] │ │
1522
+ │ │ Last success: 5 minutes ago [Delete] │ │
1523
+ │ │ Status: ✅ Success │ │
1524
+ │ ├────────────────────────────────────────────────────────┤ │
1525
+ │ │ Load Participants [Run Now] │ │
1526
+ │ │ Runs every 1 hour [Edit] │ │
1527
+ │ │ Last success: 30 minutes ago [Delete] │ │
1528
+ │ │ Status: ✅ Success │ │
1529
+ │ ├────────────────────────────────────────────────────────┤ │
1530
+ │ │ Auto-Link Markets [Run Now] │ │
1531
+ │ │ Runs every 5 minutes [Edit] │ │
1532
+ │ │ Last success: Never [Delete] │ │
1533
+ │ │ Status: ⏸️ Never run │ │
1534
+ │ └────────────────────────────────────────────────────────┘ │
1535
+ └─────────────────────────────────────────────────────────────┘
1536
+ ```
1537
+
1538
+ ### **Create New Job**
1539
+
1540
+ **Endpoint:** `POST /jobs/create`
1541
+
1542
+ ```json
1543
+ {
1544
+ "job_key": "loadMarkets",
1545
+ "name": "Load Markets",
1546
+ "description": "Loads market data for all active contests",
1547
+ "frequency": 10,
1548
+ "frequency_type": "minutes"
1549
+ }
1550
+ ```
1551
+
1552
+ **Response:**
1553
+ ```json
1554
+ {
1555
+ "message": "Job created successfully",
1556
+ "job": {
1557
+ "router_job_id": "job-new-123",
1558
+ "job_key": "loadMarkets",
1559
+ "name": "Load Markets",
1560
+ ...
1561
+ }
1562
+ }
1563
+ ```
1564
+
1565
+ ### **Update Job**
1566
+
1567
+ **Endpoint:** `PUT /jobs/update`
1568
+
1569
+ ```json
1570
+ {
1571
+ "router_job_id": "job-001",
1572
+ "frequency": 30,
1573
+ "frequency_type": "minutes"
1574
+ }
1575
+ ```
1576
+
1577
+ ### **Delete Job**
1578
+
1579
+ **Endpoint:** `DELETE /jobs/:router_job_id`
1580
+
1581
+ Removes a job from the system.
1582
+
1583
+ ### **Queue/Run Job**
1584
+
1585
+ **Endpoint:** `POST /jobs/queue`
1586
+
1587
+ Manually trigger a job to run immediately:
1588
+
1589
+ ```json
1590
+ {
1591
+ "job_key": "loadContests"
1592
+ }
1593
+ ```
1594
+
1595
+ **Response:**
1596
+ ```json
1597
+ {
1598
+ "message": "Job loadContests queued and executed successfully",
1599
+ "job_key": "loadContests",
1600
+ "job_name": "Load Contests",
1601
+ "status_count": 1,
1602
+ "job_statuses": [
1603
+ {
1604
+ "job_status_id": "status-123",
1605
+ "router_job_id": "job-001",
1606
+ "status": "success",
1607
+ "start_datetime": "2025-11-03T10:45:00Z",
1608
+ "end_datetime": "2025-11-03T10:45:15Z"
1609
+ }
1610
+ ]
1611
+ }
1612
+ ```
1613
+
1614
+ **Important:**
1615
+ - The server automatically determines if the job is a parent or child job
1616
+ - Parent jobs will orchestrate child jobs based on priorities
1617
+ - Returns all job statuses created during execution
1618
+
1619
+ ---
1620
+
1621
+ ### **Job Status History**
1622
+
1623
+ **Endpoint:** `GET /jobs/statuses/recent?limit=50&offset=0`
1624
+
1625
+ View recent job executions with pagination:
1626
+
1627
+ ```json
1628
+ {
1629
+ "message": "Recent job statuses retrieved successfully",
1630
+ "count": 50,
1631
+ "total_count": 250,
1632
+ "has_more": true,
1633
+ "statuses": [
1634
+ {
1635
+ "job_status_id": "status-123",
1636
+ "router_job_id": "job-001",
1637
+ "job_name": "Load Contests",
1638
+ "job_key": "loadContests",
1639
+ "status": "success",
1640
+ "start_datetime": "2025-11-03T10:45:00Z",
1641
+ "end_datetime": "2025-11-03T10:45:15Z",
1642
+ "is_parent_job": true,
1643
+ "child_job_count": 3,
1644
+ "create_datetime": "2025-11-03T10:45:00Z"
1645
+ },
1646
+ {
1647
+ "job_status_id": "status-122",
1648
+ "router_job_id": "job-002",
1649
+ "job_name": "Load Participants",
1650
+ "job_key": "loadParticipants",
1651
+ "status": "failed",
1652
+ "start_datetime": "2025-11-03T10:30:00Z",
1653
+ "end_datetime": "2025-11-03T10:30:05Z",
1654
+ "is_parent_job": false,
1655
+ "child_job_count": 0,
1656
+ "create_datetime": "2025-11-03T10:30:00Z"
1657
+ }
1658
+ ]
1659
+ }
1660
+ ```
1661
+
1662
+ **UI Display:**
1663
+ ```
1664
+ ┌─────────────────────────────────────────────────────────────┐
1665
+ │ Job Execution History │
1666
+ │ │
1667
+ │ Showing 50 of 250 executions [Page 1 of 5] │
1668
+ │ │
1669
+ │ ┌────────────────────────────────────────────────────────┐ │
1670
+ │ │ ✅ Load Contests (Parent) [View Children] │ │
1671
+ │ │ Started: 2025-11-03 10:45:00 │ │
1672
+ │ │ Duration: 15 seconds │ │
1673
+ │ │ 3 child jobs executed │ │
1674
+ │ ├────────────────────────────────────────────────────────┤ │
1675
+ │ │ ❌ Load Participants │ │
1676
+ │ │ Started: 2025-11-03 10:30:00 │ │
1677
+ │ │ Duration: 5 seconds │ │
1678
+ │ │ Failed with error │ │
1679
+ │ ├────────────────────────────────────────────────────────┤ │
1680
+ │ │ ⏳ Auto-Link Markets (Parent) [View Children] │ │
1681
+ │ │ Started: 2025-11-03 10:25:00 │ │
1682
+ │ │ Status: In Progress │ │
1683
+ │ │ 2 child jobs completed, 1 in progress │ │
1684
+ │ └────────────────────────────────────────────────────────┘ │
1685
+ │ │
1686
+ │ [Previous] 1 2 3 4 5 [Next] │
1687
+ └─────────────────────────────────────────────────────────────┘
1688
+ ```
1689
+
1690
+ **Query Parameters:**
1691
+ - `limit` (optional): Number of statuses to return (default: 50)
1692
+ - `offset` (optional): Pagination offset (default: 0)
1693
+
1694
+ **Status Icons:**
1695
+ - ✅ Success
1696
+ - ❌ Failed
1697
+ - ⏳ In Progress
1698
+ - 📅 Scheduled
1699
+
1700
+ ---
1701
+
1702
+ ### **View Child Job Statuses**
1703
+
1704
+ **Endpoint:** `GET /jobs/statuses/:job_status_id/children`
1705
+
1706
+ When a parent job is executed, you can view the status of all child jobs:
1707
+
1708
+ ```json
1709
+ {
1710
+ "message": "Child job statuses retrieved successfully",
1711
+ "parent_job_status_id": "status-123",
1712
+ "count": 3,
1713
+ "child_statuses": [
1714
+ {
1715
+ "job_status_id": "status-124",
1716
+ "router_job_id": "job-child-001",
1717
+ "job_name": "Load Raw Contests",
1718
+ "job_key": "loadRawContests",
1719
+ "status": "success",
1720
+ "start_datetime": "2025-11-03T10:45:01Z",
1721
+ "end_datetime": "2025-11-03T10:45:05Z",
1722
+ "parent_job_id": "status-123"
1723
+ },
1724
+ {
1725
+ "job_status_id": "status-125",
1726
+ "router_job_id": "job-child-002",
1727
+ "job_name": "Auto-Link Contests",
1728
+ "job_key": "autoLinkContests",
1729
+ "status": "success",
1730
+ "start_datetime": "2025-11-03T10:45:06Z",
1731
+ "end_datetime": "2025-11-03T10:45:10Z",
1732
+ "parent_job_id": "status-123"
1733
+ },
1734
+ {
1735
+ "job_status_id": "status-126",
1736
+ "router_job_id": "job-child-003",
1737
+ "job_name": "Load Markets",
1738
+ "job_key": "loadMarkets",
1739
+ "status": "success",
1740
+ "start_datetime": "2025-11-03T10:45:11Z",
1741
+ "end_datetime": "2025-11-03T10:45:15Z",
1742
+ "parent_job_id": "status-123"
1743
+ }
1744
+ ]
1745
+ }
1746
+ ```
1747
+
1748
+ **UI Dropdown/Modal:**
1749
+ ```
1750
+ ┌─────────────────────────────────────────────────────────────┐
1751
+ │ Load Contests - Child Jobs [Close X] │
1752
+ │ │
1753
+ │ Parent Job Started: 2025-11-03 10:45:00 │
1754
+ │ Total Duration: 15 seconds │
1755
+ │ │
1756
+ │ ┌────────────────────────────────────────────────────────┐ │
1757
+ │ │ 1. Load Raw Contests │ │
1758
+ │ │ ✅ Success │ │
1759
+ │ │ Started: 10:45:01 │ │
1760
+ │ │ Duration: 4 seconds │ │
1761
+ │ ├────────────────────────────────────────────────────────┤ │
1762
+ │ │ 2. Auto-Link Contests │ │
1763
+ │ │ ✅ Success │ │
1764
+ │ │ Started: 10:45:06 │ │
1765
+ │ │ Duration: 4 seconds │ │
1766
+ │ ├────────────────────────────────────────────────────────┤ │
1767
+ │ │ 3. Load Markets │ │
1768
+ │ │ ✅ Success │ │
1769
+ │ │ Started: 10:45:11 │ │
1770
+ │ │ Duration: 4 seconds │ │
1771
+ │ └────────────────────────────────────────────────────────┘ │
1772
+ └─────────────────────────────────────────────────────────────┘
1773
+ ```
1774
+
1775
+ ---
1776
+
1777
+ ### **Job Endpoints Summary**
1778
+
1779
+ | Method | Endpoint | Purpose |
1780
+ |--------|----------|---------|
1781
+ | GET | `/jobs` | Get all jobs |
1782
+ | GET | `/jobs/:job_key` | Get specific job by key |
1783
+ | POST | `/jobs/create` | Create new job |
1784
+ | PUT | `/jobs/update` | Update existing job |
1785
+ | DELETE | `/jobs/:router_job_id` | Delete job |
1786
+ | POST | `/jobs/queue` | Run job immediately |
1787
+ | GET | `/jobs/statuses/recent?limit=50&offset=0` | Get recent job execution history (paginated) |
1788
+ | GET | `/jobs/statuses/:job_status_id/children` | Get child job statuses for a parent job |
1789
+
1790
+ ---
1791
+
1792
+ ### **Job Types**
1793
+
1794
+ **Parent Jobs:**
1795
+ - Orchestrate multiple child jobs based on priorities
1796
+ - Examples: `loadContests`, `loadParticipants`
1797
+ - Run child jobs sequentially in priority order
1798
+
1799
+ **Child Jobs:**
1800
+ - Individual tasks that can be run standalone or as part of a parent
1801
+ - Examples: `loadRawContests`, `autoLinkContests`, `loadMarkets`
1802
+ - Accept optional `parent_job_id` parameter
1803
+
1804
+ **How Parent/Child Works:**
1805
+ 1. Admin queues `loadContests` job
1806
+ 2. Server checks `parent_job_priorities` table
1807
+ 3. Finds 3 child jobs: priority 1=`loadRawContests`, priority 2=`autoLinkContests`, priority 3=`loadMarkets`
1808
+ 4. Runs each child job in order
1809
+ 5. Creates status records for parent + all children
1810
+
1811
+ ---
1812
+
1813
+ ## 🚀 Implementation Priority
1814
+
1815
+ 1. **Phase 0:** League linking (foundation - must be done first!) ✅
1816
+ 2. **Phase 1:** Contest linking (described above) ✅
1817
+ 3. **Phase 2:** Participant linking (league-level, similar pattern) ✅
1818
+ 4. **Phase 3:** Market supported setup (add/remove supported markets) ✅
1819
+ 5. **Phase 4:** Market raw linking (link raw markets to supported markets) ✅
1820
+ 6. **Phase 5:** Bulk operations, analytics, status checks
1821
+
1822
+ **Important:** Leagues must be linked before contests, participants, or markets can be linked!
1823
+
1824
+ ---
1825
+
1826
+ ## 🗺️ Complete Navigation Flow Summary
1827
+
1828
+ ```
1829
+ ┌──────────────────────────────────────────────────────────────┐
1830
+ │ LEAGUES (Entry Point) │
1831
+ │ • View all router leagues │
1832
+ │ • Select a league to manage │
1833
+ └────────────┬─────────────────────────────────────────────────┘
1834
+
1835
+ ├─── League Detail Page
1836
+ │ • See partner link status (BettorEdge, Kalshi, BetOpenly)
1837
+ │ • Load & link raw leagues for each partner
1838
+ │ • [Manage League Links] [View Contests] [View Participants]
1839
+
1840
+ ├─── CONTESTS (League Context)
1841
+ │ │
1842
+ │ ├─── Contest List
1843
+ │ │ • All contests in this league
1844
+ │ │ • Search/filter by status, date
1845
+ │ │ • Click contest to view details
1846
+ │ │
1847
+ │ └─── Contest Detail Page
1848
+ │ • See partner link status
1849
+ │ • Load & link raw contests for each partner
1850
+ │ • Navigate to Markets tab
1851
+ │ │
1852
+ │ └─── MARKETS (Contest Context)
1853
+ │ • Manage supported markets (which market types)
1854
+ │ • For each market type, link raw markets from partners
1855
+ │ • Add variables (spreads, totals) as needed
1856
+
1857
+ └─── PARTICIPANTS (League Context)
1858
+
1859
+ ├─── Participant List
1860
+ │ • All participants in this league
1861
+ │ • Search/filter by name, type
1862
+ │ • Quick view of partner link status
1863
+ │ • Click participant to view details
1864
+
1865
+ └─── Participant Detail Page
1866
+ • See partner link status
1867
+ • Load & link raw participants for each partner
1868
+ • Multiple raw participants can link to one router participant
1869
+ ```
1870
+
1871
+ ### **Key Concepts:**
1872
+
1873
+ 1. **League-First Navigation**: Everything starts with selecting a league
1874
+ 2. **Consistent Linking Pattern**: Load available → Select → Link (same for leagues, contests, participants, markets)
1875
+ 3. **Partner Status Visibility**: Always show which partners are linked (✅/❌)
1876
+ 4. **Already Linked Section**: Every modal shows both "Already Linked" and "Available to Link"
1877
+ 5. **Context Scoping**:
1878
+ - Contests belong to a league
1879
+ - Participants belong to a league
1880
+ - Markets belong to a contest
1881
+ 6. **Search & Filter**: Enable at every level for better UX