@ottochain/sdk 1.5.0 → 1.6.0

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 (80) hide show
  1. package/dist/cjs/apps/contracts/index.js +6 -10
  2. package/dist/cjs/apps/{governance/state-machines/governance-legislature.json → contracts/state-machines/index.js} +381 -330
  3. package/dist/cjs/apps/corporate/index.js +12 -24
  4. package/dist/cjs/apps/corporate/state-machines/index.js +10246 -0
  5. package/dist/cjs/apps/governance/index.js +11 -22
  6. package/dist/cjs/apps/governance/state-machines/index.js +4755 -0
  7. package/dist/cjs/apps/identity/index.js +3 -6
  8. package/dist/{esm/apps/identity/state-machines/agent-identity.json → cjs/apps/identity/state-machines/index.js} +9 -2
  9. package/dist/cjs/apps/markets/index.js +2 -5
  10. package/dist/{esm/apps/markets/state-machines/market-universal.json → cjs/apps/markets/state-machines/index.js} +9 -2
  11. package/dist/cjs/apps/oracles/index.js +2 -5
  12. package/dist/{esm/apps/oracles/state-machines/oracle.json → cjs/apps/oracles/state-machines/index.js} +9 -2
  13. package/dist/cjs/ottochain/index.js +4 -1
  14. package/dist/cjs/ottochain/normalize.js +17 -3
  15. package/dist/cjs/ottochain/types.js +12 -0
  16. package/dist/esm/apps/contracts/index.js +2 -3
  17. package/dist/esm/apps/{governance/state-machines/governance-legislature.json → contracts/state-machines/index.js} +378 -330
  18. package/dist/esm/apps/corporate/index.js +2 -11
  19. package/dist/esm/apps/corporate/state-machines/index.js +10243 -0
  20. package/dist/esm/apps/governance/index.js +2 -10
  21. package/dist/esm/apps/governance/state-machines/index.js +4752 -0
  22. package/dist/esm/apps/identity/index.js +2 -2
  23. package/dist/{cjs/apps/identity/state-machines/agent-identity.json → esm/apps/identity/state-machines/index.js} +6 -2
  24. package/dist/esm/apps/markets/index.js +1 -1
  25. package/dist/{cjs/apps/markets/state-machines/market-universal.json → esm/apps/markets/state-machines/index.js} +6 -2
  26. package/dist/esm/apps/oracles/index.js +1 -1
  27. package/dist/{cjs/apps/oracles/state-machines/oracle.json → esm/apps/oracles/state-machines/index.js} +6 -2
  28. package/dist/esm/ottochain/index.js +2 -0
  29. package/dist/esm/ottochain/normalize.js +17 -3
  30. package/dist/esm/ottochain/types.js +11 -1
  31. package/dist/types/apps/contracts/state-machines/index.d.ts +549 -0
  32. package/dist/types/apps/corporate/state-machines/index.d.ts +9121 -0
  33. package/dist/types/apps/governance/state-machines/index.d.ts +3551 -0
  34. package/dist/types/apps/identity/state-machines/index.d.ts +206 -0
  35. package/dist/types/apps/markets/state-machines/index.d.ts +448 -0
  36. package/dist/types/apps/oracles/state-machines/index.d.ts +312 -0
  37. package/dist/types/ottochain/index.d.ts +2 -1
  38. package/dist/types/ottochain/normalize.d.ts +14 -0
  39. package/dist/types/ottochain/types.d.ts +9 -0
  40. package/package.json +4 -3
  41. package/dist/cjs/apps/contracts/state-machines/contract.json +0 -352
  42. package/dist/cjs/apps/contracts/state-machines/escrow.json +0 -354
  43. package/dist/cjs/apps/corporate/state-machines/corporate-board.json +0 -1064
  44. package/dist/cjs/apps/corporate/state-machines/corporate-bylaws.json +0 -751
  45. package/dist/cjs/apps/corporate/state-machines/corporate-committee.json +0 -957
  46. package/dist/cjs/apps/corporate/state-machines/corporate-compliance.json +0 -1293
  47. package/dist/cjs/apps/corporate/state-machines/corporate-entity.json +0 -861
  48. package/dist/cjs/apps/corporate/state-machines/corporate-officers.json +0 -843
  49. package/dist/cjs/apps/corporate/state-machines/corporate-proxy.json +0 -783
  50. package/dist/cjs/apps/corporate/state-machines/corporate-resolution.json +0 -1174
  51. package/dist/cjs/apps/corporate/state-machines/corporate-securities.json +0 -1215
  52. package/dist/cjs/apps/corporate/state-machines/corporate-shareholders.json +0 -1298
  53. package/dist/cjs/apps/governance/state-machines/dao-multisig.json +0 -667
  54. package/dist/cjs/apps/governance/state-machines/dao-single.json +0 -230
  55. package/dist/cjs/apps/governance/state-machines/dao-threshold.json +0 -624
  56. package/dist/cjs/apps/governance/state-machines/dao-token.json +0 -638
  57. package/dist/cjs/apps/governance/state-machines/governance-constitution.json +0 -357
  58. package/dist/cjs/apps/governance/state-machines/governance-executive.json +0 -387
  59. package/dist/cjs/apps/governance/state-machines/governance-judiciary.json +0 -558
  60. package/dist/cjs/apps/governance/state-machines/governance-simple.json +0 -625
  61. package/dist/esm/apps/contracts/state-machines/contract.json +0 -352
  62. package/dist/esm/apps/contracts/state-machines/escrow.json +0 -354
  63. package/dist/esm/apps/corporate/state-machines/corporate-board.json +0 -1064
  64. package/dist/esm/apps/corporate/state-machines/corporate-bylaws.json +0 -751
  65. package/dist/esm/apps/corporate/state-machines/corporate-committee.json +0 -957
  66. package/dist/esm/apps/corporate/state-machines/corporate-compliance.json +0 -1293
  67. package/dist/esm/apps/corporate/state-machines/corporate-entity.json +0 -861
  68. package/dist/esm/apps/corporate/state-machines/corporate-officers.json +0 -843
  69. package/dist/esm/apps/corporate/state-machines/corporate-proxy.json +0 -783
  70. package/dist/esm/apps/corporate/state-machines/corporate-resolution.json +0 -1174
  71. package/dist/esm/apps/corporate/state-machines/corporate-securities.json +0 -1215
  72. package/dist/esm/apps/corporate/state-machines/corporate-shareholders.json +0 -1298
  73. package/dist/esm/apps/governance/state-machines/dao-multisig.json +0 -667
  74. package/dist/esm/apps/governance/state-machines/dao-single.json +0 -230
  75. package/dist/esm/apps/governance/state-machines/dao-threshold.json +0 -624
  76. package/dist/esm/apps/governance/state-machines/dao-token.json +0 -638
  77. package/dist/esm/apps/governance/state-machines/governance-constitution.json +0 -357
  78. package/dist/esm/apps/governance/state-machines/governance-executive.json +0 -387
  79. package/dist/esm/apps/governance/state-machines/governance-judiciary.json +0 -558
  80. package/dist/esm/apps/governance/state-machines/governance-simple.json +0 -625
