@openora/core 0.4.1-canary.65 → 0.4.1-canary.67

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 (157) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/audit/__tests__/audit.service.int.test.js +157 -2
  3. package/dist/audit/__tests__/audit.service.int.test.js.map +1 -1
  4. package/dist/audit/plugin.d.ts +2 -0
  5. package/dist/audit/plugin.d.ts.map +1 -1
  6. package/dist/audit/plugin.js +50 -34
  7. package/dist/audit/plugin.js.map +1 -1
  8. package/dist/casino/gaming/__tests__/gaming.service.int.test.js +4 -3
  9. package/dist/casino/gaming/__tests__/gaming.service.int.test.js.map +1 -1
  10. package/dist/casino/gaming/plugin.d.ts +1 -1
  11. package/dist/casino/gaming/plugin.d.ts.map +1 -1
  12. package/dist/casino/gaming/plugin.js +3 -3
  13. package/dist/casino/gaming/plugin.js.map +1 -1
  14. package/dist/casino/gaming/service/gaming.service.d.ts +3 -2
  15. package/dist/casino/gaming/service/gaming.service.d.ts.map +1 -1
  16. package/dist/casino/gaming/service/gaming.service.js +9 -2
  17. package/dist/casino/gaming/service/gaming.service.js.map +1 -1
  18. package/dist/compliance/__tests__/compliance.service.int.test.js +4 -3
  19. package/dist/compliance/__tests__/compliance.service.int.test.js.map +1 -1
  20. package/dist/compliance/__tests__/kyc-admin.router.int.test.js +2 -1
  21. package/dist/compliance/__tests__/kyc-admin.router.int.test.js.map +1 -1
  22. package/dist/compliance/__tests__/kyc.service.int.test.js +2 -1
  23. package/dist/compliance/__tests__/kyc.service.int.test.js.map +1 -1
  24. package/dist/compliance/__tests__/rg.router.int.test.js +4 -2
  25. package/dist/compliance/__tests__/rg.router.int.test.js.map +1 -1
  26. package/dist/compliance/__tests__/rg.service.int.test.js +4 -2
  27. package/dist/compliance/__tests__/rg.service.int.test.js.map +1 -1
  28. package/dist/compliance/plugin.d.ts.map +1 -1
  29. package/dist/compliance/plugin.js +4 -2
  30. package/dist/compliance/plugin.js.map +1 -1
  31. package/dist/compliance/service/compliance.service.d.ts +3 -2
  32. package/dist/compliance/service/compliance.service.d.ts.map +1 -1
  33. package/dist/compliance/service/compliance.service.js +5 -1
  34. package/dist/compliance/service/compliance.service.js.map +1 -1
  35. package/dist/compliance/service/kyc.service.d.ts +3 -1
  36. package/dist/compliance/service/kyc.service.d.ts.map +1 -1
  37. package/dist/compliance/service/kyc.service.js +6 -2
  38. package/dist/compliance/service/kyc.service.js.map +1 -1
  39. package/dist/compliance/service/rg.service.d.ts +3 -1
  40. package/dist/compliance/service/rg.service.d.ts.map +1 -1
  41. package/dist/compliance/service/rg.service.js +7 -0
  42. package/dist/compliance/service/rg.service.js.map +1 -1
  43. package/dist/contracts/adapters/identity-reader.d.ts +2 -0
  44. package/dist/contracts/adapters/identity-reader.d.ts.map +1 -1
  45. package/dist/contracts/adapters/identity-reader.js.map +1 -1
  46. package/dist/contracts/schemas/events.d.ts +46 -0
  47. package/dist/contracts/schemas/events.d.ts.map +1 -1
  48. package/dist/contracts/schemas/events.js +121 -24
  49. package/dist/contracts/schemas/events.js.map +1 -1
  50. package/dist/engagement/chat/__tests__/chat.service.int.test.js +8 -3
  51. package/dist/engagement/chat/__tests__/chat.service.int.test.js.map +1 -1
  52. package/dist/engagement/chat/plugin.d.ts.map +1 -1
  53. package/dist/engagement/chat/plugin.js +2 -2
  54. package/dist/engagement/chat/plugin.js.map +1 -1
  55. package/dist/engagement/chat/service/chat.service.d.ts +3 -2
  56. package/dist/engagement/chat/service/chat.service.d.ts.map +1 -1
  57. package/dist/engagement/chat/service/chat.service.js +18 -1
  58. package/dist/engagement/chat/service/chat.service.js.map +1 -1
  59. package/dist/engagement/chat-commands/contract/index.d.ts +1 -0
  60. package/dist/engagement/chat-commands/contract/index.d.ts.map +1 -1
  61. package/dist/engagement/chat-commands/contract/index.js +1 -0
  62. package/dist/engagement/chat-commands/contract/index.js.map +1 -1
  63. package/dist/engagement/chat-commands/router/index.d.ts +1 -0
  64. package/dist/engagement/chat-commands/router/index.d.ts.map +1 -1
  65. package/dist/engagement/chat-commands/router/index.js +1 -1
  66. package/dist/engagement/chat-commands/router/index.js.map +1 -1
  67. package/dist/engagement/chat-commands/service/__tests__/chat-commands.service.test.js +61 -4
  68. package/dist/engagement/chat-commands/service/__tests__/chat-commands.service.test.js.map +1 -1
  69. package/dist/engagement/chat-commands/service/chat-commands.service.d.ts +6 -1
  70. package/dist/engagement/chat-commands/service/chat-commands.service.d.ts.map +1 -1
  71. package/dist/engagement/chat-commands/service/chat-commands.service.js +10 -3
  72. package/dist/engagement/chat-commands/service/chat-commands.service.js.map +1 -1
  73. package/dist/iam/__tests__/iam.service.int.test.js +42 -38
  74. package/dist/iam/__tests__/iam.service.int.test.js.map +1 -1
  75. package/dist/iam/plugin.d.ts.map +1 -1
  76. package/dist/iam/plugin.js +2 -2
  77. package/dist/iam/plugin.js.map +1 -1
  78. package/dist/iam/service/iam.service.d.ts +3 -2
  79. package/dist/iam/service/iam.service.d.ts.map +1 -1
  80. package/dist/iam/service/iam.service.js +24 -10
  81. package/dist/iam/service/iam.service.js.map +1 -1
  82. package/dist/pam/identity/__tests__/identity.rate-limit.int.test.js +6 -2
  83. package/dist/pam/identity/__tests__/identity.rate-limit.int.test.js.map +1 -1
  84. package/dist/pam/identity/__tests__/identity.service.int.test.js +3 -2
  85. package/dist/pam/identity/__tests__/identity.service.int.test.js.map +1 -1
  86. package/dist/pam/identity/__tests__/login-enforcement.service.int.test.js +8 -3
  87. package/dist/pam/identity/__tests__/login-enforcement.service.int.test.js.map +1 -1
  88. package/dist/pam/identity/adapters/identity-reader.service.d.ts +1 -0
  89. package/dist/pam/identity/adapters/identity-reader.service.d.ts.map +1 -1
  90. package/dist/pam/identity/adapters/identity-reader.service.js +11 -0
  91. package/dist/pam/identity/adapters/identity-reader.service.js.map +1 -1
  92. package/dist/pam/identity/plugin.d.ts.map +1 -1
  93. package/dist/pam/identity/plugin.js +16 -3
  94. package/dist/pam/identity/plugin.js.map +1 -1
  95. package/dist/pam/identity/service/identity.service.d.ts +4 -2
  96. package/dist/pam/identity/service/identity.service.d.ts.map +1 -1
  97. package/dist/pam/identity/service/identity.service.js +81 -31
  98. package/dist/pam/identity/service/identity.service.js.map +1 -1
  99. package/dist/pam/identity/service/phone-login.service.d.ts.map +1 -1
  100. package/dist/pam/identity/service/phone-login.service.js +16 -6
  101. package/dist/pam/identity/service/phone-login.service.js.map +1 -1
  102. package/dist/pam/identity/service/session.service.d.ts +4 -2
  103. package/dist/pam/identity/service/session.service.d.ts.map +1 -1
  104. package/dist/pam/identity/service/session.service.js +5 -1
  105. package/dist/pam/identity/service/session.service.js.map +1 -1
  106. package/dist/pam/player-management/__tests__/kyc-status-writer.int.test.js +2 -1
  107. package/dist/pam/player-management/__tests__/kyc-status-writer.int.test.js.map +1 -1
  108. package/dist/pam/player-management/__tests__/player.service.int.test.js +1 -0
  109. package/dist/pam/player-management/__tests__/player.service.int.test.js.map +1 -1
  110. package/dist/pam/player-management/service/kyc-status-writer.d.ts.map +1 -1
  111. package/dist/pam/player-management/service/kyc-status-writer.js +2 -1
  112. package/dist/pam/player-management/service/kyc-status-writer.js.map +1 -1
  113. package/dist/pam/player-management/service/player.service.d.ts.map +1 -1
  114. package/dist/pam/player-management/service/player.service.js +1 -0
  115. package/dist/pam/player-management/service/player.service.js.map +1 -1
  116. package/dist/pam/tag/__tests__/tag-evaluation.service.int.test.js +57 -13
  117. package/dist/pam/tag/__tests__/tag-evaluation.service.int.test.js.map +1 -1
  118. package/dist/pam/tag/service/tag.service.d.ts.map +1 -1
  119. package/dist/pam/tag/service/tag.service.js +25 -0
  120. package/dist/pam/tag/service/tag.service.js.map +1 -1
  121. package/dist/server/auth/admin-guard.d.ts +3 -2
  122. package/dist/server/auth/admin-guard.d.ts.map +1 -1
  123. package/dist/server/auth/admin-guard.js +28 -9
  124. package/dist/server/auth/admin-guard.js.map +1 -1
  125. package/dist/server/kernel/__tests__/event-bus.int.test.js +9 -5
  126. package/dist/server/kernel/__tests__/event-bus.int.test.js.map +1 -1
  127. package/dist/server/runtime/create-app.d.ts.map +1 -1
  128. package/dist/server/runtime/create-app.js +4 -2
  129. package/dist/server/runtime/create-app.js.map +1 -1
  130. package/dist/testing/mock.d.ts +2 -1
  131. package/dist/testing/mock.d.ts.map +1 -1
  132. package/dist/testing/mock.js +8 -0
  133. package/dist/testing/mock.js.map +1 -1
  134. package/dist/wallet/__tests__/wallet-auto-rule.router.int.test.js +2 -1
  135. package/dist/wallet/__tests__/wallet-auto-rule.router.int.test.js.map +1 -1
  136. package/dist/wallet/__tests__/wallet-auto-withdrawal-config.router.int.test.js +4 -2
  137. package/dist/wallet/__tests__/wallet-auto-withdrawal-config.router.int.test.js.map +1 -1
  138. package/dist/wallet/__tests__/wallet-auto-withdrawal.int.test.js +5 -2
  139. package/dist/wallet/__tests__/wallet-auto-withdrawal.int.test.js.map +1 -1
  140. package/dist/wallet/__tests__/wallet-kyc-gate.int.test.js +4 -2
  141. package/dist/wallet/__tests__/wallet-kyc-gate.int.test.js.map +1 -1
  142. package/dist/wallet/__tests__/wallet-webhook.router.int.test.js +4 -2
  143. package/dist/wallet/__tests__/wallet-webhook.router.int.test.js.map +1 -1
  144. package/dist/wallet/__tests__/wallet.rate-limit.int.test.js +4 -2
  145. package/dist/wallet/__tests__/wallet.rate-limit.int.test.js.map +1 -1
  146. package/dist/wallet/__tests__/wallet.router.int.test.js +2 -1
  147. package/dist/wallet/__tests__/wallet.router.int.test.js.map +1 -1
  148. package/dist/wallet/__tests__/wallet.service.int.test.js +4 -2
  149. package/dist/wallet/__tests__/wallet.service.int.test.js.map +1 -1
  150. package/dist/wallet/plugin.d.ts.map +1 -1
  151. package/dist/wallet/plugin.js +2 -1
  152. package/dist/wallet/plugin.js.map +1 -1
  153. package/dist/wallet/service/wallet.service.d.ts +4 -2
  154. package/dist/wallet/service/wallet.service.d.ts.map +1 -1
  155. package/dist/wallet/service/wallet.service.js +8 -1
  156. package/dist/wallet/service/wallet.service.js.map +1 -1
  157. package/package.json +1 -1
