@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,843 +0,0 @@
1
- {
2
- "$schema": "https://ottochain.dev/schemas/state-machine-v1.json",
3
- "name": "corporate-officers",
4
- "version": "1.0.0",
5
- "category": "corporate-governance",
6
- "description": "Executive officers state machine managing officer appointments, authority delegation, and succession. Tracks officer roles, reporting relationships, and delegation chains.",
7
- "context": {
8
- "officersInstanceId": {
9
- "type": "string",
10
- "description": "Unique identifier for this officers instance"
11
- },
12
- "entityId": {
13
- "type": "string",
14
- "description": "Reference to parent corporate-entity"
15
- },
16
- "officers": {
17
- "type": "array",
18
- "items": {
19
- "type": "object",
20
- "properties": {
21
- "officerId": {
22
- "type": "string"
23
- },
24
- "personId": {
25
- "type": "string",
26
- "description": "Person identifier"
27
- },
28
- "name": {
29
- "type": "string"
30
- },
31
- "title": {
32
- "type": "string",
33
- "enum": [
34
- "CEO",
35
- "PRESIDENT",
36
- "COO",
37
- "CFO",
38
- "CTO",
39
- "CLO",
40
- "SECRETARY",
41
- "TREASURER",
42
- "VP",
43
- "SVP",
44
- "EVP",
45
- "GENERAL_COUNSEL",
46
- "CONTROLLER",
47
- "ASSISTANT_SECRETARY",
48
- "ASSISTANT_TREASURER",
49
- "OTHER"
50
- ],
51
- "description": "Officer title"
52
- },
53
- "customTitle": {
54
- "type": "string",
55
- "nullable": true,
56
- "description": "Custom title if OTHER"
57
- },
58
- "status": {
59
- "type": "string",
60
- "enum": [
61
- "ACTIVE",
62
- "RESIGNED",
63
- "REMOVED",
64
- "INTERIM"
65
- ]
66
- },
67
- "appointedDate": {
68
- "type": "string",
69
- "format": "date"
70
- },
71
- "appointmentResolutionRef": {
72
- "type": "string"
73
- },
74
- "terminationDate": {
75
- "type": "string",
76
- "format": "date",
77
- "nullable": true
78
- },
79
- "reportsTo": {
80
- "type": "string",
81
- "nullable": true,
82
- "description": "Officer ID of supervisor"
83
- },
84
- "isBoardMember": {
85
- "type": "boolean",
86
- "default": false
87
- },
88
- "directorId": {
89
- "type": "string",
90
- "nullable": true
91
- },
92
- "compensationAgreementRef": {
93
- "type": "string",
94
- "nullable": true
95
- },
96
- "authorityLevel": {
97
- "type": "string",
98
- "enum": [
99
- "FULL",
100
- "LIMITED",
101
- "SPECIFIC"
102
- ],
103
- "description": "Scope of authority"
104
- },
105
- "spendingLimit": {
106
- "type": "number",
107
- "nullable": true,
108
- "description": "Unilateral spending authority limit"
109
- },
110
- "signatureAuthority": {
111
- "type": "object",
112
- "properties": {
113
- "contracts": {
114
- "type": "boolean",
115
- "default": false
116
- },
117
- "contractLimit": {
118
- "type": "number",
119
- "nullable": true
120
- },
121
- "checks": {
122
- "type": "boolean",
123
- "default": false
124
- },
125
- "checkLimit": {
126
- "type": "number",
127
- "nullable": true
128
- },
129
- "hiringAuthority": {
130
- "type": "boolean",
131
- "default": false
132
- },
133
- "terminationAuthority": {
134
- "type": "boolean",
135
- "default": false
136
- }
137
- }
138
- },
139
- "delegatedAuthorities": {
140
- "type": "array",
141
- "items": {
142
- "type": "object",
143
- "properties": {
144
- "delegationId": {
145
- "type": "string"
146
- },
147
- "authority": {
148
- "type": "string"
149
- },
150
- "scope": {
151
- "type": "string"
152
- },
153
- "delegatedBy": {
154
- "type": "string"
155
- },
156
- "delegatedOn": {
157
- "type": "string",
158
- "format": "date"
159
- },
160
- "expiresOn": {
161
- "type": "string",
162
- "format": "date",
163
- "nullable": true
164
- },
165
- "revoked": {
166
- "type": "boolean",
167
- "default": false
168
- }
169
- }
170
- }
171
- }
172
- }
173
- }
174
- },
175
- "appointmentAuthority": {
176
- "type": "object",
177
- "description": "Which officers can appoint which other officers",
178
- "properties": {
179
- "boardAppoints": {
180
- "type": "array",
181
- "items": {
182
- "type": "string"
183
- },
184
- "default": [
185
- "CEO",
186
- "PRESIDENT",
187
- "CFO",
188
- "SECRETARY",
189
- "TREASURER",
190
- "GENERAL_COUNSEL"
191
- ]
192
- },
193
- "ceoAppoints": {
194
- "type": "array",
195
- "items": {
196
- "type": "string"
197
- },
198
- "default": [
199
- "COO",
200
- "CTO",
201
- "VP",
202
- "SVP",
203
- "EVP",
204
- "CONTROLLER"
205
- ]
206
- },
207
- "cfoAppoints": {
208
- "type": "array",
209
- "items": {
210
- "type": "string"
211
- },
212
- "default": [
213
- "CONTROLLER",
214
- "ASSISTANT_TREASURER"
215
- ]
216
- },
217
- "secretaryAppoints": {
218
- "type": "array",
219
- "items": {
220
- "type": "string"
221
- },
222
- "default": [
223
- "ASSISTANT_SECRETARY"
224
- ]
225
- }
226
- }
227
- },
228
- "successionPlan": {
229
- "type": "array",
230
- "items": {
231
- "type": "object",
232
- "properties": {
233
- "position": {
234
- "type": "string"
235
- },
236
- "currentOfficerId": {
237
- "type": "string"
238
- },
239
- "successors": {
240
- "type": "array",
241
- "items": {
242
- "type": "object",
243
- "properties": {
244
- "personId": {
245
- "type": "string"
246
- },
247
- "name": {
248
- "type": "string"
249
- },
250
- "priority": {
251
- "type": "integer"
252
- },
253
- "readiness": {
254
- "type": "string",
255
- "enum": [
256
- "READY_NOW",
257
- "READY_1_YEAR",
258
- "READY_2_YEARS",
259
- "DEVELOPMENTAL"
260
- ]
261
- }
262
- }
263
- }
264
- }
265
- }
266
- }
267
- },
268
- "vacantPositions": {
269
- "type": "array",
270
- "items": {
271
- "type": "string"
272
- },
273
- "description": "Officer titles currently vacant"
274
- },
275
- "createdAt": {
276
- "type": "string",
277
- "format": "date-time"
278
- },
279
- "updatedAt": {
280
- "type": "string",
281
- "format": "date-time"
282
- }
283
- },
284
- "states": {
285
- "ACTIVE": {
286
- "description": "Officer roster is active. This is the only state - all changes are self-transitions.",
287
- "metadata": null
288
- }
289
- },
290
- "initialState": "ACTIVE",
291
- "transitions": {
292
- "appoint_officer": {
293
- "from": "ACTIVE",
294
- "to": "ACTIVE",
295
- "description": "Appoint a new executive officer",
296
- "event": {
297
- "name": "appoint_officer",
298
- "payload": {
299
- "officerId": {
300
- "type": "string",
301
- "required": true
302
- },
303
- "personId": {
304
- "type": "string",
305
- "required": true
306
- },
307
- "name": {
308
- "type": "string",
309
- "required": true
310
- },
311
- "title": {
312
- "type": "string",
313
- "required": true
314
- },
315
- "customTitle": {
316
- "type": "string"
317
- },
318
- "appointedDate": {
319
- "type": "string",
320
- "format": "date",
321
- "required": true
322
- },
323
- "appointmentResolutionRef": {
324
- "type": "string",
325
- "required": true
326
- },
327
- "reportsTo": {
328
- "type": "string"
329
- },
330
- "isBoardMember": {
331
- "type": "boolean",
332
- "default": false
333
- },
334
- "directorId": {
335
- "type": "string"
336
- },
337
- "authorityLevel": {
338
- "type": "string",
339
- "default": "LIMITED"
340
- },
341
- "spendingLimit": {
342
- "type": "number"
343
- },
344
- "signatureAuthority": {
345
- "type": "object"
346
- },
347
- "isInterim": {
348
- "type": "boolean",
349
- "default": false
350
- }
351
- }
352
- },
353
- "guards": [
354
- {
355
- "name": "hasAppointmentResolution",
356
- "description": "Officer appointment requires board resolution (for senior) or authorized officer action",
357
- "crossMachine": {
358
- "machine": "corporate-resolution",
359
- "instanceRef": "{{ event.appointmentResolutionRef }}",
360
- "requiredState": "EXECUTED"
361
- }
362
- },
363
- {
364
- "name": "boardMeetingHadQuorum",
365
- "description": "If board-appointed, board meeting must have had quorum",
366
- "expression": "true",
367
- "note": "Validated through resolution's meeting reference"
368
- },
369
- {
370
- "name": "positionNotDuplicate",
371
- "description": "Cannot have two active officers with same title (except VPs)",
372
- "expression": "event.title === 'VP' || event.title === 'SVP' || event.title === 'EVP' || event.title === 'OTHER' || !context.officers.some(o => o.title === event.title && o.status === 'ACTIVE')"
373
- }
374
- ],
375
- "effects": [
376
- {
377
- "type": "APPEND_ARRAY",
378
- "path": "officers",
379
- "value": {
380
- "officerId": "{{ event.officerId }}",
381
- "personId": "{{ event.personId }}",
382
- "name": "{{ event.name }}",
383
- "title": "{{ event.title }}",
384
- "customTitle": "{{ event.customTitle }}",
385
- "status": "{{ event.isInterim ? 'INTERIM' : 'ACTIVE' }}",
386
- "appointedDate": "{{ event.appointedDate }}",
387
- "appointmentResolutionRef": "{{ event.appointmentResolutionRef }}",
388
- "reportsTo": "{{ event.reportsTo }}",
389
- "isBoardMember": "{{ event.isBoardMember }}",
390
- "directorId": "{{ event.directorId }}",
391
- "authorityLevel": "{{ event.authorityLevel }}",
392
- "spendingLimit": "{{ event.spendingLimit }}",
393
- "signatureAuthority": "{{ event.signatureAuthority }}",
394
- "delegatedAuthorities": []
395
- }
396
- },
397
- {
398
- "type": "REMOVE_FROM_ARRAY",
399
- "path": "vacantPositions",
400
- "value": "{{ event.title }}"
401
- },
402
- {
403
- "type": "EMIT_EVENT",
404
- "eventType": "OFFICER_APPOINTED",
405
- "payload": {
406
- "entityId": "{{ context.entityId }}",
407
- "officerId": "{{ event.officerId }}",
408
- "name": "{{ event.name }}",
409
- "title": "{{ event.title }}",
410
- "appointedDate": "{{ event.appointedDate }}"
411
- }
412
- }
413
- ]
414
- },
415
- "remove_officer": {
416
- "from": "ACTIVE",
417
- "to": "ACTIVE",
418
- "description": "Remove an officer (with or without cause)",
419
- "event": {
420
- "name": "remove_officer",
421
- "payload": {
422
- "officerId": {
423
- "type": "string",
424
- "required": true
425
- },
426
- "effectiveDate": {
427
- "type": "string",
428
- "format": "date",
429
- "required": true
430
- },
431
- "reason": {
432
- "type": "string",
433
- "enum": [
434
- "WITH_CAUSE",
435
- "WITHOUT_CAUSE",
436
- "REORGANIZATION"
437
- ],
438
- "required": true
439
- },
440
- "removalResolutionRef": {
441
- "type": "string",
442
- "required": true
443
- },
444
- "severanceAgreementRef": {
445
- "type": "string"
446
- }
447
- }
448
- },
449
- "guards": [
450
- {
451
- "name": "isActiveOfficer",
452
- "expression": "context.officers.some(o => o.officerId === event.officerId && (o.status === 'ACTIVE' || o.status === 'INTERIM'))"
453
- },
454
- {
455
- "name": "hasRemovalAuthority",
456
- "crossMachine": {
457
- "machine": "corporate-resolution",
458
- "instanceRef": "{{ event.removalResolutionRef }}",
459
- "requiredState": "EXECUTED"
460
- }
461
- }
462
- ],
463
- "effects": [
464
- {
465
- "type": "UPDATE_ARRAY_ITEM",
466
- "path": "officers",
467
- "matchKey": "officerId",
468
- "matchValue": "{{ event.officerId }}",
469
- "updates": {
470
- "status": "REMOVED",
471
- "terminationDate": "{{ event.effectiveDate }}"
472
- }
473
- },
474
- {
475
- "type": "COMPUTE",
476
- "path": "vacantPositions",
477
- "expression": "context.vacantPositions.concat([context.officers.find(o => o.officerId === event.officerId).title])"
478
- },
479
- {
480
- "type": "EMIT_EVENT",
481
- "eventType": "OFFICER_REMOVED",
482
- "payload": {
483
- "entityId": "{{ context.entityId }}",
484
- "officerId": "{{ event.officerId }}",
485
- "reason": "{{ event.reason }}"
486
- }
487
- }
488
- ]
489
- },
490
- "accept_resignation": {
491
- "from": "ACTIVE",
492
- "to": "ACTIVE",
493
- "description": "Accept an officer's resignation",
494
- "event": {
495
- "name": "accept_resignation",
496
- "payload": {
497
- "officerId": {
498
- "type": "string",
499
- "required": true
500
- },
501
- "effectiveDate": {
502
- "type": "string",
503
- "format": "date",
504
- "required": true
505
- },
506
- "resignationLetterRef": {
507
- "type": "string"
508
- },
509
- "acceptedBy": {
510
- "type": "string",
511
- "required": true,
512
- "description": "Officer ID or BOARD"
513
- }
514
- }
515
- },
516
- "guards": [
517
- {
518
- "name": "isActiveOfficer",
519
- "expression": "context.officers.some(o => o.officerId === event.officerId && o.status === 'ACTIVE')"
520
- }
521
- ],
522
- "effects": [
523
- {
524
- "type": "UPDATE_ARRAY_ITEM",
525
- "path": "officers",
526
- "matchKey": "officerId",
527
- "matchValue": "{{ event.officerId }}",
528
- "updates": {
529
- "status": "RESIGNED",
530
- "terminationDate": "{{ event.effectiveDate }}"
531
- }
532
- },
533
- {
534
- "type": "COMPUTE",
535
- "path": "vacantPositions",
536
- "expression": "context.vacantPositions.concat([context.officers.find(o => o.officerId === event.officerId).title])"
537
- },
538
- {
539
- "type": "EMIT_EVENT",
540
- "eventType": "OFFICER_RESIGNED",
541
- "payload": {
542
- "entityId": "{{ context.entityId }}",
543
- "officerId": "{{ event.officerId }}",
544
- "effectiveDate": "{{ event.effectiveDate }}"
545
- }
546
- }
547
- ]
548
- },
549
- "delegate_authority": {
550
- "from": "ACTIVE",
551
- "to": "ACTIVE",
552
- "description": "One officer delegates specific authority to another",
553
- "event": {
554
- "name": "delegate_authority",
555
- "payload": {
556
- "delegationId": {
557
- "type": "string",
558
- "required": true
559
- },
560
- "fromOfficerId": {
561
- "type": "string",
562
- "required": true
563
- },
564
- "toOfficerId": {
565
- "type": "string",
566
- "required": true
567
- },
568
- "authority": {
569
- "type": "string",
570
- "required": true,
571
- "description": "Type of authority being delegated"
572
- },
573
- "scope": {
574
- "type": "string",
575
- "required": true,
576
- "description": "Scope/limits of delegation"
577
- },
578
- "expiresOn": {
579
- "type": "string",
580
- "format": "date"
581
- }
582
- }
583
- },
584
- "guards": [
585
- {
586
- "name": "delegatorIsActive",
587
- "expression": "context.officers.some(o => o.officerId === event.fromOfficerId && o.status === 'ACTIVE')"
588
- },
589
- {
590
- "name": "delegateeIsActive",
591
- "expression": "context.officers.some(o => o.officerId === event.toOfficerId && o.status === 'ACTIVE')"
592
- },
593
- {
594
- "name": "delegatorHasAuthority",
595
- "description": "Cannot delegate authority you don't have",
596
- "expression": "true"
597
- }
598
- ],
599
- "effects": [
600
- {
601
- "type": "UPDATE_ARRAY_ITEM",
602
- "path": "officers",
603
- "matchKey": "officerId",
604
- "matchValue": "{{ event.toOfficerId }}",
605
- "arrayPath": "delegatedAuthorities",
606
- "arrayOperation": "APPEND",
607
- "value": {
608
- "delegationId": "{{ event.delegationId }}",
609
- "authority": "{{ event.authority }}",
610
- "scope": "{{ event.scope }}",
611
- "delegatedBy": "{{ event.fromOfficerId }}",
612
- "delegatedOn": "{{ today() }}",
613
- "expiresOn": "{{ event.expiresOn }}",
614
- "revoked": false
615
- }
616
- },
617
- {
618
- "type": "EMIT_EVENT",
619
- "eventType": "AUTHORITY_DELEGATED",
620
- "payload": {
621
- "entityId": "{{ context.entityId }}",
622
- "delegationId": "{{ event.delegationId }}",
623
- "from": "{{ event.fromOfficerId }}",
624
- "to": "{{ event.toOfficerId }}",
625
- "authority": "{{ event.authority }}"
626
- }
627
- }
628
- ]
629
- },
630
- "revoke_authority": {
631
- "from": "ACTIVE",
632
- "to": "ACTIVE",
633
- "description": "Revoke a previously delegated authority",
634
- "event": {
635
- "name": "revoke_authority",
636
- "payload": {
637
- "delegationId": {
638
- "type": "string",
639
- "required": true
640
- },
641
- "officerId": {
642
- "type": "string",
643
- "required": true
644
- },
645
- "revokedBy": {
646
- "type": "string",
647
- "required": true
648
- },
649
- "reason": {
650
- "type": "string"
651
- }
652
- }
653
- },
654
- "effects": [
655
- {
656
- "type": "UPDATE_NESTED_ARRAY_ITEM",
657
- "path": "officers",
658
- "matchKey": "officerId",
659
- "matchValue": "{{ event.officerId }}",
660
- "nestedPath": "delegatedAuthorities",
661
- "nestedMatchKey": "delegationId",
662
- "nestedMatchValue": "{{ event.delegationId }}",
663
- "updates": {
664
- "revoked": true
665
- }
666
- },
667
- {
668
- "type": "EMIT_EVENT",
669
- "eventType": "AUTHORITY_REVOKED",
670
- "payload": {
671
- "entityId": "{{ context.entityId }}",
672
- "delegationId": "{{ event.delegationId }}",
673
- "officerId": "{{ event.officerId }}"
674
- }
675
- }
676
- ]
677
- },
678
- "update_authority_limits": {
679
- "from": "ACTIVE",
680
- "to": "ACTIVE",
681
- "description": "Update an officer's spending or signature authority limits",
682
- "event": {
683
- "name": "update_authority_limits",
684
- "payload": {
685
- "officerId": {
686
- "type": "string",
687
- "required": true
688
- },
689
- "authorityLevel": {
690
- "type": "string"
691
- },
692
- "spendingLimit": {
693
- "type": "number"
694
- },
695
- "signatureAuthority": {
696
- "type": "object"
697
- },
698
- "resolutionRef": {
699
- "type": "string",
700
- "required": true
701
- }
702
- }
703
- },
704
- "guards": [
705
- {
706
- "name": "hasApproval",
707
- "crossMachine": {
708
- "machine": "corporate-resolution",
709
- "instanceRef": "{{ event.resolutionRef }}",
710
- "requiredState": "EXECUTED"
711
- }
712
- }
713
- ],
714
- "effects": [
715
- {
716
- "type": "UPDATE_ARRAY_ITEM",
717
- "path": "officers",
718
- "matchKey": "officerId",
719
- "matchValue": "{{ event.officerId }}",
720
- "updates": {
721
- "authorityLevel": "{{ event.authorityLevel }}",
722
- "spendingLimit": "{{ event.spendingLimit }}",
723
- "signatureAuthority": "{{ event.signatureAuthority }}"
724
- }
725
- }
726
- ]
727
- },
728
- "promote_interim_to_permanent": {
729
- "from": "ACTIVE",
730
- "to": "ACTIVE",
731
- "description": "Convert an interim officer to permanent status",
732
- "event": {
733
- "name": "promote_interim_to_permanent",
734
- "payload": {
735
- "officerId": {
736
- "type": "string",
737
- "required": true
738
- },
739
- "effectiveDate": {
740
- "type": "string",
741
- "format": "date",
742
- "required": true
743
- },
744
- "resolutionRef": {
745
- "type": "string",
746
- "required": true
747
- }
748
- }
749
- },
750
- "guards": [
751
- {
752
- "name": "isInterimOfficer",
753
- "expression": "context.officers.some(o => o.officerId === event.officerId && o.status === 'INTERIM')"
754
- }
755
- ],
756
- "effects": [
757
- {
758
- "type": "UPDATE_ARRAY_ITEM",
759
- "path": "officers",
760
- "matchKey": "officerId",
761
- "matchValue": "{{ event.officerId }}",
762
- "updates": {
763
- "status": "ACTIVE",
764
- "appointedDate": "{{ event.effectiveDate }}",
765
- "appointmentResolutionRef": "{{ event.resolutionRef }}"
766
- }
767
- },
768
- {
769
- "type": "EMIT_EVENT",
770
- "eventType": "INTERIM_MADE_PERMANENT",
771
- "payload": {
772
- "entityId": "{{ context.entityId }}",
773
- "officerId": "{{ event.officerId }}"
774
- }
775
- }
776
- ]
777
- },
778
- "update_succession_plan": {
779
- "from": "ACTIVE",
780
- "to": "ACTIVE",
781
- "description": "Update the succession plan for key positions",
782
- "event": {
783
- "name": "update_succession_plan",
784
- "payload": {
785
- "position": {
786
- "type": "string",
787
- "required": true
788
- },
789
- "currentOfficerId": {
790
- "type": "string",
791
- "required": true
792
- },
793
- "successors": {
794
- "type": "array",
795
- "required": true
796
- }
797
- }
798
- },
799
- "effects": [
800
- {
801
- "type": "UPSERT_ARRAY",
802
- "path": "successionPlan",
803
- "matchKey": "position",
804
- "matchValue": "{{ event.position }}",
805
- "value": {
806
- "position": "{{ event.position }}",
807
- "currentOfficerId": "{{ event.currentOfficerId }}",
808
- "successors": "{{ event.successors }}"
809
- }
810
- }
811
- ]
812
- }
813
- },
814
- "crossMachineRefs": {
815
- "entity": {
816
- "machine": "corporate-entity",
817
- "description": "Parent corporate entity",
818
- "foreignKey": "entityId"
819
- },
820
- "board": {
821
- "machine": "corporate-board",
822
- "description": "Board that appoints senior officers",
823
- "foreignKey": "entityId"
824
- },
825
- "resolutions": {
826
- "machine": "corporate-resolution",
827
- "description": "Resolutions authorizing officer actions",
828
- "foreignKey": "entityId"
829
- }
830
- },
831
- "metadata": {
832
- "author": "OttoChain",
833
- "license": "MIT",
834
- "tags": [
835
- "corporate",
836
- "governance",
837
- "officers",
838
- "executives",
839
- "authority"
840
- ],
841
- "documentation": "https://ottochain.dev/docs/corporate/officers"
842
- }
843
- }