@artu-ai/compliance-sdk 0.4.0 → 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.
Files changed (110) hide show
  1. package/package.json +4 -5
  2. package/src/errors/api.ts +0 -305
  3. package/src/errors/base.ts +0 -127
  4. package/src/errors/index.ts +0 -63
  5. package/src/errors/upload.ts +0 -204
  6. package/src/errors/validation.ts +0 -163
  7. package/src/exports/base.ts +0 -139
  8. package/src/exports/index.ts +0 -187
  9. package/src/exports/mexico/actividad-vulnerable/avi.ts +0 -207
  10. package/src/exports/mexico/actividad-vulnerable/jys.ts +0 -214
  11. package/src/exports/mexico/actividad-vulnerable/tsc.ts +0 -202
  12. package/src/exports/mexico/index.ts +0 -215
  13. package/src/models/Address.ts +0 -235
  14. package/src/models/BankAccount.ts +0 -235
  15. package/src/models/Client.ts +0 -363
  16. package/src/models/ContactMethod.ts +0 -197
  17. package/src/models/Document.ts +0 -355
  18. package/src/models/LinkedClient.ts +0 -84
  19. package/src/models/Report.ts +0 -193
  20. package/src/models/ReportItem.ts +0 -211
  21. package/src/models/Transaction.ts +0 -219
  22. package/src/models/base.ts +0 -56
  23. package/src/models/index.ts +0 -148
  24. package/src/models/mex/MexAddress.ts +0 -184
  25. package/src/models/mex/MexBankAccount.ts +0 -121
  26. package/src/models/mex/MexClient.ts +0 -177
  27. package/src/models/mex/MexDocument.ts +0 -890
  28. package/src/models/mex/MexReport.ts +0 -99
  29. package/src/models/mex/MexReportItem.ts +0 -79
  30. package/src/models/mex/MexTransaction.ts +0 -105
  31. package/src/models/mex/actividad-vulnerable/MexActividadVulnerableClient.ts +0 -66
  32. package/src/models/mex/actividad-vulnerable/MexActividadVulnerableReport.ts +0 -73
  33. package/src/models/mex/actividad-vulnerable/MexActividadVulnerableReportItem.ts +0 -74
  34. package/src/models/mex/actividad-vulnerable/MexActividadVulnerableTransaction.ts +0 -50
  35. package/src/models/mex/actividad-vulnerable/avi/MexAVIClient.ts +0 -80
  36. package/src/models/mex/actividad-vulnerable/avi/MexAVIReport.ts +0 -114
  37. package/src/models/mex/actividad-vulnerable/avi/MexAVIReportItem.ts +0 -105
  38. package/src/models/mex/actividad-vulnerable/avi/MexAVITransaction.ts +0 -157
  39. package/src/models/mex/actividad-vulnerable/index.ts +0 -78
  40. package/src/models/mex/actividad-vulnerable/jys/MexJYSClient.ts +0 -73
  41. package/src/models/mex/actividad-vulnerable/jys/MexJYSReport.ts +0 -114
  42. package/src/models/mex/actividad-vulnerable/jys/MexJYSReportItem.ts +0 -105
  43. package/src/models/mex/actividad-vulnerable/jys/MexJYSTransaction.ts +0 -178
  44. package/src/models/mex/actividad-vulnerable/tsc/MexTSCClient.ts +0 -73
  45. package/src/models/mex/actividad-vulnerable/tsc/MexTSCReport.ts +0 -114
  46. package/src/models/mex/actividad-vulnerable/tsc/MexTSCReportItem.ts +0 -105
  47. package/src/models/mex/actividad-vulnerable/tsc/MexTSCTransaction.ts +0 -104
  48. package/src/models/mex/index.ts +0 -57
  49. package/src/models/types.ts +0 -196
  50. package/src/namespaces/index.ts +0 -29
  51. package/src/namespaces/mexico/actividad-vulnerable/avi/index.ts +0 -62
  52. package/src/namespaces/mexico/actividad-vulnerable/index.ts +0 -79
  53. package/src/namespaces/mexico/actividad-vulnerable/jys/index.ts +0 -72
  54. package/src/namespaces/mexico/actividad-vulnerable/tsc/index.ts +0 -60
  55. package/src/namespaces/mexico/index.ts +0 -325
  56. package/src/resources/addresses.ts +0 -391
  57. package/src/resources/bank-accounts.ts +0 -417
  58. package/src/resources/base.ts +0 -327
  59. package/src/resources/clients.ts +0 -808
  60. package/src/resources/contact-methods.ts +0 -412
  61. package/src/resources/documents.ts +0 -688
  62. package/src/resources/index.ts +0 -40
  63. package/src/resources/mex/actividad-vulnerable/avi/clients.ts +0 -559
  64. package/src/resources/mex/actividad-vulnerable/avi/index.ts +0 -7
  65. package/src/resources/mex/actividad-vulnerable/avi/reports.ts +0 -609
  66. package/src/resources/mex/actividad-vulnerable/avi/transactions.ts +0 -404
  67. package/src/resources/mex/actividad-vulnerable/index.ts +0 -12
  68. package/src/resources/mex/actividad-vulnerable/jys/clients.ts +0 -445
  69. package/src/resources/mex/actividad-vulnerable/jys/index.ts +0 -7
  70. package/src/resources/mex/actividad-vulnerable/jys/reports.ts +0 -591
  71. package/src/resources/mex/actividad-vulnerable/jys/transactions.ts +0 -395
  72. package/src/resources/mex/actividad-vulnerable/tsc/clients.ts +0 -445
  73. package/src/resources/mex/actividad-vulnerable/tsc/index.ts +0 -7
  74. package/src/resources/mex/actividad-vulnerable/tsc/reports.ts +0 -591
  75. package/src/resources/mex/actividad-vulnerable/tsc/transactions.ts +0 -404
  76. package/src/resources/mex/addresses.ts +0 -493
  77. package/src/resources/mex/bank-accounts.ts +0 -283
  78. package/src/resources/mex/clients.ts +0 -758
  79. package/src/resources/mex/ebr.ts +0 -621
  80. package/src/resources/mex/index.ts +0 -23
  81. package/src/resources/mex/reports.ts +0 -643
  82. package/src/resources/mex/transactions.ts +0 -422
  83. package/src/resources/reports.ts +0 -515
  84. package/src/resources/transactions.ts +0 -358
  85. package/src/sdk/ComplianceSDK.ts +0 -812
  86. package/src/sdk/base.ts +0 -43
  87. package/src/sdk/index.ts +0 -98
  88. package/src/sdk/mex/ComplianceSDK.ts +0 -147
  89. package/src/sdk/mex/actividad-vulnerable/avi/ComplianceSDK.ts +0 -55
  90. package/src/sdk/mex/actividad-vulnerable/avi/index.ts +0 -16
  91. package/src/sdk/mex/actividad-vulnerable/avi/types.ts +0 -86
  92. package/src/sdk/mex/actividad-vulnerable/index.ts +0 -58
  93. package/src/sdk/mex/actividad-vulnerable/jys/ComplianceSDK.ts +0 -54
  94. package/src/sdk/mex/actividad-vulnerable/jys/index.ts +0 -16
  95. package/src/sdk/mex/actividad-vulnerable/jys/types.ts +0 -86
  96. package/src/sdk/mex/actividad-vulnerable/tsc/ComplianceSDK.ts +0 -54
  97. package/src/sdk/mex/actividad-vulnerable/tsc/index.ts +0 -16
  98. package/src/sdk/mex/actividad-vulnerable/tsc/types.ts +0 -86
  99. package/src/sdk/mex/index.ts +0 -66
  100. package/src/sdk/mex/types.ts +0 -88
  101. package/src/sdk/resource-registry.ts +0 -204
  102. package/src/sdk/sdk-registry.ts +0 -99
  103. package/src/sdk/types.ts +0 -304
  104. package/src/utils/environment.ts +0 -187
  105. package/src/utils/filters.ts +0 -412
  106. package/src/utils/index.ts +0 -134
  107. package/src/utils/pagination.ts +0 -143
  108. package/src/utils/session.ts +0 -303
  109. package/src/utils/trpc-client.ts +0 -242
  110. package/src/utils/upload.ts +0 -388