@@ -1,6 +1,7 @@
1
1
  import * as z from 'zod';
2
2
  export declare const KycStatusUpdatedSchema: z.ZodObject<{
3
3
  userId: z.ZodUUID;
4
+ playerId: z.ZodNullable<z.ZodUUID>;
4
5
  actorId: z.ZodNullable<z.ZodUUID>;
5
6
  status: z.ZodEnum<{
6
7
  pending: "pending";
@@ -33,11 +34,13 @@ export declare const domainEventSchemas: {
33
34
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
34
35
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
35
36
  userId: z.ZodUUID;
37
+ playerId: z.ZodNullable<z.ZodUUID>;
36
38
  }, z.core.$strip>;
37
39
  readonly 'identity.user.login': z.ZodObject<{
38
40
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
39
41
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
40
42
  userId: z.ZodUUID;
43
+ playerId: z.ZodNullable<z.ZodUUID>;
41
44
  }, z.core.$strip>;
42
45
  readonly 'identity.user.login.failed': z.ZodObject<{
43
46
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -50,11 +53,13 @@ export declare const domainEventSchemas: {
50
53
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
51
54
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
55
  userId: z.ZodUUID;
56
+ playerId: z.ZodNullable<z.ZodUUID>;
53
57
  }, z.core.$strip>;
54
58
  readonly 'identity.user.phone_login': z.ZodObject<{
55
59
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
60
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
61
  userId: z.ZodUUID;
62
+ playerId: z.ZodNullable<z.ZodUUID>;
58
63
  method: z.ZodLiteral<"phone">;
59
64
  }, z.core.$strip>;
60
65
  readonly 'identity.phone_otp.requested': z.ZodObject<{
@@ -91,26 +96,31 @@ export declare const domainEventSchemas: {
91
96
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
92
97
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
93
98
  userId: z.ZodUUID;
99
+ playerId: z.ZodNullable<z.ZodUUID>;
94
100
  }, z.core.$strip>;
95
101
  readonly 'identity.2fa.disabled': z.ZodObject<{
96
102
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
97
103
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
98
104
  userId: z.ZodUUID;
105
+ playerId: z.ZodNullable<z.ZodUUID>;
99
106
  }, z.core.$strip>;
100
107
  readonly 'identity.password.reset': z.ZodObject<{
101
108
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
102
109
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
110
  userId: z.ZodUUID;
111
+ playerId: z.ZodNullable<z.ZodUUID>;
104
112
  }, z.core.$strip>;
105
113
  readonly 'identity.email.verified': z.ZodObject<{
106
114
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
107
115
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
108
116
  userId: z.ZodUUID;
117
+ playerId: z.ZodNullable<z.ZodUUID>;
109
118
  }, z.core.$strip>;
110
119
  readonly 'identity.profile.updated': z.ZodObject<{
111
120
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
112
121
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
113
122
  userId: z.ZodUUID;
123
+ playerId: z.ZodNullable<z.ZodUUID>;
114
124
  }, z.core.$strip>;
115
125
  readonly 'identity.user.deactivated': z.ZodObject<{
116
126
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -128,6 +138,7 @@ export declare const domainEventSchemas: {
128
138
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
129
139
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
130
140
  userId: z.ZodUUID;
141
+ playerId: z.ZodNullable<z.ZodUUID>;
131
142
  sessionId: z.ZodUUID;
132
143
  actorId: z.ZodOptional<z.ZodUUID>;
133
144
  }, z.core.$strip>;
@@ -135,12 +146,14 @@ export declare const domainEventSchemas: {
135
146
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
136
147
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
137
148
  userId: z.ZodUUID;
149
+ playerId: z.ZodNullable<z.ZodUUID>;
138
150
  actorId: z.ZodOptional<z.ZodUUID>;
139
151
  }, z.core.$strip>;
140
152
  readonly 'identity.user.unauthorized_access': z.ZodObject<{
141
153
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
142
154
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
143
155
  userId: z.ZodUUID;
156
+ playerId: z.ZodNullable<z.ZodUUID>;
144
157
  resource: z.ZodString;
145
158
  action: z.ZodString;
146
159
  role: z.ZodOptional<z.ZodString>;
@@ -157,18 +170,21 @@ export declare const domainEventSchemas: {
157
170
  amount: z.ZodString;
158
171
  currency: z.ZodString;
159
172
  transactionId: z.ZodUUID;
173
+ playerId: z.ZodNullable<z.ZodUUID>;
160
174
  }, z.core.$strip>;
161
175
  readonly 'wallet.withdrawal.completed': z.ZodObject<{
162
176
  userId: z.ZodUUID;
163
177
  amount: z.ZodString;
164
178
  currency: z.ZodString;
165
179
  transactionId: z.ZodUUID;
180
+ playerId: z.ZodNullable<z.ZodUUID>;
166
181
  }, z.core.$strip>;
167
182
  readonly 'wallet.withdrawal.requested': z.ZodObject<{
168
183
  userId: z.ZodUUID;
169
184
  amount: z.ZodString;
170
185
  currency: z.ZodString;
171
186
  transactionId: z.ZodUUID;
187
+ playerId: z.ZodNullable<z.ZodUUID>;
172
188
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
173
189
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
174
190
  }, z.core.$strip>;
@@ -202,11 +218,13 @@ export declare const domainEventSchemas: {
202
218
  roundId: z.ZodUUID;
203
219
  gameId: z.ZodUUID;
204
220
  userId: z.ZodUUID;
221
+ playerId: z.ZodNullable<z.ZodUUID>;
205
222
  currency: z.ZodString;
206
223
  }, z.core.$strip>;
207
224
  readonly 'gaming.round.ended': z.ZodObject<{
208
225
  roundId: z.ZodUUID;
209
226
  userId: z.ZodUUID;
227
+ playerId: z.ZodNullable<z.ZodUUID>;
210
228
  }, z.core.$strip>;
211
229
  readonly 'chat.message.sent': z.ZodObject<{
212
230
  messageId: z.ZodUUID;
@@ -217,25 +235,33 @@ export declare const domainEventSchemas: {
217
235
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
218
236
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
219
237
  blockerId: z.ZodUUID;
238
+ actorPlayerId: z.ZodNullable<z.ZodUUID>;
220
239
  blockedId: z.ZodUUID;
240
+ playerId: z.ZodNullable<z.ZodUUID>;
221
241
  }, z.core.$strip>;
222
242
  readonly 'chat.user.unblocked': z.ZodObject<{
223
243
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
224
244
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
225
245
  blockerId: z.ZodUUID;
246
+ actorPlayerId: z.ZodNullable<z.ZodUUID>;
226
247
  blockedId: z.ZodUUID;
248
+ playerId: z.ZodNullable<z.ZodUUID>;
227
249
  }, z.core.$strip>;
228
250
  readonly 'chat.user.ignored': z.ZodObject<{
229
251
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
230
252
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
231
253
  ignorerId: z.ZodUUID;
254
+ actorPlayerId: z.ZodNullable<z.ZodUUID>;
232
255
  ignoredId: z.ZodUUID;
256
+ playerId: z.ZodNullable<z.ZodUUID>;
233
257
  }, z.core.$strip>;
234
258
  readonly 'chat.user.unignored': z.ZodObject<{
235
259
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
236
260
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
237
261
  ignorerId: z.ZodUUID;
262
+ actorPlayerId: z.ZodNullable<z.ZodUUID>;
238
263
  ignoredId: z.ZodUUID;
264
+ playerId: z.ZodNullable<z.ZodUUID>;
239
265
  }, z.core.$strip>;
240
266
  readonly 'chat.room.created': z.ZodObject<{
241
267
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -278,24 +304,28 @@ export declare const domainEventSchemas: {
278
304
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
279
305
  roomId: z.ZodUUID;
280
306
  creatorId: z.ZodUUID;
307
+ playerId: z.ZodNullable<z.ZodUUID>;
281
308
  }, z.core.$strip>;
282
309
  readonly 'chat.private_room.deleted': z.ZodObject<{
283
310
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
284
311
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
285
312
  roomId: z.ZodUUID;
286
313
  creatorId: z.ZodUUID;
314
+ playerId: z.ZodNullable<z.ZodUUID>;
287
315
  }, z.core.$strip>;
288
316
  readonly 'chat.room.member.joined': z.ZodObject<{
289
317
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
290
318
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
291
319
  roomId: z.ZodUUID;
292
320
  userId: z.ZodUUID;
321
+ playerId: z.ZodNullable<z.ZodUUID>;
293
322
  }, z.core.$strip>;
294
323
  readonly 'chat.room.member.left': z.ZodObject<{
295
324
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
296
325
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
297
326
  roomId: z.ZodUUID;
298
327
  userId: z.ZodUUID;
328
+ playerId: z.ZodNullable<z.ZodUUID>;
299
329
  }, z.core.$strip>;
300
330
  readonly 'chat.room.member.kicked': z.ZodObject<{
301
331
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -303,6 +333,7 @@ export declare const domainEventSchemas: {
303
333
  roomId: z.ZodUUID;
304
334
  userId: z.ZodUUID;
305
335
  kickedBy: z.ZodUUID;
336
+ playerId: z.ZodNullable<z.ZodUUID>;
306
337
  }, z.core.$strip>;
307
338
  readonly 'chat.room.member.banned': z.ZodObject<{
308
339
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -310,6 +341,7 @@ export declare const domainEventSchemas: {
310
341
  roomId: z.ZodUUID;
311
342
  userId: z.ZodUUID;
312
343
  bannedBy: z.ZodUUID;
344
+ playerId: z.ZodNullable<z.ZodUUID>;
313
345
  }, z.core.$strip>;
314
346
  readonly 'compliance.geo-rule.added': z.ZodObject<{
315
347
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -325,18 +357,21 @@ export declare const domainEventSchemas: {
325
357
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
326
358
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
327
359
  userId: z.ZodUUID;
360
+ playerId: z.ZodNullable<z.ZodUUID>;
328
361
  limitId: z.ZodUUID;
329
362
  }, z.core.$strip>;
330
363
  readonly 'compliance.limit.removed': z.ZodObject<{
331
364
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
332
365
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
333
366
  userId: z.ZodUUID;
367
+ playerId: z.ZodNullable<z.ZodUUID>;
334
368
  limitId: z.ZodUUID;
335
369
  }, z.core.$strip>;
336
370
  readonly 'rg.limit.set': z.ZodObject<{
337
371
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
338
372
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
339
373
  userId: z.ZodUUID;
374
+ playerId: z.ZodNullable<z.ZodUUID>;
340
375
  actorId: z.ZodUUID;
341
376
  limitId: z.ZodUUID;
342
377
  type: z.ZodEnum<{
@@ -360,6 +395,7 @@ export declare const domainEventSchemas: {
360
395
  actorId: z.ZodUUID;
361
396
  reason: z.ZodString;
362
397
  userId: z.ZodUUID;
398
+ playerId: z.ZodNullable<z.ZodUUID>;
363
399
  exclusionId: z.ZodUUID;
364
400
  expiresAt: z.ZodISODateTime;
365
401
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -369,6 +405,7 @@ export declare const domainEventSchemas: {
369
405
  actorId: z.ZodUUID;
370
406
  reason: z.ZodString;
371
407
  userId: z.ZodUUID;
408
+ playerId: z.ZodNullable<z.ZodUUID>;
372
409
  exclusionId: z.ZodUUID;
373
410
  isPermanent: z.ZodBoolean;
374
411
  durationMonths: z.ZodNullable<z.ZodNumber>;
@@ -380,6 +417,7 @@ export declare const domainEventSchemas: {
380
417
  actorId: z.ZodUUID;
381
418
  reason: z.ZodString;
382
419
  userId: z.ZodUUID;
420
+ playerId: z.ZodNullable<z.ZodUUID>;
383
421
  exclusionId: z.ZodUUID;
384
422
  kind: z.ZodEnum<{
385
423
  cooling_off: "cooling_off";
@@ -392,6 +430,7 @@ export declare const domainEventSchemas: {
392
430
  actorId: z.ZodUUID;
393
431
  reason: z.ZodString;
394
432
  userId: z.ZodUUID;
433
+ playerId: z.ZodNullable<z.ZodUUID>;
395
434
  exclusionId: z.ZodUUID;
396
435
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
397
436
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -400,9 +439,11 @@ export declare const domainEventSchemas: {
400
439
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
401
440
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
402
441
  userId: z.ZodUUID;
442
+ playerId: z.ZodNullable<z.ZodUUID>;
403
443
  }, z.core.$strip>;
404
444
  readonly 'compliance.kyc.updated': z.ZodObject<{
405
445
  userId: z.ZodUUID;
446
+ playerId: z.ZodNullable<z.ZodUUID>;
406
447
  actorId: z.ZodNullable<z.ZodUUID>;
407
448
  status: z.ZodEnum<{
408
449
  pending: "pending";
@@ -434,15 +475,18 @@ export declare const domainEventSchemas: {
434
475
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
435
476
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
436
477
  userId: z.ZodUUID;
478
+ playerId: z.ZodNullable<z.ZodUUID>;
437
479
  referenceId: z.ZodString;
438
480
  provider: z.ZodString;
439
481
  }, z.core.$strip>;
440
482
  readonly 'compliance.kyc.reverify_required': z.ZodObject<{
441
483
  userId: z.ZodUUID;
484
+ playerId: z.ZodNullable<z.ZodUUID>;
442
485
  reason: z.ZodString;
443
486
  }, z.core.$strip>;
444
487
  readonly 'compliance.kyc.high_risk_signal_detected': z.ZodObject<{
445
488
  userId: z.ZodUUID;
489
+ playerId: z.ZodNullable<z.ZodUUID>;
446
490
  referenceId: z.ZodString;
447
491
  vpnOrTorDetected: z.ZodBoolean;
448
492
  dataCenterIpDetected: z.ZodBoolean;
@@ -718,6 +762,7 @@ export declare const domainEventSchemas: {
718
762
  }, z.core.$strip>;
719
763
  readonly 'player.level.changed': z.ZodObject<{
720
764
  userId: z.ZodUUID;
765
+ playerId: z.ZodNullable<z.ZodUUID>;
721
766
  previousLevel: z.ZodNumber;
722
767
  newLevel: z.ZodNumber;
723
768
  actorId: z.ZodUUID;
@@ -726,6 +771,7 @@ export declare const domainEventSchemas: {
726
771
  ip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
727
772
  userAgent: z.ZodOptional<z.ZodNullable<z.ZodString>>;
728
773
  userId: z.ZodUUID;
774
+ playerId: z.ZodNullable<z.ZodUUID>;
729
775
  status: z.ZodEnum<{
730
776
  active: "active";
731
777
  self_excluded: "self_excluded";
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/contracts/schemas/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAyCzB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAOjC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4UrB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAC9D,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAIpG,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CA4BxE,CAAC;AAEF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,eAAO,MAAM,oBAAoB,EAAsC,eAAe,EAAE,CAAC;AAEzF,sIAAsI;AACtI,wBAAgB,YAAY,IAAI,aAAa,CAAC;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAKzF"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../src/contracts/schemas/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAyCzB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAQjC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4arB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,kBAAkB,CAAC;AAC9D,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,eAAe,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,OAAO,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAIpG,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CA4BxE,CAAC;AAEF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAErD;AAED,eAAO,MAAM,oBAAoB,EAAsC,eAAe,EAAE,CAAC;AAEzF,sIAAsI;AACtI,wBAAgB,YAAY,IAAI,aAAa,CAAC;IAAE,KAAK,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAKzF"}
@@ -30,6 +30,7 @@ const walletTxnBase = z.object({
30
30
  });
31
31
  export const KycStatusUpdatedSchema = z.object({
32
32
  userId: UuidSchema,
33
+ playerId: UuidSchema.nullable(),
33
34
  actorId: UuidSchema.nullable(),
34
35
  status: KycStatusSchema,
35
36
  previousStatus: KycStatusSchema,
@@ -37,16 +38,26 @@ export const KycStatusUpdatedSchema = z.object({
37
38
  source: KycStatusSourceSchema,
38
39
  });
39
40
  export const domainEventSchemas = {
40
- 'identity.user.registered': authContextBase.extend({ userId: UuidSchema }),
41
- 'identity.user.login': authContextBase.extend({ userId: UuidSchema }),
41
+ 'identity.user.registered': authContextBase.extend({
42
+ userId: UuidSchema,
43
+ playerId: UuidSchema.nullable(),
44
+ }),
45
+ 'identity.user.login': authContextBase.extend({
46
+ userId: UuidSchema,
47
+ playerId: UuidSchema.nullable(),
48
+ }),
42
49
  'identity.user.login.failed': authContextBase.extend({
43
50
  email: z.email(),
44
51
  reason: z.string().nullable().optional(),
45
52
  attemptsRemaining: z.number().int().optional(),
46
53
  }),
47
- 'identity.user.logout': authContextBase.extend({ userId: UuidSchema }),
54
+ 'identity.user.logout': authContextBase.extend({
55
+ userId: UuidSchema,
56
+ playerId: UuidSchema.nullable(),
57
+ }),
48
58
  'identity.user.phone_login': authContextBase.extend({
49
59
  userId: UuidSchema,
60
+ playerId: UuidSchema.nullable(),
50
61
  method: z.literal('phone'),
51
62
  }),
52
63
  'identity.phone_otp.requested': authContextBase.extend({ userId: UuidSchema }),
@@ -66,11 +77,26 @@ export const domainEventSchemas = {
66
77
  previousFailedAttempts: z.number().int().optional(),
67
78
  previousLockoutUntil: TimestampSchema.nullable().optional(),
68
79
  }),
69
- 'identity.2fa.enabled': authContextBase.extend({ userId: UuidSchema }),
70
- 'identity.2fa.disabled': authContextBase.extend({ userId: UuidSchema }),
71
- 'identity.password.reset': authContextBase.extend({ userId: UuidSchema }),
72
- 'identity.email.verified': authContextBase.extend({ userId: UuidSchema }),
73
- 'identity.profile.updated': authContextBase.extend({ userId: UuidSchema }),
80
+ 'identity.2fa.enabled': authContextBase.extend({
81
+ userId: UuidSchema,
82
+ playerId: UuidSchema.nullable(),
83
+ }),
84
+ 'identity.2fa.disabled': authContextBase.extend({
85
+ userId: UuidSchema,
86
+ playerId: UuidSchema.nullable(),
87
+ }),
88
+ 'identity.password.reset': authContextBase.extend({
89
+ userId: UuidSchema,
90
+ playerId: UuidSchema.nullable(),
91
+ }),
92
+ 'identity.email.verified': authContextBase.extend({
93
+ userId: UuidSchema,
94
+ playerId: UuidSchema.nullable(),
95
+ }),
96
+ 'identity.profile.updated': authContextBase.extend({
97
+ userId: UuidSchema,
98
+ playerId: UuidSchema.nullable(),
99
+ }),
74
100
  // An admin toggled a user's active status (the only user-lifecycle flow today;
75
101
  // users are deactivated, never hard-deleted). userId = subject, actorId = the
76
102
  // admin who acted (for a complete audit trail).
@@ -78,15 +104,18 @@ export const domainEventSchemas = {
78
104
  'identity.user.reactivated': authContextBase.extend({ userId: UuidSchema, actorId: UuidSchema }),
79
105
  'identity.session.revoked': authContextBase.extend({
80
106
  userId: UuidSchema,
107
+ playerId: UuidSchema.nullable(),
81
108
  sessionId: UuidSchema,
82
109
  actorId: UuidSchema.optional(),
83
110
  }),
84
111
  'identity.sessions.revoked_all': authContextBase.extend({
85
112
  userId: UuidSchema,
113
+ playerId: UuidSchema.nullable(),
86
114
  actorId: UuidSchema.optional(),
87
115
  }),
88
116
  'identity.user.unauthorized_access': authContextBase.extend({
89
117
  userId: UuidSchema,
118
+ playerId: UuidSchema.nullable(),
90
119
  resource: z.string(),
91
120
  action: z.string(),
92
121
  role: z.string().optional(),
@@ -98,11 +127,13 @@ export const domainEventSchemas = {
98
127
  email: z.email(),
99
128
  actorId: UuidSchema,
100
129
  }),
101
- 'wallet.deposit.completed': walletTxnBase,
102
- 'wallet.withdrawal.completed': walletTxnBase,
130
+ 'wallet.deposit.completed': walletTxnBase.extend({ playerId: UuidSchema.nullable() }),
131
+ 'wallet.withdrawal.completed': walletTxnBase.extend({ playerId: UuidSchema.nullable() }),
103
132
  // A player requested a withdrawal; funds are held (balance debited) and the
104
133
  // request enters the back-office approval queue as `pending`.
105
- 'wallet.withdrawal.requested': walletTxnBase.extend(authContextBase.shape),
134
+ 'wallet.withdrawal.requested': walletTxnBase
135
+ .extend({ playerId: UuidSchema.nullable() })
136
+ .extend(authContextBase.shape),
106
137
  // A payments admin approved a pending withdrawal; it moves to `processing` and
107
138
  // is sent to the PSP/Fireblocks rail. `adminId` is the acting reviewer.
108
139
  'wallet.withdrawal.approved': walletTxnBase
@@ -120,9 +151,14 @@ export const domainEventSchemas = {
120
151
  roundId: UuidSchema,
121
152
  gameId: UuidSchema,
122
153
  userId: UuidSchema,
154
+ playerId: UuidSchema.nullable(),
123
155
  currency: CurrencyCodeSchema,
124
156
  }),
125
- 'gaming.round.ended': z.object({ roundId: UuidSchema, userId: UuidSchema }),
157
+ 'gaming.round.ended': z.object({
158
+ roundId: UuidSchema,
159
+ userId: UuidSchema,
160
+ playerId: UuidSchema.nullable(),
161
+ }),
126
162
  'chat.message.sent': z.object({
127
163
  messageId: UuidSchema,
128
164
  // null for global-chat messages (no room); a room id otherwise.
@@ -130,10 +166,31 @@ export const domainEventSchemas = {
130
166
  userId: UuidSchema,
131
167
  }),
132
168
  // A player muted/unmuted another player's messages for themselves (ABC-45 AC11).
133
- 'chat.user.blocked': authContextBase.extend({ blockerId: UuidSchema, blockedId: UuidSchema }),
134
- 'chat.user.unblocked': authContextBase.extend({ blockerId: UuidSchema, blockedId: UuidSchema }),
135
- 'chat.user.ignored': authContextBase.extend({ ignorerId: UuidSchema, ignoredId: UuidSchema }),
136
- 'chat.user.unignored': authContextBase.extend({ ignorerId: UuidSchema, ignoredId: UuidSchema }),
169
+ // actorPlayerId = the blocker/ignorer; playerId = the blocked/ignored subject (resourceId).
170
+ 'chat.user.blocked': authContextBase.extend({
171
+ blockerId: UuidSchema,
172
+ actorPlayerId: UuidSchema.nullable(),
173
+ blockedId: UuidSchema,
174
+ playerId: UuidSchema.nullable(),
175
+ }),
176
+ 'chat.user.unblocked': authContextBase.extend({
177
+ blockerId: UuidSchema,
178
+ actorPlayerId: UuidSchema.nullable(),
179
+ blockedId: UuidSchema,
180
+ playerId: UuidSchema.nullable(),
181
+ }),
182
+ 'chat.user.ignored': authContextBase.extend({
183
+ ignorerId: UuidSchema,
184
+ actorPlayerId: UuidSchema.nullable(),
185
+ ignoredId: UuidSchema,
186
+ playerId: UuidSchema.nullable(),
187
+ }),
188
+ 'chat.user.unignored': authContextBase.extend({
189
+ ignorerId: UuidSchema,
190
+ actorPlayerId: UuidSchema.nullable(),
191
+ ignoredId: UuidSchema,
192
+ playerId: UuidSchema.nullable(),
193
+ }),
137
194
  // Admin room CRUD (actorId = acting admin UUID).
138
195
  'chat.room.created': authContextBase.extend({
139
196
  roomId: UuidSchema,
@@ -157,22 +214,34 @@ export const domainEventSchemas = {
157
214
  'chat.private_room.created': authContextBase.extend({
158
215
  roomId: UuidSchema,
159
216
  creatorId: UuidSchema,
217
+ playerId: UuidSchema.nullable(),
160
218
  }),
161
219
  'chat.private_room.deleted': authContextBase.extend({
162
220
  roomId: UuidSchema,
163
221
  creatorId: UuidSchema,
222
+ playerId: UuidSchema.nullable(),
223
+ }),
224
+ 'chat.room.member.joined': authContextBase.extend({
225
+ roomId: UuidSchema,
226
+ userId: UuidSchema,
227
+ playerId: UuidSchema.nullable(),
228
+ }),
229
+ 'chat.room.member.left': authContextBase.extend({
230
+ roomId: UuidSchema,
231
+ userId: UuidSchema,
232
+ playerId: UuidSchema.nullable(),
164
233
  }),
165
- 'chat.room.member.joined': authContextBase.extend({ roomId: UuidSchema, userId: UuidSchema }),
166
- 'chat.room.member.left': authContextBase.extend({ roomId: UuidSchema, userId: UuidSchema }),
167
234
  'chat.room.member.kicked': authContextBase.extend({
168
235
  roomId: UuidSchema,
169
236
  userId: UuidSchema,
170
237
  kickedBy: UuidSchema,
238
+ playerId: UuidSchema.nullable(),
171
239
  }),
172
240
  'chat.room.member.banned': authContextBase.extend({
173
241
  roomId: UuidSchema,
174
242
  userId: UuidSchema,
175
243
  bannedBy: UuidSchema,
244
+ playerId: UuidSchema.nullable(),
176
245
  }),
177
246
  // An admin added or changed a geo (country) rule (regulatory). `actorId` is the
178
247
  // acting admin so the audit log can attribute the mutation.
@@ -181,8 +250,16 @@ export const domainEventSchemas = {
181
250
  action: GeoRuleActionSchema,
182
251
  actorId: UuidSchema.optional(),
183
252
  }),
184
- 'compliance.limit.upserted': authContextBase.extend({ userId: UuidSchema, limitId: UuidSchema }),
185
- 'compliance.limit.removed': authContextBase.extend({ userId: UuidSchema, limitId: UuidSchema }),
253
+ 'compliance.limit.upserted': authContextBase.extend({
254
+ userId: UuidSchema,
255
+ playerId: UuidSchema.nullable(),
256
+ limitId: UuidSchema,
257
+ }),
258
+ 'compliance.limit.removed': authContextBase.extend({
259
+ userId: UuidSchema,
260
+ playerId: UuidSchema.nullable(),
261
+ limitId: UuidSchema,
262
+ }),
186
263
  // Responsible-Gambling admin actions. `userId` = the subject player, `actorId` =
187
264
  // the acting admin (the envelope carries no caller, so it is explicit for the audit
188
265
  // trail). login_blocked is system-driven (no actor) and a failure outcome.
@@ -192,6 +269,7 @@ export const domainEventSchemas = {
192
269
  // when this is the first limit of that (type, period).
193
270
  'rg.limit.set': authContextBase.extend({
194
271
  userId: UuidSchema,
272
+ playerId: UuidSchema.nullable(),
195
273
  actorId: UuidSchema,
196
274
  limitId: UuidSchema,
197
275
  type: LimitTypeSchema,
@@ -202,13 +280,19 @@ export const domainEventSchemas = {
202
280
  previousMinutes: z.number().int().nullable(),
203
281
  }),
204
282
  'rg.cooling_off.activated': actorReasonBase
205
- .extend({ userId: UuidSchema, exclusionId: UuidSchema, expiresAt: TimestampSchema })
283
+ .extend({
284
+ userId: UuidSchema,
285
+ playerId: UuidSchema.nullable(),
286
+ exclusionId: UuidSchema,
287
+ expiresAt: TimestampSchema,
288
+ })
206
289
  .extend(authContextBase.shape),
207
290
  // durationMonths is the admin's chosen term, null when permanent - the regulatory
208
291
  // export reads the decision as made rather than re-deriving it from expiresAt.
209
292
  'rg.self_exclusion.activated': actorReasonBase
210
293
  .extend({
211
294
  userId: UuidSchema,
295
+ playerId: UuidSchema.nullable(),
212
296
  exclusionId: UuidSchema,
213
297
  isPermanent: z.boolean(),
214
298
  durationMonths: z.number().int().nullable(),
@@ -216,12 +300,20 @@ export const domainEventSchemas = {
216
300
  })
217
301
  .extend(authContextBase.shape),
218
302
  'rg.self_exclusion.lifted': actorReasonBase
219
- .extend({ userId: UuidSchema, exclusionId: UuidSchema, kind: ExclusionKindSchema })
303
+ .extend({
304
+ userId: UuidSchema,
305
+ playerId: UuidSchema.nullable(),
306
+ exclusionId: UuidSchema,
307
+ kind: ExclusionKindSchema,
308
+ })
220
309
  .extend(authContextBase.shape),
221
310
  'rg.cooling_off.lifted': actorReasonBase
222
- .extend({ userId: UuidSchema, exclusionId: UuidSchema })
311
+ .extend({ userId: UuidSchema, playerId: UuidSchema.nullable(), exclusionId: UuidSchema })
223
312
  .extend(authContextBase.shape),
224
- 'rg.exclusion.login_blocked': authContextBase.extend({ userId: UuidSchema }),
313
+ 'rg.exclusion.login_blocked': authContextBase.extend({
314
+ userId: UuidSchema,
315
+ playerId: UuidSchema.nullable(),
316
+ }),
225
317
  // A player's KYC status changed. userId = subject player; actorId = the admin who
226
318
  // acted, or null for system-driven changes (vendor decision, webhook, threshold
227
319
  // re-KYC). before/after status records the transition for the audit log.
@@ -230,6 +322,7 @@ export const domainEventSchemas = {
230
322
  // the provider. userId = the submitting player; referenceId = the provider reference.
231
323
  'compliance.kyc.submitted': authContextBase.extend({
232
324
  userId: UuidSchema,
325
+ playerId: UuidSchema.nullable(),
233
326
  referenceId: z.string(),
234
327
  provider: z.string(),
235
328
  }),
@@ -237,10 +330,12 @@ export const domainEventSchemas = {
237
330
  // System-driven (no admin actor); reason records the metric that crossed.
238
331
  'compliance.kyc.reverify_required': z.object({
239
332
  userId: UuidSchema,
333
+ playerId: UuidSchema.nullable(),
240
334
  reason: z.string(),
241
335
  }),
242
336
  'compliance.kyc.high_risk_signal_detected': z.object({
243
337
  userId: UuidSchema,
338
+ playerId: UuidSchema.nullable(),
244
339
  referenceId: z.string(),
245
340
  vpnOrTorDetected: z.boolean(),
246
341
  dataCenterIpDetected: z.boolean(),
@@ -338,6 +433,7 @@ export const domainEventSchemas = {
338
433
  }),
339
434
  'player.level.changed': z.object({
340
435
  userId: UuidSchema,
436
+ playerId: UuidSchema.nullable(),
341
437
  previousLevel: z.number().int(),
342
438
  newLevel: z.number().int(),
343
439
  actorId: UuidSchema,
@@ -347,6 +443,7 @@ export const domainEventSchemas = {
347
443
  // is a failure outcome. userId = the subject player; status = the blocking status.
348
444
  'player.login_blocked': authContextBase.extend({
349
445
  userId: UuidSchema,
446
+ playerId: UuidSchema.nullable(),
350
447
  status: PlayerStatusSchema,
351
448
  }),
352
449
  };