@ttt-productions/q-core 0.1.16 → 0.1.18

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 (275) hide show
  1. package/dist/constants/business.d.ts.map +1 -1
  2. package/dist/constants/business.js +25 -5
  3. package/dist/constants/business.js.map +1 -1
  4. package/dist/constants/sports.d.ts.map +1 -1
  5. package/dist/constants/sports.js +2 -2
  6. package/dist/constants/sports.js.map +1 -1
  7. package/dist/doc-schemas/admin-notifications.d.ts +1 -1
  8. package/dist/doc-schemas/admin-notifications.d.ts.map +1 -1
  9. package/dist/doc-schemas/admin-notifications.js +4 -1
  10. package/dist/doc-schemas/admin-notifications.js.map +1 -1
  11. package/dist/doc-schemas/aggregate-stats.d.ts.map +1 -1
  12. package/dist/doc-schemas/aggregate-stats.js +4 -1
  13. package/dist/doc-schemas/aggregate-stats.js.map +1 -1
  14. package/dist/doc-schemas/atoms.d.ts.map +1 -1
  15. package/dist/doc-schemas/atoms.js +2 -2
  16. package/dist/doc-schemas/atoms.js.map +1 -1
  17. package/dist/doc-schemas/audit-event.d.ts.map +1 -1
  18. package/dist/doc-schemas/audit-event.js +8 -4
  19. package/dist/doc-schemas/audit-event.js.map +1 -1
  20. package/dist/doc-schemas/award-group-grant.d.ts.map +1 -1
  21. package/dist/doc-schemas/award-group-grant.js +11 -3
  22. package/dist/doc-schemas/award-group-grant.js.map +1 -1
  23. package/dist/doc-schemas/catalogs.js +1 -1
  24. package/dist/doc-schemas/catalogs.js.map +1 -1
  25. package/dist/doc-schemas/gallery.js +1 -1
  26. package/dist/doc-schemas/gallery.js.map +1 -1
  27. package/dist/doc-schemas/game-stat-history.d.ts.map +1 -1
  28. package/dist/doc-schemas/game-stat-history.js.map +1 -1
  29. package/dist/doc-schemas/game-stats.d.ts.map +1 -1
  30. package/dist/doc-schemas/game-stats.js +10 -2
  31. package/dist/doc-schemas/game-stats.js.map +1 -1
  32. package/dist/doc-schemas/league-team.js +1 -1
  33. package/dist/doc-schemas/league-team.js.map +1 -1
  34. package/dist/doc-schemas/membership-roster-sync.d.ts.map +1 -1
  35. package/dist/doc-schemas/membership-roster-sync.js +2 -1
  36. package/dist/doc-schemas/membership-roster-sync.js.map +1 -1
  37. package/dist/doc-schemas/migration-console.js +1 -1
  38. package/dist/doc-schemas/migration-console.js.map +1 -1
  39. package/dist/doc-schemas/pending-media.d.ts.map +1 -1
  40. package/dist/doc-schemas/pending-media.js.map +1 -1
  41. package/dist/doc-schemas/picture-retirement.d.ts.map +1 -1
  42. package/dist/doc-schemas/picture-retirement.js +5 -1
  43. package/dist/doc-schemas/picture-retirement.js.map +1 -1
  44. package/dist/doc-schemas/registry.d.ts +1 -1
  45. package/dist/doc-schemas/registry.d.ts.map +1 -1
  46. package/dist/doc-schemas/registry.js +1 -1
  47. package/dist/doc-schemas/registry.js.map +1 -1
  48. package/dist/doc-schemas/sport-game.d.ts.map +1 -1
  49. package/dist/doc-schemas/sport-game.js.map +1 -1
  50. package/dist/doc-schemas/sport-league.d.ts.map +1 -1
  51. package/dist/doc-schemas/sport-league.js +10 -2
  52. package/dist/doc-schemas/sport-league.js.map +1 -1
  53. package/dist/doc-schemas/status-reconcile-queue.d.ts.map +1 -1
  54. package/dist/doc-schemas/status-reconcile-queue.js.map +1 -1
  55. package/dist/doc-schemas/sweep-state.d.ts.map +1 -1
  56. package/dist/doc-schemas/sweep-state.js +10 -2
  57. package/dist/doc-schemas/sweep-state.js.map +1 -1
  58. package/dist/doc-schemas/system.d.ts.map +1 -1
  59. package/dist/doc-schemas/system.js.map +1 -1
  60. package/dist/doc-schemas/user-profile.d.ts.map +1 -1
  61. package/dist/doc-schemas/user-profile.js +1 -1
  62. package/dist/doc-schemas/user-profile.js.map +1 -1
  63. package/dist/doc-schemas/waivers-and-hardware.d.ts.map +1 -1
  64. package/dist/doc-schemas/waivers-and-hardware.js +15 -3
  65. package/dist/doc-schemas/waivers-and-hardware.js.map +1 -1
  66. package/dist/domain-events/domain-events.d.ts.map +1 -1
  67. package/dist/domain-events/domain-events.js +88 -24
  68. package/dist/domain-events/domain-events.js.map +1 -1
  69. package/dist/ids/notification-ids.d.ts.map +1 -1
  70. package/dist/ids/notification-ids.js.map +1 -1
  71. package/dist/ids/picture-ids.d.ts.map +1 -1
  72. package/dist/ids/picture-ids.js.map +1 -1
  73. package/dist/ids/stat-event-ids.d.ts.map +1 -1
  74. package/dist/ids/stat-event-ids.js.map +1 -1
  75. package/dist/ids/waiver-template-ids.d.ts.map +1 -1
  76. package/dist/ids/waiver-template-ids.js.map +1 -1
  77. package/dist/index.d.ts +4 -9
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +6 -9
  80. package/dist/index.js.map +1 -1
  81. package/dist/input-formats/{index.d.ts → input-formats.d.ts} +1 -1
  82. package/dist/input-formats/input-formats.d.ts.map +1 -0
  83. package/dist/input-formats/{index.js → input-formats.js} +1 -1
  84. package/dist/input-formats/input-formats.js.map +1 -0
  85. package/dist/media/file-origins.d.ts.map +1 -1
  86. package/dist/media/file-origins.js +30 -6
  87. package/dist/media/file-origins.js.map +1 -1
  88. package/dist/migration-console/action-ids.d.ts.map +1 -1
  89. package/dist/migration-console/action-ids.js.map +1 -1
  90. package/dist/migration-console/manifest.d.ts.map +1 -1
  91. package/dist/migration-console/manifest.js +42 -7
  92. package/dist/migration-console/manifest.js.map +1 -1
  93. package/dist/migration-console/run-state.d.ts.map +1 -1
  94. package/dist/migration-console/run-state.js.map +1 -1
  95. package/dist/notifications/admin-notification-config.d.ts.map +1 -1
  96. package/dist/notifications/admin-notification-config.js +5 -3
  97. package/dist/notifications/admin-notification-config.js.map +1 -1
  98. package/dist/notifications/occurrences.d.ts.map +1 -1
  99. package/dist/notifications/occurrences.js.map +1 -1
  100. package/dist/paths/path-builders.d.ts.map +1 -1
  101. package/dist/paths/path-builders.js +60 -15
  102. package/dist/paths/path-builders.js.map +1 -1
  103. package/dist/paths/picture-owner-paths.d.ts.map +1 -1
  104. package/dist/paths/picture-owner-paths.js.map +1 -1
  105. package/dist/paths/storage-paths.d.ts.map +1 -1
  106. package/dist/paths/storage-paths.js.map +1 -1
  107. package/dist/schemas/admin-notifications.d.ts.map +1 -1
  108. package/dist/schemas/admin-notifications.js +8 -4
  109. package/dist/schemas/admin-notifications.js.map +1 -1
  110. package/dist/schemas/app-config.js +1 -1
  111. package/dist/schemas/app-config.js.map +1 -1
  112. package/dist/schemas/atoms.d.ts +0 -1
  113. package/dist/schemas/atoms.d.ts.map +1 -1
  114. package/dist/schemas/atoms.js +3 -5
  115. package/dist/schemas/atoms.js.map +1 -1
  116. package/dist/schemas/awards.d.ts.map +1 -1
  117. package/dist/schemas/awards.js +13 -5
  118. package/dist/schemas/awards.js.map +1 -1
  119. package/dist/schemas/dead-letters.d.ts.map +1 -1
  120. package/dist/schemas/dead-letters.js +6 -3
  121. package/dist/schemas/dead-letters.js.map +1 -1
  122. package/dist/schemas/game-locations.d.ts.map +1 -1
  123. package/dist/schemas/game-locations.js +1 -1
  124. package/dist/schemas/game-locations.js.map +1 -1
  125. package/dist/schemas/hardware-loan-contracts.d.ts.map +1 -1
  126. package/dist/schemas/hardware-loan-contracts.js +11 -4
  127. package/dist/schemas/hardware-loan-contracts.js.map +1 -1
  128. package/dist/schemas/leagues.d.ts +2 -2
  129. package/dist/schemas/leagues.d.ts.map +1 -1
  130. package/dist/schemas/leagues.js +12 -3
  131. package/dist/schemas/leagues.js.map +1 -1
  132. package/dist/schemas/migration-console.d.ts.map +1 -1
  133. package/dist/schemas/migration-console.js +3 -6
  134. package/dist/schemas/migration-console.js.map +1 -1
  135. package/dist/schemas/pictures.d.ts.map +1 -1
  136. package/dist/schemas/pictures.js +6 -2
  137. package/dist/schemas/pictures.js.map +1 -1
  138. package/dist/schemas/schedules.d.ts +8 -8
  139. package/dist/schemas/schedules.d.ts.map +1 -1
  140. package/dist/schemas/schedules.js +9 -3
  141. package/dist/schemas/schedules.js.map +1 -1
  142. package/dist/schemas/scoring.d.ts +12 -12
  143. package/dist/schemas/scoring.d.ts.map +1 -1
  144. package/dist/schemas/scoring.js +11 -4
  145. package/dist/schemas/scoring.js.map +1 -1
  146. package/dist/schemas/signed-waivers.d.ts.map +1 -1
  147. package/dist/schemas/signed-waivers.js +5 -3
  148. package/dist/schemas/signed-waivers.js.map +1 -1
  149. package/dist/schemas/stats.d.ts.map +1 -1
  150. package/dist/schemas/stats.js +27 -8
  151. package/dist/schemas/stats.js.map +1 -1
  152. package/dist/schemas/team-joining.d.ts.map +1 -1
  153. package/dist/schemas/team-joining.js +13 -5
  154. package/dist/schemas/team-joining.js.map +1 -1
  155. package/dist/schemas/teams.d.ts.map +1 -1
  156. package/dist/schemas/teams.js +19 -6
  157. package/dist/schemas/teams.js.map +1 -1
  158. package/dist/schemas/uploads.d.ts.map +1 -1
  159. package/dist/schemas/uploads.js +12 -5
  160. package/dist/schemas/uploads.js.map +1 -1
  161. package/dist/schemas/users.d.ts.map +1 -1
  162. package/dist/schemas/users.js +22 -8
  163. package/dist/schemas/users.js.map +1 -1
  164. package/dist/schemas/waiver-templates.js +1 -1
  165. package/dist/schemas/waiver-templates.js.map +1 -1
  166. package/dist/sports/basketball-scoring.d.ts.map +1 -1
  167. package/dist/sports/basketball-scoring.js +67 -16
  168. package/dist/sports/basketball-scoring.js.map +1 -1
  169. package/dist/sports/basketball.d.ts.map +1 -1
  170. package/dist/sports/basketball.js +34 -7
  171. package/dist/sports/basketball.js.map +1 -1
  172. package/dist/sports/column-catalog.d.ts.map +1 -1
  173. package/dist/sports/column-catalog.js +4 -1
  174. package/dist/sports/column-catalog.js.map +1 -1
  175. package/dist/sports/contribution.d.ts.map +1 -1
  176. package/dist/sports/contribution.js +10 -3
  177. package/dist/sports/contribution.js.map +1 -1
  178. package/dist/sports/curling-scoring.d.ts.map +1 -1
  179. package/dist/sports/curling-scoring.js +30 -8
  180. package/dist/sports/curling-scoring.js.map +1 -1
  181. package/dist/sports/curling.d.ts.map +1 -1
  182. package/dist/sports/curling.js +1 -1
  183. package/dist/sports/curling.js.map +1 -1
  184. package/dist/sports/finalized-record.d.ts.map +1 -1
  185. package/dist/sports/finalized-record.js.map +1 -1
  186. package/dist/sports/football-scoring.d.ts.map +1 -1
  187. package/dist/sports/football-scoring.js +28 -8
  188. package/dist/sports/football-scoring.js.map +1 -1
  189. package/dist/sports/football.d.ts.map +1 -1
  190. package/dist/sports/football.js +1 -1
  191. package/dist/sports/football.js.map +1 -1
  192. package/dist/sports/index.d.ts +2 -2
  193. package/dist/sports/index.d.ts.map +1 -1
  194. package/dist/sports/index.js +1 -1
  195. package/dist/sports/index.js.map +1 -1
  196. package/dist/sports/ledger-continuity.d.ts.map +1 -1
  197. package/dist/sports/ledger-continuity.js.map +1 -1
  198. package/dist/sports/rankings.d.ts.map +1 -1
  199. package/dist/sports/rankings.js +5 -1
  200. package/dist/sports/rankings.js.map +1 -1
  201. package/dist/sports/replay.d.ts.map +1 -1
  202. package/dist/sports/replay.js +4 -1
  203. package/dist/sports/replay.js.map +1 -1
  204. package/dist/sports/rollup-check.d.ts.map +1 -1
  205. package/dist/sports/rollup-check.js +15 -3
  206. package/dist/sports/rollup-check.js.map +1 -1
  207. package/dist/sports/score-mirror.d.ts.map +1 -1
  208. package/dist/sports/score-mirror.js.map +1 -1
  209. package/dist/sports/scoring-display.d.ts.map +1 -1
  210. package/dist/sports/scoring-display.js.map +1 -1
  211. package/dist/sports/scoring.d.ts.map +1 -1
  212. package/dist/sports/scoring.js.map +1 -1
  213. package/dist/sports/sport-adapter.d.ts.map +1 -1
  214. package/dist/sports/sport-adapter.js.map +1 -1
  215. package/dist/sports/store-driver.d.ts.map +1 -1
  216. package/dist/sports/store-driver.js +18 -7
  217. package/dist/sports/store-driver.js.map +1 -1
  218. package/dist/types/audit.d.ts.map +1 -1
  219. package/dist/types/audit.js +16 -3
  220. package/dist/types/audit.js.map +1 -1
  221. package/dist/types/index.d.ts +0 -1
  222. package/dist/types/index.d.ts.map +1 -1
  223. package/dist/types/index.js +0 -1
  224. package/dist/types/index.js.map +1 -1
  225. package/dist/types/notifications.d.ts.map +1 -1
  226. package/dist/types/notifications.js +9 -13
  227. package/dist/types/notifications.js.map +1 -1
  228. package/dist/types/schedules.d.ts.map +1 -1
  229. package/dist/types/schedules.js.map +1 -1
  230. package/dist/types/sports.d.ts.map +1 -1
  231. package/dist/types/sports.js +9 -2
  232. package/dist/types/sports.js.map +1 -1
  233. package/dist/types/stats.d.ts.map +1 -1
  234. package/dist/types/stats.js +45 -9
  235. package/dist/types/stats.js.map +1 -1
  236. package/dist/types/unions.d.ts.map +1 -1
  237. package/dist/types/unions.js +32 -6
  238. package/dist/types/unions.js.map +1 -1
  239. package/dist/upload-variables/picture-upload-variables.d.ts.map +1 -1
  240. package/dist/upload-variables/picture-upload-variables.js +4 -2
  241. package/dist/upload-variables/picture-upload-variables.js.map +1 -1
  242. package/dist/upload-variables/sign-hardware-contract-variables.d.ts.map +1 -1
  243. package/dist/upload-variables/sign-hardware-contract-variables.js +4 -2
  244. package/dist/upload-variables/sign-hardware-contract-variables.js.map +1 -1
  245. package/dist/upload-variables/sign-waiver-variables.d.ts.map +1 -1
  246. package/dist/upload-variables/sign-waiver-variables.js +5 -3
  247. package/dist/upload-variables/sign-waiver-variables.js.map +1 -1
  248. package/dist/utils/app-config.d.ts.map +1 -1
  249. package/dist/utils/app-config.js +5 -1
  250. package/dist/utils/app-config.js.map +1 -1
  251. package/dist/utils/app-routes.d.ts.map +1 -1
  252. package/dist/utils/app-routes.js +6 -1
  253. package/dist/utils/app-routes.js.map +1 -1
  254. package/dist/utils/league-calendar.d.ts.map +1 -1
  255. package/dist/utils/league-calendar.js +4 -1
  256. package/dist/utils/league-calendar.js.map +1 -1
  257. package/dist/utils/league-join-warning.d.ts.map +1 -1
  258. package/dist/utils/league-join-warning.js +15 -5
  259. package/dist/utils/league-join-warning.js.map +1 -1
  260. package/dist/utils/schedules.d.ts.map +1 -1
  261. package/dist/utils/schedules.js +6 -2
  262. package/dist/utils/schedules.js.map +1 -1
  263. package/dist/utils/team-member-actions.d.ts.map +1 -1
  264. package/dist/utils/team-member-actions.js.map +1 -1
  265. package/package.json +5 -17
  266. package/dist/input-formats/index.d.ts.map +0 -1
  267. package/dist/input-formats/index.js.map +0 -1
  268. package/dist/migration-console/index.d.ts +0 -4
  269. package/dist/migration-console/index.d.ts.map +0 -1
  270. package/dist/migration-console/index.js +0 -5
  271. package/dist/migration-console/index.js.map +0 -1
  272. package/dist/types/documents.d.ts +0 -24
  273. package/dist/types/documents.d.ts.map +0 -1
  274. package/dist/types/documents.js +0 -5
  275. package/dist/types/documents.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,iGAAiG;AACjG,qBAAqB;AACrB,EAAE;AACF,kGAAkG;AAClG,qGAAqG;AACrG,0DAA0D;AAG1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAC1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;A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AIlD,iGAAiG;AACjG,0FAA0F;AAC1F,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,sBAAsB,EAAE,KAAK;IAC7B,6BAA6B,EAAE,QAAQ;IACvC,8CAA8C,EAAE,SAAS;IACzD,mCAAmC,EAAE,UAAU;IAC/C,4BAA4B,EAAE,IAAI;IAClC,+BAA+B,EAAE,IAAI;IACrC,sCAAsC,EAAE,qBAAqB;IAC7D,qCAAqC,EAAE,YAAY;IACnD,oCAAoC,EAAE,OAAO;IAC7C,4BAA4B,EAAE,SAAS;IACvC,2DAA2D,EAAE,QAAQ;IACrE,gCAAgC,EAAE,UAAU;CACwB,CAAC;AAEvE,mFAAmF;AACnF,MAAM,CAAC,MAAM,mBAAmB,GAAsB,EAAE,CAAC","sourcesContent":["// Collection → schema registry: every Firestore path template bound to the zod schema its\n// documents must satisfy. Every document a migration copy action writes is validated against the\n// schema bound here.\n//\n// A key is the literal path template — `{placeholder}` for an id, the literal segment for a fixed\n// document id. __tests__/doc-schemas-registry.test.ts fails when a collection constant has neither a\n// binding here nor an explicit PENDING_COLLECTIONS entry.\n\nimport type { z } from 'zod';\nimport { StatusReconcileQueueEntrySchema } from './status-reconcile-queue.js';\nimport {\n ActiveAdminNotificationSchema,\n AdminNotificationHistorySchema,\n NotificationArchiveAllJobSchema,\n NotificationDeliverySchema,\n} from './admin-notifications.js';\nimport { AwardDefinitionSchema } from './catalogs.js';\nimport { AwardGroupGrantPersonSchema, AwardGroupGrantSchema } from './award-group-grant.js';\nimport { GameLocationRegistrySchema, GameLocationSchema } from './game-location.js';\nimport { GalleryPictureSchema } from './gallery.js';\nimport { PendingMediaSchema } from './pending-media.js';\nimport { PictureRetirementSchema } from './picture-retirement.js';\nimport { GameRosterPlayerSchema, SportGameSchema } from './sport-game.js';\nimport { SportHallOfFameSchema } from './aggregate-stats.js';\nimport { GameStatHistoryPageSchema } from './game-stat-history.js';\nimport { GameStatEventSchema } from './game-stats.js';\nimport { StatsOperationSchema } from './stats-operation.js';\nimport { LeagueTeamContactSchema, LeagueTeamSchema } from './league-team.js';\nimport { MembershipRosterSyncSchema } from './membership-roster-sync.js';\nimport { MigrationActionRunSchema, MigrationConsoleSchema } from './migration-console.js';\nimport { AuditEventSchema } from './audit-event.js';\nimport { PublicUserSchema } from './publicUser.js';\nimport { RegistrationStartSchema } from './registration-start.js';\nimport { ReservedDisplayNameSchema } from './reserved-display-name.js';\nimport { SportLeagueSchema } from './sport-league.js';\nimport { SweepStateSchema } from './sweep-state.js';\nimport {\n AppConfigSchema,\n LandingPageConfigSchema,\n AdminListSchema,\n StatsBeaconSchema,\n StatsValidationReportSchema,\n} from './system.js';\nimport {\n LeagueFreeAgentSchema,\n TeamJoinRequestSchema,\n TeamInvitationSchema,\n TeamMembershipSchema,\n} from './team-membership.js';\nimport { HistoricalStatsSchema, UserPrivateDataSchema, UserProfileSchema } from './user-profile.js';\nimport { HardwareLoanContractSchema, SignedWaiverSchema } from './waivers-and-hardware.js';\nimport { WaiverTemplateRegistrySchema, WaiverTemplateSchema, WaiverTemplateVersionSchema } from './waiver-template.js';\n\nexport const COLLECTION_SCHEMAS = {\n 'userProfiles/{userId}': UserProfileSchema,\n 'userProfiles/{userId}/privateData/{privateDataId}': UserPrivateDataSchema,\n 'userProfiles/{userId}/historicalStats/{sportKey}': HistoricalStatsSchema,\n 'publicUsers/{userId}': PublicUserSchema,\n 'reservedDisplayNames/{reservedDisplayNameKey}': ReservedDisplayNameSchema,\n 'statusReconcileQueue/{userId}': StatusReconcileQueueEntrySchema,\n 'registrationStarts/{userId}': RegistrationStartSchema,\n\n 'sportLeagues/{leagueId}': SportLeagueSchema,\n 'leagueTeams/{teamId}': LeagueTeamSchema,\n 'leagueTeamContacts/{teamId}': LeagueTeamContactSchema,\n 'teamMemberships/{teamMembershipId}': TeamMembershipSchema,\n 'membershipRosterSyncs/{teamMembershipId}': MembershipRosterSyncSchema,\n 'teamInvitations/{inviteId}': TeamInvitationSchema,\n 'teamJoinRequests/{requestId}': TeamJoinRequestSchema,\n 'leagueFreeAgents/{leagueFreeAgentId}': LeagueFreeAgentSchema,\n\n 'sportGames/{gameId}': SportGameSchema,\n 'sportGames/{gameId}/gameRosterPlayers/{gameRosterPlayerId}': GameRosterPlayerSchema,\n 'sportGames/{gameId}/gameStatEvents/{eventId}': GameStatEventSchema,\n 'sportGames/{gameId}/gameStatHistory/{pageId}': GameStatHistoryPageSchema,\n 'gameLocations/{gameLocationId}': GameLocationSchema,\n\n 'waiverTemplates/{waiverTemplateId}': WaiverTemplateSchema,\n 'waiverTemplates/{waiverTemplateId}/waiverTemplateVersions/{versionId}': WaiverTemplateVersionSchema,\n 'signedWaivers/{signedWaiverId}': SignedWaiverSchema,\n 'hardwareLoanContracts/{contractId}': HardwareLoanContractSchema,\n\n 'awardDefinitions/{awardId}': AwardDefinitionSchema,\n 'awardGroupGrants/{grantId}': AwardGroupGrantSchema,\n 'awardGroupGrants/{grantId}/awardGroupGrantPeople/{userId}': AwardGroupGrantPersonSchema,\n 'sportHallOfFame/{sportKey}': SportHallOfFameSchema,\n 'statsValidationReports/{reportId}': StatsValidationReportSchema,\n 'statsOperations/{operationId}': StatsOperationSchema,\n\n 'galleryPictures/{pictureId}': GalleryPictureSchema,\n 'pendingMedia/{pendingMediaId}': PendingMediaSchema,\n 'pictureRetirements/{retirementId}': PictureRetirementSchema,\n\n 'auditEvents/{auditEventId}': AuditEventSchema,\n\n 'activeAdminNotifications/{notificationId}': ActiveAdminNotificationSchema,\n 'adminNotificationHistory/{historyId}': AdminNotificationHistorySchema,\n 'notificationDeliveries/{deliveryId}': NotificationDeliverySchema,\n 'notificationArchiveAllJobs/{jobId}': NotificationArchiveAllJobSchema,\n\n '_appConfig/landingPage': LandingPageConfigSchema,\n '_appConfig/app': AppConfigSchema,\n '_appConfig/statsBeacon': StatsBeaconSchema,\n '_systemData/adminList': AdminListSchema,\n '_serverData/migrationConsole': MigrationConsoleSchema,\n '_serverData/gameLocationRegistry': GameLocationRegistrySchema,\n '_serverData/waiverTemplateRegistry': WaiverTemplateRegistrySchema,\n 'migrationActionRuns/{actionId}': MigrationActionRunSchema,\n 'sweepState/{sweepName}': SweepStateSchema,\n} as const satisfies Record<string, z.ZodTypeAny>;\n\nexport type RegisteredCollectionPath = keyof typeof COLLECTION_SCHEMAS;\n\n// The body field that equals the document id, where a schema declares one. A drift check injects\n// `doc.id` under this key before validating, so a doc-id field is never a false mismatch.\nexport const COLLECTION_DOC_ID_FIELDS = {\n 'publicUsers/{userId}': 'uid',\n 'registrationStarts/{userId}': 'userId',\n 'sportGames/{gameId}/gameStatEvents/{eventId}': 'eventId',\n 'statsValidationReports/{reportId}': 'reportId',\n 'auditEvents/{auditEventId}': 'id',\n 'pendingMedia/{pendingMediaId}': 'id',\n 'adminNotificationHistory/{historyId}': 'archiveOccurrenceId',\n 'notificationDeliveries/{deliveryId}': 'deliveryId',\n 'notificationArchiveAllJobs/{jobId}': 'jobId',\n 'awardGroupGrants/{grantId}': 'grantId',\n 'awardGroupGrants/{grantId}/awardGroupGrantPeople/{userId}': 'userId',\n 'migrationActionRuns/{actionId}': 'actionId',\n} as const satisfies Partial<Record<RegisteredCollectionPath, string>>;\n\n// Collections declared in ../paths with no bound schema yet, each with the reason.\nexport const PENDING_COLLECTIONS: readonly string[] = [];\n"]}
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/doc-schemas/registry.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,iGAAiG;AACjG,qBAAqB;AACrB,EAAE;AACF,kGAAkG;AAClG,qGAAqG;AACrG,0DAA0D;AAG1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,+BAA+B,EAC/B,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,w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5D,4BAA4B,EAAE,gBAAgB;IAE9C,2CAA2C,EAAE,6BAA6B;IAC1E,sCAAsC,EAAE,8BAA8B;IACtE,qCAAqC,EAAE,0BAA0B;IACjE,oCAAoC,EAAE,+BAA+B;IAErE,wBAAwB,EAAE,uBAAuB;IACjD,gBAAgB,EAAE,eAAe;IACjC,wBAAwB,EAAE,iBAAiB;IAC3C,uBAAuB,EAAE,eAAe;IACxC,8BAA8B,EAAE,sBAAsB;IACtD,kCAAkC,EAAE,0BAA0B;IAC9D,oCAAoC,EAAE,4BAA4B;IAClE,gCAAgC,EAAE,wBAAwB;IAC1D,wBAAwB,EAAE,gBAAgB;CACK,CAAC;AAIlD,iGAAiG;AACjG,0FAA0F;AAC1F,MAAM,CAAC,MAAM,wBAAwB,GAAG;IACtC,sBAAsB,EAAE,KAAK;IAC7B,6BAA6B,EAAE,QAAQ;IACvC,8CAA8C,EAAE,SAAS;IACzD,mCAAmC,EAAE,UAAU;IAC/C,4BAA4B,EAAE,IAAI;IAClC,+BAA+B,EAAE,IAAI;IACrC,sCAAsC,EAAE,qBAAqB;IAC7D,qCAAqC,EAAE,YAAY;IACnD,oCAAoC,EAAE,OAAO;IAC7C,4BAA4B,EAAE,SAAS;IACvC,2DAA2D,EAAE,QAAQ;IACrE,gCAAgC,EAAE,UAAU;CACwB,CAAC;AAEvE,mFAAmF;AACnF,MAAM,CAAC,MAAM,mBAAmB,GAAsB,EAAE,CAAC","sourcesContent":["// Collection → schema registry: every Firestore path template bound to the zod schema its\n// documents must satisfy. Every document a migration copy action writes is validated against the\n// schema bound here.\n//\n// A key is the literal path template — `{placeholder}` for an id, the literal segment for a fixed\n// document id. __tests__/doc-schemas-registry.test.ts fails when a collection constant has neither a\n// binding here nor an explicit PENDING_COLLECTIONS entry.\n\nimport type { z } from 'zod';\nimport { StatusReconcileQueueEntrySchema } from './status-reconcile-queue.js';\nimport {\n ActiveAdminNotificationSchema,\n AdminNotificationHistorySchema,\n NotificationArchiveAllJobSchema,\n NotificationDeliverySchema,\n} from './admin-notifications.js';\nimport { AwardDefinitionSchema } from './catalogs.js';\nimport { AwardGroupGrantPersonSchema, AwardGroupGrantSchema } from './award-group-grant.js';\nimport { GameLocationRegistrySchema, GameLocationSchema } from './game-location.js';\nimport { GalleryPictureSchema } from './gallery.js';\nimport { PendingMediaSchema } from './pending-media.js';\nimport { PictureRetirementSchema } from './picture-retirement.js';\nimport { GameRosterPlayerSchema, SportGameSchema } from './sport-game.js';\nimport { SportHallOfFameSchema } from './aggregate-stats.js';\nimport { GameStatHistoryPageSchema } from './game-stat-history.js';\nimport { GameStatEventSchema } from './game-stats.js';\nimport { StatsOperationSchema } from './stats-operation.js';\nimport { LeagueTeamContactSchema, LeagueTeamSchema } from './league-team.js';\nimport { MembershipRosterSyncSchema } from './membership-roster-sync.js';\nimport { MigrationActionRunSchema, MigrationConsoleSchema } from './migration-console.js';\nimport { AuditEventSchema } from './audit-event.js';\nimport { PublicUserSchema } from './publicUser.js';\nimport { RegistrationStartSchema } from './registration-start.js';\nimport { ReservedDisplayNameSchema } from './reserved-display-name.js';\nimport { SportLeagueSchema } from './sport-league.js';\nimport { SweepStateSchema } from './sweep-state.js';\nimport {\n AppConfigSchema,\n LandingPageConfigSchema,\n AdminListSchema,\n StatsBeaconSchema,\n StatsValidationReportSchema,\n} from './system.js';\nimport {\n LeagueFreeAgentSchema,\n TeamJoinRequestSchema,\n TeamInvitationSchema,\n TeamMembershipSchema,\n} from './team-membership.js';\nimport { HistoricalStatsSchema, UserPrivateDataSchema, UserProfileSchema } from './user-profile.js';\nimport { HardwareLoanContractSchema, SignedWaiverSchema } from './waivers-and-hardware.js';\nimport {\n WaiverTemplateRegistrySchema,\n WaiverTemplateSchema,\n WaiverTemplateVersionSchema,\n} from './waiver-template.js';\n\nexport const COLLECTION_SCHEMAS = {\n 'userProfiles/{userId}': UserProfileSchema,\n 'userProfiles/{userId}/privateData/{privateDataId}': UserPrivateDataSchema,\n 'userProfiles/{userId}/historicalStats/{sportKey}': HistoricalStatsSchema,\n 'publicUsers/{userId}': PublicUserSchema,\n 'reservedDisplayNames/{reservedDisplayNameKey}': ReservedDisplayNameSchema,\n 'statusReconcileQueue/{userId}': StatusReconcileQueueEntrySchema,\n 'registrationStarts/{userId}': RegistrationStartSchema,\n\n 'sportLeagues/{leagueId}': SportLeagueSchema,\n 'leagueTeams/{teamId}': LeagueTeamSchema,\n 'leagueTeamContacts/{teamId}': LeagueTeamContactSchema,\n 'teamMemberships/{teamMembershipId}': TeamMembershipSchema,\n 'membershipRosterSyncs/{teamMembershipId}': MembershipRosterSyncSchema,\n 'teamInvitations/{inviteId}': TeamInvitationSchema,\n 'teamJoinRequests/{requestId}': TeamJoinRequestSchema,\n 'leagueFreeAgents/{leagueFreeAgentId}': LeagueFreeAgentSchema,\n\n 'sportGames/{gameId}': SportGameSchema,\n 'sportGames/{gameId}/gameRosterPlayers/{gameRosterPlayerId}': GameRosterPlayerSchema,\n 'sportGames/{gameId}/gameStatEvents/{eventId}': GameStatEventSchema,\n 'sportGames/{gameId}/gameStatHistory/{pageId}': GameStatHistoryPageSchema,\n 'gameLocations/{gameLocationId}': GameLocationSchema,\n\n 'waiverTemplates/{waiverTemplateId}': WaiverTemplateSchema,\n 'waiverTemplates/{waiverTemplateId}/waiverTemplateVersions/{versionId}':\n WaiverTemplateVersionSchema,\n 'signedWaivers/{signedWaiverId}': SignedWaiverSchema,\n 'hardwareLoanContracts/{contractId}': HardwareLoanContractSchema,\n\n 'awardDefinitions/{awardId}': AwardDefinitionSchema,\n 'awardGroupGrants/{grantId}': AwardGroupGrantSchema,\n 'awardGroupGrants/{grantId}/awardGroupGrantPeople/{userId}': AwardGroupGrantPersonSchema,\n 'sportHallOfFame/{sportKey}': SportHallOfFameSchema,\n 'statsValidationReports/{reportId}': StatsValidationReportSchema,\n 'statsOperations/{operationId}': StatsOperationSchema,\n\n 'galleryPictures/{pictureId}': GalleryPictureSchema,\n 'pendingMedia/{pendingMediaId}': PendingMediaSchema,\n 'pictureRetirements/{retirementId}': PictureRetirementSchema,\n\n 'auditEvents/{auditEventId}': AuditEventSchema,\n\n 'activeAdminNotifications/{notificationId}': ActiveAdminNotificationSchema,\n 'adminNotificationHistory/{historyId}': AdminNotificationHistorySchema,\n 'notificationDeliveries/{deliveryId}': NotificationDeliverySchema,\n 'notificationArchiveAllJobs/{jobId}': NotificationArchiveAllJobSchema,\n\n '_appConfig/landingPage': LandingPageConfigSchema,\n '_appConfig/app': AppConfigSchema,\n '_appConfig/statsBeacon': StatsBeaconSchema,\n '_systemData/adminList': AdminListSchema,\n '_serverData/migrationConsole': MigrationConsoleSchema,\n '_serverData/gameLocationRegistry': GameLocationRegistrySchema,\n '_serverData/waiverTemplateRegistry': WaiverTemplateRegistrySchema,\n 'migrationActionRuns/{actionId}': MigrationActionRunSchema,\n 'sweepState/{sweepName}': SweepStateSchema,\n} as const satisfies Record<string, z.ZodTypeAny>;\n\nexport type RegisteredCollectionPath = keyof typeof COLLECTION_SCHEMAS;\n\n// The body field that equals the document id, where a schema declares one. A drift check injects\n// `doc.id` under this key before validating, so a doc-id field is never a false mismatch.\nexport const COLLECTION_DOC_ID_FIELDS = {\n 'publicUsers/{userId}': 'uid',\n 'registrationStarts/{userId}': 'userId',\n 'sportGames/{gameId}/gameStatEvents/{eventId}': 'eventId',\n 'statsValidationReports/{reportId}': 'reportId',\n 'auditEvents/{auditEventId}': 'id',\n 'pendingMedia/{pendingMediaId}': 'id',\n 'adminNotificationHistory/{historyId}': 'archiveOccurrenceId',\n 'notificationDeliveries/{deliveryId}': 'deliveryId',\n 'notificationArchiveAllJobs/{jobId}': 'jobId',\n 'awardGroupGrants/{grantId}': 'grantId',\n 'awardGroupGrants/{grantId}/awardGroupGrantPeople/{userId}': 'userId',\n 'migrationActionRuns/{actionId}': 'actionId',\n} as const satisfies Partial<Record<RegisteredCollectionPath, string>>;\n\n// Collections declared in ../paths with no bound schema yet, each with the reason.\nexport const PENDING_COLLECTIONS: readonly string[] = [];\n"]}
@@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D,MAAM,CAAC,kBAAkB,EAAE,eAAe,CAAC,CAAC;AAG/C,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,kBAAkB,CAAC,YAAY,EAAE;IAChE,oBAAoB;IACpB,iBAAiB;IACjB,kBAAkB;CACnB,CAAC,CAAC;AAGH,oGAAoG;AACpG,+FAA+F;AAC/F,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,MAAM,EAAE,YAAY;IACpB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,QAAQ,EAAE,aAAa;CACxB,CAAC,CAAC","sourcesContent":["// `sportGames/{gameId}` — one scheduled or played game — and its `gameRosterPlayers` subcollection.\n// The game is discriminated on `leagueType`, which selects its `stats` shape (SPORT-002).\n\nimport { z } from 'zod';\nimport { parseGameRosterPlayerId } from '../ids/compound-ids.js';\nimport type { LeagueType } from '../types/sports.js';\nimport { SPORT_LINE_SCHEMAS } from './aggregate-stats.js';\nimport { gameStatsSchema } from './game-stats.js';\nimport {\n calendarDateSchema,\n countSchema,\n epochMsSchema,\n gameRosterPlayerIdSchema,\n gameStatusSchema,\n leagueIdSchema,\n scheduleWeekIdSchema,\n statsOperationIdSchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\nimport { gameLocationIdSchema } from './game-location.js';\n\n// Each sport's game `stats`: the two-key payload (SPORT-001) over that sport's game lines, taken\n// from `SPORT_LINE_SCHEMAS` — the one pairing of a sport with its lines. Spelled per sport so each\n// payload keeps its exact type; `satisfies` fails the build when a sport is missing.\nexport const SPORT_GAME_STATS_SCHEMAS = {\n Basketball: gameStatsSchema(SPORT_LINE_SCHEMAS.Basketball.gameTeam, SPORT_LINE_SCHEMAS.Basketball.gamePlayer),\n Curling: gameStatsSchema(SPORT_LINE_SCHEMAS.Curling.gameTeam, SPORT_LINE_SCHEMAS.Curling.gamePlayer),\n Football: gameStatsSchema(SPORT_LINE_SCHEMAS.Football.gameTeam, SPORT_LINE_SCHEMAS.Football.gamePlayer),\n} as const satisfies Record<LeagueType, z.ZodType>;\n\nexport type BasketballGameStats = z.infer<typeof SPORT_GAME_STATS_SCHEMAS.Basketball>;\nexport type CurlingGameStats = z.infer<typeof SPORT_GAME_STATS_SCHEMAS.Curling>;\nexport type FootballGameStats = z.infer<typeof SPORT_GAME_STATS_SCHEMAS.Football>;\n\n// Which sport's payload a game holds is decided by its `leagueType`, never by the payload's shape\n// (SPORT-002).\nexport type GameStats = z.infer<(typeof SPORT_GAME_STATS_SCHEMAS)[LeagueType]>;\n\n// One of a game's two team slots. `teamId` is a leagueTeams id, or BYE_TEAM_ID for a bye week.\nexport const GameTeamSchema = z.object({\n teamId: teamIdSchema,\n});\nexport type GameTeam = z.infer<typeof GameTeamSchema>;\n\nconst sportGameBase = {\n leagueId: leagueIdSchema,\n // The week this game belongs to; weekly schedules are reconstructed by grouping on `weekId`.\n weekId: scheduleWeekIdSchema,\n weekTitle: z.string(),\n weekLocation: z.string(),\n weekStartDate: epochMsSchema,\n startTime: epochMsSchema,\n // The game's local calendar date in LEAGUE_TIME_ZONE.\n dayKey: calendarDateSchema,\n // The venue as shown, e.g. \"Main Gym - Court 2\". Free text; `gameLocationId` is the reference.\n locationLabel: z.string(),\n gameLocationId: gameLocationIdSchema.optional(),\n subLocation: z.string().optional(),\n status: gameStatusSchema,\n // Positional: teams[0] is team one, teams[1] is team two.\n teams: z.tuple([GameTeamSchema, GameTeamSchema]),\n // The real (non-bye) team ids, for `array-contains` queries.\n teamIds: z.array(teamIdSchema).min(1).max(2),\n // Each team's score, mirrored from its `stats.teamStats` line by the same write that changes it\n // (SPORT-107), so a schedule or list reads a score without the stats.\n score: z.record(teamIdSchema, countSchema),\n // The number of this game's stat event documents, which is also the last `sequence` assigned.\n statEventSequence: countSchema,\n // A scorer's note per person, keyed by userId (real or ghost).\n memos: z.record(z.string(), z.string()).optional(),\n // Absence is per roster entry: a person on both teams can be absent on one side only.\n absentRosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n // The roster entries finalize credited no game played — the adapter's decision, stored so every\n // later path reverses what was applied rather than deciding again (SPORT-204). Present only while\n // the game is completed.\n nonScoringRosterPlayerIds: z.array(gameRosterPlayerIdSchema).optional(),\n // Set while a multi-page stats operation holds the game; every other writer of its stats, roster,\n // absence, memos, teams, or existence refuses it until the operation clears it.\n statsOperationId: statsOperationIdSchema.optional(),\n finalizedAt: epochMsSchema.optional(),\n // When reopen last opened the finalized game again; set by reopen and never cleared. Its roster is\n // then the record of who played it, so a membership change no longer reaches it — only a scorer\n // adding a ghost to this game does.\n reopenedAt: epochMsSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n};\n\n// The rollup holds a line for each of the game's teams and no other, the score mirror names the same\n// teams, and every player line is keyed to one of them.\nfunction rollupMatchesTeams(game: {\n teamIds: string[];\n score: Record<string, number>;\n stats: { teamStats: Record<string, unknown>; playerStats: Record<string, unknown> };\n}): boolean {\n const teams = new Set(game.teamIds);\n const namesEveryTeam = (keys: string[]) => keys.length === teams.size && keys.every((key) => teams.has(key));\n return (\n namesEveryTeam(Object.keys(game.stats.teamStats)) &&\n namesEveryTeam(Object.keys(game.score)) &&\n Object.keys(game.stats.playerStats).every((key) => teams.has(parseGameRosterPlayerId(key)?.teamId ?? ''))\n );\n}\nconst ROLLUP_MISMATCH = \"The stats rollup and score mirror hold exactly the game's teams.\";\n\nexport const BasketballGameSchema = z\n .object({\n ...sportGameBase,\n leagueType: z.literal('Basketball' satisfies LeagueType),\n stats: SPORT_GAME_STATS_SCHEMAS.Basketball,\n // Which team holds the possession arrow.\n jumpBallTeamId: teamIdSchema.optional(),\n })\n .refine(rollupMatchesTeams, ROLLUP_MISMATCH);\nexport type BasketballGame = z.infer<typeof BasketballGameSchema>;\n\nexport const CurlingGameSchema = z\n .object({\n ...sportGameBase,\n leagueType: z.literal('Curling' satisfies LeagueType),\n stats: SPORT_GAME_STATS_SCHEMAS.Curling,\n })\n .refine(rollupMatchesTeams, ROLLUP_MISMATCH);\nexport type CurlingGame = z.infer<typeof CurlingGameSchema>;\n\nexport const FootballGameSchema = z\n .object({\n ...sportGameBase,\n leagueType: z.literal('Football' satisfies LeagueType),\n stats: SPORT_GAME_STATS_SCHEMAS.Football,\n })\n .refine(rollupMatchesTeams, ROLLUP_MISMATCH);\nexport type FootballGame = z.infer<typeof FootballGameSchema>;\n\nexport const SportGameSchema = z.discriminatedUnion('leagueType', [\n BasketballGameSchema,\n CurlingGameSchema,\n FootballGameSchema,\n]);\nexport type SportGame = z.infer<typeof SportGameSchema>;\n\n// `sportGames/{gameId}/gameRosterPlayers/{teamId}_{userId}` — one entry per team per person, the id\n// from `buildGameRosterPlayerId`. The roster is the participation authority finalize iterates.\nexport const GameRosterPlayerSchema = z.object({\n userId: userIdSchema,\n teamId: teamIdSchema,\n isGhost: z.boolean(),\n syncedAt: epochMsSchema,\n});\nexport type GameRosterPlayer = z.infer<typeof GameRosterPlayerSchema>;\n"]}
1
+ {"version":3,"file":"sport-game.js","sourceRoot":"","sources":["../../src/doc-schemas/sport-game.ts"],"names":[],"mappings":"AAAA,oGAAoG;AACpG,0FAA0F;AAE1F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,sBAAsB,EACtB,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,iGAAiG;AACjG,mGAAmG;AACnG,qFAAqF;AACrF,MAAM,CAAC,MAAM,wBAAwB,GA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AAY;IACpB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,QAAQ,EAAE,aAAa;CACxB,CAAC,CAAC","sourcesContent":["// `sportGames/{gameId}` — one scheduled or played game — and its `gameRosterPlayers` subcollection.\n// The game is discriminated on `leagueType`, which selects its `stats` shape (SPORT-002).\n\nimport { z } from 'zod';\nimport { parseGameRosterPlayerId } from '../ids/compound-ids.js';\nimport type { LeagueType } from '../types/sports.js';\nimport { SPORT_LINE_SCHEMAS } from './aggregate-stats.js';\nimport { gameStatsSchema } from './game-stats.js';\nimport {\n calendarDateSchema,\n countSchema,\n epochMsSchema,\n gameRosterPlayerIdSchema,\n gameStatusSchema,\n leagueIdSchema,\n scheduleWeekIdSchema,\n statsOperationIdSchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\nimport { gameLocationIdSchema } from './game-location.js';\n\n// Each sport's game `stats`: the two-key payload (SPORT-001) over that sport's game lines, taken\n// from `SPORT_LINE_SCHEMAS` — the one pairing of a sport with its lines. Spelled per sport so each\n// payload keeps its exact type; `satisfies` fails the build when a sport is missing.\nexport const SPORT_GAME_STATS_SCHEMAS = {\n Basketball: gameStatsSchema(\n SPORT_LINE_SCHEMAS.Basketball.gameTeam,\n SPORT_LINE_SCHEMAS.Basketball.gamePlayer,\n ),\n Curling: gameStatsSchema(\n SPORT_LINE_SCHEMAS.Curling.gameTeam,\n SPORT_LINE_SCHEMAS.Curling.gamePlayer,\n ),\n Football: gameStatsSchema(\n SPORT_LINE_SCHEMAS.Football.gameTeam,\n SPORT_LINE_SCHEMAS.Football.gamePlayer,\n ),\n} as const satisfies Record<LeagueType, z.ZodType>;\n\nexport type BasketballGameStats = z.infer<typeof SPORT_GAME_STATS_SCHEMAS.Basketball>;\nexport type CurlingGameStats = z.infer<typeof SPORT_GAME_STATS_SCHEMAS.Curling>;\nexport type FootballGameStats = z.infer<typeof SPORT_GAME_STATS_SCHEMAS.Football>;\n\n// Which sport's payload a game holds is decided by its `leagueType`, never by the payload's shape\n// (SPORT-002).\nexport type GameStats = z.infer<(typeof SPORT_GAME_STATS_SCHEMAS)[LeagueType]>;\n\n// One of a game's two team slots. `teamId` is a leagueTeams id, or BYE_TEAM_ID for a bye week.\nexport const GameTeamSchema = z.object({\n teamId: teamIdSchema,\n});\nexport type GameTeam = z.infer<typeof GameTeamSchema>;\n\nconst sportGameBase = {\n leagueId: leagueIdSchema,\n // The week this game belongs to; weekly schedules are reconstructed by grouping on `weekId`.\n weekId: scheduleWeekIdSchema,\n weekTitle: z.string(),\n weekLocation: z.string(),\n weekStartDate: epochMsSchema,\n startTime: epochMsSchema,\n // The game's local calendar date in LEAGUE_TIME_ZONE.\n dayKey: calendarDateSchema,\n // The venue as shown, e.g. \"Main Gym - Court 2\". Free text; `gameLocationId` is the reference.\n locationLabel: z.string(),\n gameLocationId: gameLocationIdSchema.optional(),\n subLocation: z.string().optional(),\n status: gameStatusSchema,\n // Positional: teams[0] is team one, teams[1] is team two.\n teams: z.tuple([GameTeamSchema, GameTeamSchema]),\n // The real (non-bye) team ids, for `array-contains` queries.\n teamIds: z.array(teamIdSchema).min(1).max(2),\n // Each team's score, mirrored from its `stats.teamStats` line by the same write that changes it\n // (SPORT-107), so a schedule or list reads a score without the stats.\n score: z.record(teamIdSchema, countSchema),\n // The number of this game's stat event documents, which is also the last `sequence` assigned.\n statEventSequence: countSchema,\n // A scorer's note per person, keyed by userId (real or ghost).\n memos: z.record(z.string(), z.string()).optional(),\n // Absence is per roster entry: a person on both teams can be absent on one side only.\n absentRosterPlayerIds: z.array(gameRosterPlayerIdSchema),\n // The roster entries finalize credited no game played — the adapter's decision, stored so every\n // later path reverses what was applied rather than deciding again (SPORT-204). Present only while\n // the game is completed.\n nonScoringRosterPlayerIds: z.array(gameRosterPlayerIdSchema).optional(),\n // Set while a multi-page stats operation holds the game; every other writer of its stats, roster,\n // absence, memos, teams, or existence refuses it until the operation clears it.\n statsOperationId: statsOperationIdSchema.optional(),\n finalizedAt: epochMsSchema.optional(),\n // When reopen last opened the finalized game again; set by reopen and never cleared. Its roster is\n // then the record of who played it, so a membership change no longer reaches it — only a scorer\n // adding a ghost to this game does.\n reopenedAt: epochMsSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n};\n\n// The rollup holds a line for each of the game's teams and no other, the score mirror names the same\n// teams, and every player line is keyed to one of them.\nfunction rollupMatchesTeams(game: {\n teamIds: string[];\n score: Record<string, number>;\n stats: { teamStats: Record<string, unknown>; playerStats: Record<string, unknown> };\n}): boolean {\n const teams = new Set(game.teamIds);\n const namesEveryTeam = (keys: string[]) =>\n keys.length === teams.size && keys.every((key) => teams.has(key));\n return (\n namesEveryTeam(Object.keys(game.stats.teamStats)) &&\n namesEveryTeam(Object.keys(game.score)) &&\n Object.keys(game.stats.playerStats).every((key) =>\n teams.has(parseGameRosterPlayerId(key)?.teamId ?? ''),\n )\n );\n}\nconst ROLLUP_MISMATCH = \"The stats rollup and score mirror hold exactly the game's teams.\";\n\nexport const BasketballGameSchema = z\n .object({\n ...sportGameBase,\n leagueType: z.literal('Basketball' satisfies LeagueType),\n stats: SPORT_GAME_STATS_SCHEMAS.Basketball,\n // Which team holds the possession arrow.\n jumpBallTeamId: teamIdSchema.optional(),\n })\n .refine(rollupMatchesTeams, ROLLUP_MISMATCH);\nexport type BasketballGame = z.infer<typeof BasketballGameSchema>;\n\nexport const CurlingGameSchema = z\n .object({\n ...sportGameBase,\n leagueType: z.literal('Curling' satisfies LeagueType),\n stats: SPORT_GAME_STATS_SCHEMAS.Curling,\n })\n .refine(rollupMatchesTeams, ROLLUP_MISMATCH);\nexport type CurlingGame = z.infer<typeof CurlingGameSchema>;\n\nexport const FootballGameSchema = z\n .object({\n ...sportGameBase,\n leagueType: z.literal('Football' satisfies LeagueType),\n stats: SPORT_GAME_STATS_SCHEMAS.Football,\n })\n .refine(rollupMatchesTeams, ROLLUP_MISMATCH);\nexport type FootballGame = z.infer<typeof FootballGameSchema>;\n\nexport const SportGameSchema = z.discriminatedUnion('leagueType', [\n BasketballGameSchema,\n CurlingGameSchema,\n FootballGameSchema,\n]);\nexport type SportGame = z.infer<typeof SportGameSchema>;\n\n// `sportGames/{gameId}/gameRosterPlayers/{teamId}_{userId}` — one entry per team per person, the id\n// from `buildGameRosterPlayerId`. The roster is the participation authority finalize iterates.\nexport const GameRosterPlayerSchema = z.object({\n userId: userIdSchema,\n teamId: teamIdSchema,\n isGhost: z.boolean(),\n syncedAt: epochMsSchema,\n});\nexport type GameRosterPlayer = z.infer<typeof GameRosterPlayerSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sport-league.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/sport-league.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,iCAAiC,4CAA4C,CAAC;AAC3F,eAAO,MAAM,mCAAmC,2FAC0C,CAAC;AAE3F;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE;IACrD,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC,GAAG,OAAO,CAEV;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,CAAC,SAAS;IACR,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC,EACD,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAOhD;AAGD,eAAO,MAAM,wBAAwB,aAAc,CAAC;AAEpD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCM,CAAC;AACrC,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
1
+ {"version":3,"file":"sport-league.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/sport-league.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,iCAAiC,4CAA4C,CAAC;AAC3F,eAAO,MAAM,mCAAmC,2FAC0C,CAAC;AAE3F;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,MAAM,EAAE;IACrD,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC,GAAG,OAAO,CAEV;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,CAAC,SAAS;IACR,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvC,EACD,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAehD;AAGD,eAAO,MAAM,wBAAwB,aAAc,CAAC;AAEpD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCM,CAAC;AACrC,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
@@ -22,10 +22,18 @@ export function hasConsistentWaiverRequirement(league) {
22
22
  */
23
23
  export function refineLeagueSettings(league, ctx) {
24
24
  if (league.leagueEndDate < league.leagueStartDate) {
25
- ctx.addIssue({ code: 'custom', path: ['leagueEndDate'], message: LEAGUE_DATES_OUT_OF_ORDER_MESSAGE });
25
+ ctx.addIssue({
26
+ code: 'custom',
27
+ path: ['leagueEndDate'],
28
+ message: LEAGUE_DATES_OUT_OF_ORDER_MESSAGE,
29
+ });
26
30
  }
27
31
  if (!hasConsistentWaiverRequirement(league)) {
28
- ctx.addIssue({ code: 'custom', path: ['waiverTemplateId'], message: WAIVER_REQUIREMENT_MISMATCH_MESSAGE });
32
+ ctx.addIssue({
33
+ code: 'custom',
34
+ path: ['waiverTemplateId'],
35
+ message: WAIVER_REQUIREMENT_MISMATCH_MESSAGE,
36
+ });
29
37
  }
30
38
  }
31
39
  // How many teams reach the playoffs is a count; the callable inputs bound it with `MAX_PLAYOFF_CUTOFF`.
@@ -1 +1 @@
1
- {"version":3,"file":"sport-league.js","sourceRoot":"","sources":["../../src/doc-schemas/sport-league.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,iGAAiG;AACjG,gGAAgG;AAChG,0BAA0B;AAE1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,CAAC,MAAM,iCAAiC,GAAG,yCAAyC,CAAC;AAC3F,MAAM,CAAC,MAAM,mCAAmC,GAC9C,wFAAwF,CAAC;AAE3F;;;GAGG;AACH,MAAM,UAAU,8BAA8B,CAAC,MAG9C;IACC,OAAO,MAAM,CAAC,cAAc,KAAK,CAAC,MAAM,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC;AAC3E,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAOlC,MAAS,EAAE,GAA6B;IACxC,IAAI,MAAM,CAAC,aAAa,GAAG,MAAM,CAAC,eAAe,EAAE,CAAC;QAClD,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,iCAAiC,EAAE,CAAC,CAAC;IACxG,CAAC;IACD,IAAI,CAAC,8BAA8B,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5C,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,kBAAkB,CAAC,EAAE,OAAO,EAAE,mCAAmC,EAAE,CAAC,CAAC;IAC7G,CAAC;AACH,CAAC;AAED,wGAAwG;AACxG,MAAM,CAAC,MAAM,wBAAwB,GAAG,WAAW,CAAC;AAEpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,CAAC;IACN,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,UAAU,EAAE,gBAAgB;IAC5B,UAAU,EAAE,gBAAgB;IAC5B,eAAe,EAAE,kBAAkB;IACnC,aAAa,EAAE,kBAAkB;IACjC,MAAM,EAAE,kBAAkB;IAC1B,8FAA8F;IAC9F,gGAAgG;IAChG,qCAAqC;IACrC,aAAa,EAAE,wBAAwB;IACvC,iBAAiB,EAAE,wBAAwB;IAC3C,gBAAgB,EAAE,wBAAwB;IAC1C,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE;IAC3B,gBAAgB,EAAE,sBAAsB,CAAC,QAAQ,EAAE;IACnD,2FAA2F;IAC3F,gEAAgE;IAChE,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IACzC,0FAA0F;IAC1F,8EAA8E;IAC9E,mGAAmG;IACnG,yFAAyF;IACzF,YAAY,EAAE,WAAW,CAAC,QAAQ,EAAE;IACpC,6FAA6F;IAC7F,iGAAiG;IACjG,4CAA4C;IAC5C,YAAY,EAAE,WAAW,CAAC,QAAQ,EAAE;IACpC,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,WAAW,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["// `sportLeagues/{leagueId}` — one league: its sport, mode, dates, status, playoff cutoffs, and waiver\n// requirement. The admin league callables write its settings, status, and mode; the picture core\n// writes `pictures`. Teams, games, and player stats live in their own collections and are never\n// copied onto the league.\n\nimport { z } from 'zod';\nimport {\n calendarDateSchema,\n countSchema,\n epochMsSchema,\n leagueModeSchema,\n leagueStatusSchema,\n leagueTypeSchema,\n} from './atoms.js';\nimport { GallerySummarySchema } from './gallery.js';\nimport { waiverTemplateIdSchema } from './waiver-template.js';\n\nexport const LEAGUE_DATES_OUT_OF_ORDER_MESSAGE = 'The league cannot end before it starts.';\nexport const WAIVER_REQUIREMENT_MISMATCH_MESSAGE =\n 'Choose a waiver template when the league requires a waiver, and none when it does not.';\n\n/**\n * A league names a waiver template exactly when it requires a waiver, so no reader needs a\n * sentinel for \"no waiver\" and no stale template id survives turning the requirement off.\n */\nexport function hasConsistentWaiverRequirement(league: {\n requiresWaiver: boolean;\n waiverTemplateId?: string | undefined;\n}): boolean {\n return league.requiresWaiver === (league.waiverTemplateId !== undefined);\n}\n\n/**\n * The cross-field rules every league settings shape obeys — the stored document and both callable\n * inputs — so the rule a form shows, the callable enforces, and the copy action validates is one\n * rule.\n */\nexport function refineLeagueSettings<\n T extends {\n leagueStartDate: string;\n leagueEndDate: string;\n requiresWaiver: boolean;\n waiverTemplateId?: string | undefined;\n },\n>(league: T, ctx: z.core.$RefinementCtx<T>): void {\n if (league.leagueEndDate < league.leagueStartDate) {\n ctx.addIssue({ code: 'custom', path: ['leagueEndDate'], message: LEAGUE_DATES_OUT_OF_ORDER_MESSAGE });\n }\n if (!hasConsistentWaiverRequirement(league)) {\n ctx.addIssue({ code: 'custom', path: ['waiverTemplateId'], message: WAIVER_REQUIREMENT_MISMATCH_MESSAGE });\n }\n}\n\n// How many teams reach the playoffs is a count; the callable inputs bound it with `MAX_PLAYOFF_CUTOFF`.\nexport const playoffCutoffCountSchema = countSchema;\n\nexport const SportLeagueSchema = z\n .object({\n leagueTitle: z.string(),\n description: z.string(),\n leagueType: leagueTypeSchema,\n leagueMode: leagueModeSchema,\n leagueStartDate: calendarDateSchema,\n leagueEndDate: calendarDateSchema,\n status: leagueStatusSchema,\n // How many teams reach the playoffs: `playoffCutoff` in a Regular league, the Competitive and\n // Recreational pools' own cutoffs in a Competitive/Recreational one. All three are kept in both\n // modes so a mode switch loses none.\n playoffCutoff: playoffCutoffCountSchema,\n playoffCutoffComp: playoffCutoffCountSchema,\n playoffCutoffRec: playoffCutoffCountSchema,\n requiresWaiver: z.boolean(),\n waiverTemplateId: waiverTemplateIdSchema.optional(),\n // The league's picture gallery summary — absent is an empty gallery. Only the picture core\n // writes it; the league callables and the copy action never do.\n pictures: GallerySummarySchema.optional(),\n // Advanced by every team created in the league; absent until the first. Only its changing\n // matters: team creation counts the league's teams in its transaction against\n // MAX_TEAMS_PER_LEAGUE, and a query does not lock against an insert — so each creation writes this\n // document, and two creations at the cap conflict instead of both passing (BACKEND-116).\n teamRevision: countSchema.optional(),\n // Advanced by every game created in the league, a schedule week's included; absent until the\n // first. Only its changing matters, the same way: game creation counts the league's games in its\n // transaction against MAX_GAMES_PER_LEAGUE.\n gameRevision: countSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n })\n .superRefine(refineLeagueSettings);\nexport type SportLeague = z.infer<typeof SportLeagueSchema>;\n"]}
1
+ {"version":3,"file":"sport-league.js","sourceRoot":"","sources":["../../src/doc-schemas/sport-league.ts"],"names":[],"mappings":"AAAA,sGAAsG;AACtG,iGAAiG;AACjG,gGAAgG;AAChG,0BAA0B;AAE1B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,MAAM,CAAC,MAAM,iCAAiC,GAAG,yCAAyC,CAAC;AAC3F,MAA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AAE,sBAAsB,CAAC,QAAQ,EAAE;IACnD,2FAA2F;IAC3F,gEAAgE;IAChE,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE;IACzC,0FAA0F;IAC1F,8EAA8E;IAC9E,mGAAmG;IACnG,yFAAyF;IACzF,YAAY,EAAE,WAAW,CAAC,QAAQ,EAAE;IACpC,6FAA6F;IAC7F,iGAAiG;IACjG,4CAA4C;IAC5C,YAAY,EAAE,WAAW,CAAC,QAAQ,EAAE;IACpC,SAAS,EAAE,aAAa;IACxB,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,WAAW,CAAC,oBAAoB,CAAC,CAAC","sourcesContent":["// `sportLeagues/{leagueId}` — one league: its sport, mode, dates, status, playoff cutoffs, and waiver\n// requirement. The admin league callables write its settings, status, and mode; the picture core\n// writes `pictures`. Teams, games, and player stats live in their own collections and are never\n// copied onto the league.\n\nimport { z } from 'zod';\nimport {\n calendarDateSchema,\n countSchema,\n epochMsSchema,\n leagueModeSchema,\n leagueStatusSchema,\n leagueTypeSchema,\n} from './atoms.js';\nimport { GallerySummarySchema } from './gallery.js';\nimport { waiverTemplateIdSchema } from './waiver-template.js';\n\nexport const LEAGUE_DATES_OUT_OF_ORDER_MESSAGE = 'The league cannot end before it starts.';\nexport const WAIVER_REQUIREMENT_MISMATCH_MESSAGE =\n 'Choose a waiver template when the league requires a waiver, and none when it does not.';\n\n/**\n * A league names a waiver template exactly when it requires a waiver, so no reader needs a\n * sentinel for \"no waiver\" and no stale template id survives turning the requirement off.\n */\nexport function hasConsistentWaiverRequirement(league: {\n requiresWaiver: boolean;\n waiverTemplateId?: string | undefined;\n}): boolean {\n return league.requiresWaiver === (league.waiverTemplateId !== undefined);\n}\n\n/**\n * The cross-field rules every league settings shape obeys — the stored document and both callable\n * inputs — so the rule a form shows, the callable enforces, and the copy action validates is one\n * rule.\n */\nexport function refineLeagueSettings<\n T extends {\n leagueStartDate: string;\n leagueEndDate: string;\n requiresWaiver: boolean;\n waiverTemplateId?: string | undefined;\n },\n>(league: T, ctx: z.core.$RefinementCtx<T>): void {\n if (league.leagueEndDate < league.leagueStartDate) {\n ctx.addIssue({\n code: 'custom',\n path: ['leagueEndDate'],\n message: LEAGUE_DATES_OUT_OF_ORDER_MESSAGE,\n });\n }\n if (!hasConsistentWaiverRequirement(league)) {\n ctx.addIssue({\n code: 'custom',\n path: ['waiverTemplateId'],\n message: WAIVER_REQUIREMENT_MISMATCH_MESSAGE,\n });\n }\n}\n\n// How many teams reach the playoffs is a count; the callable inputs bound it with `MAX_PLAYOFF_CUTOFF`.\nexport const playoffCutoffCountSchema = countSchema;\n\nexport const SportLeagueSchema = z\n .object({\n leagueTitle: z.string(),\n description: z.string(),\n leagueType: leagueTypeSchema,\n leagueMode: leagueModeSchema,\n leagueStartDate: calendarDateSchema,\n leagueEndDate: calendarDateSchema,\n status: leagueStatusSchema,\n // How many teams reach the playoffs: `playoffCutoff` in a Regular league, the Competitive and\n // Recreational pools' own cutoffs in a Competitive/Recreational one. All three are kept in both\n // modes so a mode switch loses none.\n playoffCutoff: playoffCutoffCountSchema,\n playoffCutoffComp: playoffCutoffCountSchema,\n playoffCutoffRec: playoffCutoffCountSchema,\n requiresWaiver: z.boolean(),\n waiverTemplateId: waiverTemplateIdSchema.optional(),\n // The league's picture gallery summary — absent is an empty gallery. Only the picture core\n // writes it; the league callables and the copy action never do.\n pictures: GallerySummarySchema.optional(),\n // Advanced by every team created in the league; absent until the first. Only its changing\n // matters: team creation counts the league's teams in its transaction against\n // MAX_TEAMS_PER_LEAGUE, and a query does not lock against an insert — so each creation writes this\n // document, and two creations at the cap conflict instead of both passing (BACKEND-116).\n teamRevision: countSchema.optional(),\n // Advanced by every game created in the league, a schedule week's included; absent until the\n // first. Only its changing matters, the same way: game creation counts the league's games in its\n // transaction against MAX_GAMES_PER_LEAGUE.\n gameRevision: countSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n })\n .superRefine(refineLeagueSettings);\nexport type SportLeague = z.infer<typeof SportLeagueSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"status-reconcile-queue.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/status-reconcile-queue.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB;;;;GAIG;AACH,eAAO,MAAM,4CAA4C;;;;;;;;;;;kBAMvD,CAAC;AACH,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4CAA4C,CAAC,CAAC;AAElH,sEAAsE;AACtE,eAAO,MAAM,yCAAyC;;;;;;kBAIpD,CAAC;AACH,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yCAAyC,CAAC,CAAC;AAE5G,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;kCAG1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
1
+ {"version":3,"file":"status-reconcile-queue.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/status-reconcile-queue.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAUxB;;;;GAIG;AACH,eAAO,MAAM,4CAA4C;;;;;;;;;;;kBAMvD,CAAC;AACH,MAAM,MAAM,sCAAsC,GAAG,CAAC,CAAC,KAAK,CAC1D,OAAO,4CAA4C,CACpD,CAAC;AAEF,sEAAsE;AACtE,eAAO,MAAM,yCAAyC;;;;;;kBAIpD,CAAC;AACH,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,yCAAyC,CACjD,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;kCAG1C,CAAC;AACH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"status-reconcile-queue.js","sourceRoot":"","sources":["../../src/doc-schemas/status-reconcile-queue.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,sGAAsG;AACtG,oGAAoG;AACpG,qGAAqG;AACrG,mGAAmG;AACnG,iGAAiG;AACjG,qDAAqD;AAErD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnG,MAAM,6BAA6B,GAAG;IACpC,UAAU,EAAE,aAAa;IACzB,aAAa,EAAE,aAAa,CAAC,QAAQ,EAAE;IACvC,YAAY,EAAE,WAAW;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,4CAA4C,GAAG,CAAC,CAAC,YAAY,CAAC;IACzE,GAAG,6BAA6B;IAChC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC;IACjD,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;IACxC,YAAY,EAAE,gBAAgB;IAC9B,OAAO,EAAE,uBAAuB;CACjC,CAAC,CAAC;AAGH,sEAAsE;AACtE,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,YAAY,CAAC;IACtE,GAAG,6BAA6B;IAChC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAAC;CAChD,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,kBAAkB,CAAC,YAAY,EAAE;IAChF,4CAA4C;IAC5C,yCAAyC;CAC1C,CAAC,CAAC","sourcesContent":["// `statusReconcileQueue/{userId}` — the backend-only retry queue for an account's post-commit\n// Firebase Auth effects (QUALITY-104, BACKEND-302). One entry per account, id = the userId, whichever\n// effect queued it. A status change writes its entry in the status transaction itself; a role-claim\n// entry is written when a roster change committed but its claim write failed. The drain re-converges\n// every Auth-side mirror of the account from its canonical documents and deletes the entry once it\n// has, so the entry names why the account was queued, never what to apply. Only the retry ledger\n// (`attemptCount`, `lastAttemptAt`) is written back.\n\nimport { z } from 'zod';\nimport { ACCOUNT_STATUS_AUTH_EFFECT, ROLE_CLAIMS_EFFECT } from '../types/unions.js';\nimport { countSchema, documentIdSegmentSchema, epochMsSchema, userStatusSchema } from './atoms.js';\n\nconst statusReconcileQueueEntryBase = {\n enqueuedAt: epochMsSchema,\n lastAttemptAt: epochMsSchema.optional(),\n attemptCount: countSchema,\n};\n\n/**\n * A status change's Auth effect, owed until it lands. `writeId` names the status change that wrote\n * it: a removal compares it, so finishing an older change never removes the entry a newer change\n * wrote. The drain converges the account on its canonical status, never on `targetStatus`.\n */\nexport const StatusReconcileQueueAccountStatusEntrySchema = z.strictObject({\n ...statusReconcileQueueEntryBase,\n authEffect: z.literal(ACCOUNT_STATUS_AUTH_EFFECT),\n reason: z.literal('statusChangePending'),\n targetStatus: userStatusSchema,\n writeId: documentIdSegmentSchema,\n});\nexport type StatusReconcileQueueAccountStatusEntry = z.infer<typeof StatusReconcileQueueAccountStatusEntrySchema>;\n\n/** A failed `admin` / `referee` claim write. It carries no status. */\nexport const StatusReconcileQueueRoleClaimsEntrySchema = z.strictObject({\n ...statusReconcileQueueEntryBase,\n authEffect: z.literal(ROLE_CLAIMS_EFFECT),\n reason: z.literal('postCommitAuthEffectFailed'),\n});\nexport type StatusReconcileQueueRoleClaimsEntry = z.infer<typeof StatusReconcileQueueRoleClaimsEntrySchema>;\n\nexport const StatusReconcileQueueEntrySchema = z.discriminatedUnion('authEffect', [\n StatusReconcileQueueAccountStatusEntrySchema,\n StatusReconcileQueueRoleClaimsEntrySchema,\n]);\nexport type StatusReconcileQueueEntry = z.infer<typeof StatusReconcileQueueEntrySchema>;\n"]}
1
+ {"version":3,"file":"status-reconcile-queue.js","sourceRoot":"","sources":["../../src/doc-schemas/status-reconcile-queue.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,sGAAsG;AACtG,oGAAoG;AACpG,qGAAqG;AACrG,mGAAmG;AACnG,iGAAiG;AACjG,qDAAqD;AAErD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnG,MAAM,6BAA6B,GAAG;IACpC,UAAU,EAAE,aAAa;IACzB,aAAa,EAAE,aAAa,CAAC,QAAQ,EAAE;IACvC,YAAY,EAAE,WAAW;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,4CAA4C,GAAG,CAAC,CAAC,YAAY,CAAC;IACzE,GAAG,6BAA6B;IAChC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,0BAA0B,CAAC;IACjD,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;IACxC,YAAY,EAAE,gBAAgB;IAC9B,OAAO,EAAE,uBAAuB;CACjC,CAAC,CAAC;AAKH,sEAAsE;AACtE,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,CAAC,YAAY,CAAC;IACtE,GAAG,6BAA6B;IAChC,UAAU,EAAE,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC;IACzC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,4BAA4B,CAAC;CAChD,CAAC,CAAC;AAKH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,CAAC,kBAAkB,CAAC,YAAY,EAAE;IAChF,4CAA4C;IAC5C,yCAAyC;CAC1C,CAAC,CAAC","sourcesContent":["// `statusReconcileQueue/{userId}` — the backend-only retry queue for an account's post-commit\n// Firebase Auth effects (QUALITY-104, BACKEND-302). One entry per account, id = the userId, whichever\n// effect queued it. A status change writes its entry in the status transaction itself; a role-claim\n// entry is written when a roster change committed but its claim write failed. The drain re-converges\n// every Auth-side mirror of the account from its canonical documents and deletes the entry once it\n// has, so the entry names why the account was queued, never what to apply. Only the retry ledger\n// (`attemptCount`, `lastAttemptAt`) is written back.\n\nimport { z } from 'zod';\nimport { ACCOUNT_STATUS_AUTH_EFFECT, ROLE_CLAIMS_EFFECT } from '../types/unions.js';\nimport { countSchema, documentIdSegmentSchema, epochMsSchema, userStatusSchema } from './atoms.js';\n\nconst statusReconcileQueueEntryBase = {\n enqueuedAt: epochMsSchema,\n lastAttemptAt: epochMsSchema.optional(),\n attemptCount: countSchema,\n};\n\n/**\n * A status change's Auth effect, owed until it lands. `writeId` names the status change that wrote\n * it: a removal compares it, so finishing an older change never removes the entry a newer change\n * wrote. The drain converges the account on its canonical status, never on `targetStatus`.\n */\nexport const StatusReconcileQueueAccountStatusEntrySchema = z.strictObject({\n ...statusReconcileQueueEntryBase,\n authEffect: z.literal(ACCOUNT_STATUS_AUTH_EFFECT),\n reason: z.literal('statusChangePending'),\n targetStatus: userStatusSchema,\n writeId: documentIdSegmentSchema,\n});\nexport type StatusReconcileQueueAccountStatusEntry = z.infer<\n typeof StatusReconcileQueueAccountStatusEntrySchema\n>;\n\n/** A failed `admin` / `referee` claim write. It carries no status. */\nexport const StatusReconcileQueueRoleClaimsEntrySchema = z.strictObject({\n ...statusReconcileQueueEntryBase,\n authEffect: z.literal(ROLE_CLAIMS_EFFECT),\n reason: z.literal('postCommitAuthEffectFailed'),\n});\nexport type StatusReconcileQueueRoleClaimsEntry = z.infer<\n typeof StatusReconcileQueueRoleClaimsEntrySchema\n>;\n\nexport const StatusReconcileQueueEntrySchema = z.discriminatedUnion('authEffect', [\n StatusReconcileQueueAccountStatusEntrySchema,\n StatusReconcileQueueRoleClaimsEntrySchema,\n]);\nexport type StatusReconcileQueueEntry = z.infer<typeof StatusReconcileQueueEntrySchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"sweep-state.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/sweep-state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,wBAAwB;;;;;;;;;6BAsBjC,CAAC;AACL,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAI1E,eAAO,MAAM,sBAAsB;;;;;kBASxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;iBAgBzB,CAAC;AACL,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
1
+ {"version":3,"file":"sweep-state.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/sweep-state.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,eAAO,MAAM,wBAAwB;;;;;;;;;6BA0BjC,CAAC;AACL,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAI1E,eAAO,MAAM,sBAAsB;;;;;kBASxB,CAAC;AACZ,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;iBAoBzB,CAAC;AACL,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -33,7 +33,11 @@ export const SweepRollingCursorSchema = z
33
33
  ])
34
34
  .superRefine((value, ctx) => {
35
35
  if (value.state === 'done' && value.lapCompletedAt < value.lapStartedAt) {
36
- ctx.addIssue({ code: 'custom', path: ['lapCompletedAt'], message: 'a lap completes no earlier than it started' });
36
+ ctx.addIssue({
37
+ code: 'custom',
38
+ path: ['lapCompletedAt'],
39
+ message: 'a lap completes no earlier than it started',
40
+ });
37
41
  }
38
42
  });
39
43
  // A row the cursor moved past without clearing it (a failed read or write). The pass retries it from
@@ -60,7 +64,11 @@ export const SweepStateSchema = z
60
64
  const seen = new Set();
61
65
  (value.deferred ?? []).forEach((row, index) => {
62
66
  if (seen.has(row.key)) {
63
- ctx.addIssue({ code: 'custom', path: ['deferred', index, 'key'], message: 'a row is deferred at most once' });
67
+ ctx.addIssue({
68
+ code: 'custom',
69
+ path: ['deferred', index, 'key'],
70
+ message: 'a row is deferred at most once',
71
+ });
64
72
  }
65
73
  seen.add(row.key);
66
74
  });
@@ -1 +1 @@
1
- {"version":3,"file":"sweep-state.js","sourceRoot":"","sources":["../../src/doc-schemas/sweep-state.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,mGAAmG;AACnG,gBAAgB;AAEhB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,qCAAqC;AACrC,wEAAwE;AACxE,gGAAgG;AAChG,8FAA8F;AAC9F,mGAAmG;AACnG,oGAAoG;AACpG,iGAAiG;AACjG,kGAAkG;AAClG,+EAA+E;AAC/E,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC;KACtC,kBAAkB,CAAC,OAAO,EAAE;IAC3B,CAAC;SACE,MAAM,CAAC;QACN,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;QACzB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QAC3B,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACjC,YAAY,E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S,EAAE,aAAa;CACzB,CAAC;KACD,WAAW,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC1B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC5C,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,GAAG,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,gCAAgC,EAAE,CAAC,CAAC;QAChH,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// `sweepState/{sweepName}` — where a scheduled pass over a bounded, ordered source keeps its\n// position (BACKEND-112), one document per `SWEEP_STATE_NAMES` name. Backend-only: no client reads\n// or writes it.\n\nimport { z } from 'zod';\nimport { SWEEP_STATE_MAX_DEFERRED } from '../constants/scheduled-jobs.js';\nimport { epochMsSchema } from './atoms.js';\n\n// Where a pass stands in its source.\n// absent — no lap has run: the next pass starts one at the beginning.\n// inLap — the next page starts strictly after the last row the lap moved past. `afterKey` is\n// that row's document id; `afterValue` is its value of the numeric field the query\n// orders by first, when it orders by one. The query orders by the field and then by the\n// key and resumes after both, never `field > value`, which skips every row tied with it.\n// done — the last lap reached the end of its source. The pass that exhausted it records that\n// here rather than starting page one again in the same run; the next pass starts a new\n// lap, so rows added behind the cursor are reached on the next lap.\nexport const SweepRollingCursorSchema = z\n .discriminatedUnion('state', [\n z\n .object({\n state: z.literal('inLap'),\n afterKey: z.string().min(1),\n afterValue: z.number().optional(),\n lapStartedAt: epochMsSchema,\n })\n .strict(),\n z\n .object({\n state: z.literal('done'),\n lapStartedAt: epochMsSchema,\n lapCompletedAt: epochMsSchema,\n })\n .strict(),\n ])\n .superRefine((value, ctx) => {\n if (value.state === 'done' && value.lapCompletedAt < value.lapStartedAt) {\n ctx.addIssue({ code: 'custom', path: ['lapCompletedAt'], message: 'a lap completes no earlier than it started' });\n }\n });\nexport type SweepRollingCursor = z.infer<typeof SweepRollingCursorSchema>;\n\n// A row the cursor moved past without clearing it (a failed read or write). The pass retries it from\n// here once it is due instead of stopping at it, so one failing row never pins the window (BACKEND-309).\nexport const SweepDeferredRowSchema = z\n .object({\n key: z.string().min(1),\n value: z.number().optional(),\n /** Epoch ms from which a pass may retry it. */\n nextAttemptAt: epochMsSchema,\n /** Passes that examined it without clearing it; the pass that deferred it is the first. */\n attemptCount: z.number().int().positive(),\n })\n .strict();\nexport type SweepDeferredRow = z.infer<typeof SweepDeferredRowSchema>;\n\nexport const SweepStateSchema = z\n .object({\n /** Wall-clock ms the last full sign-in account scan ran (absent = never). */\n fullScanLastRunAt: epochMsSchema.optional(),\n rollingCursor: SweepRollingCursorSchema.optional(),\n deferred: z.array(SweepDeferredRowSchema).max(SWEEP_STATE_MAX_DEFERRED).optional(),\n updatedAt: epochMsSchema,\n })\n .superRefine((value, ctx) => {\n const seen = new Set<string>();\n (value.deferred ?? []).forEach((row, index) => {\n if (seen.has(row.key)) {\n ctx.addIssue({ code: 'custom', path: ['deferred', index, 'key'], message: 'a row is deferred at most once' });\n }\n seen.add(row.key);\n });\n });\nexport type SweepState = z.infer<typeof SweepStateSchema>;\n"]}
1
+ {"version":3,"file":"sweep-state.js","sourceRoot":"","sources":["../../src/doc-schemas/sweep-state.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,mGAAmG;AACnG,gBAAgB;AAEhB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAA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aAAa,EAAE,aAAa;IAC5B,2FAA2F;IAC3F,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;CAC1C,CAAC;KACD,MAAM,EAAE,CAAC;AAGZ,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,6EAA6E;IAC7E,iBAAiB,EAAE,aAAa,CAAC,QAAQ,EAAE;IAC3C,aAAa,EAAE,wBAAwB,CAAC,QAAQ,EAAE;IAClD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC,QAAQ,EAAE;IAClF,SAAS,EAAE,aAAa;CACzB,CAAC;KACD,WAAW,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAC1B,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QAC5C,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACtB,GAAG,CAAC,QAAQ,CAAC;gBACX,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,CAAC,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC;gBAChC,OAAO,EAAE,gCAAgC;aAC1C,CAAC,CAAC;QACL,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["// `sweepState/{sweepName}` — where a scheduled pass over a bounded, ordered source keeps its\n// position (BACKEND-112), one document per `SWEEP_STATE_NAMES` name. Backend-only: no client reads\n// or writes it.\n\nimport { z } from 'zod';\nimport { SWEEP_STATE_MAX_DEFERRED } from '../constants/scheduled-jobs.js';\nimport { epochMsSchema } from './atoms.js';\n\n// Where a pass stands in its source.\n// absent — no lap has run: the next pass starts one at the beginning.\n// inLap — the next page starts strictly after the last row the lap moved past. `afterKey` is\n// that row's document id; `afterValue` is its value of the numeric field the query\n// orders by first, when it orders by one. The query orders by the field and then by the\n// key and resumes after both, never `field > value`, which skips every row tied with it.\n// done — the last lap reached the end of its source. The pass that exhausted it records that\n// here rather than starting page one again in the same run; the next pass starts a new\n// lap, so rows added behind the cursor are reached on the next lap.\nexport const SweepRollingCursorSchema = z\n .discriminatedUnion('state', [\n z\n .object({\n state: z.literal('inLap'),\n afterKey: z.string().min(1),\n afterValue: z.number().optional(),\n lapStartedAt: epochMsSchema,\n })\n .strict(),\n z\n .object({\n state: z.literal('done'),\n lapStartedAt: epochMsSchema,\n lapCompletedAt: epochMsSchema,\n })\n .strict(),\n ])\n .superRefine((value, ctx) => {\n if (value.state === 'done' && value.lapCompletedAt < value.lapStartedAt) {\n ctx.addIssue({\n code: 'custom',\n path: ['lapCompletedAt'],\n message: 'a lap completes no earlier than it started',\n });\n }\n });\nexport type SweepRollingCursor = z.infer<typeof SweepRollingCursorSchema>;\n\n// A row the cursor moved past without clearing it (a failed read or write). The pass retries it from\n// here once it is due instead of stopping at it, so one failing row never pins the window (BACKEND-309).\nexport const SweepDeferredRowSchema = z\n .object({\n key: z.string().min(1),\n value: z.number().optional(),\n /** Epoch ms from which a pass may retry it. */\n nextAttemptAt: epochMsSchema,\n /** Passes that examined it without clearing it; the pass that deferred it is the first. */\n attemptCount: z.number().int().positive(),\n })\n .strict();\nexport type SweepDeferredRow = z.infer<typeof SweepDeferredRowSchema>;\n\nexport const SweepStateSchema = z\n .object({\n /** Wall-clock ms the last full sign-in account scan ran (absent = never). */\n fullScanLastRunAt: epochMsSchema.optional(),\n rollingCursor: SweepRollingCursorSchema.optional(),\n deferred: z.array(SweepDeferredRowSchema).max(SWEEP_STATE_MAX_DEFERRED).optional(),\n updatedAt: epochMsSchema,\n })\n .superRefine((value, ctx) => {\n const seen = new Set<string>();\n (value.deferred ?? []).forEach((row, index) => {\n if (seen.has(row.key)) {\n ctx.addIssue({\n code: 'custom',\n path: ['deferred', index, 'key'],\n message: 'a row is deferred at most once',\n });\n }\n seen.add(row.key);\n });\n });\nexport type SweepState = z.infer<typeof SweepStateSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"system.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB,eAAO,MAAM,eAAe;;;;;;iBAS1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAIxD,eAAO,MAAM,uBAAuB;;;;;;;;;iBAKlC,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAMxE,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;iBAS5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAK5D,eAAO,MAAM,eAAe;;;iBAG1B,CAAC;AACH,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAMxD,eAAO,MAAM,8BAA8B,2IAMzC,CAAC;AAEH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;kBAUjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,0BAA0B;;;kBAE8E,CAAC;AACtH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E,eAAO,MAAM,4BAA4B;;;;;;kBAMvC,CAAC;AACH,MAAM,MAAM,sBAAsB,GA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D,iBAAiB,EAAE,WAAW;IAC9B,iBAAiB,EAAE,WAAW;IAC9B,iBAAiB,EAAE,WAAW;IAC9B,mBAAmB,EAAE,WAAW;IAChC,kBAAkB,EAAE,WAAW;CAChC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,YAAY,CAAC;IACxD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,WAAW,EAAE,sBAAsB;IACnC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,YAAY;IACzB,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,6FAA6F;IAC7F,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,GAAG,CAAC,kCAAkC,CAAC;IACtF,+CAA+C;IAC/C,iBAAiB,EAAE,CAAC,CAAC,aAAa,CAAC,0BAA0B,EAAE,WAAW,CAAC;IAC3E,OAAO,EAAE,4BAA4B;CACtC,CAAC,CAAC","sourcesContent":["// Fixed-ID system documents in the underscore buckets, plus the derived stat documents. Every one\n// is callable-only for writes.\n\nimport { z } from 'zod';\nimport {\n MAX_ANNOUNCEMENT_MESSAGE_LENGTH,\n MAX_APP_VERSION_LENGTH,\n MAX_LANDING_ABOUT_TEXT_LENGTH,\n MAX_LANDING_HERO_TITLE_LENGTH,\n MAX_MAINTENANCE_MESSAGE_LENGTH,\n} from '../constants/business.js';\nimport { MAX_STATS_VALIDATION_DISCREPANCIES } from '../constants/sports.js';\nimport { GallerySummarySchema } from './gallery.js';\nimport {\n countSchema,\n documentIdSegmentSchema,\n epochMsSchema,\n gameIdSchema,\n leagueIdSchema,\n statsBeaconActionSchema,\n statsDiscrepancyKindSchema,\n statsOperationIdSchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\n\n// `_appConfig/app` — the app-wide operational levers, set through the audited updateAppConfig\n// callable. `appVersion` is what a live client compares itself against to force a refresh. It is\n// written whole through `mergeAppConfigUpdate` and read one lever at a time through\n// `readAppConfigLever` (../utils/app-config.ts). Every text lever carries the same cap as its\n// updateAppConfig input field, so no writer can store a value the input would refuse.\nexport const AppConfigSchema = z.object({\n // `''` is valid here — no version published yet; only the update input requires a value.\n appVersion: z.string().max(MAX_APP_VERSION_LENGTH),\n maintenanceMode: z.boolean(),\n maintenanceMessage: z.string().max(MAX_MAINTENANCE_MESSAGE_LENGTH).optional(),\n registrationEnabled: z.boolean(),\n // Empty means no banner — there is no separate on/off flag. Non-empty is the band above every\n // page.\n announcementMessage: z.string().max(MAX_ANNOUNCEMENT_MESSAGE_LENGTH).optional(),\n});\nexport type AppConfig = z.infer<typeof AppConfigSchema>;\n\n// `_appConfig/landingPage` — admin-authored landing page copy, written by adminUpdateLandingPage,\n// plus the landing gallery's summary, which only the picture core writes.\nexport const LandingPageConfigSchema = z.object({\n heroTitle: z.string().max(MAX_LANDING_HERO_TITLE_LENGTH),\n aboutCompany: z.string().max(MAX_LANDING_ABOUT_TEXT_LENGTH),\n pictures: GallerySummarySchema.optional(),\n updatedAt: epochMsSchema,\n});\nexport type LandingPageConfig = z.infer<typeof LandingPageConfigSchema>;\n\n// `_appConfig/statsBeacon` — the signal watching clients refresh their stats on, replaced whole by\n// every write. The scope ids say what changed; an action that spans more than one game or league\n// omits them, and because every write replaces the document, an omitted id never survives from an\n// earlier write.\nexport const StatsBeaconSchema = z.object({\n updatedAt: epochMsSchema,\n // A fresh document id minted by every write, so two commits in the same millisecond still move\n // the beacon. Absent on a beacon stored before writes carried one.\n changeId: documentIdSegmentSchema.optional(),\n action: statsBeaconActionSchema,\n leagueId: leagueIdSchema.optional(),\n gameId: gameIdSchema.optional(),\n teamIds: z.array(teamIdSchema).optional(),\n});\nexport type StatsBeacon = z.infer<typeof StatsBeaconSchema>;\n\n// `_systemData/adminList` — the admin and referee rosters. The source of truth the `admin` and\n// `referee` custom claims are minted from, written only by the audited updateAdminList callable;\n// the first admin of a fresh environment is seeded in the console.\nexport const AdminListSchema = z.object({\n admins: z.array(userIdSchema),\n referees: z.array(userIdSchema),\n});\nexport type AdminList = z.infer<typeof AdminListSchema>;\n\n// `statsValidationReports/{reportId}` — one stats check: every place a game's stored numbers, or a\n// derived aggregate, disagree with what the game's events and the completed games say they should\n// be. Its id is the check's operation id, which the admin's browser mints, so two checks never share\n// a report. Written only by the check, page by page; `complete` turns true with its last page.\nexport const STATS_DISCREPANCY_VALUE_SCHEMA = z.union([\n z.number(),\n z.string(),\n z.array(z.number().nullable()),\n z.record(z.string(), z.number()),\n z.null(),\n]);\n\nexport const StatsDiscrepancySchema = z.strictObject({\n kind: statsDiscrepancyKindSchema,\n gameId: gameIdSchema.optional(),\n // The slash path of the document the finding is about.\n path: z.string().min(1),\n // The line or entry within it — a team id, a roster-entry id, a user id — when there is one.\n key: z.string().min(1).optional(),\n field: z.string().min(1).optional(),\n expected: STATS_DISCREPANCY_VALUE_SCHEMA.optional(),\n actual: STATS_DISCREPANCY_VALUE_SCHEMA.optional(),\n});\nexport type StatsDiscrepancy = z.infer<typeof StatsDiscrepancySchema>;\n\nexport const StatsValidationScopeSchema = z\n .strictObject({ gameId: gameIdSchema.optional(), leagueId: leagueIdSchema.optional() })\n .refine((scope) => scope.gameId === undefined || scope.leagueId === undefined, 'One game or one league, not both.');\nexport type StatsValidationScope = z.infer<typeof StatsValidationScopeSchema>;\n\nexport const StatsValidationSummarySchema = z.strictObject({\n totalGamesChecked: countSchema,\n totalUsersChecked: countSchema,\n totalTeamsChecked: countSchema,\n totalLeaguesChecked: countSchema,\n discrepanciesFound: countSchema,\n});\nexport type StatsValidationSummary = z.infer<typeof StatsValidationSummarySchema>;\n\nexport const StatsValidationReportSchema = z.strictObject({\n reportId: z.string().min(1),\n operationId: statsOperationIdSchema,\n ranAt: epochMsSchema,\n ranByUserId: userIdSchema,\n scope: StatsValidationScopeSchema,\n complete: z.boolean(),\n // Game-tier findings first, then aggregate ones, at most MAX_STATS_VALIDATION_DISCREPANCIES.\n discrepancies: z.array(StatsDiscrepancySchema).max(MAX_STATS_VALIDATION_DISCREPANCIES),\n // Every finding, kept or not, counted by kind.\n discrepancyCounts: z.partialRecord(statsDiscrepancyKindSchema, countSchema),\n summary: StatsValidationSummarySchema,\n});\nexport type StatsValidationReport = z.infer<typeof StatsValidationReportSchema>;\n"]}
1
+ {"version":3,"file":"system.js","sourceRoot":"","sources":["../../src/doc-schemas/system.ts"],"names":[],"mappings":"AAAA,kGAAkG;AAClG,+BAA+B;AAE/B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,+BAA+B,EAC/B,sBAAsB,EACtB,6BAA6B,EAC7B,6BAA6B,EAC7B,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kCAAkC,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,WAAW,EACX,uBAAuB,EACvB,aAAa,EACb,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,YAAY,EACZ,YAAY,GACb,MAAM,YAAY,CAAC;AAEpB,8FAA8F;AAC9F,iGAAiG;AACjG,oFAAoF;AACpF,8FAA8F;AAC9F,sFAAsF;AACtF,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC;IACtC,yFAAyF;IACzF,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,sBAAsB,CAAC;IAClD,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE;IAC5B,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC,QAAQ,EAAE;IAC7E,mBAAmB,EAAE,CAAC,CAAC,OAAO,EAAE;IAChC,8FAA8F;IAC9F,QAAQ;IACR,mBAAmB,EAAE,CAAC,CAAC,MAAM,E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EAAE,WAAW;IAChC,kBAAkB,EAAE,WAAW;CAChC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,YAAY,CAAC;IACxD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,WAAW,EAAE,sBAAsB;IACnC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,YAAY;IACzB,KAAK,EAAE,0BAA0B;IACjC,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE;IACrB,6FAA6F;IAC7F,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,GAAG,CAAC,kCAAkC,CAAC;IACtF,+CAA+C;IAC/C,iBAAiB,EAAE,CAAC,CAAC,aAAa,CAAC,0BAA0B,EAAE,WAAW,CAAC;IAC3E,OAAO,EAAE,4BAA4B;CACtC,CAAC,CAAC","sourcesContent":["// Fixed-ID system documents in the underscore buckets, plus the derived stat documents. Every one\n// is callable-only for writes.\n\nimport { z } from 'zod';\nimport {\n MAX_ANNOUNCEMENT_MESSAGE_LENGTH,\n MAX_APP_VERSION_LENGTH,\n MAX_LANDING_ABOUT_TEXT_LENGTH,\n MAX_LANDING_HERO_TITLE_LENGTH,\n MAX_MAINTENANCE_MESSAGE_LENGTH,\n} from '../constants/business.js';\nimport { MAX_STATS_VALIDATION_DISCREPANCIES } from '../constants/sports.js';\nimport { GallerySummarySchema } from './gallery.js';\nimport {\n countSchema,\n documentIdSegmentSchema,\n epochMsSchema,\n gameIdSchema,\n leagueIdSchema,\n statsBeaconActionSchema,\n statsDiscrepancyKindSchema,\n statsOperationIdSchema,\n teamIdSchema,\n userIdSchema,\n} from './atoms.js';\n\n// `_appConfig/app` — the app-wide operational levers, set through the audited updateAppConfig\n// callable. `appVersion` is what a live client compares itself against to force a refresh. It is\n// written whole through `mergeAppConfigUpdate` and read one lever at a time through\n// `readAppConfigLever` (../utils/app-config.ts). Every text lever carries the same cap as its\n// updateAppConfig input field, so no writer can store a value the input would refuse.\nexport const AppConfigSchema = z.object({\n // `''` is valid here — no version published yet; only the update input requires a value.\n appVersion: z.string().max(MAX_APP_VERSION_LENGTH),\n maintenanceMode: z.boolean(),\n maintenanceMessage: z.string().max(MAX_MAINTENANCE_MESSAGE_LENGTH).optional(),\n registrationEnabled: z.boolean(),\n // Empty means no banner — there is no separate on/off flag. Non-empty is the band above every\n // page.\n announcementMessage: z.string().max(MAX_ANNOUNCEMENT_MESSAGE_LENGTH).optional(),\n});\nexport type AppConfig = z.infer<typeof AppConfigSchema>;\n\n// `_appConfig/landingPage` — admin-authored landing page copy, written by adminUpdateLandingPage,\n// plus the landing gallery's summary, which only the picture core writes.\nexport const LandingPageConfigSchema = z.object({\n heroTitle: z.string().max(MAX_LANDING_HERO_TITLE_LENGTH),\n aboutCompany: z.string().max(MAX_LANDING_ABOUT_TEXT_LENGTH),\n pictures: GallerySummarySchema.optional(),\n updatedAt: epochMsSchema,\n});\nexport type LandingPageConfig = z.infer<typeof LandingPageConfigSchema>;\n\n// `_appConfig/statsBeacon` — the signal watching clients refresh their stats on, replaced whole by\n// every write. The scope ids say what changed; an action that spans more than one game or league\n// omits them, and because every write replaces the document, an omitted id never survives from an\n// earlier write.\nexport const StatsBeaconSchema = z.object({\n updatedAt: epochMsSchema,\n // A fresh document id minted by every write, so two commits in the same millisecond still move\n // the beacon. Absent on a beacon stored before writes carried one.\n changeId: documentIdSegmentSchema.optional(),\n action: statsBeaconActionSchema,\n leagueId: leagueIdSchema.optional(),\n gameId: gameIdSchema.optional(),\n teamIds: z.array(teamIdSchema).optional(),\n});\nexport type StatsBeacon = z.infer<typeof StatsBeaconSchema>;\n\n// `_systemData/adminList` — the admin and referee rosters. The source of truth the `admin` and\n// `referee` custom claims are minted from, written only by the audited updateAdminList callable;\n// the first admin of a fresh environment is seeded in the console.\nexport const AdminListSchema = z.object({\n admins: z.array(userIdSchema),\n referees: z.array(userIdSchema),\n});\nexport type AdminList = z.infer<typeof AdminListSchema>;\n\n// `statsValidationReports/{reportId}` — one stats check: every place a game's stored numbers, or a\n// derived aggregate, disagree with what the game's events and the completed games say they should\n// be. Its id is the check's operation id, which the admin's browser mints, so two checks never share\n// a report. Written only by the check, page by page; `complete` turns true with its last page.\nexport const STATS_DISCREPANCY_VALUE_SCHEMA = z.union([\n z.number(),\n z.string(),\n z.array(z.number().nullable()),\n z.record(z.string(), z.number()),\n z.null(),\n]);\n\nexport const StatsDiscrepancySchema = z.strictObject({\n kind: statsDiscrepancyKindSchema,\n gameId: gameIdSchema.optional(),\n // The slash path of the document the finding is about.\n path: z.string().min(1),\n // The line or entry within it — a team id, a roster-entry id, a user id — when there is one.\n key: z.string().min(1).optional(),\n field: z.string().min(1).optional(),\n expected: STATS_DISCREPANCY_VALUE_SCHEMA.optional(),\n actual: STATS_DISCREPANCY_VALUE_SCHEMA.optional(),\n});\nexport type StatsDiscrepancy = z.infer<typeof StatsDiscrepancySchema>;\n\nexport const StatsValidationScopeSchema = z\n .strictObject({ gameId: gameIdSchema.optional(), leagueId: leagueIdSchema.optional() })\n .refine(\n (scope) => scope.gameId === undefined || scope.leagueId === undefined,\n 'One game or one league, not both.',\n );\nexport type StatsValidationScope = z.infer<typeof StatsValidationScopeSchema>;\n\nexport const StatsValidationSummarySchema = z.strictObject({\n totalGamesChecked: countSchema,\n totalUsersChecked: countSchema,\n totalTeamsChecked: countSchema,\n totalLeaguesChecked: countSchema,\n discrepanciesFound: countSchema,\n});\nexport type StatsValidationSummary = z.infer<typeof StatsValidationSummarySchema>;\n\nexport const StatsValidationReportSchema = z.strictObject({\n reportId: z.string().min(1),\n operationId: statsOperationIdSchema,\n ranAt: epochMsSchema,\n ranByUserId: userIdSchema,\n scope: StatsValidationScopeSchema,\n complete: z.boolean(),\n // Game-tier findings first, then aggregate ones, at most MAX_STATS_VALIDATION_DISCREPANCIES.\n discrepancies: z.array(StatsDiscrepancySchema).max(MAX_STATS_VALIDATION_DISCREPANCIES),\n // Every finding, kept or not, counted by kind.\n discrepancyCounts: z.partialRecord(statsDiscrepancyKindSchema, countSchema),\n summary: StatsValidationSummarySchema,\n});\nexport type StatsValidationReport = z.infer<typeof StatsValidationReportSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"user-profile.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/user-profile.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,eAAe;;;;EAAsB,CAAC;AAGnD,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAc5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAI5D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;iBAiBhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE,eAAO,MAAM,qBAAqB;;;;;kBAA6D,CAAC;AAChG,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAWpE,8DAA8D;AAC9D,eAAO,MAAM,oBAAoB,EAAyC,SAAS,CAAC,MAAM,eAAe,CAAC,EAAE,CAAC"}
1
+ {"version":3,"file":"user-profile.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/user-profile.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,eAAe;;;;EAAsB,CAAC;AAGnD,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAc5B,CAAC;AACH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAI5D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;iBAiBhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAMpE,eAAO,MAAM,qBAAqB;;;;;kBAA6D,CAAC;AAChG,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAWpE,8DAA8D;AAC9D,eAAO,MAAM,oBAAoB,EAE5B,SAAS,CAAC,MAAM,eAAe,CAAC,EAAE,CAAC"}
@@ -4,7 +4,7 @@
4
4
  // Plus its `historicalStats/{sportKey}` subcollection.
5
5
  import { z } from 'zod';
6
6
  import { THEME_NAMES } from '@ttt-productions/theme-core';
7
- import { CONTACT_PHONE_INPUT_FORMAT } from '../input-formats/index.js';
7
+ import { CONTACT_PHONE_INPUT_FORMAT } from '../input-formats/input-formats.js';
8
8
  import { BasketballPlayerTotalsSchema, UserLifetimeStatsSchema } from './aggregate-stats.js';
9
9
  import { epochMsSchema, textFieldSchema, userStatusSchema } from './atoms.js';
10
10
  import { awardIdSchema } from './catalogs.js';
@@ -1 +1 @@
1
- {"version":3,"file":"user-profile.js","sourceRoot":"","sources":["../../src/doc-schemas/user-profile.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,6FAA6F;AAC7F,kGAAkG;AAClG,uDAAuD;AAEvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE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E;IACjD,6DAA6D;IAC7D,mBAAmB,EAAE,eAAe,CAAC,0BAA0B,CAAC,CAAC,QAAQ,EAAE;IAC3E,0FAA0F;IAC1F,gEAAgE;IAChE,KAAK,EAAE,eAAe,CAAC,QAAQ,EAAE;IACjC,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACrC,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC;AAGH,mGAAmG;AACnG,sGAAsG;AACtG,+FAA+F;AAC/F,yCAAyC;AACzC,MAAM,CAAC,MAAM,qBAAqB,GAAG,4BAA4B,CAAC,IAAI,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AAGhG,sGAAsG;AACtG,8BAA8B;AAC9B,MAAM,qBAAqB,GAAwC;IACjE,WAAW,EAAE,IAAI;IACjB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,OAAO,EAAE,IAAI;CACd,CAAC;AAEF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAuC,CAAC","sourcesContent":["// `userProfiles/{userId}` — the account's profile, one per Firebase Auth uid. Ghosts have none.\n// It is publicly readable (a profile page renders signed out), so it holds nothing personal:\n// email and contact details live in its owner-only `privateData/{userId}` document (BACKEND-105).\n// Plus its `historicalStats/{sportKey}` subcollection.\n\nimport { z } from 'zod';\nimport { THEME_NAMES } from '@ttt-productions/theme-core';\nimport { CONTACT_PHONE_INPUT_FORMAT } from '../input-formats/index.js';\nimport { BasketballPlayerTotalsSchema, UserLifetimeStatsSchema } from './aggregate-stats.js';\nimport { epochMsSchema, textFieldSchema, userStatusSchema } from './atoms.js';\nimport { awardIdSchema } from './catalogs.js';\n\n// A saved theme, typed by theme-core's theme set — the one declaration its provider renders from.\nexport const themeNameSchema = z.enum(THEME_NAMES);\n\n// An award granted to this user. Name and imagery resolve from `awardDefinitions/{awardId}`.\nexport const GrantedAwardSchema = z.object({\n awardId: awardIdSchema,\n grantedAt: epochMsSchema,\n});\nexport type GrantedAward = z.infer<typeof GrantedAwardSchema>;\n\nexport const UserProfileSchema = z.object({\n displayName: z.string(),\n displayName_lowercase: z.string(),\n // Written `active` at registration and by the profile copy; nothing else writes it.\n userStatus: userStatusSchema,\n // Per sport, the career line; career games played is the sum of their games played, derived at\n // read and never stored.\n lifetimeStats: UserLifetimeStatsSchema.optional(),\n grantedAwards: z.array(GrantedAwardSchema).optional(),\n // The awards the account shows beside its name, each one it holds.\n primaryAwardId: awardIdSchema.optional(),\n secondaryAwardId: awardIdSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n});\nexport type UserProfile = z.infer<typeof UserProfileSchema>;\n\n// `userProfiles/{userId}/privateData/{userId}` — readable by its owner and by admins; written only\n// by callables.\nexport const UserPrivateDataSchema = z.object({\n email: z.string(),\n // When this login's registration started (`createRegistrationStart`); `registerUser` refuses\n // without it. Absent on an account copied from V1, which registered before the step existed.\n registrationStartedAt: epochMsSchema.optional(),\n // When the orphan-registration cleanup decided to delete this uid's login. Written in the\n // cleanup's eligibility transaction BEFORE the Auth delete, and both registration steps answer\n // `registrationExpired` in their own transactions while it is present, so no registration\n // completes into a login that is about to be deleted. Backend-only.\n orphanDeletionClaimedAt: epochMsSchema.optional(),\n // Pre-fills the contact phone when this user creates a team.\n defaultContactPhone: textFieldSchema(CONTACT_PHONE_INPUT_FORMAT).optional(),\n // The account's copy of the viewer's settings, synced with the device's. Absent means the\n // account has saved nothing and the device's own choice stands.\n theme: themeNameSchema.optional(),\n reducedMotion: z.boolean().optional(),\n updatedAt: epochMsSchema,\n});\nexport type UserPrivateData = z.infer<typeof UserPrivateDataSchema>;\n\n// `userProfiles/{userId}/historicalStats/{sportKey}` — pre-Q-Sports career totals an admin enters,\n// folded into lifetime and hall-of-fame recalculation. Absolute totals, not increments. Basketball is\n// the sport with a baseline, so it is the basketball totals line without FP, which the rebuild\n// derives when it folds the baseline in.\nexport const HistoricalStatsSchema = BasketballPlayerTotalsSchema.omit({ fantasyPoints: true });\nexport type HistoricalStats = z.infer<typeof HistoricalStatsSchema>;\n\n// Every field of a baseline, keyed so the record cannot miss one or name one the schema lacks, in the\n// order an admin enters them.\nconst HISTORICAL_STAT_ENTRY: Record<keyof HistoricalStats, true> = {\n gamesPlayed: true,\n points: true,\n rebounds: true,\n assists: true,\n};\n\n/** A baseline's totals, in the order an admin enters them. */\nexport const HISTORICAL_STAT_KEYS = Object.keys(HISTORICAL_STAT_ENTRY) as readonly (keyof HistoricalStats)[];\n"]}
1
+ {"version":3,"file":"user-profile.js","sourceRoot":"","sources":["../../src/doc-schemas/user-profile.ts"],"names":[],"mappings":"AAAA,gGAAgG;AAChG,6FAA6F;AAC7F,kGAAkG;AAClG,uDAAuD;AAEvD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,4BAA4B,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC7F,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,kGAAkG;AAClG,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAEnD,6FAA6F;AAC7F,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,aAAa;IACtB,SAAS,EAAE,aAAa;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,qBAAqB,EAAE,CAAC,CAAC,MAAM,EAAE;IAC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E,IAAI;IACd,OAAO,EAAE,IAAI;CACd,CAAC;AAEF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,IAAI,CAC7C,qBAAqB,CACgB,CAAC","sourcesContent":["// `userProfiles/{userId}` — the account's profile, one per Firebase Auth uid. Ghosts have none.\n// It is publicly readable (a profile page renders signed out), so it holds nothing personal:\n// email and contact details live in its owner-only `privateData/{userId}` document (BACKEND-105).\n// Plus its `historicalStats/{sportKey}` subcollection.\n\nimport { z } from 'zod';\nimport { THEME_NAMES } from '@ttt-productions/theme-core';\nimport { CONTACT_PHONE_INPUT_FORMAT } from '../input-formats/input-formats.js';\nimport { BasketballPlayerTotalsSchema, UserLifetimeStatsSchema } from './aggregate-stats.js';\nimport { epochMsSchema, textFieldSchema, userStatusSchema } from './atoms.js';\nimport { awardIdSchema } from './catalogs.js';\n\n// A saved theme, typed by theme-core's theme set — the one declaration its provider renders from.\nexport const themeNameSchema = z.enum(THEME_NAMES);\n\n// An award granted to this user. Name and imagery resolve from `awardDefinitions/{awardId}`.\nexport const GrantedAwardSchema = z.object({\n awardId: awardIdSchema,\n grantedAt: epochMsSchema,\n});\nexport type GrantedAward = z.infer<typeof GrantedAwardSchema>;\n\nexport const UserProfileSchema = z.object({\n displayName: z.string(),\n displayName_lowercase: z.string(),\n // Written `active` at registration and by the profile copy; nothing else writes it.\n userStatus: userStatusSchema,\n // Per sport, the career line; career games played is the sum of their games played, derived at\n // read and never stored.\n lifetimeStats: UserLifetimeStatsSchema.optional(),\n grantedAwards: z.array(GrantedAwardSchema).optional(),\n // The awards the account shows beside its name, each one it holds.\n primaryAwardId: awardIdSchema.optional(),\n secondaryAwardId: awardIdSchema.optional(),\n createdAt: epochMsSchema,\n updatedAt: epochMsSchema,\n});\nexport type UserProfile = z.infer<typeof UserProfileSchema>;\n\n// `userProfiles/{userId}/privateData/{userId}` — readable by its owner and by admins; written only\n// by callables.\nexport const UserPrivateDataSchema = z.object({\n email: z.string(),\n // When this login's registration started (`createRegistrationStart`); `registerUser` refuses\n // without it. Absent on an account copied from V1, which registered before the step existed.\n registrationStartedAt: epochMsSchema.optional(),\n // When the orphan-registration cleanup decided to delete this uid's login. Written in the\n // cleanup's eligibility transaction BEFORE the Auth delete, and both registration steps answer\n // `registrationExpired` in their own transactions while it is present, so no registration\n // completes into a login that is about to be deleted. Backend-only.\n orphanDeletionClaimedAt: epochMsSchema.optional(),\n // Pre-fills the contact phone when this user creates a team.\n defaultContactPhone: textFieldSchema(CONTACT_PHONE_INPUT_FORMAT).optional(),\n // The account's copy of the viewer's settings, synced with the device's. Absent means the\n // account has saved nothing and the device's own choice stands.\n theme: themeNameSchema.optional(),\n reducedMotion: z.boolean().optional(),\n updatedAt: epochMsSchema,\n});\nexport type UserPrivateData = z.infer<typeof UserPrivateDataSchema>;\n\n// `userProfiles/{userId}/historicalStats/{sportKey}` — pre-Q-Sports career totals an admin enters,\n// folded into lifetime and hall-of-fame recalculation. Absolute totals, not increments. Basketball is\n// the sport with a baseline, so it is the basketball totals line without FP, which the rebuild\n// derives when it folds the baseline in.\nexport const HistoricalStatsSchema = BasketballPlayerTotalsSchema.omit({ fantasyPoints: true });\nexport type HistoricalStats = z.infer<typeof HistoricalStatsSchema>;\n\n// Every field of a baseline, keyed so the record cannot miss one or name one the schema lacks, in the\n// order an admin enters them.\nconst HISTORICAL_STAT_ENTRY: Record<keyof HistoricalStats, true> = {\n gamesPlayed: true,\n points: true,\n rebounds: true,\n assists: true,\n};\n\n/** A baseline's totals, in the order an admin enters them. */\nexport const HISTORICAL_STAT_KEYS = Object.keys(\n HISTORICAL_STAT_ENTRY,\n) as readonly (keyof HistoricalStats)[];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"waivers-and-hardware.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/waivers-and-hardware.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;iBA0C5B,CAAC;AACJ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,eAAO,MAAM,kBAAkB;;;kBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAM9D,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;kBAsBpC,CAAC;AACJ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
1
+ {"version":3,"file":"waivers-and-hardware.d.ts","sourceRoot":"","sources":["../../src/doc-schemas/waivers-and-hardware.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;iBAgD5B,CAAC;AACJ,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAI9D,eAAO,MAAM,kBAAkB;;;kBAG7B,CAAC;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAM9D,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;kBA8BpC,CAAC;AACJ,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"}
@@ -33,7 +33,12 @@ export const SignedWaiverSchema = z
33
33
  witnessDisplayNameSnapshot: z.string().optional(),
34
34
  })
35
35
  .refine((waiver) => {
36
- const full = [waiver.teamId, waiver.witnessUserId, waiver.witnessAuthority, waiver.subjectDisplayNameSnapshot];
36
+ const full = [
37
+ waiver.teamId,
38
+ waiver.witnessUserId,
39
+ waiver.witnessAuthority,
40
+ waiver.subjectDisplayNameSnapshot,
41
+ ];
37
42
  const legacy = [waiver.teamId, waiver.witnessUserId, waiver.witnessDisplayNameSnapshot];
38
43
  const present = (fields) => fields.filter((field) => field !== undefined).length;
39
44
  if (present([...full, waiver.witnessDisplayNameSnapshot]) === 0)
@@ -71,6 +76,13 @@ export const HardwareLoanContractSchema = z
71
76
  })
72
77
  .refine((contract) => contract.status === PENDING_HARDWARE_LOAN_CONTRACT_STATUS
73
78
  ? contract.signatureFile === undefined && contract.loanedAt === undefined
74
- : contract.signatureFile !== undefined && contract.loanedAt !== undefined, { message: 'A contract carries its signature and loan date exactly once it is signed.', path: ['signatureFile'] })
75
- .refine((contract) => (contract.status === RETURNED_HARDWARE_LOAN_CONTRACT_STATUS) === (contract.returnedAt !== undefined), { message: 'A contract carries its return date exactly while it is returned.', path: ['returnedAt'] });
79
+ : contract.signatureFile !== undefined && contract.loanedAt !== undefined, {
80
+ message: 'A contract carries its signature and loan date exactly once it is signed.',
81
+ path: ['signatureFile'],
82
+ })
83
+ .refine((contract) => (contract.status === RETURNED_HARDWARE_LOAN_CONTRACT_STATUS) ===
84
+ (contract.returnedAt !== undefined), {
85
+ message: 'A contract carries its return date exactly while it is returned.',
86
+ path: ['returnedAt'],
87
+ });
76
88
  //# sourceMappingURL=waivers-and-hardware.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"waivers-and-hardware.js","sourceRoot":"","sources":["../../src/doc-schemas/waivers-and-hardware.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,mGAAmG;AACnG,4BAA4B;AAE5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,gCAAgC,EAChC,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,4BAA4B,GAC7B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,qCAAqC,EACrC,sCAAsC,GACvC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBA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CAAC,QAAQ,EAAE,EAAE,CACX,QAAQ,CAAC,MAAM,KAAK,qCAAqC;IACvD,CAAC,CAAC,QAAQ,CAAC,aAAa,KAAK,SAAS,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS;IACzE,CAAC,CAAC,QAAQ,CAAC,aAAa,KAAK,SAAS,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS,EAC7E,EAAE,OAAO,EAAE,2EAA2E,EAAE,IAAI,EAAE,CAAC,eAAe,CAAC,EAAE,CAClH;KACA,MAAM,CACL,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,MAAM,KAAK,sCAAsC,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,KAAK,SAAS,CAAC,EAClH,EAAE,OAAO,EAAE,kEAAkE,EAAE,IAAI,EAAE,CAAC,YAAY,CAAC,EAAE,CACtG,CAAC","sourcesContent":["// Signed waivers and referee hardware contracts. Signatures are legal artifacts: a signed waiver\n// carries the exact wording the signer saw, as named snapshots. The templates they are signed from\n// are ./waiver-template.ts.\n\nimport { z } from 'zod';\nimport {\n epochMsSchema,\n hardwareLoanContractStatusSchema,\n leagueIdSchema,\n teamIdSchema,\n userIdSchema,\n waiverWitnessAuthoritySchema,\n} from './atoms.js';\nimport {\n PENDING_HARDWARE_LOAN_CONTRACT_STATUS,\n RETURNED_HARDWARE_LOAN_CONTRACT_STATUS,\n} from '../types/unions.js';\nimport { StorageObjectRefSchema } from './pending-media.js';\nimport { waiverTemplateIdSchema, waiverTemplateVersionNumberSchema } from './waiver-template.js';\n\n// `signedWaivers/{leagueId}_{userId}` — one signed waiver per player per league, never replaced,\n// moved, or deleted: a ghost's stays under the ghost's id after the ghost is removed or linked.\nexport const SignedWaiverSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n waiverTemplateId: waiverTemplateIdSchema,\n // The published version of the template the signature was captured under. A record that names\n // no version has its wording snapshot as its whole record.\n waiverTemplateVersion: waiverTemplateVersionNumberSchema.optional(),\n waiverTitleSnapshot: z.string(),\n waiverTextSnapshot: z.string(),\n // The kept signature image. Read only through the signature-read callable, never by URL.\n signatureFile: StorageObjectRefSchema,\n signedAt: epochMsSchema,\n // A ghost player's waiver is signed by a witness for the ghost's team: the witness's account,\n // the authority they signed under, and the ghost's name at signing — a named snapshot, so the\n // record still says whom it was for after the ghost's public identity is gone (ARCH-103).\n teamId: teamIdSchema.optional(),\n witnessUserId: userIdSchema.optional(),\n witnessAuthority: waiverWitnessAuthoritySchema.optional(),\n subjectDisplayNameSnapshot: z.string().optional(),\n // A V1 witnessed waiver recorded the witness's name as it was at signing, and never the authority\n // or the ghost's name; the copy keeps that name as a named snapshot (ARCH-103) and guesses neither.\n witnessDisplayNameSnapshot: z.string().optional(),\n })\n .refine(\n (waiver) => {\n const full = [waiver.teamId, waiver.witnessUserId, waiver.witnessAuthority, waiver.subjectDisplayNameSnapshot];\n const legacy = [waiver.teamId, waiver.witnessUserId, waiver.witnessDisplayNameSnapshot];\n const present = (fields: readonly unknown[]) => fields.filter((field) => field !== undefined).length;\n if (present([...full, waiver.witnessDisplayNameSnapshot]) === 0) return true;\n if (present(full) === full.length) return waiver.witnessDisplayNameSnapshot === undefined;\n return (\n present(legacy) === legacy.length &&\n waiver.witnessAuthority === undefined &&\n waiver.subjectDisplayNameSnapshot === undefined\n );\n },\n {\n message:\n \"A ghost's waiver carries its team, witness, authority, and name together; or, copied from V1, its team, witness, and the witness's recorded name; or none of them.\",\n path: ['witnessUserId'],\n },\n );\nexport type SignedWaiver = z.infer<typeof SignedWaiverSchema>;\n\n// One loaned item, as the contract was created with it: its catalog id and name. A contract keeps\n// what it loaned even if the catalog later changes.\nexport const HardwareItemSchema = z.strictObject({\n id: z.string().min(1),\n name: z.string().min(1),\n});\nexport type HardwareItem = z.infer<typeof HardwareItemSchema>;\n\n// `hardwareLoanContracts/{contractId}` — equipment loaned to a referee: who holds it, what they hold,\n// and their signature on the loan agreement, a legal artifact. Names resolve from `publicUsers` at\n// read time (ARCH-103). `pending` until the referee signs; `loaned` from the signing, which keeps the\n// signature for good; `returned` once an admin records the equipment back, the signature retained.\nexport const HardwareLoanContractSchema = z\n .strictObject({\n refereeUserId: userIdSchema,\n createdByUserId: userIdSchema,\n hardware: z.array(HardwareItemSchema).min(1),\n status: hardwareLoanContractStatusSchema,\n // The kept signature image. Read only through the signature-read callables, never by URL.\n signatureFile: StorageObjectRefSchema.optional(),\n createdAt: epochMsSchema,\n loanedAt: epochMsSchema.optional(),\n returnedAt: epochMsSchema.optional(),\n })\n .refine(\n (contract) =>\n contract.status === PENDING_HARDWARE_LOAN_CONTRACT_STATUS\n ? contract.signatureFile === undefined && contract.loanedAt === undefined\n : contract.signatureFile !== undefined && contract.loanedAt !== undefined,\n { message: 'A contract carries its signature and loan date exactly once it is signed.', path: ['signatureFile'] },\n )\n .refine(\n (contract) => (contract.status === RETURNED_HARDWARE_LOAN_CONTRACT_STATUS) === (contract.returnedAt !== undefined),\n { message: 'A contract carries its return date exactly while it is returned.', path: ['returnedAt'] },\n );\nexport type HardwareLoanContract = z.infer<typeof HardwareLoanContractSchema>;\n"]}
1
+ {"version":3,"file":"waivers-and-hardware.js","sourceRoot":"","sources":["../../src/doc-schemas/waivers-and-hardware.ts"],"names":[],"mappings":"AAAA,iGAAiG;AACjG,mGAAmG;AACnG,4BAA4B;AAE5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,aAAa,EACb,gCAAgC,EAChC,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,4BAA4B,GAC7B,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,qCAAqC,EACrC,sCAAsC,GACvC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AAEjG,iGAAiG;AACjG,gGAAgG;AAChG,MAAM,CAAC,M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a,KAAK,SAAS,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS;IACzE,CAAC,CAAC,QAAQ,CAAC,aAAa,KAAK,SAAS,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS,EAC7E;IACE,OAAO,EAAE,2EAA2E;IACpF,IAAI,EAAE,CAAC,eAAe,CAAC;CACxB,CACF;KACA,MAAM,CACL,CAAC,QAAQ,EAAE,EAAE,CACX,CAAC,QAAQ,CAAC,MAAM,KAAK,sCAAsC,CAAC;IAC5D,CAAC,QAAQ,CAAC,UAAU,KAAK,SAAS,CAAC,EACrC;IACE,OAAO,EAAE,kEAAkE;IAC3E,IAAI,EAAE,CAAC,YAAY,CAAC;CACrB,CACF,CAAC","sourcesContent":["// Signed waivers and referee hardware contracts. Signatures are legal artifacts: a signed waiver\n// carries the exact wording the signer saw, as named snapshots. The templates they are signed from\n// are ./waiver-template.ts.\n\nimport { z } from 'zod';\nimport {\n epochMsSchema,\n hardwareLoanContractStatusSchema,\n leagueIdSchema,\n teamIdSchema,\n userIdSchema,\n waiverWitnessAuthoritySchema,\n} from './atoms.js';\nimport {\n PENDING_HARDWARE_LOAN_CONTRACT_STATUS,\n RETURNED_HARDWARE_LOAN_CONTRACT_STATUS,\n} from '../types/unions.js';\nimport { StorageObjectRefSchema } from './pending-media.js';\nimport { waiverTemplateIdSchema, waiverTemplateVersionNumberSchema } from './waiver-template.js';\n\n// `signedWaivers/{leagueId}_{userId}` — one signed waiver per player per league, never replaced,\n// moved, or deleted: a ghost's stays under the ghost's id after the ghost is removed or linked.\nexport const SignedWaiverSchema = z\n .object({\n leagueId: leagueIdSchema,\n userId: userIdSchema,\n waiverTemplateId: waiverTemplateIdSchema,\n // The published version of the template the signature was captured under. A record that names\n // no version has its wording snapshot as its whole record.\n waiverTemplateVersion: waiverTemplateVersionNumberSchema.optional(),\n waiverTitleSnapshot: z.string(),\n waiverTextSnapshot: z.string(),\n // The kept signature image. Read only through the signature-read callable, never by URL.\n signatureFile: StorageObjectRefSchema,\n signedAt: epochMsSchema,\n // A ghost player's waiver is signed by a witness for the ghost's team: the witness's account,\n // the authority they signed under, and the ghost's name at signing — a named snapshot, so the\n // record still says whom it was for after the ghost's public identity is gone (ARCH-103).\n teamId: teamIdSchema.optional(),\n witnessUserId: userIdSchema.optional(),\n witnessAuthority: waiverWitnessAuthoritySchema.optional(),\n subjectDisplayNameSnapshot: z.string().optional(),\n // A V1 witnessed waiver recorded the witness's name as it was at signing, and never the authority\n // or the ghost's name; the copy keeps that name as a named snapshot (ARCH-103) and guesses neither.\n witnessDisplayNameSnapshot: z.string().optional(),\n })\n .refine(\n (waiver) => {\n const full = [\n waiver.teamId,\n waiver.witnessUserId,\n waiver.witnessAuthority,\n waiver.subjectDisplayNameSnapshot,\n ];\n const legacy = [waiver.teamId, waiver.witnessUserId, waiver.witnessDisplayNameSnapshot];\n const present = (fields: readonly unknown[]) =>\n fields.filter((field) => field !== undefined).length;\n if (present([...full, waiver.witnessDisplayNameSnapshot]) === 0) return true;\n if (present(full) === full.length) return waiver.witnessDisplayNameSnapshot === undefined;\n return (\n present(legacy) === legacy.length &&\n waiver.witnessAuthority === undefined &&\n waiver.subjectDisplayNameSnapshot === undefined\n );\n },\n {\n message:\n \"A ghost's waiver carries its team, witness, authority, and name together; or, copied from V1, its team, witness, and the witness's recorded name; or none of them.\",\n path: ['witnessUserId'],\n },\n );\nexport type SignedWaiver = z.infer<typeof SignedWaiverSchema>;\n\n// One loaned item, as the contract was created with it: its catalog id and name. A contract keeps\n// what it loaned even if the catalog later changes.\nexport const HardwareItemSchema = z.strictObject({\n id: z.string().min(1),\n name: z.string().min(1),\n});\nexport type HardwareItem = z.infer<typeof HardwareItemSchema>;\n\n// `hardwareLoanContracts/{contractId}` — equipment loaned to a referee: who holds it, what they hold,\n// and their signature on the loan agreement, a legal artifact. Names resolve from `publicUsers` at\n// read time (ARCH-103). `pending` until the referee signs; `loaned` from the signing, which keeps the\n// signature for good; `returned` once an admin records the equipment back, the signature retained.\nexport const HardwareLoanContractSchema = z\n .strictObject({\n refereeUserId: userIdSchema,\n createdByUserId: userIdSchema,\n hardware: z.array(HardwareItemSchema).min(1),\n status: hardwareLoanContractStatusSchema,\n // The kept signature image. Read only through the signature-read callables, never by URL.\n signatureFile: StorageObjectRefSchema.optional(),\n createdAt: epochMsSchema,\n loanedAt: epochMsSchema.optional(),\n returnedAt: epochMsSchema.optional(),\n })\n .refine(\n (contract) =>\n contract.status === PENDING_HARDWARE_LOAN_CONTRACT_STATUS\n ? contract.signatureFile === undefined && contract.loanedAt === undefined\n : contract.signatureFile !== undefined && contract.loanedAt !== undefined,\n {\n message: 'A contract carries its signature and loan date exactly once it is signed.',\n path: ['signatureFile'],\n },\n )\n .refine(\n (contract) =>\n (contract.status === RETURNED_HARDWARE_LOAN_CONTRACT_STATUS) ===\n (contract.returnedAt !== undefined),\n {\n message: 'A contract carries its return date exactly while it is returned.',\n path: ['returnedAt'],\n },\n );\nexport type HardwareLoanContract = z.infer<typeof HardwareLoanContractSchema>;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"domain-events.d.ts","sourceRoot":"","sources":["../../src/domain-events/domain-events.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAgBxB,eAAO,MAAM,wBAAwB;;;;;kBAE1B,CAAC;AAEZ,eAAO,MAAM,wBAAwB;;;;;kBAE1B,CAAC;AAGZ,eAAO,MAAM,6BAA6B;;;;;kBAE/B,CAAC;AAEZ,eAAO,MAAM,4BAA4B;;;;;;kBAK9B,CAAC;AAGZ,eAAO,MAAM,4BAA4B;;;;;;;kBAK9B,CAAC;AAGZ,eAAO,MAAM,8BAA8B;;;;;;kBAKhC,CAAC;AAEZ,eAAO,MAAM,4BAA4B;;;;;;;;kBAY9B,CAAC;AAEZ,eAAO,MAAM,mCAAmC;;;;;;;kBAKrC,CAAC;AAGZ,eAAO,MAAM,mCAAmC;;;;;;;kBAKrC,CAAC;AAGZ,eAAO,MAA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