@@ -1,114 +0,0 @@
1
- /**
2
- * Mexico AVI Report Model
3
- *
4
- * Report model for Activos Virtuales (Virtual Assets) activity.
5
- */
6
-
7
- import {
8
- MexActividadVulnerableReport,
9
- type MexActividadVulnerableReportData,
10
- } from "../MexActividadVulnerableReport";
11
- import type { avi } from "@artu-ai/shared";
12
-
13
- // ===========================
14
- // Types
15
- // ===========================
16
-
17
- /**
18
- * AVI report data
19
- */
20
- export interface MexAVIReportData extends MexActividadVulnerableReportData {
21
- jurisdictions?: {
22
- MX?: {
23
- actividadVulnerable?: {
24
- AVI?: avi.AVIReportData;
25
- };
26
- };
27
- [key: string]: unknown;
28
- };
29
- }
30
-
31
- // ===========================
32
- // MexAVIReport Model
33
- // ===========================
34
-
35
- /**
36
- * Mexico AVI Report Model.
37
- *
38
- * Provides typed accessors for AVI-specific report data.
39
- *
40
- * @example
41
- * ```typescript
42
- * if (report instanceof MexAVIReport) {
43
- * console.log(`Period: ${report.mesReportado}`);
44
- * }
45
- * ```
46
- */
47
- export class MexAVIReport extends MexActividadVulnerableReport {
48
- // ─────────────────────────────────────────────────────────────────
49
- // AVI Data
50
- // ─────────────────────────────────────────────────────────────────
51
-
52
- /**
53
- * AVI-specific report data
54
- */
55
- protected get aviData(): avi.AVIReportData | undefined {
56
- return this.actividadVulnerableData?.AVI;
57
- }
58
-
59
- /**
60
- * Reporting period (YYYYMM format)
61
- */
62
- get mesReportado(): string | undefined {
63
- return this.aviData?.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 `MexAVIReport(${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 an AVI (Activos Virtuales) report
111
- */
112
- export function isMexAVIReport(report: ReportModel): report is MexAVIReport {
113
- return report instanceof MexAVIReport;
114
- }
@@ -1,105 +0,0 @@
1
- /**
2
- * Mexico AVI Report Item Model
3
- *
4
- * Report item model for Activos Virtuales (Virtual Assets) activity.
5
- */
6
-
7
- import {
8
- MexActividadVulnerableReportItem,
9
- type MexActividadVulnerableReportItemData,
10
- } from "../MexActividadVulnerableReportItem";
11
- import type { avi } from "@artu-ai/shared";
12
-
13
- // ===========================
14
- // Types
15
- // ===========================
16
-
17
- /**
18
- * AVI report item data
19
- */
20
- export interface MexAVIReportItemData
21
- extends MexActividadVulnerableReportItemData {
22
- jurisdictions?: {
23
- MX?: {
24
- actividadVulnerable?: {
25
- AVI?: avi.AVIReportItemData;
26
- };
27
- };
28
- [key: string]: unknown;
29
- };
30
- }
31
-
32
- // ===========================
33
- // MexAVIReportItem Model
34
- // ===========================
35
-
36
- /**
37
- * Mexico AVI Report Item Model.
38
- *
39
- * Provides typed accessors for AVI-specific report item data.
40
- */
41
- export class MexAVIReportItem extends MexActividadVulnerableReportItem {
42
- // ─────────────────────────────────────────────────────────────────
43
- // AVI Data
44
- // ─────────────────────────────────────────────────────────────────
45
-
46
- /**
47
- * AVI-specific report item data
48
- */
49
- protected get aviData(): avi.AVIReportItemData | undefined {
50
- return this.actividadVulnerableData?.AVI;
51
- }
52
-
53
- /**
54
- * Alert type code
55
- * - "100" for monthly reports
56
- * - Other codes for unusual activity
57
- */
58
- get alertType(): avi.TipoAlerta | undefined {
59
- return this.aviData?.alertType;
60
- }
61
-
62
- /**
63
- * Alert description (for unusual activity)
64
- */
65
- get alertDescription(): string | undefined {
66
- return this.aviData?.alertDescription;
67
- }
68
-
69
- /**
70
- * Amendment data for corrections
71
- */
72
- get amendment(): avi.Amendment | undefined {
73
- return this.aviData?.amendment;
74
- }
75
-
76
- /**
77
- * Whether this item is an amendment
78
- */
79
- get isAmendment(): boolean {
80
- return !!this.aviData?.amendment;
81
- }
82
-
83
- // ─────────────────────────────────────────────────────────────────
84
- // String Representation
85
- // ─────────────────────────────────────────────────────────────────
86
-
87
- override toString(): string {
88
- return `MexAVIReportItem(${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 an AVI (Activos Virtuales) report item
100
- */
101
- export function isMexAVIReportItem(
102
- item: ReportItemModel
103
- ): item is MexAVIReportItem {
104
- return item instanceof MexAVIReportItem;
105
- }
@@ -1,157 +0,0 @@
1
- /**
2
- * Mexico AVI (Activos Virtuales) Transaction
3
- *
4
- * Specialized for virtual asset / cryptocurrency transactions.
5
- */
6
-
7
- import { avi } from "@artu-ai/shared";
8
- import { MexActividadVulnerableTransaction } from "../MexActividadVulnerableTransaction";
9
-
10
- // ===========================
11
- // MexAVITransaction Model
12
- // ===========================
13
-
14
- /**
15
- * Mexico AVI Transaction Model.
16
- *
17
- * Provides typed accessors for virtual asset transaction data.
18
- *
19
- * @example
20
- * ```typescript
21
- * if (txn instanceof MexAVITransaction) {
22
- * console.log(`Operation: ${txn.operationType}`);
23
- * console.log(`Crypto: ${txn.crypto}`);
24
- * }
25
- * ```
26
- */
27
- export class MexAVITransaction extends MexActividadVulnerableTransaction {
28
- // ─────────────────────────────────────────────────────────────────
29
- // AVI-Specific Data
30
- // ─────────────────────────────────────────────────────────────────
31
-
32
- /**
33
- * AVI-specific transaction data
34
- */
35
- protected get aviData(): avi.AVITransactionData | undefined {
36
- return this.mexicoData?.actividadVulnerable?.AVI;
37
- }
38
-
39
- /**
40
- * Operation type (buy, sell, exchange, transfer, deposit, withdrawal)
41
- */
42
- get operationType(): string | undefined {
43
- return this.aviData?.operationType;
44
- }
45
-
46
- /**
47
- * Cryptocurrency/virtual asset code (for buy, sell, transfer operations)
48
- */
49
- get crypto(): string | undefined {
50
- const data = this.aviData;
51
- if (!data) return undefined;
52
- if ("crypto" in data) {
53
- return data.crypto;
54
- }
55
- return undefined;
56
- }
57
-
58
- /**
59
- * Amount of virtual asset (for buy, sell, transfer operations)
60
- */
61
- get cryptoAmount(): number | undefined {
62
- const data = this.aviData;
63
- if (!data) return undefined;
64
- if ("cryptoAmount" in data) {
65
- return data.cryptoAmount;
66
- }
67
- return undefined;
68
- }
69
-
70
- /**
71
- * Exchange rate to MXN (for buy, sell, transfer operations)
72
- */
73
- get cryptoExchangeRate(): string | undefined {
74
- const data = this.aviData;
75
- if (!data) return undefined;
76
- if ("cryptoExchangeRate" in data) {
77
- return data.cryptoExchangeRate;
78
- }
79
- return undefined;
80
- }
81
-
82
- /**
83
- * Description of the virtual asset (for buy, sell, transfer operations)
84
- */
85
- get cryptoDescription(): string | undefined {
86
- const data = this.aviData;
87
- if (!data) return undefined;
88
- if ("cryptoDescription" in data) {
89
- return data.cryptoDescription;
90
- }
91
- return undefined;
92
- }
93
-
94
- /**
95
- * Transaction hash (for blockchain operations)
96
- */
97
- get hash(): string | undefined {
98
- const data = this.aviData;
99
- if (!data) return undefined;
100
- if ("hash" in data) {
101
- return data.hash;
102
- }
103
- return undefined;
104
- }
105
-
106
- /**
107
- * Monetary instrument (for deposit/withdrawal operations)
108
- */
109
- get monetaryInstrument(): string | undefined {
110
- const data = this.aviData;
111
- if (!data) return undefined;
112
- if ("monetaryInstrument" in data) {
113
- return data.monetaryInstrument;
114
- }
115
- return undefined;
116
- }
117
-
118
- /**
119
- * Exchange data (for exchange operations)
120
- */
121
- get exchangeData():
122
- | Omit<AVIExchangeTransaction, "operationType" | "hash">
123
- | undefined {
124
- const data = this.aviData;
125
- if (!data || data.operationType !== avi.TipoOperacion.Exchange)
126
- return undefined;
127
- if ("sent" in data && "received" in data) {
128
- return { sent: data.sent, received: data.received };
129
- }
130
- return undefined;
131
- }
132
-
133
- // ─────────────────────────────────────────────────────────────────
134
- // String Representation
135
- // ─────────────────────────────────────────────────────────────────
136
-
137
- override toString(): string {
138
- return `MexAVITransaction(${this.id}, ${this.formattedAmount}, ${this.operationType ?? "unknown"})`;
139
- }
140
- }
141
-
142
- // ===========================
143
- // Type Guards
144
- // ===========================
145
-
146
- import type { TransactionModel } from "../../../types";
147
-
148
- type AVIExchangeTransaction = avi.AVIExchangeTransaction;
149
-
150
- /**
151
- * Check if transaction is an AVI (Activos Virtuales) transaction
152
- */
153
- export function isMexAVITransaction(
154
- txn: TransactionModel
155
- ): txn is MexAVITransaction {
156
- return txn instanceof MexAVITransaction;
157
- }
@@ -1,78 +0,0 @@
1
- /**
2
- * Mexico Actividad Vulnerable Models
3
- */
4
-
5
- // Base activity client
6
- export {
7
- MexActividadVulnerableClient,
8
- isActividadVulnerable,
9
- } from "./MexActividadVulnerableClient";
10
-
11
- // Base activity transaction
12
- export {
13
- MexActividadVulnerableTransaction,
14
- isActividadVulnerableTransaction,
15
- } from "./MexActividadVulnerableTransaction";
16
-
17
- // Base activity report
18
- export {
19
- MexActividadVulnerableReport,
20
- type MexActividadVulnerableReportData,
21
- isActividadVulnerableReport,
22
- } from "./MexActividadVulnerableReport";
23
- export {
24
- MexActividadVulnerableReportItem,
25
- type MexActividadVulnerableReportItemData,
26
- isActividadVulnerableReportItem,
27
- } from "./MexActividadVulnerableReportItem";
28
-
29
- // Activity-specific clients
30
- export { MexAVIClient, isMexAVIClient } from "./avi/MexAVIClient";
31
- export { MexJYSClient, isMexJYSClient } from "./jys/MexJYSClient";
32
- export { MexTSCClient, isMexTSCClient } from "./tsc/MexTSCClient";
33
-
34
- // Activity-specific transactions
35
- export {
36
- MexAVITransaction,
37
- isMexAVITransaction,
38
- } from "./avi/MexAVITransaction";
39
- export {
40
- MexJYSTransaction,
41
- isMexJYSTransaction,
42
- } from "./jys/MexJYSTransaction";
43
- export {
44
- MexTSCTransaction,
45
- isMexTSCTransaction,
46
- } from "./tsc/MexTSCTransaction";
47
-
48
- // Activity-specific reports
49
- export {
50
- MexAVIReport,
51
- type MexAVIReportData,
52
- isMexAVIReport,
53
- } from "./avi/MexAVIReport";
54
- export {
55
- MexAVIReportItem,
56
- type MexAVIReportItemData,
57
- isMexAVIReportItem,
58
- } from "./avi/MexAVIReportItem";
59
- export {
60
- MexJYSReport,
61
- type MexJYSReportData,
62
- isMexJYSReport,
63
- } from "./jys/MexJYSReport";
64
- export {
65
- MexJYSReportItem,
66
- type MexJYSReportItemData,
67
- isMexJYSReportItem,
68
- } from "./jys/MexJYSReportItem";
69
- export {
70
- MexTSCReport,
71
- type MexTSCReportData,
72
- isMexTSCReport,
73
- } from "./tsc/MexTSCReport";
74
- export {
75
- MexTSCReportItem,
76
- type MexTSCReportItemData,
77
- isMexTSCReportItem,
78
- } from "./tsc/MexTSCReportItem";
@@ -1,73 +0,0 @@
1
- /**
2
- * Mexico JYS (Juegos y Sorteos) Client
3
- *
4
- * Specialized for gaming and lottery operations.
5
- */
6
-
7
- import type { ClientRelationshipType, jys } from "@artu-ai/shared";
8
- import { MexActividadVulnerableClient } from "../MexActividadVulnerableClient";
9
-
10
- // ===========================
11
- // MexJYSClient Model
12
- // ===========================
13
-
14
- /**
15
- * Mexico JYS Client Model.
16
- *
17
- * Provides typed accessors for gaming/lottery specific data.
18
- *
19
- * @example
20
- * ```typescript
21
- * if (client instanceof MexJYSClient) {
22
- * console.log(`JYS Client: ${client.name}`);
23
- * }
24
- * ```
25
- */
26
- export class MexJYSClient extends MexActividadVulnerableClient {
27
- // ─────────────────────────────────────────────────────────────────
28
- // JYS-Specific Data
29
- // ─────────────────────────────────────────────────────────────────
30
-
31
- /**
32
- * JYS-specific activity data
33
- */
34
- protected get jysData(): jys.JYSClientData | undefined {
35
- return this.mexicoData?.actividadVulnerable?.JYS;
36
- }
37
-
38
- // ─────────────────────────────────────────────────────────────────
39
- // String Representation
40
- // ─────────────────────────────────────────────────────────────────
41
-
42
- override toString(): string {
43
- return `MexJYSClient(${this.id}, ${this.name})`;
44
- }
45
-
46
- /**
47
- * Linked clients (if included) instantiated as MexJYSClient
48
- */
49
- override get linkedClients():
50
- | {
51
- relationshipType: ClientRelationshipType;
52
- client: MexJYSClient;
53
- }[]
54
- | undefined {
55
- return (this._data.linkedClients ?? []).map((l) => ({
56
- relationshipType: l.relationshipType,
57
- client: new MexJYSClient(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 JYS (Juegos y Sorteos) client
70
- */
71
- export function isMexJYSClient(client: ClientModel): client is MexJYSClient {
72
- return client instanceof MexJYSClient;
73
- }
@@ -1,114 +0,0 @@
1
- /**
2
- * Mexico JYS Report Model
3
- *
4
- * Report model for Juegos y Sorteos (Games and Raffles) activity.
5
- */
6
-
7
- import {
8
- MexActividadVulnerableReport,
9
- type MexActividadVulnerableReportData,
10
- } from "../MexActividadVulnerableReport";
11
- import type { jys } from "@artu-ai/shared";
12
-
13
- // ===========================
14
- // Types
15
- // ===========================
16
-
17
- /**
18
- * JYS report data
19
- */
20
- export interface MexJYSReportData extends MexActividadVulnerableReportData {
21
- jurisdictions?: {
22
- MX?: {
23
- actividadVulnerable?: {
24
- JYS?: jys.JYSReportData;
25
- };
26
- };
27
- [key: string]: unknown;
28
- };
29
- }
30
-
31
- // ===========================
32
- // MexJYSReport Model
33
- // ===========================
34
-
35
- /**
36
- * Mexico JYS Report Model.
37
- *
38
- * Provides typed accessors for JYS-specific report data.
39
- *
40
- * @example
41
- * ```typescript
42
- * if (report instanceof MexJYSReport) {
43
- * console.log(`Period: ${report.mesReportado}`);
44
- * }
45
- * ```
46
- */
47
- export class MexJYSReport extends MexActividadVulnerableReport {
48
- // ─────────────────────────────────────────────────────────────────
49
- // JYS Data
50
- // ─────────────────────────────────────────────────────────────────
51
-
52
- /**
53
- * JYS-specific report data
54
- */
55
- protected get jysData(): jys.JYSReportData | undefined {
56
- return this.actividadVulnerableData?.JYS;
57
- }
58
-
59
- /**
60
- * Reporting period (YYYYMM format)
61
- */
62
- get mesReportado(): string | undefined {
63
- return this.jysData?.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 `MexJYSReport(${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 JYS (Juegos y Sorteos) report
111
- */
112
- export function isMexJYSReport(report: ReportModel): report is MexJYSReport {
113
- return report instanceof MexJYSReport;
114
- }