@openora/core 0.4.1-canary.35 → 0.4.1-canary.36
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.
- package/dist/.tsbuildinfo +1 -1
- package/dist/audit/plugin.d.ts.map +1 -1
- package/dist/audit/plugin.js +4 -2
- package/dist/audit/plugin.js.map +1 -1
- package/dist/casino/gaming/__tests__/gaming.service.test.js +18 -2
- package/dist/casino/gaming/__tests__/gaming.service.test.js.map +1 -1
- package/dist/casino/gaming/plugin.d.ts.map +1 -1
- package/dist/casino/gaming/plugin.js +3 -2
- package/dist/casino/gaming/plugin.js.map +1 -1
- package/dist/casino/gaming/router/index.d.ts.map +1 -1
- package/dist/casino/gaming/router/index.js +2 -2
- package/dist/casino/gaming/router/index.js.map +1 -1
- package/dist/casino/gaming/service/gaming.service.d.ts +4 -2
- package/dist/casino/gaming/service/gaming.service.d.ts.map +1 -1
- package/dist/casino/gaming/service/gaming.service.js +8 -2
- package/dist/casino/gaming/service/gaming.service.js.map +1 -1
- package/dist/compliance/__tests__/rg.contract.test.js +8 -1
- package/dist/compliance/__tests__/rg.contract.test.js.map +1 -1
- package/dist/compliance/__tests__/rg.router.test.js +35 -1
- package/dist/compliance/__tests__/rg.router.test.js.map +1 -1
- package/dist/compliance/__tests__/rg.service.test.js +73 -1
- package/dist/compliance/__tests__/rg.service.test.js.map +1 -1
- package/dist/compliance/contract/index.d.ts +26 -0
- package/dist/compliance/contract/index.d.ts.map +1 -1
- package/dist/compliance/contract/rg.d.ts +31 -0
- package/dist/compliance/contract/rg.d.ts.map +1 -1
- package/dist/compliance/contract/rg.js +8 -0
- package/dist/compliance/contract/rg.js.map +1 -1
- package/dist/compliance/plugin.d.ts.map +1 -1
- package/dist/compliance/plugin.js +2 -1
- package/dist/compliance/plugin.js.map +1 -1
- package/dist/compliance/router/index.d.ts +26 -0
- package/dist/compliance/router/index.d.ts.map +1 -1
- package/dist/compliance/router/index.js +4 -0
- package/dist/compliance/router/index.js.map +1 -1
- package/dist/compliance/service/rg.service.d.ts +11 -2
- package/dist/compliance/service/rg.service.d.ts.map +1 -1
- package/dist/compliance/service/rg.service.js +54 -12
- package/dist/compliance/service/rg.service.js.map +1 -1
- package/dist/contracts/adapters/admin-user-directory.d.ts +1 -0
- package/dist/contracts/adapters/admin-user-directory.d.ts.map +1 -1
- package/dist/contracts/adapters/admin-user-directory.js.map +1 -1
- package/dist/contracts/adapters/email-template.d.ts +15 -1
- package/dist/contracts/adapters/email-template.d.ts.map +1 -1
- package/dist/contracts/adapters/email-template.js +29 -0
- package/dist/contracts/adapters/email-template.js.map +1 -1
- package/dist/contracts/adapters/index.d.ts +2 -0
- package/dist/contracts/adapters/index.d.ts.map +1 -1
- package/dist/contracts/adapters/index.js +1 -0
- package/dist/contracts/adapters/index.js.map +1 -1
- package/dist/contracts/adapters/play-eligibility.d.ts +15 -0
- package/dist/contracts/adapters/play-eligibility.d.ts.map +1 -0
- package/dist/contracts/adapters/play-eligibility.js +3 -0
- package/dist/contracts/adapters/play-eligibility.js.map +1 -0
- package/dist/contracts/schemas/events.d.ts +9 -0
- package/dist/contracts/schemas/events.d.ts.map +1 -1
- package/dist/contracts/schemas/events.js +8 -1
- package/dist/contracts/schemas/events.js.map +1 -1
- package/dist/pam/identity/__tests__/play-eligibility.test.d.ts +2 -0
- package/dist/pam/identity/__tests__/play-eligibility.test.d.ts.map +1 -0
- package/dist/pam/identity/__tests__/play-eligibility.test.js +30 -0
- package/dist/pam/identity/__tests__/play-eligibility.test.js.map +1 -0
- package/dist/pam/identity/admin-user-directory.d.ts +2 -1
- package/dist/pam/identity/admin-user-directory.d.ts.map +1 -1
- package/dist/pam/identity/admin-user-directory.js +2 -3
- package/dist/pam/identity/admin-user-directory.js.map +1 -1
- package/dist/pam/identity/plugin.d.ts.map +1 -1
- package/dist/pam/identity/plugin.js +3 -1
- package/dist/pam/identity/plugin.js.map +1 -1
- package/dist/pam/identity/service/play-eligibility.service.d.ts +8 -0
- package/dist/pam/identity/service/play-eligibility.service.d.ts.map +1 -0
- package/dist/pam/identity/service/play-eligibility.service.js +21 -0
- package/dist/pam/identity/service/play-eligibility.service.js.map +1 -0
- package/dist/wallet/__tests__/wallet-commands.service.test.js +21 -3
- package/dist/wallet/__tests__/wallet-commands.service.test.js.map +1 -1
- package/dist/wallet/plugin.d.ts.map +1 -1
- package/dist/wallet/plugin.js +2 -2
- package/dist/wallet/plugin.js.map +1 -1
- package/dist/wallet/service/wallet-commands.service.d.ts +4 -1
- package/dist/wallet/service/wallet-commands.service.d.ts.map +1 -1
- package/dist/wallet/service/wallet-commands.service.js +9 -1
- package/dist/wallet/service/wallet-commands.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createDomainError } from '@openora/core/server';
|
|
1
|
+
import { createDomainError, makeConflictError } from '@openora/core/server';
|
|
2
2
|
import { and, eq, gte, sql } from 'drizzle-orm';
|
|
3
3
|
import { wallet, walletTransaction } from '../schema/index.js';
|
|
4
4
|
import { railFor } from './wallet.service.js';
|
|
@@ -10,7 +10,12 @@ export const WalletCommandAmountError = createDomainError('WalletCommandAmountEr
|
|
|
10
10
|
// (status `completed`, internal settlement so no provider ref) so gameplay shows in
|
|
11
11
|
// transaction history. The `balance >= amount` guard in the UPDATE makes concurrent
|
|
12
12
|
// debits safe (a lost race updates zero rows and we report the shortfall).
|
|
13
|
+
export const WalletRgRestrictedError = makeConflictError('WalletRgRestrictedError', 'wager is restricted by an active responsible-gambling exclusion');
|
|
13
14
|
export class WalletCommandsService {
|
|
15
|
+
playEligibility;
|
|
16
|
+
constructor(playEligibility) {
|
|
17
|
+
this.playEligibility = playEligibility;
|
|
18
|
+
}
|
|
14
19
|
// Completed, internal-settlement ledger row (no provider ref) shared by every gameplay move.
|
|
15
20
|
writeLedgerRow(txn, row, type, amount) {
|
|
16
21
|
return txn.insert(walletTransaction).values({
|
|
@@ -24,6 +29,9 @@ export class WalletCommandsService {
|
|
|
24
29
|
}
|
|
25
30
|
async debit(tx, { userId, amount, type }) {
|
|
26
31
|
const txn = tx;
|
|
32
|
+
if (type === 'bet' && (await this.playEligibility.isRestricted(userId))) {
|
|
33
|
+
throw new WalletRgRestrictedError();
|
|
34
|
+
}
|
|
27
35
|
// `loss` is informational (stake already left at bet time): 0-amount row, balance untouched. Every other debit is real money.
|
|
28
36
|
if (type !== 'loss' && Number(amount) <= 0) {
|
|
29
37
|
throw new WalletCommandAmountError('debit', amount);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet-commands.service.js","sourceRoot":"","sources":["../../../src/wallet/service/wallet-commands.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wallet-commands.service.js","sourceRoot":"","sources":["../../../src/wallet/service/wallet-commands.service.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAkB,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9C,MAAM,CAAC,MAAM,wBAAwB,GAAG,iBAAiB,CACvD,0BAA0B,EAC1B,CAAC,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,UAAU,SAAS,iCAAiC,MAAM,GAAG,CACrF,CAAC;AAEF,8EAA8E;AAC9E,iFAAiF;AACjF,mFAAmF;AACnF,qFAAqF;AACrF,oFAAoF;AACpF,oFAAoF;AACpF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,uBAAuB,GAAG,iBAAiB,CACtD,yBAAyB,EACzB,iEAAiE,CAClE,CAAC;AAEF,MAAM,OAAO,qBAAqB;IACH;IAA7B,YAA6B,eAAoC;QAApC,oBAAe,GAAf,eAAe,CAAqB;IAAG,CAAC;IAErE,6FA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IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QAC/E,gFAAgF;QAChF,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,CAAC;QACnD,CAAC;QAED,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,GAAG;aACzB,MAAM,CAAC,MAAM,CAAC;aACd,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,CAAA,GAAG,MAAM,CAAC,OAAO,MAAM,MAAM,WAAW,EAAE,CAAC;aAC7D,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;aAC5B,SAAS,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;QAC1C,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAElD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IACpD,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openora/core",
|
|
3
|
-
"version": "0.4.1-canary.
|
|
3
|
+
"version": "0.4.1-canary.36",
|
|
4
4
|
"description": "Open-source, headless, plugin-based, AI-native iGaming framework - domain modules, plugin engine, Zod-first contracts, typed React SDK",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai-native",
|