@artu-ai/compliance-sdk 0.4.1 → 0.4.2
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/package.json +3 -4
- package/src/errors/api.ts +0 -305
- package/src/errors/base.ts +0 -127
- package/src/errors/index.ts +0 -63
- package/src/errors/upload.ts +0 -204
- package/src/errors/validation.ts +0 -163
- package/src/exports/base.ts +0 -139
- package/src/exports/index.ts +0 -187
- package/src/exports/mexico/actividad-vulnerable/avi.ts +0 -207
- package/src/exports/mexico/actividad-vulnerable/jys.ts +0 -214
- package/src/exports/mexico/actividad-vulnerable/tsc.ts +0 -202
- package/src/exports/mexico/index.ts +0 -215
- package/src/models/Address.ts +0 -235
- package/src/models/BankAccount.ts +0 -235
- package/src/models/Client.ts +0 -363
- package/src/models/ContactMethod.ts +0 -197
- package/src/models/Document.ts +0 -355
- package/src/models/LinkedClient.ts +0 -84
- package/src/models/Report.ts +0 -193
- package/src/models/ReportItem.ts +0 -211
- package/src/models/Transaction.ts +0 -219
- package/src/models/base.ts +0 -56
- package/src/models/index.ts +0 -148
- package/src/models/mex/MexAddress.ts +0 -184
- package/src/models/mex/MexBankAccount.ts +0 -121
- package/src/models/mex/MexClient.ts +0 -177
- package/src/models/mex/MexDocument.ts +0 -890
- package/src/models/mex/MexReport.ts +0 -99
- package/src/models/mex/MexReportItem.ts +0 -79
- package/src/models/mex/MexTransaction.ts +0 -105
- package/src/models/mex/actividad-vulnerable/MexActividadVulnerableClient.ts +0 -66
- package/src/models/mex/actividad-vulnerable/MexActividadVulnerableReport.ts +0 -73
- package/src/models/mex/actividad-vulnerable/MexActividadVulnerableReportItem.ts +0 -74
- package/src/models/mex/actividad-vulnerable/MexActividadVulnerableTransaction.ts +0 -50
- package/src/models/mex/actividad-vulnerable/avi/MexAVIClient.ts +0 -80
- package/src/models/mex/actividad-vulnerable/avi/MexAVIReport.ts +0 -114
- package/src/models/mex/actividad-vulnerable/avi/MexAVIReportItem.ts +0 -105
- package/src/models/mex/actividad-vulnerable/avi/MexAVITransaction.ts +0 -157
- package/src/models/mex/actividad-vulnerable/index.ts +0 -78
- package/src/models/mex/actividad-vulnerable/jys/MexJYSClient.ts +0 -73
- package/src/models/mex/actividad-vulnerable/jys/MexJYSReport.ts +0 -114
- package/src/models/mex/actividad-vulnerable/jys/MexJYSReportItem.ts +0 -105
- package/src/models/mex/actividad-vulnerable/jys/MexJYSTransaction.ts +0 -178
- package/src/models/mex/actividad-vulnerable/tsc/MexTSCClient.ts +0 -73
- package/src/models/mex/actividad-vulnerable/tsc/MexTSCReport.ts +0 -114
- package/src/models/mex/actividad-vulnerable/tsc/MexTSCReportItem.ts +0 -105
- package/src/models/mex/actividad-vulnerable/tsc/MexTSCTransaction.ts +0 -104
- package/src/models/mex/index.ts +0 -57
- package/src/models/types.ts +0 -196
- package/src/namespaces/index.ts +0 -29
- package/src/namespaces/mexico/actividad-vulnerable/avi/index.ts +0 -62
- package/src/namespaces/mexico/actividad-vulnerable/index.ts +0 -79
- package/src/namespaces/mexico/actividad-vulnerable/jys/index.ts +0 -72
- package/src/namespaces/mexico/actividad-vulnerable/tsc/index.ts +0 -60
- package/src/namespaces/mexico/index.ts +0 -325
- package/src/resources/addresses.ts +0 -391
- package/src/resources/bank-accounts.ts +0 -417
- package/src/resources/base.ts +0 -327
- package/src/resources/clients.ts +0 -808
- package/src/resources/contact-methods.ts +0 -412
- package/src/resources/documents.ts +0 -688
- package/src/resources/index.ts +0 -40
- package/src/resources/mex/actividad-vulnerable/avi/clients.ts +0 -559
- package/src/resources/mex/actividad-vulnerable/avi/index.ts +0 -7
- package/src/resources/mex/actividad-vulnerable/avi/reports.ts +0 -609
- package/src/resources/mex/actividad-vulnerable/avi/transactions.ts +0 -404
- package/src/resources/mex/actividad-vulnerable/index.ts +0 -12
- package/src/resources/mex/actividad-vulnerable/jys/clients.ts +0 -445
- package/src/resources/mex/actividad-vulnerable/jys/index.ts +0 -7
- package/src/resources/mex/actividad-vulnerable/jys/reports.ts +0 -591
- package/src/resources/mex/actividad-vulnerable/jys/transactions.ts +0 -395
- package/src/resources/mex/actividad-vulnerable/tsc/clients.ts +0 -445
- package/src/resources/mex/actividad-vulnerable/tsc/index.ts +0 -7
- package/src/resources/mex/actividad-vulnerable/tsc/reports.ts +0 -591
- package/src/resources/mex/actividad-vulnerable/tsc/transactions.ts +0 -404
- package/src/resources/mex/addresses.ts +0 -493
- package/src/resources/mex/bank-accounts.ts +0 -283
- package/src/resources/mex/clients.ts +0 -758
- package/src/resources/mex/ebr.ts +0 -621
- package/src/resources/mex/index.ts +0 -23
- package/src/resources/mex/reports.ts +0 -643
- package/src/resources/mex/transactions.ts +0 -422
- package/src/resources/reports.ts +0 -515
- package/src/resources/transactions.ts +0 -358
- package/src/sdk/ComplianceSDK.ts +0 -812
- package/src/sdk/base.ts +0 -43
- package/src/sdk/index.ts +0 -98
- package/src/sdk/mex/ComplianceSDK.ts +0 -147
- package/src/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.ts +0 -55
- package/src/sdk/mex/actividad-vulnerable/avi/index.ts +0 -16
- package/src/sdk/mex/actividad-vulnerable/avi/types.ts +0 -86
- package/src/sdk/mex/actividad-vulnerable/index.ts +0 -58
- package/src/sdk/mex/actividad-vulnerable/jys/ComplianceSDK.ts +0 -54
- package/src/sdk/mex/actividad-vulnerable/jys/index.ts +0 -16
- package/src/sdk/mex/actividad-vulnerable/jys/types.ts +0 -86
- package/src/sdk/mex/actividad-vulnerable/tsc/ComplianceSDK.ts +0 -54
- package/src/sdk/mex/actividad-vulnerable/tsc/index.ts +0 -16
- package/src/sdk/mex/actividad-vulnerable/tsc/types.ts +0 -86
- package/src/sdk/mex/index.ts +0 -66
- package/src/sdk/mex/types.ts +0 -88
- package/src/sdk/resource-registry.ts +0 -204
- package/src/sdk/sdk-registry.ts +0 -99
- package/src/sdk/types.ts +0 -304
- package/src/utils/environment.ts +0 -187
- package/src/utils/filters.ts +0 -412
- package/src/utils/index.ts +0 -134
- package/src/utils/pagination.ts +0 -143
- package/src/utils/session.ts +0 -303
- package/src/utils/trpc-client.ts +0 -242
- package/src/utils/upload.ts +0 -388
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mexico JYS Report Item Model
|
|
3
|
-
*
|
|
4
|
-
* Report item model for Juegos y Sorteos (Games and Raffles) activity.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
MexActividadVulnerableReportItem,
|
|
9
|
-
type MexActividadVulnerableReportItemData,
|
|
10
|
-
} from "../MexActividadVulnerableReportItem";
|
|
11
|
-
import type { jys } from "@artu-ai/shared";
|
|
12
|
-
|
|
13
|
-
// ===========================
|
|
14
|
-
// Types
|
|
15
|
-
// ===========================
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* JYS report item data
|
|
19
|
-
*/
|
|
20
|
-
export interface MexJYSReportItemData
|
|
21
|
-
extends MexActividadVulnerableReportItemData {
|
|
22
|
-
jurisdictions?: {
|
|
23
|
-
MX?: {
|
|
24
|
-
actividadVulnerable?: {
|
|
25
|
-
JYS?: jys.JYSReportItemData;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
[key: string]: unknown;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// ===========================
|
|
33
|
-
// MexJYSReportItem Model
|
|
34
|
-
// ===========================
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Mexico JYS Report Item Model.
|
|
38
|
-
*
|
|
39
|
-
* Provides typed accessors for JYS-specific report item data.
|
|
40
|
-
*/
|
|
41
|
-
export class MexJYSReportItem extends MexActividadVulnerableReportItem {
|
|
42
|
-
// ─────────────────────────────────────────────────────────────────
|
|
43
|
-
// JYS Data
|
|
44
|
-
// ─────────────────────────────────────────────────────────────────
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* JYS-specific report item data
|
|
48
|
-
*/
|
|
49
|
-
protected get jysData(): jys.JYSReportItemData | undefined {
|
|
50
|
-
return this.actividadVulnerableData?.JYS;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Alert type code
|
|
55
|
-
* - "100" for monthly reports
|
|
56
|
-
* - Other codes for unusual activity
|
|
57
|
-
*/
|
|
58
|
-
get alertType(): jys.TipoAlerta | undefined {
|
|
59
|
-
return this.jysData?.alertType;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Alert description (for unusual activity)
|
|
64
|
-
*/
|
|
65
|
-
get alertDescription(): string | undefined {
|
|
66
|
-
return this.jysData?.alertDescription;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Amendment data for corrections
|
|
71
|
-
*/
|
|
72
|
-
get amendment(): jys.Amendment | undefined {
|
|
73
|
-
return this.jysData?.amendment;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Whether this item is an amendment
|
|
78
|
-
*/
|
|
79
|
-
get isAmendment(): boolean {
|
|
80
|
-
return !!this.jysData?.amendment;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// ─────────────────────────────────────────────────────────────────
|
|
84
|
-
// String Representation
|
|
85
|
-
// ─────────────────────────────────────────────────────────────────
|
|
86
|
-
|
|
87
|
-
override toString(): string {
|
|
88
|
-
return `MexJYSReportItem(${this.id}, ${this.clientNames?.join(", ") ?? "Unknown"}, Alert: ${this.alertType ?? "N/A"})`;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// ===========================
|
|
93
|
-
// Type Guards
|
|
94
|
-
// ===========================
|
|
95
|
-
|
|
96
|
-
import type { ReportItemModel } from "../../../types";
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Check if report item is a JYS (Juegos y Sorteos) report item
|
|
100
|
-
*/
|
|
101
|
-
export function isMexJYSReportItem(
|
|
102
|
-
item: ReportItemModel
|
|
103
|
-
): item is MexJYSReportItem {
|
|
104
|
-
return item instanceof MexJYSReportItem;
|
|
105
|
-
}
|
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mexico JYS (Juegos y Sorteos) Transaction
|
|
3
|
-
*
|
|
4
|
-
* Specialized for gaming and lottery transactions.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { jys } from "@artu-ai/shared";
|
|
8
|
-
import { MexActividadVulnerableTransaction } from "../MexActividadVulnerableTransaction";
|
|
9
|
-
|
|
10
|
-
// ===========================
|
|
11
|
-
// MexJYSTransaction Model
|
|
12
|
-
// ===========================
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Mexico JYS Transaction Model.
|
|
16
|
-
*
|
|
17
|
-
* Provides typed accessors for gaming/lottery transaction data.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* if (txn instanceof MexJYSTransaction) {
|
|
22
|
-
* console.log(`Operation: ${txn.operationType}`);
|
|
23
|
-
* console.log(`Settlement: ${txn.settlementType}`);
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export class MexJYSTransaction extends MexActividadVulnerableTransaction {
|
|
28
|
-
// ─────────────────────────────────────────────────────────────────
|
|
29
|
-
// JYS-Specific Data
|
|
30
|
-
// ─────────────────────────────────────────────────────────────────
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* JYS-specific transaction data
|
|
34
|
-
*/
|
|
35
|
-
protected get jysData(): jys.JYSTransactionData | undefined {
|
|
36
|
-
return this.mexicoData?.actividadVulnerable?.JYS;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// ─────────────────────────────────────────────────────────────────
|
|
40
|
-
// Operation Fields
|
|
41
|
-
// ─────────────────────────────────────────────────────────────────
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Operation type (e.g., bet, prize, purchase)
|
|
45
|
-
*/
|
|
46
|
-
get operationType(): string | undefined {
|
|
47
|
-
return this.jysData?.operationType;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Business line (e.g., casino, lottery, sports betting)
|
|
52
|
-
*/
|
|
53
|
-
get businessLine(): string | undefined {
|
|
54
|
-
return this.jysData?.businessLine;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Operation method (e.g., in-individual, online)
|
|
59
|
-
*/
|
|
60
|
-
get operationMethod(): string | undefined {
|
|
61
|
-
return this.jysData?.operationMethod;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// ─────────────────────────────────────────────────────────────────
|
|
65
|
-
// Branch Information
|
|
66
|
-
// ─────────────────────────────────────────────────────────────────
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Branch information where the transaction occurred
|
|
70
|
-
*/
|
|
71
|
-
get branchInfo(): jys.BranchInformation | undefined {
|
|
72
|
-
const data = this.jysData;
|
|
73
|
-
if (!data) return undefined;
|
|
74
|
-
return data.branchInformation;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Branch postal code
|
|
79
|
-
*/
|
|
80
|
-
get branchPostalCode(): string | undefined {
|
|
81
|
-
return this.branchInfo?.postalCode;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Whether this is an operator branch (vs own branch)
|
|
86
|
-
*/
|
|
87
|
-
get isOperatorBranch(): boolean {
|
|
88
|
-
return this.branchInfo?.type === jys.TipoSucursal.Operator;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Operator name (if operator branch)
|
|
93
|
-
*/
|
|
94
|
-
get operatorName(): string | undefined {
|
|
95
|
-
const info = this.branchInfo;
|
|
96
|
-
if (info?.type === jys.TipoSucursal.Operator) {
|
|
97
|
-
return info.operatorName;
|
|
98
|
-
}
|
|
99
|
-
return undefined;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// ─────────────────────────────────────────────────────────────────
|
|
103
|
-
// Settlement Information
|
|
104
|
-
// ─────────────────────────────────────────────────────────────────
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Settlement type (cash or in-kind)
|
|
108
|
-
*/
|
|
109
|
-
get settlementType(): jys.TipoLiquidacion | undefined {
|
|
110
|
-
const data = this.jysData;
|
|
111
|
-
if (!data || !("settlementType" in data)) return undefined;
|
|
112
|
-
return data.settlementType;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Whether this is a cash settlement
|
|
117
|
-
*/
|
|
118
|
-
get isCashSettlement(): boolean {
|
|
119
|
-
return this.settlementType === jys.TipoLiquidacion.Cash;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Whether this is an in-kind settlement (assets)
|
|
124
|
-
*/
|
|
125
|
-
get isInKindSettlement(): boolean {
|
|
126
|
-
return this.settlementType === jys.TipoLiquidacion.InKind;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Monetary instrument (for cash settlements)
|
|
131
|
-
*/
|
|
132
|
-
get monetaryInstrument(): string | undefined {
|
|
133
|
-
const data = this.jysData;
|
|
134
|
-
if (!data || !("monetaryInstrument" in data)) return undefined;
|
|
135
|
-
return data.monetaryInstrument as string;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Asset type (for in-kind settlements)
|
|
140
|
-
*/
|
|
141
|
-
get assetType(): string | undefined {
|
|
142
|
-
const data = this.jysData;
|
|
143
|
-
if (!data || !("assetType" in data)) return undefined;
|
|
144
|
-
return data.assetType as string;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Real estate type (for real estate in-kind settlements)
|
|
149
|
-
*/
|
|
150
|
-
get realEstateType(): string | undefined {
|
|
151
|
-
const data = this.jysData;
|
|
152
|
-
if (!data || !("realEstateType" in data)) return undefined;
|
|
153
|
-
return data.realEstateType as string;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// ─────────────────────────────────────────────────────────────────
|
|
157
|
-
// String Representation
|
|
158
|
-
// ─────────────────────────────────────────────────────────────────
|
|
159
|
-
|
|
160
|
-
override toString(): string {
|
|
161
|
-
return `MexJYSTransaction(${this.id}, ${this.formattedAmount}, ${this.operationType ?? "unknown"})`;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
// ===========================
|
|
166
|
-
// Type Guards
|
|
167
|
-
// ===========================
|
|
168
|
-
|
|
169
|
-
import type { TransactionModel } from "../../../types";
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Check if transaction is a JYS (Juegos y Sorteos) transaction
|
|
173
|
-
*/
|
|
174
|
-
export function isMexJYSTransaction(
|
|
175
|
-
txn: TransactionModel
|
|
176
|
-
): txn is MexJYSTransaction {
|
|
177
|
-
return txn instanceof MexJYSTransaction;
|
|
178
|
-
}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mexico TSC (Tarjetas de Servicio y Crédito) Client
|
|
3
|
-
*
|
|
4
|
-
* Specialized for service and credit card operations.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { ClientRelationshipType, tsc } from "@artu-ai/shared";
|
|
8
|
-
import { MexActividadVulnerableClient } from "../MexActividadVulnerableClient";
|
|
9
|
-
|
|
10
|
-
// ===========================
|
|
11
|
-
// MexTSCClient Model
|
|
12
|
-
// ===========================
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Mexico TSC Client Model.
|
|
16
|
-
*
|
|
17
|
-
* Provides typed accessors for service/credit card specific data.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* if (client instanceof MexTSCClient) {
|
|
22
|
-
* console.log(`TSC Client: ${client.name}`);
|
|
23
|
-
* }
|
|
24
|
-
* ```
|
|
25
|
-
*/
|
|
26
|
-
export class MexTSCClient extends MexActividadVulnerableClient {
|
|
27
|
-
// ─────────────────────────────────────────────────────────────────
|
|
28
|
-
// TSC-Specific Data
|
|
29
|
-
// ─────────────────────────────────────────────────────────────────
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* TSC-specific activity data
|
|
33
|
-
*/
|
|
34
|
-
protected get tscData(): tsc.TSCClientData | undefined {
|
|
35
|
-
return this.mexicoData?.actividadVulnerable?.TSC;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
// ─────────────────────────────────────────────────────────────────
|
|
39
|
-
// String Representation
|
|
40
|
-
// ─────────────────────────────────────────────────────────────────
|
|
41
|
-
|
|
42
|
-
override toString(): string {
|
|
43
|
-
return `MexTSCClient(${this.id}, ${this.name})`;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Linked clients (if included) instantiated as MexTSCClient
|
|
48
|
-
*/
|
|
49
|
-
override get linkedClients():
|
|
50
|
-
| {
|
|
51
|
-
relationshipType: ClientRelationshipType;
|
|
52
|
-
client: MexTSCClient;
|
|
53
|
-
}[]
|
|
54
|
-
| undefined {
|
|
55
|
-
return (this._data.linkedClients ?? []).map((l) => ({
|
|
56
|
-
relationshipType: l.relationshipType,
|
|
57
|
-
client: new MexTSCClient(l.client),
|
|
58
|
-
}));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// ===========================
|
|
63
|
-
// Type Guards
|
|
64
|
-
// ===========================
|
|
65
|
-
|
|
66
|
-
import type { ClientModel } from "../../../types";
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Check if client is a TSC (Tarjetas de Servicio y Crédito) client
|
|
70
|
-
*/
|
|
71
|
-
export function isMexTSCClient(client: ClientModel): client is MexTSCClient {
|
|
72
|
-
return client instanceof MexTSCClient;
|
|
73
|
-
}
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mexico TSC Report Model
|
|
3
|
-
*
|
|
4
|
-
* Report model for Tarjetas de Servicio y Crédito (Service and Credit Cards) activity.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
MexActividadVulnerableReport,
|
|
9
|
-
type MexActividadVulnerableReportData,
|
|
10
|
-
} from "../MexActividadVulnerableReport";
|
|
11
|
-
import type { tsc } from "@artu-ai/shared";
|
|
12
|
-
|
|
13
|
-
// ===========================
|
|
14
|
-
// Types
|
|
15
|
-
// ===========================
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* TSC report data
|
|
19
|
-
*/
|
|
20
|
-
export interface MexTSCReportData extends MexActividadVulnerableReportData {
|
|
21
|
-
jurisdictions?: {
|
|
22
|
-
MX?: {
|
|
23
|
-
actividadVulnerable?: {
|
|
24
|
-
TSC?: tsc.TSCReportData;
|
|
25
|
-
};
|
|
26
|
-
};
|
|
27
|
-
[key: string]: unknown;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
// ===========================
|
|
32
|
-
// MexTSCReport Model
|
|
33
|
-
// ===========================
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Mexico TSC Report Model.
|
|
37
|
-
*
|
|
38
|
-
* Provides typed accessors for TSC-specific report data.
|
|
39
|
-
*
|
|
40
|
-
* @example
|
|
41
|
-
* ```typescript
|
|
42
|
-
* if (report instanceof MexTSCReport) {
|
|
43
|
-
* console.log(`Period: ${report.mesReportado}`);
|
|
44
|
-
* }
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
export class MexTSCReport extends MexActividadVulnerableReport {
|
|
48
|
-
// ─────────────────────────────────────────────────────────────────
|
|
49
|
-
// TSC Data
|
|
50
|
-
// ─────────────────────────────────────────────────────────────────
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* TSC-specific report data
|
|
54
|
-
*/
|
|
55
|
-
protected get tscData(): tsc.TSCReportData | undefined {
|
|
56
|
-
return this.actividadVulnerableData?.TSC;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Reporting period (YYYYMM format)
|
|
61
|
-
*/
|
|
62
|
-
get mesReportado(): string | undefined {
|
|
63
|
-
return this.tscData?.mesReportado;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Reporting period as a formatted string (e.g., "January 2024")
|
|
68
|
-
*/
|
|
69
|
-
get formattedPeriod(): string | undefined {
|
|
70
|
-
const mes = this.mesReportado;
|
|
71
|
-
if (!mes) return undefined;
|
|
72
|
-
|
|
73
|
-
const year = mes.slice(0, 4);
|
|
74
|
-
const month = parseInt(mes.slice(4, 6), 10);
|
|
75
|
-
|
|
76
|
-
const monthNames = [
|
|
77
|
-
"January",
|
|
78
|
-
"February",
|
|
79
|
-
"March",
|
|
80
|
-
"April",
|
|
81
|
-
"May",
|
|
82
|
-
"June",
|
|
83
|
-
"July",
|
|
84
|
-
"August",
|
|
85
|
-
"September",
|
|
86
|
-
"October",
|
|
87
|
-
"November",
|
|
88
|
-
"December",
|
|
89
|
-
];
|
|
90
|
-
|
|
91
|
-
return `${monthNames[month - 1]} ${year}`;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// ─────────────────────────────────────────────────────────────────
|
|
95
|
-
// String Representation
|
|
96
|
-
// ─────────────────────────────────────────────────────────────────
|
|
97
|
-
|
|
98
|
-
override toString(): string {
|
|
99
|
-
return `MexTSCReport(${this.id}, ${this.mesReportado ?? "N/A"})`;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// ===========================
|
|
104
|
-
// Type Guards
|
|
105
|
-
// ===========================
|
|
106
|
-
|
|
107
|
-
import type { ReportModel } from "../../../types";
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Check if report is a TSC (Tarjetas de Servicio y Crédito) report
|
|
111
|
-
*/
|
|
112
|
-
export function isMexTSCReport(report: ReportModel): report is MexTSCReport {
|
|
113
|
-
return report instanceof MexTSCReport;
|
|
114
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mexico TSC Report Item Model
|
|
3
|
-
*
|
|
4
|
-
* Report item model for Tarjetas de Servicio y Crédito (Service and Credit Cards) activity.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
MexActividadVulnerableReportItem,
|
|
9
|
-
type MexActividadVulnerableReportItemData,
|
|
10
|
-
} from "../MexActividadVulnerableReportItem";
|
|
11
|
-
import type { tsc } from "@artu-ai/shared";
|
|
12
|
-
|
|
13
|
-
// ===========================
|
|
14
|
-
// Types
|
|
15
|
-
// ===========================
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* TSC report item data
|
|
19
|
-
*/
|
|
20
|
-
export interface MexTSCReportItemData
|
|
21
|
-
extends MexActividadVulnerableReportItemData {
|
|
22
|
-
jurisdictions?: {
|
|
23
|
-
MX?: {
|
|
24
|
-
actividadVulnerable?: {
|
|
25
|
-
TSC?: tsc.TSCReportItemData;
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
[key: string]: unknown;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// ===========================
|
|
33
|
-
// MexTSCReportItem Model
|
|
34
|
-
// ===========================
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Mexico TSC Report Item Model.
|
|
38
|
-
*
|
|
39
|
-
* Provides typed accessors for TSC-specific report item data.
|
|
40
|
-
*/
|
|
41
|
-
export class MexTSCReportItem extends MexActividadVulnerableReportItem {
|
|
42
|
-
// ─────────────────────────────────────────────────────────────────
|
|
43
|
-
// TSC Data
|
|
44
|
-
// ─────────────────────────────────────────────────────────────────
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* TSC-specific report item data
|
|
48
|
-
*/
|
|
49
|
-
protected get tscData(): tsc.TSCReportItemData | undefined {
|
|
50
|
-
return this.actividadVulnerableData?.TSC;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Alert type code
|
|
55
|
-
* - "100" for monthly reports
|
|
56
|
-
* - Other codes for unusual activity
|
|
57
|
-
*/
|
|
58
|
-
get alertType(): tsc.TipoAlerta | undefined {
|
|
59
|
-
return this.tscData?.alertType;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Alert description (for unusual activity)
|
|
64
|
-
*/
|
|
65
|
-
get alertDescription(): string | undefined {
|
|
66
|
-
return this.tscData?.alertDescription;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* Amendment data for corrections
|
|
71
|
-
*/
|
|
72
|
-
get amendment(): tsc.Amendment | undefined {
|
|
73
|
-
return this.tscData?.amendment;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Whether this item is an amendment
|
|
78
|
-
*/
|
|
79
|
-
get isAmendment(): boolean {
|
|
80
|
-
return !!this.tscData?.amendment;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
// ─────────────────────────────────────────────────────────────────
|
|
84
|
-
// String Representation
|
|
85
|
-
// ─────────────────────────────────────────────────────────────────
|
|
86
|
-
|
|
87
|
-
override toString(): string {
|
|
88
|
-
return `MexTSCReportItem(${this.id}, ${this.clientNames?.join(", ") ?? "Unknown"}, Alert: ${this.alertType ?? "N/A"})`;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// ===========================
|
|
93
|
-
// Type Guards
|
|
94
|
-
// ===========================
|
|
95
|
-
|
|
96
|
-
import type { ReportItemModel } from "../../../types";
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Check if report item is a TSC (Tarjetas de Servicio y Crédito) report item
|
|
100
|
-
*/
|
|
101
|
-
export function isMexTSCReportItem(
|
|
102
|
-
item: ReportItemModel
|
|
103
|
-
): item is MexTSCReportItem {
|
|
104
|
-
return item instanceof MexTSCReportItem;
|
|
105
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mexico TSC (Tarjetas de Servicio y Crédito) Transaction
|
|
3
|
-
*
|
|
4
|
-
* Specialized for service and credit card transactions.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import { tsc } from "@artu-ai/shared";
|
|
8
|
-
import { MexActividadVulnerableTransaction } from "../MexActividadVulnerableTransaction";
|
|
9
|
-
|
|
10
|
-
// ===========================
|
|
11
|
-
// MexTSCTransaction Model
|
|
12
|
-
// ===========================
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Mexico TSC Transaction Model.
|
|
16
|
-
*
|
|
17
|
-
* Provides typed accessors for service/credit card transaction data.
|
|
18
|
-
*
|
|
19
|
-
* @example
|
|
20
|
-
* ```typescript
|
|
21
|
-
* if (txn instanceof MexTSCTransaction) {
|
|
22
|
-
* console.log(`Card: ${txn.cardType}`);
|
|
23
|
-
* console.log(`ID: ${txn.idNumber}`);
|
|
24
|
-
* }
|
|
25
|
-
* ```
|
|
26
|
-
*/
|
|
27
|
-
export class MexTSCTransaction extends MexActividadVulnerableTransaction {
|
|
28
|
-
// ─────────────────────────────────────────────────────────────────
|
|
29
|
-
// TSC-Specific Data
|
|
30
|
-
// ─────────────────────────────────────────────────────────────────
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* TSC-specific transaction data
|
|
34
|
-
*/
|
|
35
|
-
protected get tscData(): tsc.TSCTransactionData | undefined {
|
|
36
|
-
return this.mexicoData?.actividadVulnerable?.TSC;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// ─────────────────────────────────────────────────────────────────
|
|
40
|
-
// Card Fields
|
|
41
|
-
// ─────────────────────────────────────────────────────────────────
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Card type (service or credit)
|
|
45
|
-
*/
|
|
46
|
-
get cardType(): string | undefined {
|
|
47
|
-
return this.tscData?.cardType;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Card/account identifier
|
|
52
|
-
*/
|
|
53
|
-
get idNumber(): string | undefined {
|
|
54
|
-
return this.tscData?.idNumber;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* Operation type (typically card consumption)
|
|
59
|
-
*/
|
|
60
|
-
get operationType(): string | undefined {
|
|
61
|
-
return this.tscData?.operationType;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// ─────────────────────────────────────────────────────────────────
|
|
65
|
-
// Helpers
|
|
66
|
-
// ─────────────────────────────────────────────────────────────────
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Whether this is a service card transaction
|
|
70
|
-
*/
|
|
71
|
-
get isServiceCard(): boolean {
|
|
72
|
-
return this.cardType === tsc.TiposTarjeta.enum.ServiceCard;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Whether this is a credit card transaction
|
|
77
|
-
*/
|
|
78
|
-
get isCreditCard(): boolean {
|
|
79
|
-
return this.cardType === tsc.TiposTarjeta.enum.CreditCard;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// ─────────────────────────────────────────────────────────────────
|
|
83
|
-
// String Representation
|
|
84
|
-
// ─────────────────────────────────────────────────────────────────
|
|
85
|
-
|
|
86
|
-
override toString(): string {
|
|
87
|
-
return `MexTSCTransaction(${this.id}, ${this.formattedAmount}, ${this.cardType ?? "unknown"})`;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// ===========================
|
|
92
|
-
// Type Guards
|
|
93
|
-
// ===========================
|
|
94
|
-
|
|
95
|
-
import type { TransactionModel } from "../../../types";
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Check if transaction is a TSC (Tarjetas de Servicio y Crédito) transaction
|
|
99
|
-
*/
|
|
100
|
-
export function isMexTSCTransaction(
|
|
101
|
-
txn: TransactionModel
|
|
102
|
-
): txn is MexTSCTransaction {
|
|
103
|
-
return txn instanceof MexTSCTransaction;
|
|
104
|
-
}
|