@@ -1,1293 +0,0 @@
1
- {
2
- "$schema": "https://ottochain.dev/schemas/state-machine-v1.json",
3
- "name": "corporate-compliance",
4
- "version": "1.0.0",
5
- "category": "corporate-governance",
6
- "description": "Regulatory compliance state machine tracking filing obligations, deadlines, deficiencies, and remediation for corporate entities. Manages annual reports, franchise taxes, registered agent status, and other state/federal requirements.",
7
- "context": {
8
- "complianceId": {
9
- "type": "string",
10
- "description": "Unique identifier for this compliance record"
11
- },
12
- "entityId": {
13
- "type": "string",
14
- "description": "Reference to parent corporate-entity"
15
- },
16
- "jurisdiction": {
17
- "type": "object",
18
- "properties": {
19
- "state": {
20
- "type": "string",
21
- "description": "Primary jurisdiction"
22
- },
23
- "country": {
24
- "type": "string",
25
- "default": "USA"
26
- },
27
- "foreignQualifications": {
28
- "type": "array",
29
- "items": {
30
- "type": "object",
31
- "properties": {
32
- "state": {
33
- "type": "string"
34
- },
35
- "qualificationDate": {
36
- "type": "string",
37
- "format": "date"
38
- },
39
- "foreignEntityNumber": {
40
- "type": "string"
41
- },
42
- "status": {
43
- "type": "string",
44
- "enum": [
45
- "ACTIVE",
46
- "WITHDRAWN",
47
- "REVOKED"
48
- ]
49
- }
50
- }
51
- }
52
- }
53
- }
54
- },
55
- "filingCalendar": {
56
- "type": "array",
57
- "description": "Required filings and their deadlines",
58
- "items": {
59
- "type": "object",
60
- "properties": {
61
- "filingId": {
62
- "type": "string"
63
- },
64
- "filingType": {
65
- "type": "string",
66
- "enum": [
67
- "ANNUAL_REPORT",
68
- "BIENNIAL_REPORT",
69
- "FRANCHISE_TAX",
70
- "STATEMENT_OF_INFORMATION",
71
- "REGISTERED_AGENT_UPDATE",
72
- "FOREIGN_QUALIFICATION_ANNUAL",
73
- "BENEFICIAL_OWNERSHIP",
74
- "FEDERAL_TAX_RETURN",
75
- "STATE_TAX_RETURN",
76
- "SEC_FILING",
77
- "OTHER"
78
- ]
79
- },
80
- "jurisdiction": {
81
- "type": "string"
82
- },
83
- "frequency": {
84
- "type": "string",
85
- "enum": [
86
- "ANNUAL",
87
- "BIENNIAL",
88
- "QUARTERLY",
89
- "ONE_TIME"
90
- ]
91
- },
92
- "dueDate": {
93
- "type": "string",
94
- "format": "date"
95
- },
96
- "gracePeriodDays": {
97
- "type": "integer",
98
- "default": 0
99
- },
100
- "estimatedFee": {
101
- "type": "number"
102
- },
103
- "status": {
104
- "type": "string",
105
- "enum": [
106
- "PENDING",
107
- "FILED",
108
- "OVERDUE",
109
- "WAIVED"
110
- ]
111
- },
112
- "lastFiledDate": {
113
- "type": "string",
114
- "format": "date",
115
- "nullable": true
116
- },
117
- "confirmationNumber": {
118
- "type": "string",
119
- "nullable": true
120
- },
121
- "notes": {
122
- "type": "string",
123
- "nullable": true
124
- }
125
- }
126
- }
127
- },
128
- "registeredAgents": {
129
- "type": "array",
130
- "description": "Registered agents by jurisdiction",
131
- "items": {
132
- "type": "object",
133
- "properties": {
134
- "jurisdiction": {
135
- "type": "string"
136
- },
137
- "agentName": {
138
- "type": "string"
139
- },
140
- "agentAddress": {
141
- "type": "object"
142
- },
143
- "agentPhone": {
144
- "type": "string"
145
- },
146
- "agentEmail": {
147
- "type": "string"
148
- },
149
- "effectiveDate": {
150
- "type": "string",
151
- "format": "date"
152
- },
153
- "isThirdParty": {
154
- "type": "boolean"
155
- },
156
- "serviceAgreementRef": {
157
- "type": "string",
158
- "nullable": true
159
- },
160
- "renewalDate": {
161
- "type": "string",
162
- "format": "date",
163
- "nullable": true
164
- }
165
- }
166
- }
167
- },
168
- "deficiencies": {
169
- "type": "array",
170
- "items": {
171
- "type": "object",
172
- "properties": {
173
- "deficiencyId": {
174
- "type": "string"
175
- },
176
- "jurisdiction": {
177
- "type": "string"
178
- },
179
- "type": {
180
- "type": "string",
181
- "enum": [
182
- "ANNUAL_REPORT_MISSING",
183
- "FRANCHISE_TAX_DELINQUENT",
184
- "REGISTERED_AGENT_LAPSE",
185
- "BENEFICIAL_OWNERSHIP_MISSING",
186
- "OTHER"
187
- ]
188
- },
189
- "description": {
190
- "type": "string"
191
- },
192
- "noticeDate": {
193
- "type": "string",
194
- "format": "date"
195
- },
196
- "noticeRef": {
197
- "type": "string"
198
- },
199
- "cureDeadline": {
200
- "type": "string",
201
- "format": "date"
202
- },
203
- "penaltyAmount": {
204
- "type": "number",
205
- "nullable": true
206
- },
207
- "status": {
208
- "type": "string",
209
- "enum": [
210
- "OPEN",
211
- "IN_PROGRESS",
212
- "CURED",
213
- "PENALTY_ASSESSED",
214
- "ADMINISTRATIVE_ACTION"
215
- ]
216
- },
217
- "curedDate": {
218
- "type": "string",
219
- "format": "date",
220
- "nullable": true
221
- },
222
- "curativeActions": {
223
- "type": "array",
224
- "items": {
225
- "type": "string"
226
- }
227
- }
228
- }
229
- }
230
- },
231
- "filingHistory": {
232
- "type": "array",
233
- "items": {
234
- "type": "object",
235
- "properties": {
236
- "filingId": {
237
- "type": "string"
238
- },
239
- "filingType": {
240
- "type": "string"
241
- },
242
- "jurisdiction": {
243
- "type": "string"
244
- },
245
- "filedDate": {
246
- "type": "string",
247
- "format": "date"
248
- },
249
- "periodCovered": {
250
- "type": "string"
251
- },
252
- "confirmationNumber": {
253
- "type": "string"
254
- },
255
- "feePaid": {
256
- "type": "number"
257
- },
258
- "filedBy": {
259
- "type": "string"
260
- },
261
- "documentRef": {
262
- "type": "string"
263
- }
264
- }
265
- }
266
- },
267
- "goodStandingCertificates": {
268
- "type": "array",
269
- "items": {
270
- "type": "object",
271
- "properties": {
272
- "certificateId": {
273
- "type": "string"
274
- },
275
- "jurisdiction": {
276
- "type": "string"
277
- },
278
- "issuedDate": {
279
- "type": "string",
280
- "format": "date"
281
- },
282
- "validThrough": {
283
- "type": "string",
284
- "format": "date",
285
- "nullable": true
286
- },
287
- "documentRef": {
288
- "type": "string"
289
- },
290
- "purpose": {
291
- "type": "string"
292
- }
293
- }
294
- }
295
- },
296
- "complianceScore": {
297
- "type": "object",
298
- "properties": {
299
- "overallStatus": {
300
- "type": "string",
301
- "enum": [
302
- "GREEN",
303
- "YELLOW",
304
- "RED"
305
- ]
306
- },
307
- "openDeficiencies": {
308
- "type": "integer"
309
- },
310
- "overdueFilings": {
311
- "type": "integer"
312
- },
313
- "upcomingDeadlines30Days": {
314
- "type": "integer"
315
- },
316
- "lastAssessedDate": {
317
- "type": "string",
318
- "format": "date"
319
- }
320
- }
321
- },
322
- "createdAt": {
323
- "type": "string",
324
- "format": "date-time"
325
- },
326
- "updatedAt": {
327
- "type": "string",
328
- "format": "date-time"
329
- }
330
- },
331
- "states": {
332
- "COMPLIANT": {
333
- "description": "Entity is in good standing in all jurisdictions with no open deficiencies",
334
- "metadata": null
335
- },
336
- "REVIEW_PENDING": {
337
- "description": "Compliance review needed; deadline approaching or minor issue flagged",
338
- "metadata": null
339
- },
340
- "DEFICIENT": {
341
- "description": "One or more deficiencies identified; action required",
342
- "metadata": null
343
- },
344
- "REMEDIATED": {
345
- "description": "Deficiencies cured; awaiting state confirmation of good standing",
346
- "metadata": null
347
- }
348
- },
349
- "initialState": "COMPLIANT",
350
- "transitions": {
351
- "initialize_compliance": {
352
- "from": null,
353
- "to": "COMPLIANT",
354
- "description": "Initialize compliance tracking for an entity",
355
- "event": {
356
- "name": "initialize_compliance",
357
- "payload": {
358
- "complianceId": {
359
- "type": "string",
360
- "required": true
361
- },
362
- "entityId": {
363
- "type": "string",
364
- "required": true
365
- },
366
- "jurisdiction": {
367
- "type": "object",
368
- "required": true
369
- },
370
- "registeredAgents": {
371
- "type": "array",
372
- "required": true
373
- },
374
- "filingCalendar": {
375
- "type": "array"
376
- }
377
- }
378
- },
379
- "effects": [
380
- {
381
- "type": "SET_CONTEXT",
382
- "path": "complianceId",
383
- "value": "{{ event.complianceId }}"
384
- },
385
- {
386
- "type": "SET_CONTEXT",
387
- "path": "entityId",
388
- "value": "{{ event.entityId }}"
389
- },
390
- {
391
- "type": "SET_CONTEXT",
392
- "path": "jurisdiction",
393
- "value": "{{ event.jurisdiction }}"
394
- },
395
- {
396
- "type": "SET_CONTEXT",
397
- "path": "registeredAgents",
398
- "value": "{{ event.registeredAgents }}"
399
- },
400
- {
401
- "type": "SET_CONTEXT",
402
- "path": "filingCalendar",
403
- "value": "{{ event.filingCalendar || [] }}"
404
- },
405
- {
406
- "type": "SET_CONTEXT",
407
- "path": "deficiencies",
408
- "value": []
409
- },
410
- {
411
- "type": "SET_CONTEXT",
412
- "path": "filingHistory",
413
- "value": []
414
- },
415
- {
416
- "type": "SET_CONTEXT",
417
- "path": "goodStandingCertificates",
418
- "value": []
419
- },
420
- {
421
- "type": "SET_CONTEXT",
422
- "path": "complianceScore",
423
- "value": {
424
- "overallStatus": "GREEN",
425
- "openDeficiencies": 0,
426
- "overdueFilings": 0,
427
- "upcomingDeadlines30Days": 0,
428
- "lastAssessedDate": "{{ today() }}"
429
- }
430
- }
431
- ]
432
- },
433
- "add_filing_requirement": {
434
- "from": [
435
- "COMPLIANT",
436
- "REVIEW_PENDING",
437
- "DEFICIENT",
438
- "REMEDIATED"
439
- ],
440
- "to": null,
441
- "description": "Add a new filing requirement to the calendar",
442
- "event": {
443
- "name": "add_filing_requirement",
444
- "payload": {
445
- "filingId": {
446
- "type": "string",
447
- "required": true
448
- },
449
- "filingType": {
450
- "type": "string",
451
- "required": true
452
- },
453
- "jurisdiction": {
454
- "type": "string",
455
- "required": true
456
- },
457
- "frequency": {
458
- "type": "string",
459
- "required": true
460
- },
461
- "dueDate": {
462
- "type": "string",
463
- "format": "date",
464
- "required": true
465
- },
466
- "gracePeriodDays": {
467
- "type": "integer",
468
- "default": 0
469
- },
470
- "estimatedFee": {
471
- "type": "number"
472
- }
473
- }
474
- },
475
- "effects": [
476
- {
477
- "type": "APPEND_ARRAY",
478
- "path": "filingCalendar",
479
- "value": {
480
- "filingId": "{{ event.filingId }}",
481
- "filingType": "{{ event.filingType }}",
482
- "jurisdiction": "{{ event.jurisdiction }}",
483
- "frequency": "{{ event.frequency }}",
484
- "dueDate": "{{ event.dueDate }}",
485
- "gracePeriodDays": "{{ event.gracePeriodDays }}",
486
- "estimatedFee": "{{ event.estimatedFee }}",
487
- "status": "PENDING"
488
- }
489
- }
490
- ]
491
- },
492
- "file_annual_report": {
493
- "from": [
494
- "COMPLIANT",
495
- "REVIEW_PENDING",
496
- "DEFICIENT",
497
- "REMEDIATED"
498
- ],
499
- "to": null,
500
- "description": "Record filing of annual report",
501
- "event": {
502
- "name": "file_annual_report",
503
- "payload": {
504
- "filingId": {
505
- "type": "string",
506
- "required": true
507
- },
508
- "jurisdiction": {
509
- "type": "string",
510
- "required": true
511
- },
512
- "filedDate": {
513
- "type": "string",
514
- "format": "date",
515
- "required": true
516
- },
517
- "periodCovered": {
518
- "type": "string",
519
- "required": true
520
- },
521
- "confirmationNumber": {
522
- "type": "string",
523
- "required": true
524
- },
525
- "feePaid": {
526
- "type": "number",
527
- "required": true
528
- },
529
- "filedBy": {
530
- "type": "string",
531
- "required": true
532
- },
533
- "documentRef": {
534
- "type": "string"
535
- },
536
- "nextDueDate": {
537
- "type": "string",
538
- "format": "date"
539
- }
540
- }
541
- },
542
- "effects": [
543
- {
544
- "type": "UPDATE_ARRAY_ITEM",
545
- "path": "filingCalendar",
546
- "matchKey": "filingId",
547
- "matchValue": "{{ event.filingId }}",
548
- "updates": {
549
- "status": "FILED",
550
- "lastFiledDate": "{{ event.filedDate }}",
551
- "confirmationNumber": "{{ event.confirmationNumber }}",
552
- "dueDate": "{{ event.nextDueDate }}"
553
- }
554
- },
555
- {
556
- "type": "APPEND_ARRAY",
557
- "path": "filingHistory",
558
- "value": {
559
- "filingId": "{{ event.filingId }}",
560
- "filingType": "ANNUAL_REPORT",
561
- "jurisdiction": "{{ event.jurisdiction }}",
562
- "filedDate": "{{ event.filedDate }}",
563
- "periodCovered": "{{ event.periodCovered }}",
564
- "confirmationNumber": "{{ event.confirmationNumber }}",
565
- "feePaid": "{{ event.feePaid }}",
566
- "filedBy": "{{ event.filedBy }}",
567
- "documentRef": "{{ event.documentRef }}"
568
- }
569
- },
570
- {
571
- "type": "EMIT_EVENT",
572
- "eventType": "ANNUAL_REPORT_FILED",
573
- "payload": {
574
- "complianceId": "{{ context.complianceId }}",
575
- "entityId": "{{ context.entityId }}",
576
- "jurisdiction": "{{ event.jurisdiction }}",
577
- "confirmationNumber": "{{ event.confirmationNumber }}"
578
- }
579
- }
580
- ]
581
- },
582
- "pay_franchise_tax": {
583
- "from": [
584
- "COMPLIANT",
585
- "REVIEW_PENDING",
586
- "DEFICIENT",
587
- "REMEDIATED"
588
- ],
589
- "to": null,
590
- "description": "Record payment of franchise tax",
591
- "event": {
592
- "name": "pay_franchise_tax",
593
- "payload": {
594
- "filingId": {
595
- "type": "string",
596
- "required": true
597
- },
598
- "jurisdiction": {
599
- "type": "string",
600
- "required": true
601
- },
602
- "paidDate": {
603
- "type": "string",
604
- "format": "date",
605
- "required": true
606
- },
607
- "taxYear": {
608
- "type": "integer",
609
- "required": true
610
- },
611
- "amountPaid": {
612
- "type": "number",
613
- "required": true
614
- },
615
- "confirmationNumber": {
616
- "type": "string",
617
- "required": true
618
- },
619
- "nextDueDate": {
620
- "type": "string",
621
- "format": "date"
622
- }
623
- }
624
- },
625
- "effects": [
626
- {
627
- "type": "UPDATE_ARRAY_ITEM",
628
- "path": "filingCalendar",
629
- "matchKey": "filingId",
630
- "matchValue": "{{ event.filingId }}",
631
- "updates": {
632
- "status": "FILED",
633
- "lastFiledDate": "{{ event.paidDate }}",
634
- "confirmationNumber": "{{ event.confirmationNumber }}",
635
- "dueDate": "{{ event.nextDueDate }}"
636
- }
637
- },
638
- {
639
- "type": "APPEND_ARRAY",
640
- "path": "filingHistory",
641
- "value": {
642
- "filingId": "{{ event.filingId }}",
643
- "filingType": "FRANCHISE_TAX",
644
- "jurisdiction": "{{ event.jurisdiction }}",
645
- "filedDate": "{{ event.paidDate }}",
646
- "periodCovered": "{{ event.taxYear }}",
647
- "confirmationNumber": "{{ event.confirmationNumber }}",
648
- "feePaid": "{{ event.amountPaid }}"
649
- }
650
- },
651
- {
652
- "type": "EMIT_EVENT",
653
- "eventType": "FRANCHISE_TAX_PAID",
654
- "payload": {
655
- "complianceId": "{{ context.complianceId }}",
656
- "entityId": "{{ context.entityId }}",
657
- "jurisdiction": "{{ event.jurisdiction }}",
658
- "taxYear": "{{ event.taxYear }}"
659
- }
660
- }
661
- ]
662
- },
663
- "update_registered_agent": {
664
- "from": [
665
- "COMPLIANT",
666
- "REVIEW_PENDING",
667
- "DEFICIENT",
668
- "REMEDIATED"
669
- ],
670
- "to": null,
671
- "description": "Update registered agent for a jurisdiction",
672
- "event": {
673
- "name": "update_registered_agent",
674
- "payload": {
675
- "jurisdiction": {
676
- "type": "string",
677
- "required": true
678
- },
679
- "agentName": {
680
- "type": "string",
681
- "required": true
682
- },
683
- "agentAddress": {
684
- "type": "object",
685
- "required": true
686
- },
687
- "agentPhone": {
688
- "type": "string"
689
- },
690
- "agentEmail": {
691
- "type": "string"
692
- },
693
- "effectiveDate": {
694
- "type": "string",
695
- "format": "date",
696
- "required": true
697
- },
698
- "isThirdParty": {
699
- "type": "boolean",
700
- "default": false
701
- },
702
- "serviceAgreementRef": {
703
- "type": "string"
704
- },
705
- "filingConfirmation": {
706
- "type": "string"
707
- }
708
- }
709
- },
710
- "effects": [
711
- {
712
- "type": "UPSERT_ARRAY",
713
- "path": "registeredAgents",
714
- "matchKey": "jurisdiction",
715
- "matchValue": "{{ event.jurisdiction }}",
716
- "value": {
717
- "jurisdiction": "{{ event.jurisdiction }}",
718
- "agentName": "{{ event.agentName }}",
719
- "agentAddress": "{{ event.agentAddress }}",
720
- "agentPhone": "{{ event.agentPhone }}",
721
- "agentEmail": "{{ event.agentEmail }}",
722
- "effectiveDate": "{{ event.effectiveDate }}",
723
- "isThirdParty": "{{ event.isThirdParty }}",
724
- "serviceAgreementRef": "{{ event.serviceAgreementRef }}"
725
- }
726
- },
727
- {
728
- "type": "EMIT_EVENT",
729
- "eventType": "REGISTERED_AGENT_UPDATED",
730
- "payload": {
731
- "complianceId": "{{ context.complianceId }}",
732
- "entityId": "{{ context.entityId }}",
733
- "jurisdiction": "{{ event.jurisdiction }}",
734
- "newAgent": "{{ event.agentName }}"
735
- }
736
- }
737
- ]
738
- },
739
- "flag_review": {
740
- "from": "COMPLIANT",
741
- "to": "REVIEW_PENDING",
742
- "description": "Flag entity for compliance review (deadline approaching or issue identified)",
743
- "event": {
744
- "name": "flag_review",
745
- "payload": {
746
- "reason": {
747
- "type": "string",
748
- "required": true
749
- },
750
- "filingId": {
751
- "type": "string"
752
- },
753
- "dueDate": {
754
- "type": "string",
755
- "format": "date"
756
- }
757
- }
758
- },
759
- "effects": [
760
- {
761
- "type": "SET_CONTEXT",
762
- "path": "complianceScore.overallStatus",
763
- "value": "YELLOW"
764
- },
765
- {
766
- "type": "EMIT_EVENT",
767
- "eventType": "COMPLIANCE_REVIEW_FLAGGED",
768
- "payload": {
769
- "complianceId": "{{ context.complianceId }}",
770
- "entityId": "{{ context.entityId }}",
771
- "reason": "{{ event.reason }}"
772
- }
773
- }
774
- ]
775
- },
776
- "note_deficiency": {
777
- "from": [
778
- "COMPLIANT",
779
- "REVIEW_PENDING",
780
- "REMEDIATED"
781
- ],
782
- "to": "DEFICIENT",
783
- "description": "Record a compliance deficiency",
784
- "event": {
785
- "name": "note_deficiency",
786
- "payload": {
787
- "deficiencyId": {
788
- "type": "string",
789
- "required": true
790
- },
791
- "jurisdiction": {
792
- "type": "string",
793
- "required": true
794
- },
795
- "type": {
796
- "type": "string",
797
- "required": true
798
- },
799
- "description": {
800
- "type": "string",
801
- "required": true
802
- },
803
- "noticeDate": {
804
- "type": "string",
805
- "format": "date",
806
- "required": true
807
- },
808
- "noticeRef": {
809
- "type": "string"
810
- },
811
- "cureDeadline": {
812
- "type": "string",
813
- "format": "date",
814
- "required": true
815
- },
816
- "penaltyAmount": {
817
- "type": "number"
818
- }
819
- }
820
- },
821
- "effects": [
822
- {
823
- "type": "APPEND_ARRAY",
824
- "path": "deficiencies",
825
- "value": {
826
- "deficiencyId": "{{ event.deficiencyId }}",
827
- "jurisdiction": "{{ event.jurisdiction }}",
828
- "type": "{{ event.type }}",
829
- "description": "{{ event.description }}",
830
- "noticeDate": "{{ event.noticeDate }}",
831
- "noticeRef": "{{ event.noticeRef }}",
832
- "cureDeadline": "{{ event.cureDeadline }}",
833
- "penaltyAmount": "{{ event.penaltyAmount }}",
834
- "status": "OPEN",
835
- "curativeActions": []
836
- }
837
- },
838
- {
839
- "type": "INCREMENT",
840
- "path": "complianceScore.openDeficiencies",
841
- "amount": 1
842
- },
843
- {
844
- "type": "SET_CONTEXT",
845
- "path": "complianceScore.overallStatus",
846
- "value": "RED"
847
- },
848
- {
849
- "type": "EMIT_EVENT",
850
- "eventType": "DEFICIENCY_NOTED",
851
- "payload": {
852
- "complianceId": "{{ context.complianceId }}",
853
- "entityId": "{{ context.entityId }}",
854
- "deficiencyId": "{{ event.deficiencyId }}",
855
- "type": "{{ event.type }}",
856
- "cureDeadline": "{{ event.cureDeadline }}"
857
- }
858
- }
859
- ]
860
- },
861
- "record_curative_action": {
862
- "from": "DEFICIENT",
863
- "to": "DEFICIENT",
864
- "description": "Record a curative action taken for a deficiency",
865
- "event": {
866
- "name": "record_curative_action",
867
- "payload": {
868
- "deficiencyId": {
869
- "type": "string",
870
- "required": true
871
- },
872
- "action": {
873
- "type": "string",
874
- "required": true
875
- },
876
- "actionDate": {
877
- "type": "string",
878
- "format": "date",
879
- "required": true
880
- },
881
- "documentRef": {
882
- "type": "string"
883
- }
884
- }
885
- },
886
- "effects": [
887
- {
888
- "type": "UPDATE_ARRAY_ITEM",
889
- "path": "deficiencies",
890
- "matchKey": "deficiencyId",
891
- "matchValue": "{{ event.deficiencyId }}",
892
- "arrayPath": "curativeActions",
893
- "arrayOperation": "APPEND",
894
- "value": "{{ event.action }} ({{ event.actionDate }})"
895
- },
896
- {
897
- "type": "UPDATE_ARRAY_ITEM",
898
- "path": "deficiencies",
899
- "matchKey": "deficiencyId",
900
- "matchValue": "{{ event.deficiencyId }}",
901
- "updates": {
902
- "status": "IN_PROGRESS"
903
- }
904
- }
905
- ]
906
- },
907
- "cure_deficiency": {
908
- "from": "DEFICIENT",
909
- "to": "REMEDIATED",
910
- "description": "Cure a deficiency and submit for state confirmation",
911
- "event": {
912
- "name": "cure_deficiency",
913
- "payload": {
914
- "deficiencyId": {
915
- "type": "string",
916
- "required": true
917
- },
918
- "curedDate": {
919
- "type": "string",
920
- "format": "date",
921
- "required": true
922
- },
923
- "confirmationNumber": {
924
- "type": "string"
925
- },
926
- "penaltyPaid": {
927
- "type": "number"
928
- }
929
- }
930
- },
931
- "guards": [
932
- {
933
- "name": "isLastOpenDeficiency",
934
- "description": "Transition to REMEDIATED only when curing last deficiency",
935
- "expression": "context.deficiencies.filter(d => d.status === 'OPEN' || d.status === 'IN_PROGRESS').length === 1"
936
- }
937
- ],
938
- "effects": [
939
- {
940
- "type": "UPDATE_ARRAY_ITEM",
941
- "path": "deficiencies",
942
- "matchKey": "deficiencyId",
943
- "matchValue": "{{ event.deficiencyId }}",
944
- "updates": {
945
- "status": "CURED",
946
- "curedDate": "{{ event.curedDate }}"
947
- }
948
- },
949
- {
950
- "type": "DECREMENT",
951
- "path": "complianceScore.openDeficiencies",
952
- "amount": 1
953
- },
954
- {
955
- "type": "SET_CONTEXT",
956
- "path": "complianceScore.overallStatus",
957
- "value": "YELLOW"
958
- },
959
- {
960
- "type": "EMIT_EVENT",
961
- "eventType": "DEFICIENCY_CURED",
962
- "payload": {
963
- "complianceId": "{{ context.complianceId }}",
964
- "entityId": "{{ context.entityId }}",
965
- "deficiencyId": "{{ event.deficiencyId }}"
966
- }
967
- }
968
- ]
969
- },
970
- "cure_deficiency_remaining": {
971
- "from": "DEFICIENT",
972
- "to": "DEFICIENT",
973
- "description": "Cure one deficiency when others remain",
974
- "event": {
975
- "name": "cure_deficiency_remaining",
976
- "payload": {
977
- "deficiencyId": {
978
- "type": "string",
979
- "required": true
980
- },
981
- "curedDate": {
982
- "type": "string",
983
- "format": "date",
984
- "required": true
985
- },
986
- "confirmationNumber": {
987
- "type": "string"
988
- }
989
- }
990
- },
991
- "guards": [
992
- {
993
- "name": "hasRemainingDeficiencies",
994
- "expression": "context.deficiencies.filter(d => d.status === 'OPEN' || d.status === 'IN_PROGRESS').length > 1"
995
- }
996
- ],
997
- "effects": [
998
- {
999
- "type": "UPDATE_ARRAY_ITEM",
1000
- "path": "deficiencies",
1001
- "matchKey": "deficiencyId",
1002
- "matchValue": "{{ event.deficiencyId }}",
1003
- "updates": {
1004
- "status": "CURED",
1005
- "curedDate": "{{ event.curedDate }}"
1006
- }
1007
- },
1008
- {
1009
- "type": "DECREMENT",
1010
- "path": "complianceScore.openDeficiencies",
1011
- "amount": 1
1012
- }
1013
- ]
1014
- },
1015
- "confirm_good_standing": {
1016
- "from": "REMEDIATED",
1017
- "to": "COMPLIANT",
1018
- "description": "State confirms entity returned to good standing",
1019
- "event": {
1020
- "name": "confirm_good_standing",
1021
- "payload": {
1022
- "confirmationDate": {
1023
- "type": "string",
1024
- "format": "date",
1025
- "required": true
1026
- },
1027
- "jurisdiction": {
1028
- "type": "string",
1029
- "required": true
1030
- },
1031
- "certificateRef": {
1032
- "type": "string"
1033
- },
1034
- "validThrough": {
1035
- "type": "string",
1036
- "format": "date"
1037
- }
1038
- }
1039
- },
1040
- "effects": [
1041
- {
1042
- "type": "CONDITIONAL",
1043
- "condition": "event.certificateRef != null",
1044
- "then": {
1045
- "type": "APPEND_ARRAY",
1046
- "path": "goodStandingCertificates",
1047
- "value": {
1048
- "certificateId": "{{ event.certificateRef }}",
1049
- "jurisdiction": "{{ event.jurisdiction }}",
1050
- "issuedDate": "{{ event.confirmationDate }}",
1051
- "validThrough": "{{ event.validThrough }}",
1052
- "documentRef": "{{ event.certificateRef }}",
1053
- "purpose": "Post-remediation confirmation"
1054
- }
1055
- }
1056
- },
1057
- {
1058
- "type": "SET_CONTEXT",
1059
- "path": "complianceScore.overallStatus",
1060
- "value": "GREEN"
1061
- },
1062
- {
1063
- "type": "SET_CONTEXT",
1064
- "path": "complianceScore.lastAssessedDate",
1065
- "value": "{{ event.confirmationDate }}"
1066
- },
1067
- {
1068
- "type": "EMIT_EVENT",
1069
- "eventType": "GOOD_STANDING_CONFIRMED",
1070
- "payload": {
1071
- "complianceId": "{{ context.complianceId }}",
1072
- "entityId": "{{ context.entityId }}",
1073
- "jurisdiction": "{{ event.jurisdiction }}"
1074
- }
1075
- }
1076
- ]
1077
- },
1078
- "clear_review": {
1079
- "from": "REVIEW_PENDING",
1080
- "to": "COMPLIANT",
1081
- "description": "Clear pending review - no issues found",
1082
- "event": {
1083
- "name": "clear_review",
1084
- "payload": {
1085
- "clearedDate": {
1086
- "type": "string",
1087
- "format": "date",
1088
- "required": true
1089
- },
1090
- "reviewedBy": {
1091
- "type": "string",
1092
- "required": true
1093
- },
1094
- "notes": {
1095
- "type": "string"
1096
- }
1097
- }
1098
- },
1099
- "effects": [
1100
- {
1101
- "type": "SET_CONTEXT",
1102
- "path": "complianceScore.overallStatus",
1103
- "value": "GREEN"
1104
- },
1105
- {
1106
- "type": "SET_CONTEXT",
1107
- "path": "complianceScore.lastAssessedDate",
1108
- "value": "{{ event.clearedDate }}"
1109
- }
1110
- ]
1111
- },
1112
- "request_good_standing_certificate": {
1113
- "from": [
1114
- "COMPLIANT"
1115
- ],
1116
- "to": "COMPLIANT",
1117
- "description": "Request and record receipt of good standing certificate",
1118
- "event": {
1119
- "name": "request_good_standing_certificate",
1120
- "payload": {
1121
- "certificateId": {
1122
- "type": "string",
1123
- "required": true
1124
- },
1125
- "jurisdiction": {
1126
- "type": "string",
1127
- "required": true
1128
- },
1129
- "issuedDate": {
1130
- "type": "string",
1131
- "format": "date",
1132
- "required": true
1133
- },
1134
- "validThrough": {
1135
- "type": "string",
1136
- "format": "date"
1137
- },
1138
- "documentRef": {
1139
- "type": "string",
1140
- "required": true
1141
- },
1142
- "purpose": {
1143
- "type": "string"
1144
- }
1145
- }
1146
- },
1147
- "effects": [
1148
- {
1149
- "type": "APPEND_ARRAY",
1150
- "path": "goodStandingCertificates",
1151
- "value": {
1152
- "certificateId": "{{ event.certificateId }}",
1153
- "jurisdiction": "{{ event.jurisdiction }}",
1154
- "issuedDate": "{{ event.issuedDate }}",
1155
- "validThrough": "{{ event.validThrough }}",
1156
- "documentRef": "{{ event.documentRef }}",
1157
- "purpose": "{{ event.purpose }}"
1158
- }
1159
- }
1160
- ]
1161
- },
1162
- "add_foreign_qualification": {
1163
- "from": [
1164
- "COMPLIANT",
1165
- "REVIEW_PENDING"
1166
- ],
1167
- "to": null,
1168
- "description": "Record foreign qualification in a new state",
1169
- "event": {
1170
- "name": "add_foreign_qualification",
1171
- "payload": {
1172
- "state": {
1173
- "type": "string",
1174
- "required": true
1175
- },
1176
- "qualificationDate": {
1177
- "type": "string",
1178
- "format": "date",
1179
- "required": true
1180
- },
1181
- "foreignEntityNumber": {
1182
- "type": "string",
1183
- "required": true
1184
- },
1185
- "registeredAgent": {
1186
- "type": "object",
1187
- "required": true
1188
- }
1189
- }
1190
- },
1191
- "effects": [
1192
- {
1193
- "type": "APPEND_ARRAY",
1194
- "path": "jurisdiction.foreignQualifications",
1195
- "value": {
1196
- "state": "{{ event.state }}",
1197
- "qualificationDate": "{{ event.qualificationDate }}",
1198
- "foreignEntityNumber": "{{ event.foreignEntityNumber }}",
1199
- "status": "ACTIVE"
1200
- }
1201
- },
1202
- {
1203
- "type": "APPEND_ARRAY",
1204
- "path": "registeredAgents",
1205
- "value": "{{ event.registeredAgent }}"
1206
- },
1207
- {
1208
- "type": "EMIT_EVENT",
1209
- "eventType": "FOREIGN_QUALIFIED",
1210
- "payload": {
1211
- "complianceId": "{{ context.complianceId }}",
1212
- "entityId": "{{ context.entityId }}",
1213
- "state": "{{ event.state }}"
1214
- }
1215
- }
1216
- ]
1217
- },
1218
- "assess_compliance": {
1219
- "from": [
1220
- "COMPLIANT",
1221
- "REVIEW_PENDING",
1222
- "DEFICIENT",
1223
- "REMEDIATED"
1224
- ],
1225
- "to": null,
1226
- "description": "Perform compliance assessment and update score",
1227
- "event": {
1228
- "name": "assess_compliance",
1229
- "payload": {
1230
- "assessmentDate": {
1231
- "type": "string",
1232
- "format": "date",
1233
- "required": true
1234
- },
1235
- "assessedBy": {
1236
- "type": "string",
1237
- "required": true
1238
- }
1239
- }
1240
- },
1241
- "effects": [
1242
- {
1243
- "type": "COMPUTE",
1244
- "path": "complianceScore.openDeficiencies",
1245
- "expression": "context.deficiencies.filter(d => d.status === 'OPEN' || d.status === 'IN_PROGRESS').length"
1246
- },
1247
- {
1248
- "type": "COMPUTE",
1249
- "path": "complianceScore.overdueFilings",
1250
- "expression": "context.filingCalendar.filter(f => f.status === 'OVERDUE').length"
1251
- },
1252
- {
1253
- "type": "COMPUTE",
1254
- "path": "complianceScore.upcomingDeadlines30Days",
1255
- "expression": "context.filingCalendar.filter(f => f.status === 'PENDING' && new Date(f.dueDate) <= new Date(Date.now() + 30*24*60*60*1000)).length"
1256
- },
1257
- {
1258
- "type": "SET_CONTEXT",
1259
- "path": "complianceScore.lastAssessedDate",
1260
- "value": "{{ event.assessmentDate }}"
1261
- },
1262
- {
1263
- "type": "COMPUTE",
1264
- "path": "complianceScore.overallStatus",
1265
- "expression": "context.complianceScore.openDeficiencies > 0 ? 'RED' : (context.complianceScore.overdueFilings > 0 || context.complianceScore.upcomingDeadlines30Days > 2) ? 'YELLOW' : 'GREEN'"
1266
- }
1267
- ]
1268
- }
1269
- },
1270
- "crossMachineRefs": {
1271
- "entity": {
1272
- "machine": "corporate-entity",
1273
- "description": "Parent corporate entity",
1274
- "foreignKey": "entityId",
1275
- "eventTriggers": {
1276
- "CORPORATION_SUSPENDED": "Triggers transition to DEFICIENT if compliance-related",
1277
- "CORPORATION_REINSTATED": "May trigger return to COMPLIANT"
1278
- }
1279
- }
1280
- },
1281
- "metadata": {
1282
- "author": "OttoChain",
1283
- "license": "MIT",
1284
- "tags": [
1285
- "corporate",
1286
- "governance",
1287
- "compliance",
1288
- "regulatory",
1289
- "filings"
1290
- ],
1291
- "documentation": "https://ottochain.dev/docs/corporate/compliance"
1292
- }
1293
- }