@ottochain/sdk 2.4.0 → 2.5.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.
- package/dist/cjs/apps/compute/index.js +33 -0
- package/dist/cjs/apps/compute/state-machines/compute-rule110.js +164 -0
- package/dist/cjs/apps/compute/state-machines/index.js +9 -0
- package/dist/cjs/apps/contracts/index.js +1 -1
- package/dist/cjs/apps/contracts/state-machines/contract-agreement.js +126 -148
- package/dist/cjs/apps/contracts/state-machines/contract-escrow.js +153 -174
- package/dist/cjs/apps/contracts/state-machines/contract-universal.js +46 -58
- package/dist/cjs/apps/corporate/state-machines/corp-board.js +415 -481
- package/dist/cjs/apps/corporate/state-machines/corp-entity.js +368 -440
- package/dist/cjs/apps/corporate/state-machines/corp-securities.js +532 -647
- package/dist/cjs/apps/corporate/state-machines/corp-shareholders.js +499 -603
- package/dist/cjs/apps/governance/index.js +7 -7
- package/dist/cjs/apps/governance/state-machines/dao-multisig.js +170 -209
- package/dist/cjs/apps/governance/state-machines/dao-reputation.js +161 -214
- package/dist/cjs/apps/governance/state-machines/dao-single.js +92 -92
- package/dist/cjs/apps/governance/state-machines/dao-token.js +169 -223
- package/dist/cjs/apps/governance/state-machines/governance-simple.js +185 -217
- package/dist/cjs/apps/governance/state-machines/governance-universal.js +64 -64
- package/dist/cjs/apps/identity/constants.js +16 -24
- package/dist/cjs/apps/identity/index.js +1 -1
- package/dist/cjs/apps/identity/state-machines/identity-agent.js +124 -158
- package/dist/cjs/apps/identity/state-machines/identity-oracle.js +151 -169
- package/dist/cjs/apps/identity/state-machines/identity-registry.js +89 -115
- package/dist/cjs/apps/identity/state-machines/identity-universal.js +51 -57
- package/dist/cjs/apps/index.js +4 -1
- package/dist/cjs/apps/lending/assets.js +41 -17
- package/dist/cjs/apps/lending/credit-scoring.js +4 -4
- package/dist/cjs/apps/lending/eligibility.js +9 -25
- package/dist/cjs/apps/lending/index.js +1 -1
- package/dist/cjs/apps/lending/state-machines/lending-zk-loan.js +177 -156
- package/dist/cjs/apps/markets/index.js +1 -1
- package/dist/cjs/apps/markets/state-machines/market-auction.js +115 -134
- package/dist/cjs/apps/markets/state-machines/market-crowdfund.js +122 -137
- package/dist/cjs/apps/markets/state-machines/market-group-buy.js +158 -177
- package/dist/cjs/apps/markets/state-machines/market-prediction.js +193 -227
- package/dist/cjs/apps/markets/state-machines/market-universal.js +65 -80
- package/dist/cjs/apps/oracles/index.js +1 -1
- package/dist/cjs/apps/privacy/index.js +67 -0
- package/dist/cjs/apps/privacy/state-machines/index.js +17 -0
- package/dist/cjs/apps/privacy/state-machines/mixer-ddhRing.js +286 -0
- package/dist/cjs/apps/privacy/state-machines/note-pool.js +476 -0
- package/dist/cjs/apps/staked-pool/assets.js +103 -0
- package/dist/cjs/apps/staked-pool/base.js +498 -0
- package/dist/cjs/apps/staked-pool/consumer.js +55 -0
- package/dist/cjs/apps/staked-pool/index.js +83 -0
- package/dist/cjs/apps/staked-pool/state-machines/index.js +12 -0
- package/dist/cjs/apps/staked-pool/state-machines/staked-pool-base.js +49 -0
- package/dist/cjs/apps/staked-pool/state-machines/staked-pool-oracle.js +131 -0
- package/dist/cjs/generated/google/protobuf/struct.js +1 -1
- package/dist/cjs/generated/google/protobuf/timestamp.js +1 -1
- package/dist/cjs/generated/ottochain/apps/contracts/v1/contract.js +1 -1
- package/dist/cjs/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
- package/dist/cjs/generated/ottochain/apps/governance/v1/governance.js +1 -1
- package/dist/cjs/generated/ottochain/apps/identity/v1/attestation.js +1 -1
- package/dist/cjs/generated/ottochain/apps/identity/v1/identity.js +1 -1
- package/dist/cjs/generated/ottochain/apps/markets/v1/market.js +1 -1
- package/dist/cjs/generated/ottochain/v1/common.js +1 -1
- package/dist/cjs/generated/ottochain/v1/fiber.js +40 -2
- package/dist/cjs/generated/ottochain/v1/messages.js +1 -1
- package/dist/cjs/generated/ottochain/v1/records.js +1 -1
- package/dist/cjs/index.js +20 -3
- package/dist/cjs/ottochain/genesis-manifest.js +6 -0
- package/dist/cjs/ottochain/metagraph-client.js +16 -8
- package/dist/cjs/ottochain/snapshot.js +2 -4
- package/dist/cjs/ottochain/transaction.js +10 -0
- package/dist/cjs/privacy/sealed-bid.js +85 -82
- package/dist/cjs/privacy/shield-app.js +32 -32
- package/dist/cjs/schema/effects.js +117 -1
- package/dist/cjs/schema/fiber-app.js +132 -3
- package/dist/cjs/schema/guard-lint.js +3 -12
- package/dist/cjs/schema/guards.js +38 -38
- package/dist/cjs/templates/asset-policy.js +190 -0
- package/dist/cjs/templates/index.js +86 -0
- package/dist/cjs/templates/machine.js +130 -0
- package/dist/cjs/templates/migration.js +39 -0
- package/dist/cjs/templates/state-shape.js +38 -0
- package/dist/cjs/validation.js +1 -3
- package/dist/esm/apps/compute/index.js +29 -0
- package/dist/esm/apps/compute/state-machines/compute-rule110.js +161 -0
- package/dist/esm/apps/compute/state-machines/index.js +5 -0
- package/dist/esm/apps/contracts/index.js +4 -4
- package/dist/esm/apps/contracts/state-machines/contract-agreement.js +128 -150
- package/dist/esm/apps/contracts/state-machines/contract-escrow.js +155 -176
- package/dist/esm/apps/contracts/state-machines/contract-universal.js +47 -59
- package/dist/esm/apps/corporate/index.js +2 -2
- package/dist/esm/apps/corporate/state-machines/corp-board.js +418 -484
- package/dist/esm/apps/corporate/state-machines/corp-entity.js +371 -443
- package/dist/esm/apps/corporate/state-machines/corp-securities.js +535 -650
- package/dist/esm/apps/corporate/state-machines/corp-shareholders.js +502 -606
- package/dist/esm/apps/governance/index.js +10 -10
- package/dist/esm/apps/governance/state-machines/dao-multisig.js +172 -211
- package/dist/esm/apps/governance/state-machines/dao-reputation.js +163 -216
- package/dist/esm/apps/governance/state-machines/dao-single.js +94 -94
- package/dist/esm/apps/governance/state-machines/dao-token.js +171 -225
- package/dist/esm/apps/governance/state-machines/governance-simple.js +187 -219
- package/dist/esm/apps/governance/state-machines/governance-universal.js +65 -65
- package/dist/esm/apps/identity/constants.js +18 -26
- package/dist/esm/apps/identity/index.js +8 -8
- package/dist/esm/apps/identity/state-machines/identity-agent.js +125 -159
- package/dist/esm/apps/identity/state-machines/identity-oracle.js +153 -171
- package/dist/esm/apps/identity/state-machines/identity-registry.js +91 -117
- package/dist/esm/apps/identity/state-machines/identity-universal.js +52 -58
- package/dist/esm/apps/index.js +9 -6
- package/dist/esm/apps/lending/assets.js +41 -17
- package/dist/esm/apps/lending/credit-scoring.js +6 -6
- package/dist/esm/apps/lending/eligibility.js +10 -26
- package/dist/esm/apps/lending/index.js +5 -5
- package/dist/esm/apps/lending/state-machines/lending-zk-loan.js +178 -157
- package/dist/esm/apps/markets/index.js +5 -5
- package/dist/esm/apps/markets/state-machines/market-auction.js +117 -136
- package/dist/esm/apps/markets/state-machines/market-crowdfund.js +124 -139
- package/dist/esm/apps/markets/state-machines/market-group-buy.js +160 -179
- package/dist/esm/apps/markets/state-machines/market-prediction.js +195 -229
- package/dist/esm/apps/markets/state-machines/market-universal.js +66 -81
- package/dist/esm/apps/oracles/index.js +3 -3
- package/dist/esm/apps/privacy/index.js +56 -0
- package/dist/esm/apps/privacy/state-machines/index.js +6 -0
- package/dist/esm/apps/privacy/state-machines/mixer-ddhRing.js +282 -0
- package/dist/esm/apps/privacy/state-machines/note-pool.js +470 -0
- package/dist/esm/apps/staked-pool/assets.js +91 -0
- package/dist/esm/apps/staked-pool/base.js +493 -0
- package/dist/esm/apps/staked-pool/consumer.js +49 -0
- package/dist/esm/apps/staked-pool/index.js +60 -0
- package/dist/esm/apps/staked-pool/state-machines/index.js +6 -0
- package/dist/esm/apps/staked-pool/state-machines/staked-pool-base.js +46 -0
- package/dist/esm/apps/staked-pool/state-machines/staked-pool-oracle.js +127 -0
- package/dist/esm/generated/google/protobuf/struct.js +1 -1
- package/dist/esm/generated/google/protobuf/timestamp.js +1 -1
- package/dist/esm/generated/ottochain/apps/contracts/v1/contract.js +1 -1
- package/dist/esm/generated/ottochain/apps/corporate/v1/corporate.js +1 -1
- package/dist/esm/generated/ottochain/apps/governance/v1/governance.js +1 -1
- package/dist/esm/generated/ottochain/apps/identity/v1/attestation.js +1 -1
- package/dist/esm/generated/ottochain/apps/identity/v1/identity.js +1 -1
- package/dist/esm/generated/ottochain/apps/markets/v1/market.js +1 -1
- package/dist/esm/generated/ottochain/v1/common.js +1 -1
- package/dist/esm/generated/ottochain/v1/fiber.js +40 -2
- package/dist/esm/generated/ottochain/v1/messages.js +1 -1
- package/dist/esm/generated/ottochain/v1/records.js +1 -1
- package/dist/esm/index.js +10 -4
- package/dist/esm/ottochain/genesis-manifest.js +6 -0
- package/dist/esm/ottochain/metagraph-client.js +16 -8
- package/dist/esm/ottochain/snapshot.js +2 -4
- package/dist/esm/ottochain/transaction.js +8 -0
- package/dist/esm/privacy/index.js +2 -2
- package/dist/esm/privacy/sealed-bid.js +87 -84
- package/dist/esm/privacy/shield-app.js +33 -33
- package/dist/esm/schema/effects.js +110 -0
- package/dist/esm/schema/fiber-app.js +127 -3
- package/dist/esm/schema/guard-lint.js +3 -12
- package/dist/esm/schema/guards.js +36 -37
- package/dist/esm/templates/asset-policy.js +182 -0
- package/dist/esm/templates/index.js +41 -0
- package/dist/esm/templates/machine.js +125 -0
- package/dist/esm/templates/migration.js +34 -0
- package/dist/esm/templates/state-shape.js +34 -0
- package/dist/esm/validation.js +1 -3
- package/dist/esm/zk/index.js +4 -4
- package/dist/types/apps/compute/index.d.ts +176 -0
- package/dist/types/apps/compute/state-machines/compute-rule110.d.ts +157 -0
- package/dist/types/apps/compute/state-machines/index.d.ts +5 -0
- package/dist/types/apps/contracts/index.d.ts +14 -14
- package/dist/types/apps/contracts/state-machines/contract-agreement.d.ts +3 -3
- package/dist/types/apps/contracts/state-machines/contract-escrow.d.ts +3 -3
- package/dist/types/apps/contracts/state-machines/contract-universal.d.ts +4 -4
- package/dist/types/apps/corporate/index.d.ts +162 -162
- package/dist/types/apps/corporate/state-machines/corp-board.d.ts +88 -88
- package/dist/types/apps/corporate/state-machines/corp-entity.d.ts +14 -14
- package/dist/types/apps/corporate/state-machines/corp-securities.d.ts +18 -18
- package/dist/types/apps/corporate/state-machines/corp-shareholders.d.ts +43 -43
- package/dist/types/apps/governance/index.d.ts +81 -81
- package/dist/types/apps/governance/state-machines/dao-multisig.d.ts +16 -16
- package/dist/types/apps/governance/state-machines/dao-reputation.d.ts +22 -22
- package/dist/types/apps/governance/state-machines/dao-token.d.ts +21 -21
- package/dist/types/apps/governance/state-machines/governance-simple.d.ts +11 -11
- package/dist/types/apps/governance/state-machines/governance-universal.d.ts +4 -4
- package/dist/types/apps/identity/constants.d.ts +2 -2
- package/dist/types/apps/identity/index.d.ts +70 -70
- package/dist/types/apps/identity/state-machines/identity-agent.d.ts +23 -23
- package/dist/types/apps/identity/state-machines/identity-oracle.d.ts +11 -11
- package/dist/types/apps/identity/state-machines/identity-registry.d.ts +27 -27
- package/dist/types/apps/identity/state-machines/identity-universal.d.ts +4 -4
- package/dist/types/apps/index.d.ts +9 -6
- package/dist/types/apps/lending/assets.d.ts +2 -2
- package/dist/types/apps/lending/credit-scoring.d.ts +5 -5
- package/dist/types/apps/lending/eligibility.d.ts +2 -2
- package/dist/types/apps/lending/index.d.ts +20 -12
- package/dist/types/apps/lending/state-machines/lending-zk-loan.d.ts +15 -7
- package/dist/types/apps/markets/index.d.ts +76 -76
- package/dist/types/apps/markets/state-machines/market-auction.d.ts +12 -12
- package/dist/types/apps/markets/state-machines/market-crowdfund.d.ts +19 -19
- package/dist/types/apps/markets/state-machines/market-group-buy.d.ts +18 -18
- package/dist/types/apps/markets/state-machines/market-prediction.d.ts +15 -15
- package/dist/types/apps/markets/state-machines/market-universal.d.ts +7 -7
- package/dist/types/apps/oracles/index.d.ts +1 -1
- package/dist/types/apps/privacy/index.d.ts +328 -0
- package/dist/types/apps/privacy/state-machines/index.d.ts +6 -0
- package/dist/types/apps/privacy/state-machines/mixer-ddhRing.d.ts +337 -0
- package/dist/types/apps/privacy/state-machines/note-pool.d.ts +196 -0
- package/dist/types/apps/staked-pool/assets.d.ts +53 -0
- package/dist/types/apps/staked-pool/base.d.ts +80 -0
- package/dist/types/apps/staked-pool/consumer.d.ts +29 -0
- package/dist/types/apps/staked-pool/index.d.ts +51 -0
- package/dist/types/apps/staked-pool/state-machines/index.d.ts +6 -0
- package/dist/types/apps/staked-pool/state-machines/staked-pool-base.d.ts +8 -0
- package/dist/types/apps/staked-pool/state-machines/staked-pool-oracle.d.ts +34 -0
- package/dist/types/generated/openapi.d.ts +13 -0
- package/dist/types/generated/ottochain/v1/fiber.d.ts +7 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/openapi.d.ts +4 -2
- package/dist/types/ottochain/genesis-manifest.d.ts +6 -0
- package/dist/types/ottochain/transaction.d.ts +9 -1
- package/dist/types/ottochain/types.d.ts +1 -1
- package/dist/types/privacy/index.d.ts +2 -2
- package/dist/types/privacy/sealed-bid.d.ts +9 -9
- package/dist/types/privacy/shield-app.d.ts +1 -1
- package/dist/types/schema/effects.d.ts +107 -0
- package/dist/types/schema/fiber-app.d.ts +281 -0
- package/dist/types/schema/guards.d.ts +12 -0
- package/dist/types/templates/asset-policy.d.ts +119 -0
- package/dist/types/templates/index.d.ts +26 -0
- package/dist/types/templates/machine.d.ts +139 -0
- package/dist/types/templates/migration.d.ts +34 -0
- package/dist/types/templates/state-shape.d.ts +30 -0
- package/dist/types/zk/index.d.ts +4 -4
- package/package.json +31 -13
|
@@ -1,455 +1,439 @@
|
|
|
1
|
-
import { defineFiberApp } from
|
|
2
|
-
import { signerInSet, depInState } from
|
|
3
|
-
import { addDependency } from
|
|
1
|
+
import { defineFiberApp } from '../../../schema/fiber-app.js';
|
|
2
|
+
import { signerInSet, depInState } from '../../../schema/guards.js';
|
|
3
|
+
import { addDependency } from '../../../schema/effects.js';
|
|
4
4
|
/**
|
|
5
5
|
* Board of directors state machine managing director seats, meetings, quorum, and formal board actions.
|
|
6
6
|
* Supports staggered boards with classified directors.
|
|
7
7
|
*/
|
|
8
8
|
export const corpBoardDef = defineFiberApp({
|
|
9
9
|
metadata: {
|
|
10
|
-
name:
|
|
11
|
-
app:
|
|
12
|
-
type:
|
|
13
|
-
version:
|
|
14
|
-
description:
|
|
10
|
+
name: 'CorpBoard',
|
|
11
|
+
app: 'corporate',
|
|
12
|
+
type: 'board',
|
|
13
|
+
version: '1.0.0',
|
|
14
|
+
description: 'Board of directors state machine managing director seats, meetings, quorum, and formal board actions. Supports staggered boards with classified directors.',
|
|
15
15
|
crossReferences: {
|
|
16
16
|
entity: {
|
|
17
|
-
machine:
|
|
18
|
-
description:
|
|
19
|
-
foreignKey:
|
|
17
|
+
machine: 'corporate-entity',
|
|
18
|
+
description: 'Parent corporate entity',
|
|
19
|
+
foreignKey: 'entityId',
|
|
20
20
|
},
|
|
21
21
|
resolutions: {
|
|
22
|
-
machine:
|
|
23
|
-
description:
|
|
24
|
-
foreignKey:
|
|
22
|
+
machine: 'corporate-resolution',
|
|
23
|
+
description: 'Board resolutions',
|
|
24
|
+
foreignKey: 'boardId',
|
|
25
25
|
},
|
|
26
26
|
committees: {
|
|
27
|
-
machine:
|
|
28
|
-
description:
|
|
29
|
-
foreignKey:
|
|
27
|
+
machine: 'corporate-committee',
|
|
28
|
+
description: 'Board committees',
|
|
29
|
+
foreignKey: 'boardId',
|
|
30
30
|
},
|
|
31
31
|
officers: {
|
|
32
|
-
machine:
|
|
33
|
-
description:
|
|
34
|
-
foreignKey:
|
|
32
|
+
machine: 'corporate-officers',
|
|
33
|
+
description: 'Officers appointed by board',
|
|
34
|
+
foreignKey: 'entityId',
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
},
|
|
38
38
|
createSchema: {
|
|
39
|
-
required: [
|
|
39
|
+
required: ['boardId', 'entityId', 'seats', 'authorizedRemovers'],
|
|
40
40
|
properties: {
|
|
41
41
|
boardId: {
|
|
42
|
-
type:
|
|
43
|
-
description:
|
|
42
|
+
type: 'string',
|
|
43
|
+
description: 'Unique identifier for this board instance',
|
|
44
44
|
immutable: true,
|
|
45
45
|
},
|
|
46
46
|
entityId: {
|
|
47
|
-
type:
|
|
48
|
-
description:
|
|
47
|
+
type: 'string',
|
|
48
|
+
description: 'Reference to parent corporate-entity',
|
|
49
49
|
immutable: true,
|
|
50
50
|
},
|
|
51
51
|
authorizedRemovers: {
|
|
52
|
-
type:
|
|
53
|
-
description:
|
|
52
|
+
type: 'array',
|
|
53
|
+
description: 'State-pinned set of DAG addresses authorized to remove a director for cause (board/shareholder authority). A verified signer must be a member; checked against proofs[].address.',
|
|
54
54
|
immutable: false,
|
|
55
|
-
items: { type:
|
|
55
|
+
items: { type: 'address' },
|
|
56
56
|
},
|
|
57
57
|
seats: {
|
|
58
|
-
type:
|
|
58
|
+
type: 'object',
|
|
59
59
|
properties: {
|
|
60
60
|
authorized: {
|
|
61
|
-
type:
|
|
62
|
-
description:
|
|
61
|
+
type: 'integer',
|
|
62
|
+
description: 'Number of board seats authorized by bylaws',
|
|
63
63
|
},
|
|
64
|
-
filled: { type:
|
|
65
|
-
vacant: { type:
|
|
64
|
+
filled: { type: 'integer' },
|
|
65
|
+
vacant: { type: 'integer' },
|
|
66
66
|
},
|
|
67
67
|
},
|
|
68
68
|
boardStructure: {
|
|
69
|
-
type:
|
|
69
|
+
type: 'object',
|
|
70
70
|
properties: {
|
|
71
71
|
isClassified: {
|
|
72
|
-
type:
|
|
73
|
-
description:
|
|
72
|
+
type: 'boolean',
|
|
73
|
+
description: 'Whether board has staggered terms',
|
|
74
74
|
},
|
|
75
75
|
termYears: {
|
|
76
|
-
type:
|
|
76
|
+
type: 'integer',
|
|
77
77
|
default: 1,
|
|
78
|
-
description:
|
|
78
|
+
description: 'Director term length',
|
|
79
79
|
},
|
|
80
80
|
classTerms: {
|
|
81
|
-
type:
|
|
81
|
+
type: 'object',
|
|
82
82
|
properties: {
|
|
83
|
-
CLASS_I: { type:
|
|
84
|
-
CLASS_II: { type:
|
|
85
|
-
CLASS_III: { type:
|
|
83
|
+
CLASS_I: { type: 'integer' },
|
|
84
|
+
CLASS_II: { type: 'integer' },
|
|
85
|
+
CLASS_III: { type: 'integer' },
|
|
86
86
|
},
|
|
87
87
|
},
|
|
88
88
|
},
|
|
89
89
|
},
|
|
90
90
|
quorumRules: {
|
|
91
|
-
type:
|
|
91
|
+
type: 'object',
|
|
92
92
|
properties: {
|
|
93
93
|
type: {
|
|
94
|
-
type:
|
|
95
|
-
enum: [
|
|
96
|
-
default:
|
|
94
|
+
type: 'string',
|
|
95
|
+
enum: ['MAJORITY', 'SUPERMAJORITY', 'FIXED_NUMBER'],
|
|
96
|
+
default: 'MAJORITY',
|
|
97
97
|
},
|
|
98
98
|
threshold: {
|
|
99
|
-
type:
|
|
100
|
-
description:
|
|
99
|
+
type: 'number',
|
|
100
|
+
description: 'Fraction for majority/super, or count for fixed',
|
|
101
101
|
},
|
|
102
102
|
minimumRequired: {
|
|
103
|
-
type:
|
|
104
|
-
description:
|
|
103
|
+
type: 'integer',
|
|
104
|
+
description: 'Absolute minimum regardless of formula',
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
107
|
},
|
|
108
108
|
votingRules: {
|
|
109
|
-
type:
|
|
109
|
+
type: 'object',
|
|
110
110
|
properties: {
|
|
111
111
|
standardApproval: {
|
|
112
|
-
type:
|
|
113
|
-
enum: [
|
|
114
|
-
default:
|
|
112
|
+
type: 'string',
|
|
113
|
+
enum: ['MAJORITY_PRESENT', 'MAJORITY_FULL_BOARD'],
|
|
114
|
+
default: 'MAJORITY_PRESENT',
|
|
115
115
|
},
|
|
116
116
|
supermajorityMatters: {
|
|
117
|
-
type:
|
|
118
|
-
items: { type:
|
|
119
|
-
description:
|
|
117
|
+
type: 'array',
|
|
118
|
+
items: { type: 'string' },
|
|
119
|
+
description: 'Action types requiring supermajority',
|
|
120
120
|
},
|
|
121
|
-
supermajorityThreshold: { type:
|
|
121
|
+
supermajorityThreshold: { type: 'number', default: 0.6667 },
|
|
122
122
|
},
|
|
123
123
|
},
|
|
124
124
|
},
|
|
125
125
|
},
|
|
126
126
|
stateSchema: {
|
|
127
127
|
properties: {
|
|
128
|
-
boardId: { type:
|
|
129
|
-
entityId: { type:
|
|
130
|
-
authorizedRemovers: { type:
|
|
128
|
+
boardId: { type: 'string', immutable: true },
|
|
129
|
+
entityId: { type: 'string', immutable: true },
|
|
130
|
+
authorizedRemovers: { type: 'array', items: { type: 'address' } },
|
|
131
131
|
directors: {
|
|
132
|
-
type:
|
|
133
|
-
items: { $ref:
|
|
132
|
+
type: 'array',
|
|
133
|
+
items: { $ref: '#/definitions/Director' },
|
|
134
134
|
computed: true,
|
|
135
135
|
},
|
|
136
|
-
seats: { type:
|
|
137
|
-
boardStructure: { type:
|
|
138
|
-
quorumRules: { type:
|
|
139
|
-
votingRules: { type:
|
|
136
|
+
seats: { type: 'object' },
|
|
137
|
+
boardStructure: { type: 'object' },
|
|
138
|
+
quorumRules: { type: 'object' },
|
|
139
|
+
votingRules: { type: 'object' },
|
|
140
140
|
currentMeeting: {
|
|
141
|
-
$ref:
|
|
141
|
+
$ref: '#/definitions/Meeting',
|
|
142
142
|
nullable: true,
|
|
143
143
|
computed: true,
|
|
144
144
|
},
|
|
145
145
|
meetingHistory: {
|
|
146
|
-
type:
|
|
147
|
-
items: { $ref:
|
|
146
|
+
type: 'array',
|
|
147
|
+
items: { $ref: '#/definitions/MeetingRecord' },
|
|
148
148
|
computed: true,
|
|
149
149
|
},
|
|
150
150
|
status: {
|
|
151
|
-
type:
|
|
152
|
-
enum: [
|
|
151
|
+
type: 'string',
|
|
152
|
+
enum: ['ACTIVE', 'IN_MEETING', 'QUORUM_LOST'],
|
|
153
153
|
computed: true,
|
|
154
154
|
},
|
|
155
|
-
createdAt: { type:
|
|
156
|
-
updatedAt: { type:
|
|
155
|
+
createdAt: { type: 'timestamp', computed: true },
|
|
156
|
+
updatedAt: { type: 'timestamp', computed: true },
|
|
157
157
|
// Two-phase removal (#24): propose_removal binds the resolution fiber + records the pending
|
|
158
158
|
// removal here; remove_for_cause asserts the bound resolution is EXECUTED, then clears this.
|
|
159
|
-
pendingRemoval: { type:
|
|
159
|
+
pendingRemoval: { type: 'object', nullable: true, computed: true },
|
|
160
160
|
},
|
|
161
161
|
},
|
|
162
162
|
eventSchemas: {
|
|
163
163
|
elect_director: {
|
|
164
|
-
description:
|
|
165
|
-
required: [
|
|
166
|
-
"directorId",
|
|
167
|
-
"name",
|
|
168
|
-
"termStart",
|
|
169
|
-
"termEnd",
|
|
170
|
-
"isIndependent",
|
|
171
|
-
"electionResolutionRef",
|
|
172
|
-
],
|
|
164
|
+
description: 'Add a new director to the board (election typically done at shareholder meeting or by board to fill vacancy)',
|
|
165
|
+
required: ['directorId', 'name', 'termStart', 'termEnd', 'isIndependent', 'electionResolutionRef'],
|
|
173
166
|
properties: {
|
|
174
|
-
directorId: { type:
|
|
175
|
-
name: { type:
|
|
176
|
-
email: { type:
|
|
177
|
-
termStart: { type:
|
|
178
|
-
termEnd: { type:
|
|
167
|
+
directorId: { type: 'string' },
|
|
168
|
+
name: { type: 'string' },
|
|
169
|
+
email: { type: 'string' },
|
|
170
|
+
termStart: { type: 'string', format: 'date' },
|
|
171
|
+
termEnd: { type: 'string', format: 'date' },
|
|
179
172
|
class: {
|
|
180
|
-
type:
|
|
181
|
-
enum: [
|
|
173
|
+
type: 'string',
|
|
174
|
+
enum: ['CLASS_I', 'CLASS_II', 'CLASS_III', 'UNCLASSIFIED'],
|
|
182
175
|
},
|
|
183
|
-
isIndependent: { type:
|
|
176
|
+
isIndependent: { type: 'boolean' },
|
|
184
177
|
electionResolutionRef: {
|
|
185
|
-
type:
|
|
186
|
-
description:
|
|
178
|
+
type: 'string',
|
|
179
|
+
description: 'Shareholder or board resolution',
|
|
187
180
|
},
|
|
188
|
-
isFillingVacancy: { type:
|
|
181
|
+
isFillingVacancy: { type: 'boolean', default: false },
|
|
189
182
|
},
|
|
190
183
|
},
|
|
191
184
|
resign_director: {
|
|
192
|
-
description:
|
|
193
|
-
required: [
|
|
185
|
+
description: 'Director resigns from the board',
|
|
186
|
+
required: ['directorId', 'effectiveDate'],
|
|
194
187
|
properties: {
|
|
195
|
-
directorId: { type:
|
|
196
|
-
effectiveDate: { type:
|
|
197
|
-
reason: { type:
|
|
188
|
+
directorId: { type: 'string' },
|
|
189
|
+
effectiveDate: { type: 'string', format: 'date' },
|
|
190
|
+
reason: { type: 'string' },
|
|
198
191
|
resignationLetter: {
|
|
199
|
-
type:
|
|
200
|
-
description:
|
|
192
|
+
type: 'string',
|
|
193
|
+
description: 'Document reference',
|
|
201
194
|
},
|
|
202
195
|
},
|
|
203
196
|
},
|
|
204
197
|
propose_removal: {
|
|
205
|
-
description:
|
|
206
|
-
required: [
|
|
198
|
+
description: 'Phase 1 of for-cause removal: bind the executing resolution fiber (#24 _addDependency) and record the pending removal',
|
|
199
|
+
required: ['directorId', 'cause', 'removalResolutionRef'],
|
|
207
200
|
properties: {
|
|
208
|
-
directorId: { type:
|
|
209
|
-
cause: { type:
|
|
210
|
-
removalResolutionRef: { type:
|
|
201
|
+
directorId: { type: 'string' },
|
|
202
|
+
cause: { type: 'string' },
|
|
203
|
+
removalResolutionRef: { type: 'string' },
|
|
211
204
|
},
|
|
212
205
|
},
|
|
213
206
|
remove_for_cause: {
|
|
214
|
-
description:
|
|
215
|
-
required: [
|
|
207
|
+
description: 'Phase 2 of for-cause removal: execute once the bound removal resolution is EXECUTED',
|
|
208
|
+
required: ['directorId', 'effectiveDate'],
|
|
216
209
|
properties: {
|
|
217
|
-
directorId: { type:
|
|
218
|
-
effectiveDate: { type:
|
|
210
|
+
directorId: { type: 'string' },
|
|
211
|
+
effectiveDate: { type: 'string', format: 'date' },
|
|
219
212
|
},
|
|
220
213
|
},
|
|
221
214
|
designate_chair: {
|
|
222
|
-
description:
|
|
223
|
-
required: [
|
|
215
|
+
description: 'Designate a director as board chair',
|
|
216
|
+
required: ['directorId', 'resolutionRef'],
|
|
224
217
|
properties: {
|
|
225
|
-
directorId: { type:
|
|
226
|
-
resolutionRef: { type:
|
|
218
|
+
directorId: { type: 'string' },
|
|
219
|
+
resolutionRef: { type: 'string' },
|
|
227
220
|
},
|
|
228
221
|
},
|
|
229
222
|
call_meeting: {
|
|
230
|
-
description:
|
|
231
|
-
required: [
|
|
232
|
-
"meetingId",
|
|
233
|
-
"type",
|
|
234
|
-
"scheduledDate",
|
|
235
|
-
"calledBy",
|
|
236
|
-
"noticeDate",
|
|
237
|
-
],
|
|
223
|
+
description: 'Schedule a board meeting (can be called by chair, CEO, or directors per bylaws)',
|
|
224
|
+
required: ['meetingId', 'type', 'scheduledDate', 'calledBy', 'noticeDate'],
|
|
238
225
|
properties: {
|
|
239
|
-
meetingId: { type:
|
|
226
|
+
meetingId: { type: 'string' },
|
|
240
227
|
type: {
|
|
241
|
-
type:
|
|
242
|
-
enum: [
|
|
228
|
+
type: 'string',
|
|
229
|
+
enum: ['REGULAR', 'SPECIAL', 'ANNUAL', 'ORGANIZATIONAL'],
|
|
243
230
|
},
|
|
244
|
-
scheduledDate: { type:
|
|
245
|
-
location: { type:
|
|
246
|
-
isVirtual: { type:
|
|
231
|
+
scheduledDate: { type: 'string', format: 'date-time' },
|
|
232
|
+
location: { type: 'string' },
|
|
233
|
+
isVirtual: { type: 'boolean', default: false },
|
|
247
234
|
calledBy: {
|
|
248
|
-
type:
|
|
249
|
-
description:
|
|
235
|
+
type: 'string',
|
|
236
|
+
description: 'Director ID or officer title',
|
|
250
237
|
},
|
|
251
|
-
noticeDate: { type:
|
|
252
|
-
agenda: { type:
|
|
238
|
+
noticeDate: { type: 'string', format: 'date' },
|
|
239
|
+
agenda: { type: 'array', items: { type: 'string' } },
|
|
253
240
|
waiverOfNotice: {
|
|
254
|
-
type:
|
|
241
|
+
type: 'boolean',
|
|
255
242
|
default: false,
|
|
256
|
-
description:
|
|
243
|
+
description: 'If all directors waive notice',
|
|
257
244
|
},
|
|
258
245
|
},
|
|
259
246
|
},
|
|
260
247
|
record_attendance: {
|
|
261
248
|
description: "Record a director's attendance before meeting opens",
|
|
262
|
-
required: [
|
|
249
|
+
required: ['directorId', 'present'],
|
|
263
250
|
properties: {
|
|
264
|
-
directorId: { type:
|
|
265
|
-
present: { type:
|
|
266
|
-
arrivedAt: { type:
|
|
251
|
+
directorId: { type: 'string' },
|
|
252
|
+
present: { type: 'boolean' },
|
|
253
|
+
arrivedAt: { type: 'string', format: 'date-time' },
|
|
267
254
|
},
|
|
268
255
|
},
|
|
269
256
|
open_meeting: {
|
|
270
|
-
description:
|
|
271
|
-
required: [
|
|
257
|
+
description: 'Officially open the board meeting once quorum is established',
|
|
258
|
+
required: ['openedAt'],
|
|
272
259
|
properties: {
|
|
273
|
-
openedAt: { type:
|
|
260
|
+
openedAt: { type: 'string', format: 'date-time' },
|
|
274
261
|
chairPresiding: {
|
|
275
|
-
type:
|
|
276
|
-
description:
|
|
262
|
+
type: 'string',
|
|
263
|
+
description: 'Director ID presiding',
|
|
277
264
|
},
|
|
278
265
|
},
|
|
279
266
|
},
|
|
280
267
|
director_departs: {
|
|
281
|
-
description:
|
|
282
|
-
required: [
|
|
268
|
+
description: 'Record a director leaving the meeting (may affect quorum)',
|
|
269
|
+
required: ['directorId', 'departedAt'],
|
|
283
270
|
properties: {
|
|
284
|
-
directorId: { type:
|
|
285
|
-
departedAt: { type:
|
|
271
|
+
directorId: { type: 'string' },
|
|
272
|
+
departedAt: { type: 'string', format: 'date-time' },
|
|
286
273
|
},
|
|
287
274
|
},
|
|
288
275
|
quorum_lost: {
|
|
289
|
-
description:
|
|
290
|
-
required: [
|
|
276
|
+
description: 'Automatic transition when quorum is lost during meeting',
|
|
277
|
+
required: ['lostAt'],
|
|
291
278
|
properties: {
|
|
292
|
-
lostAt: { type:
|
|
279
|
+
lostAt: { type: 'string', format: 'date-time' },
|
|
293
280
|
},
|
|
294
281
|
},
|
|
295
282
|
quorum_restored: {
|
|
296
|
-
description:
|
|
297
|
-
required: [
|
|
283
|
+
description: 'Quorum restored after additional director(s) join',
|
|
284
|
+
required: ['restoredAt', 'directorId'],
|
|
298
285
|
properties: {
|
|
299
|
-
restoredAt: { type:
|
|
300
|
-
directorId: { type:
|
|
286
|
+
restoredAt: { type: 'string', format: 'date-time' },
|
|
287
|
+
directorId: { type: 'string', description: 'Joining director' },
|
|
301
288
|
},
|
|
302
289
|
},
|
|
303
290
|
adjourn: {
|
|
304
|
-
description:
|
|
305
|
-
required: [
|
|
291
|
+
description: 'Adjourn the board meeting',
|
|
292
|
+
required: ['closedAt'],
|
|
306
293
|
properties: {
|
|
307
|
-
closedAt: { type:
|
|
294
|
+
closedAt: { type: 'string', format: 'date-time' },
|
|
308
295
|
minutesRef: {
|
|
309
|
-
type:
|
|
310
|
-
description:
|
|
296
|
+
type: 'string',
|
|
297
|
+
description: 'Reference to meeting minutes document',
|
|
311
298
|
},
|
|
312
|
-
resolutionsPassed: { type:
|
|
299
|
+
resolutionsPassed: { type: 'array', items: { type: 'string' } },
|
|
313
300
|
adjournedTo: {
|
|
314
|
-
type:
|
|
315
|
-
format:
|
|
301
|
+
type: 'string',
|
|
302
|
+
format: 'date-time',
|
|
316
303
|
nullable: true,
|
|
317
|
-
description:
|
|
304
|
+
description: 'If adjourning to later date',
|
|
318
305
|
},
|
|
319
306
|
},
|
|
320
307
|
},
|
|
321
308
|
update_seats: {
|
|
322
|
-
description:
|
|
323
|
-
required: [
|
|
309
|
+
description: 'Change the number of authorized board seats (requires bylaw amendment)',
|
|
310
|
+
required: ['newAuthorizedSeats', 'bylawAmendmentRef'],
|
|
324
311
|
properties: {
|
|
325
|
-
newAuthorizedSeats: { type:
|
|
326
|
-
bylawAmendmentRef: { type:
|
|
312
|
+
newAuthorizedSeats: { type: 'integer' },
|
|
313
|
+
bylawAmendmentRef: { type: 'string' },
|
|
327
314
|
},
|
|
328
315
|
},
|
|
329
316
|
},
|
|
330
317
|
definitions: {
|
|
331
318
|
Director: {
|
|
332
|
-
type:
|
|
319
|
+
type: 'object',
|
|
333
320
|
properties: {
|
|
334
|
-
directorId: { type:
|
|
335
|
-
name: { type:
|
|
336
|
-
email: { type:
|
|
337
|
-
termStart: { type:
|
|
338
|
-
termEnd: { type:
|
|
321
|
+
directorId: { type: 'string' },
|
|
322
|
+
name: { type: 'string' },
|
|
323
|
+
email: { type: 'string' },
|
|
324
|
+
termStart: { type: 'string', format: 'date' },
|
|
325
|
+
termEnd: { type: 'string', format: 'date' },
|
|
339
326
|
class: {
|
|
340
|
-
type:
|
|
341
|
-
enum: [
|
|
327
|
+
type: 'string',
|
|
328
|
+
enum: ['CLASS_I', 'CLASS_II', 'CLASS_III', 'UNCLASSIFIED'],
|
|
342
329
|
},
|
|
343
330
|
status: {
|
|
344
|
-
type:
|
|
345
|
-
enum: [
|
|
331
|
+
type: 'string',
|
|
332
|
+
enum: ['ACTIVE', 'RESIGNED', 'REMOVED', 'TERM_EXPIRED'],
|
|
346
333
|
},
|
|
347
334
|
isIndependent: {
|
|
348
|
-
type:
|
|
349
|
-
description:
|
|
335
|
+
type: 'boolean',
|
|
336
|
+
description: 'Independence under applicable rules',
|
|
350
337
|
},
|
|
351
|
-
isChair: { type:
|
|
352
|
-
isLeadIndependent: { type:
|
|
338
|
+
isChair: { type: 'boolean', default: false },
|
|
339
|
+
isLeadIndependent: { type: 'boolean', default: false },
|
|
353
340
|
committees: {
|
|
354
|
-
type:
|
|
355
|
-
items: { type:
|
|
356
|
-
description:
|
|
341
|
+
type: 'array',
|
|
342
|
+
items: { type: 'string' },
|
|
343
|
+
description: 'Committee memberships by committee ID',
|
|
357
344
|
},
|
|
358
345
|
electedBy: {
|
|
359
|
-
type:
|
|
360
|
-
description:
|
|
346
|
+
type: 'string',
|
|
347
|
+
description: 'Resolution reference for election',
|
|
361
348
|
},
|
|
362
|
-
compensationAgreementRef: { type:
|
|
349
|
+
compensationAgreementRef: { type: 'string', nullable: true },
|
|
363
350
|
},
|
|
364
351
|
},
|
|
365
352
|
Meeting: {
|
|
366
|
-
type:
|
|
353
|
+
type: 'object',
|
|
367
354
|
nullable: true,
|
|
368
355
|
properties: {
|
|
369
|
-
meetingId: { type:
|
|
356
|
+
meetingId: { type: 'string' },
|
|
370
357
|
type: {
|
|
371
|
-
type:
|
|
372
|
-
enum: [
|
|
358
|
+
type: 'string',
|
|
359
|
+
enum: ['REGULAR', 'SPECIAL', 'ANNUAL', 'ORGANIZATIONAL'],
|
|
373
360
|
},
|
|
374
|
-
scheduledDate: { type:
|
|
375
|
-
location: { type:
|
|
376
|
-
isVirtual: { type:
|
|
377
|
-
calledBy: { type:
|
|
378
|
-
noticeDate: { type:
|
|
379
|
-
agenda: { type:
|
|
380
|
-
attendees: { type:
|
|
381
|
-
quorumPresent: { type:
|
|
382
|
-
quorumCount: { type:
|
|
383
|
-
openedAt: { type:
|
|
384
|
-
closedAt: { type:
|
|
385
|
-
minutesRef: { type:
|
|
361
|
+
scheduledDate: { type: 'string', format: 'date-time' },
|
|
362
|
+
location: { type: 'string' },
|
|
363
|
+
isVirtual: { type: 'boolean' },
|
|
364
|
+
calledBy: { type: 'string' },
|
|
365
|
+
noticeDate: { type: 'string', format: 'date' },
|
|
366
|
+
agenda: { type: 'array', items: { type: 'string' } },
|
|
367
|
+
attendees: { type: 'array', items: { $ref: '#/definitions/Attendee' } },
|
|
368
|
+
quorumPresent: { type: 'boolean' },
|
|
369
|
+
quorumCount: { type: 'integer' },
|
|
370
|
+
openedAt: { type: 'string', format: 'date-time', nullable: true },
|
|
371
|
+
closedAt: { type: 'string', format: 'date-time', nullable: true },
|
|
372
|
+
minutesRef: { type: 'string', nullable: true },
|
|
386
373
|
},
|
|
387
374
|
},
|
|
388
375
|
Attendee: {
|
|
389
|
-
type:
|
|
376
|
+
type: 'object',
|
|
390
377
|
properties: {
|
|
391
|
-
directorId: { type:
|
|
392
|
-
present: { type:
|
|
393
|
-
arrivedAt: { type:
|
|
394
|
-
departedAt: { type:
|
|
395
|
-
viaProxy: { type:
|
|
378
|
+
directorId: { type: 'string' },
|
|
379
|
+
present: { type: 'boolean' },
|
|
380
|
+
arrivedAt: { type: 'string', format: 'date-time', nullable: true },
|
|
381
|
+
departedAt: { type: 'string', format: 'date-time', nullable: true },
|
|
382
|
+
viaProxy: { type: 'boolean', default: false },
|
|
396
383
|
},
|
|
397
384
|
},
|
|
398
385
|
MeetingRecord: {
|
|
399
|
-
type:
|
|
386
|
+
type: 'object',
|
|
400
387
|
properties: {
|
|
401
|
-
meetingId: { type:
|
|
402
|
-
type: { type:
|
|
403
|
-
date: { type:
|
|
404
|
-
quorumAchieved: { type:
|
|
405
|
-
attendeeCount: { type:
|
|
406
|
-
resolutionsPassed: { type:
|
|
407
|
-
minutesRef: { type:
|
|
388
|
+
meetingId: { type: 'string' },
|
|
389
|
+
type: { type: 'string' },
|
|
390
|
+
date: { type: 'string', format: 'date' },
|
|
391
|
+
quorumAchieved: { type: 'boolean' },
|
|
392
|
+
attendeeCount: { type: 'integer' },
|
|
393
|
+
resolutionsPassed: { type: 'array', items: { type: 'string' } },
|
|
394
|
+
minutesRef: { type: 'string' },
|
|
408
395
|
},
|
|
409
396
|
},
|
|
410
397
|
},
|
|
411
398
|
states: {
|
|
412
399
|
ACTIVE: {
|
|
413
|
-
id:
|
|
400
|
+
id: 'ACTIVE',
|
|
414
401
|
isFinal: false,
|
|
415
|
-
description:
|
|
402
|
+
description: 'Board is constituted and able to conduct business. Default state between meetings.',
|
|
416
403
|
},
|
|
417
404
|
IN_MEETING: {
|
|
418
|
-
id:
|
|
405
|
+
id: 'IN_MEETING',
|
|
419
406
|
isFinal: false,
|
|
420
|
-
description:
|
|
407
|
+
description: 'Board meeting is in session with quorum present. Can take formal actions.',
|
|
421
408
|
},
|
|
422
409
|
QUORUM_LOST: {
|
|
423
|
-
id:
|
|
410
|
+
id: 'QUORUM_LOST',
|
|
424
411
|
isFinal: false,
|
|
425
|
-
description:
|
|
412
|
+
description: 'Meeting in progress but quorum lost due to departures. No further action until quorum restored or adjourned.',
|
|
426
413
|
},
|
|
427
414
|
},
|
|
428
|
-
initialState:
|
|
415
|
+
initialState: 'ACTIVE',
|
|
429
416
|
transitions: [
|
|
430
417
|
// ACTIVE -> ACTIVE (elect_director)
|
|
431
418
|
{
|
|
432
|
-
from:
|
|
433
|
-
to:
|
|
434
|
-
eventName:
|
|
419
|
+
from: 'ACTIVE',
|
|
420
|
+
to: 'ACTIVE',
|
|
421
|
+
eventName: 'elect_director',
|
|
435
422
|
guard: {
|
|
436
423
|
and: [
|
|
437
424
|
// vacancy gated solely on verified state — the forgeable event.isFillingVacancy disjunct was removed
|
|
438
|
-
{
|
|
439
|
-
{
|
|
425
|
+
{ '>': [{ var: 'state.seats.vacant' }, 0] },
|
|
426
|
+
{ '!=': [{ var: 'event.electionResolutionRef' }, null] },
|
|
440
427
|
{
|
|
441
|
-
|
|
428
|
+
'!': {
|
|
442
429
|
some: [
|
|
443
|
-
{ var:
|
|
430
|
+
{ var: 'state.directors' },
|
|
444
431
|
{
|
|
445
432
|
and: [
|
|
446
433
|
{
|
|
447
|
-
|
|
448
|
-
{ var: "directorId" },
|
|
449
|
-
{ var: "event.directorId" },
|
|
450
|
-
],
|
|
434
|
+
'==': [{ var: 'directorId' }, { var: 'event.directorId' }],
|
|
451
435
|
},
|
|
452
|
-
{
|
|
436
|
+
{ '==': [{ var: 'status' }, 'ACTIVE'] },
|
|
453
437
|
],
|
|
454
438
|
},
|
|
455
439
|
],
|
|
@@ -459,168 +443,156 @@ export const corpBoardDef = defineFiberApp({
|
|
|
459
443
|
},
|
|
460
444
|
effect: {
|
|
461
445
|
merge: [
|
|
462
|
-
{ var:
|
|
446
|
+
{ var: 'state' },
|
|
463
447
|
{
|
|
464
448
|
directors: {
|
|
465
449
|
merge: [
|
|
466
|
-
{ var:
|
|
450
|
+
{ var: 'state.directors' },
|
|
467
451
|
[
|
|
468
452
|
{
|
|
469
|
-
directorId: { var:
|
|
470
|
-
name: { var:
|
|
471
|
-
email: { var:
|
|
472
|
-
termStart: { var:
|
|
473
|
-
termEnd: { var:
|
|
474
|
-
class: { var:
|
|
475
|
-
status:
|
|
476
|
-
isIndependent: { var:
|
|
453
|
+
directorId: { var: 'event.directorId' },
|
|
454
|
+
name: { var: 'event.name' },
|
|
455
|
+
email: { var: 'event.email' },
|
|
456
|
+
termStart: { var: 'event.termStart' },
|
|
457
|
+
termEnd: { var: 'event.termEnd' },
|
|
458
|
+
class: { var: 'event.class' },
|
|
459
|
+
status: 'ACTIVE',
|
|
460
|
+
isIndependent: { var: 'event.isIndependent' },
|
|
477
461
|
isChair: false,
|
|
478
462
|
isLeadIndependent: false,
|
|
479
463
|
committees: [],
|
|
480
|
-
electedBy: { var:
|
|
464
|
+
electedBy: { var: 'event.electionResolutionRef' },
|
|
481
465
|
},
|
|
482
466
|
],
|
|
483
467
|
],
|
|
484
468
|
},
|
|
485
469
|
seats: {
|
|
486
470
|
merge: [
|
|
487
|
-
{ var:
|
|
471
|
+
{ var: 'state.seats' },
|
|
488
472
|
{
|
|
489
|
-
filled: {
|
|
490
|
-
vacant: {
|
|
473
|
+
filled: { '+': [{ var: 'state.seats.filled' }, 1] },
|
|
474
|
+
vacant: { '-': [{ var: 'state.seats.vacant' }, 1] },
|
|
491
475
|
},
|
|
492
476
|
],
|
|
493
477
|
},
|
|
494
478
|
},
|
|
495
479
|
{
|
|
496
|
-
_emit: [
|
|
497
|
-
{ name: "DIRECTOR_ELECTED", data: { var: "event" }, destination: "external" },
|
|
498
|
-
],
|
|
480
|
+
_emit: [{ name: 'DIRECTOR_ELECTED', data: { var: 'event' }, destination: 'external' }],
|
|
499
481
|
},
|
|
500
482
|
],
|
|
501
483
|
},
|
|
502
484
|
},
|
|
503
485
|
// ACTIVE -> ACTIVE (resign_director) and IN_MEETING -> ACTIVE (resign_director)
|
|
504
486
|
{
|
|
505
|
-
from:
|
|
506
|
-
to:
|
|
507
|
-
eventName:
|
|
487
|
+
from: 'ACTIVE',
|
|
488
|
+
to: 'ACTIVE',
|
|
489
|
+
eventName: 'resign_director',
|
|
508
490
|
guard: {
|
|
509
491
|
some: [
|
|
510
|
-
{ var:
|
|
492
|
+
{ var: 'state.directors' },
|
|
511
493
|
{
|
|
512
494
|
and: [
|
|
513
|
-
{
|
|
514
|
-
{
|
|
495
|
+
{ '==': [{ var: 'directorId' }, { var: 'event.directorId' }] },
|
|
496
|
+
{ '==': [{ var: 'status' }, 'ACTIVE'] },
|
|
515
497
|
],
|
|
516
498
|
},
|
|
517
499
|
],
|
|
518
500
|
},
|
|
519
501
|
effect: {
|
|
520
502
|
merge: [
|
|
521
|
-
{ var:
|
|
503
|
+
{ var: 'state' },
|
|
522
504
|
{
|
|
523
505
|
directors: {
|
|
524
506
|
map: [
|
|
525
|
-
{ var:
|
|
507
|
+
{ var: 'state.directors' },
|
|
526
508
|
{
|
|
527
509
|
if: [
|
|
528
510
|
{
|
|
529
|
-
|
|
530
|
-
{ var: "directorId" },
|
|
531
|
-
{ var: "event.directorId" },
|
|
532
|
-
],
|
|
511
|
+
'==': [{ var: 'directorId' }, { var: 'event.directorId' }],
|
|
533
512
|
},
|
|
534
513
|
{
|
|
535
514
|
merge: [
|
|
536
|
-
{ var:
|
|
515
|
+
{ var: '' },
|
|
537
516
|
{
|
|
538
|
-
status:
|
|
539
|
-
termEnd: { var:
|
|
517
|
+
status: 'RESIGNED',
|
|
518
|
+
termEnd: { var: 'event.effectiveDate' },
|
|
540
519
|
},
|
|
541
520
|
],
|
|
542
521
|
},
|
|
543
|
-
{ var:
|
|
522
|
+
{ var: '' },
|
|
544
523
|
],
|
|
545
524
|
},
|
|
546
525
|
],
|
|
547
526
|
},
|
|
548
527
|
seats: {
|
|
549
528
|
merge: [
|
|
550
|
-
{ var:
|
|
529
|
+
{ var: 'state.seats' },
|
|
551
530
|
{
|
|
552
|
-
filled: {
|
|
553
|
-
vacant: {
|
|
531
|
+
filled: { '-': [{ var: 'state.seats.filled' }, 1] },
|
|
532
|
+
vacant: { '+': [{ var: 'state.seats.vacant' }, 1] },
|
|
554
533
|
},
|
|
555
534
|
],
|
|
556
535
|
},
|
|
557
536
|
},
|
|
558
537
|
{
|
|
559
|
-
_emit: [
|
|
560
|
-
{ name: "DIRECTOR_RESIGNED", data: { var: "event" }, destination: "external" },
|
|
561
|
-
],
|
|
538
|
+
_emit: [{ name: 'DIRECTOR_RESIGNED', data: { var: 'event' }, destination: 'external' }],
|
|
562
539
|
},
|
|
563
540
|
],
|
|
564
541
|
},
|
|
565
542
|
},
|
|
566
543
|
{
|
|
567
|
-
from:
|
|
568
|
-
to:
|
|
569
|
-
eventName:
|
|
544
|
+
from: 'IN_MEETING',
|
|
545
|
+
to: 'ACTIVE',
|
|
546
|
+
eventName: 'resign_director',
|
|
570
547
|
guard: {
|
|
571
548
|
some: [
|
|
572
|
-
{ var:
|
|
549
|
+
{ var: 'state.directors' },
|
|
573
550
|
{
|
|
574
551
|
and: [
|
|
575
|
-
{
|
|
576
|
-
{
|
|
552
|
+
{ '==': [{ var: 'directorId' }, { var: 'event.directorId' }] },
|
|
553
|
+
{ '==': [{ var: 'status' }, 'ACTIVE'] },
|
|
577
554
|
],
|
|
578
555
|
},
|
|
579
556
|
],
|
|
580
557
|
},
|
|
581
558
|
effect: {
|
|
582
559
|
merge: [
|
|
583
|
-
{ var:
|
|
560
|
+
{ var: 'state' },
|
|
584
561
|
{
|
|
585
562
|
directors: {
|
|
586
563
|
map: [
|
|
587
|
-
{ var:
|
|
564
|
+
{ var: 'state.directors' },
|
|
588
565
|
{
|
|
589
566
|
if: [
|
|
590
567
|
{
|
|
591
|
-
|
|
592
|
-
{ var: "directorId" },
|
|
593
|
-
{ var: "event.directorId" },
|
|
594
|
-
],
|
|
568
|
+
'==': [{ var: 'directorId' }, { var: 'event.directorId' }],
|
|
595
569
|
},
|
|
596
570
|
{
|
|
597
571
|
merge: [
|
|
598
|
-
{ var:
|
|
572
|
+
{ var: '' },
|
|
599
573
|
{
|
|
600
|
-
status:
|
|
601
|
-
termEnd: { var:
|
|
574
|
+
status: 'RESIGNED',
|
|
575
|
+
termEnd: { var: 'event.effectiveDate' },
|
|
602
576
|
},
|
|
603
577
|
],
|
|
604
578
|
},
|
|
605
|
-
{ var:
|
|
579
|
+
{ var: '' },
|
|
606
580
|
],
|
|
607
581
|
},
|
|
608
582
|
],
|
|
609
583
|
},
|
|
610
584
|
seats: {
|
|
611
585
|
merge: [
|
|
612
|
-
{ var:
|
|
586
|
+
{ var: 'state.seats' },
|
|
613
587
|
{
|
|
614
|
-
filled: {
|
|
615
|
-
vacant: {
|
|
588
|
+
filled: { '-': [{ var: 'state.seats.filled' }, 1] },
|
|
589
|
+
vacant: { '+': [{ var: 'state.seats.vacant' }, 1] },
|
|
616
590
|
},
|
|
617
591
|
],
|
|
618
592
|
},
|
|
619
593
|
},
|
|
620
594
|
{
|
|
621
|
-
_emit: [
|
|
622
|
-
{ name: "DIRECTOR_RESIGNED", data: { var: "event" }, destination: "external" },
|
|
623
|
-
],
|
|
595
|
+
_emit: [{ name: 'DIRECTOR_RESIGNED', data: { var: 'event' }, destination: 'external' }],
|
|
624
596
|
},
|
|
625
597
|
],
|
|
626
598
|
},
|
|
@@ -628,19 +600,19 @@ export const corpBoardDef = defineFiberApp({
|
|
|
628
600
|
// ACTIVE -> ACTIVE (propose_removal) — phase 1 (#24): bind the executing resolution fiber and
|
|
629
601
|
// record the pending removal, so the next transition can read the resolution's state.
|
|
630
602
|
{
|
|
631
|
-
from:
|
|
632
|
-
to:
|
|
633
|
-
eventName:
|
|
603
|
+
from: 'ACTIVE',
|
|
604
|
+
to: 'ACTIVE',
|
|
605
|
+
eventName: 'propose_removal',
|
|
634
606
|
guard: {
|
|
635
607
|
and: [
|
|
636
|
-
signerInSet(
|
|
608
|
+
signerInSet('state.authorizedRemovers'),
|
|
637
609
|
{
|
|
638
610
|
some: [
|
|
639
|
-
{ var:
|
|
611
|
+
{ var: 'state.directors' },
|
|
640
612
|
{
|
|
641
613
|
and: [
|
|
642
|
-
{
|
|
643
|
-
{
|
|
614
|
+
{ '==': [{ var: 'directorId' }, { var: 'event.directorId' }] },
|
|
615
|
+
{ '==': [{ var: 'status' }, 'ACTIVE'] },
|
|
644
616
|
],
|
|
645
617
|
},
|
|
646
618
|
],
|
|
@@ -649,17 +621,17 @@ export const corpBoardDef = defineFiberApp({
|
|
|
649
621
|
},
|
|
650
622
|
effect: {
|
|
651
623
|
merge: [
|
|
652
|
-
{ var:
|
|
624
|
+
{ var: 'state' },
|
|
653
625
|
{
|
|
654
626
|
pendingRemoval: {
|
|
655
|
-
directorId: { var:
|
|
656
|
-
cause: { var:
|
|
657
|
-
resolutionRef: { var:
|
|
658
|
-
proposedAt: { var:
|
|
627
|
+
directorId: { var: 'event.directorId' },
|
|
628
|
+
cause: { var: 'event.cause' },
|
|
629
|
+
resolutionRef: { var: 'event.removalResolutionRef' },
|
|
630
|
+
proposedAt: { var: '$ordinal' },
|
|
659
631
|
},
|
|
660
632
|
},
|
|
661
633
|
// bind the resolution fiber so remove_for_cause can assert its state next transition
|
|
662
|
-
addDependency({ var:
|
|
634
|
+
addDependency({ var: 'event.removalResolutionRef' }),
|
|
663
635
|
],
|
|
664
636
|
},
|
|
665
637
|
dependencies: [],
|
|
@@ -667,32 +639,29 @@ export const corpBoardDef = defineFiberApp({
|
|
|
667
639
|
// ACTIVE -> ACTIVE (remove_for_cause) — phase 2 (#24): execute once the bound removal resolution is
|
|
668
640
|
// EXECUTED. depInState replaces the dropped object-form dependency (which silently never gated).
|
|
669
641
|
{
|
|
670
|
-
from:
|
|
671
|
-
to:
|
|
672
|
-
eventName:
|
|
642
|
+
from: 'ACTIVE',
|
|
643
|
+
to: 'ACTIVE',
|
|
644
|
+
eventName: 'remove_for_cause',
|
|
673
645
|
// authority gate — a member of the pinned authorizedRemovers set must sign; an identity role
|
|
674
646
|
// attestation (BOARD_MEMBER/...) layers on additively when the identity registry lands (§4.2).
|
|
675
647
|
guard: {
|
|
676
648
|
and: [
|
|
677
|
-
signerInSet(
|
|
649
|
+
signerInSet('state.authorizedRemovers'),
|
|
678
650
|
// the proposal must target this director, and its bound resolution must be EXECUTED
|
|
679
651
|
{
|
|
680
|
-
|
|
681
|
-
{ var: "state.pendingRemoval.directorId" },
|
|
682
|
-
{ var: "event.directorId" },
|
|
683
|
-
],
|
|
652
|
+
'==': [{ var: 'state.pendingRemoval.directorId' }, { var: 'event.directorId' }],
|
|
684
653
|
},
|
|
685
|
-
depInState(
|
|
654
|
+
depInState('state.pendingRemoval.resolutionRef', 'EXECUTED'),
|
|
686
655
|
// event.directorId is the lookup key only — the director must exist and be ACTIVE
|
|
687
656
|
{
|
|
688
657
|
some: [
|
|
689
|
-
{ var:
|
|
658
|
+
{ var: 'state.directors' },
|
|
690
659
|
{
|
|
691
660
|
and: [
|
|
692
661
|
{
|
|
693
|
-
|
|
662
|
+
'==': [{ var: 'directorId' }, { var: 'event.directorId' }],
|
|
694
663
|
},
|
|
695
|
-
{
|
|
664
|
+
{ '==': [{ var: 'status' }, 'ACTIVE'] },
|
|
696
665
|
],
|
|
697
666
|
},
|
|
698
667
|
],
|
|
@@ -701,39 +670,36 @@ export const corpBoardDef = defineFiberApp({
|
|
|
701
670
|
},
|
|
702
671
|
effect: {
|
|
703
672
|
merge: [
|
|
704
|
-
{ var:
|
|
673
|
+
{ var: 'state' },
|
|
705
674
|
{
|
|
706
675
|
directors: {
|
|
707
676
|
map: [
|
|
708
|
-
{ var:
|
|
677
|
+
{ var: 'state.directors' },
|
|
709
678
|
{
|
|
710
679
|
if: [
|
|
711
680
|
{
|
|
712
|
-
|
|
713
|
-
{ var: "directorId" },
|
|
714
|
-
{ var: "event.directorId" },
|
|
715
|
-
],
|
|
681
|
+
'==': [{ var: 'directorId' }, { var: 'event.directorId' }],
|
|
716
682
|
},
|
|
717
683
|
{
|
|
718
684
|
merge: [
|
|
719
|
-
{ var:
|
|
685
|
+
{ var: '' },
|
|
720
686
|
{
|
|
721
|
-
status:
|
|
722
|
-
termEnd: { var:
|
|
687
|
+
status: 'REMOVED',
|
|
688
|
+
termEnd: { var: 'event.effectiveDate' },
|
|
723
689
|
},
|
|
724
690
|
],
|
|
725
691
|
},
|
|
726
|
-
{ var:
|
|
692
|
+
{ var: '' },
|
|
727
693
|
],
|
|
728
694
|
},
|
|
729
695
|
],
|
|
730
696
|
},
|
|
731
697
|
seats: {
|
|
732
698
|
merge: [
|
|
733
|
-
{ var:
|
|
699
|
+
{ var: 'state.seats' },
|
|
734
700
|
{
|
|
735
|
-
filled: {
|
|
736
|
-
vacant: {
|
|
701
|
+
filled: { '-': [{ var: 'state.seats.filled' }, 1] },
|
|
702
|
+
vacant: { '+': [{ var: 'state.seats.vacant' }, 1] },
|
|
737
703
|
},
|
|
738
704
|
],
|
|
739
705
|
},
|
|
@@ -741,9 +707,7 @@ export const corpBoardDef = defineFiberApp({
|
|
|
741
707
|
pendingRemoval: null,
|
|
742
708
|
},
|
|
743
709
|
{
|
|
744
|
-
_emit: [
|
|
745
|
-
{ name: "DIRECTOR_REMOVED", data: { var: "event" }, destination: "external" },
|
|
746
|
-
],
|
|
710
|
+
_emit: [{ name: 'DIRECTOR_REMOVED', data: { var: 'event' }, destination: 'external' }],
|
|
747
711
|
},
|
|
748
712
|
],
|
|
749
713
|
},
|
|
@@ -751,36 +715,33 @@ export const corpBoardDef = defineFiberApp({
|
|
|
751
715
|
},
|
|
752
716
|
// ACTIVE -> ACTIVE (designate_chair)
|
|
753
717
|
{
|
|
754
|
-
from:
|
|
755
|
-
to:
|
|
756
|
-
eventName:
|
|
718
|
+
from: 'ACTIVE',
|
|
719
|
+
to: 'ACTIVE',
|
|
720
|
+
eventName: 'designate_chair',
|
|
757
721
|
guard: {
|
|
758
722
|
some: [
|
|
759
|
-
{ var:
|
|
723
|
+
{ var: 'state.directors' },
|
|
760
724
|
{
|
|
761
725
|
and: [
|
|
762
|
-
{
|
|
763
|
-
{
|
|
726
|
+
{ '==': [{ var: 'directorId' }, { var: 'event.directorId' }] },
|
|
727
|
+
{ '==': [{ var: 'status' }, 'ACTIVE'] },
|
|
764
728
|
],
|
|
765
729
|
},
|
|
766
730
|
],
|
|
767
731
|
},
|
|
768
732
|
effect: {
|
|
769
733
|
merge: [
|
|
770
|
-
{ var:
|
|
734
|
+
{ var: 'state' },
|
|
771
735
|
{
|
|
772
736
|
directors: {
|
|
773
737
|
map: [
|
|
774
|
-
{ var:
|
|
738
|
+
{ var: 'state.directors' },
|
|
775
739
|
{
|
|
776
740
|
merge: [
|
|
777
|
-
{ var:
|
|
741
|
+
{ var: '' },
|
|
778
742
|
{
|
|
779
743
|
isChair: {
|
|
780
|
-
|
|
781
|
-
{ var: "directorId" },
|
|
782
|
-
{ var: "event.directorId" },
|
|
783
|
-
],
|
|
744
|
+
'==': [{ var: 'directorId' }, { var: 'event.directorId' }],
|
|
784
745
|
},
|
|
785
746
|
},
|
|
786
747
|
],
|
|
@@ -793,21 +754,18 @@ export const corpBoardDef = defineFiberApp({
|
|
|
793
754
|
},
|
|
794
755
|
// ACTIVE -> ACTIVE (call_meeting)
|
|
795
756
|
{
|
|
796
|
-
from:
|
|
797
|
-
to:
|
|
798
|
-
eventName:
|
|
757
|
+
from: 'ACTIVE',
|
|
758
|
+
to: 'ACTIVE',
|
|
759
|
+
eventName: 'call_meeting',
|
|
799
760
|
guard: {
|
|
800
761
|
and: [
|
|
801
762
|
{
|
|
802
763
|
or: [
|
|
803
|
-
{
|
|
764
|
+
{ '==': [{ var: 'event.waiverOfNotice' }, true] },
|
|
804
765
|
{
|
|
805
|
-
|
|
766
|
+
'>=': [
|
|
806
767
|
{
|
|
807
|
-
|
|
808
|
-
{ var: "event.scheduledDate" },
|
|
809
|
-
{ var: "event.noticeDate" },
|
|
810
|
-
],
|
|
768
|
+
'-': [{ var: 'event.scheduledDate' }, { var: 'event.noticeDate' }],
|
|
811
769
|
},
|
|
812
770
|
172800000, // 2 days in ms
|
|
813
771
|
],
|
|
@@ -816,56 +774,54 @@ export const corpBoardDef = defineFiberApp({
|
|
|
816
774
|
},
|
|
817
775
|
{
|
|
818
776
|
or: [
|
|
819
|
-
{
|
|
820
|
-
{
|
|
777
|
+
{ '==': [{ var: 'state.currentMeeting' }, null] },
|
|
778
|
+
{ '!=': [{ var: 'state.currentMeeting.closedAt' }, null] },
|
|
821
779
|
],
|
|
822
780
|
},
|
|
823
781
|
],
|
|
824
782
|
},
|
|
825
783
|
effect: {
|
|
826
784
|
merge: [
|
|
827
|
-
{ var:
|
|
785
|
+
{ var: 'state' },
|
|
828
786
|
{
|
|
829
787
|
currentMeeting: {
|
|
830
|
-
meetingId: { var:
|
|
831
|
-
type: { var:
|
|
832
|
-
scheduledDate: { var:
|
|
833
|
-
location: { var:
|
|
834
|
-
isVirtual: { var:
|
|
835
|
-
calledBy: { var:
|
|
836
|
-
noticeDate: { var:
|
|
837
|
-
agenda: { var:
|
|
788
|
+
meetingId: { var: 'event.meetingId' },
|
|
789
|
+
type: { var: 'event.type' },
|
|
790
|
+
scheduledDate: { var: 'event.scheduledDate' },
|
|
791
|
+
location: { var: 'event.location' },
|
|
792
|
+
isVirtual: { var: 'event.isVirtual' },
|
|
793
|
+
calledBy: { var: 'event.calledBy' },
|
|
794
|
+
noticeDate: { var: 'event.noticeDate' },
|
|
795
|
+
agenda: { var: 'event.agenda' },
|
|
838
796
|
attendees: [],
|
|
839
797
|
quorumPresent: false,
|
|
840
798
|
quorumCount: 0,
|
|
841
799
|
},
|
|
842
800
|
},
|
|
843
801
|
{
|
|
844
|
-
_emit: [
|
|
845
|
-
{ name: "BOARD_MEETING_SCHEDULED", data: { var: "event" }, destination: "external" },
|
|
846
|
-
],
|
|
802
|
+
_emit: [{ name: 'BOARD_MEETING_SCHEDULED', data: { var: 'event' }, destination: 'external' }],
|
|
847
803
|
},
|
|
848
804
|
],
|
|
849
805
|
},
|
|
850
806
|
},
|
|
851
807
|
// ACTIVE -> ACTIVE (record_attendance)
|
|
852
808
|
{
|
|
853
|
-
from:
|
|
854
|
-
to:
|
|
855
|
-
eventName:
|
|
809
|
+
from: 'ACTIVE',
|
|
810
|
+
to: 'ACTIVE',
|
|
811
|
+
eventName: 'record_attendance',
|
|
856
812
|
guard: {
|
|
857
813
|
and: [
|
|
858
|
-
{
|
|
859
|
-
{
|
|
814
|
+
{ '!=': [{ var: 'state.currentMeeting' }, null] },
|
|
815
|
+
{ '==': [{ var: 'state.currentMeeting.openedAt' }, null] },
|
|
860
816
|
{
|
|
861
817
|
some: [
|
|
862
|
-
{ var:
|
|
818
|
+
{ var: 'state.directors' },
|
|
863
819
|
{
|
|
864
820
|
and: [
|
|
865
821
|
{
|
|
866
|
-
|
|
822
|
+
'==': [{ var: 'directorId' }, { var: 'event.directorId' }],
|
|
867
823
|
},
|
|
868
|
-
{
|
|
824
|
+
{ '==': [{ var: 'status' }, 'ACTIVE'] },
|
|
869
825
|
],
|
|
870
826
|
},
|
|
871
827
|
],
|
|
@@ -874,20 +830,20 @@ export const corpBoardDef = defineFiberApp({
|
|
|
874
830
|
},
|
|
875
831
|
effect: {
|
|
876
832
|
merge: [
|
|
877
|
-
{ var:
|
|
833
|
+
{ var: 'state' },
|
|
878
834
|
{
|
|
879
835
|
currentMeeting: {
|
|
880
836
|
merge: [
|
|
881
|
-
{ var:
|
|
837
|
+
{ var: 'state.currentMeeting' },
|
|
882
838
|
{
|
|
883
839
|
attendees: {
|
|
884
840
|
merge: [
|
|
885
|
-
{ var:
|
|
841
|
+
{ var: 'state.currentMeeting.attendees' },
|
|
886
842
|
[
|
|
887
843
|
{
|
|
888
|
-
directorId: { var:
|
|
889
|
-
present: { var:
|
|
890
|
-
arrivedAt: { var:
|
|
844
|
+
directorId: { var: 'event.directorId' },
|
|
845
|
+
present: { var: 'event.present' },
|
|
846
|
+
arrivedAt: { var: 'event.arrivedAt' },
|
|
891
847
|
viaProxy: false,
|
|
892
848
|
},
|
|
893
849
|
],
|
|
@@ -902,71 +858,63 @@ export const corpBoardDef = defineFiberApp({
|
|
|
902
858
|
},
|
|
903
859
|
// ACTIVE -> IN_MEETING (open_meeting)
|
|
904
860
|
{
|
|
905
|
-
from:
|
|
906
|
-
to:
|
|
907
|
-
eventName:
|
|
861
|
+
from: 'ACTIVE',
|
|
862
|
+
to: 'IN_MEETING',
|
|
863
|
+
eventName: 'open_meeting',
|
|
908
864
|
guard: {
|
|
909
865
|
and: [
|
|
910
|
-
{
|
|
911
|
-
{
|
|
912
|
-
{
|
|
866
|
+
{ '!=': [{ var: 'state.currentMeeting' }, null] },
|
|
867
|
+
{ '==': [{ var: 'state.currentMeeting.openedAt' }, null] },
|
|
868
|
+
{ '==': [{ var: 'state.currentMeeting.quorumPresent' }, true] },
|
|
913
869
|
],
|
|
914
870
|
},
|
|
915
871
|
effect: {
|
|
916
872
|
merge: [
|
|
917
|
-
{ var:
|
|
873
|
+
{ var: 'state' },
|
|
918
874
|
{
|
|
919
|
-
status:
|
|
875
|
+
status: 'IN_MEETING',
|
|
920
876
|
currentMeeting: {
|
|
921
|
-
merge: [
|
|
922
|
-
{ var: "state.currentMeeting" },
|
|
923
|
-
{ openedAt: { var: "event.openedAt" } },
|
|
924
|
-
],
|
|
877
|
+
merge: [{ var: 'state.currentMeeting' }, { openedAt: { var: 'event.openedAt' } }],
|
|
925
878
|
},
|
|
926
879
|
},
|
|
927
880
|
{
|
|
928
|
-
_emit: [
|
|
929
|
-
{ name: "BOARD_MEETING_OPENED", data: { var: "event" }, destination: "external" },
|
|
930
|
-
],
|
|
881
|
+
_emit: [{ name: 'BOARD_MEETING_OPENED', data: { var: 'event' }, destination: 'external' }],
|
|
931
882
|
},
|
|
932
883
|
],
|
|
933
884
|
},
|
|
934
885
|
},
|
|
935
886
|
// IN_MEETING -> IN_MEETING (director_departs)
|
|
936
887
|
{
|
|
937
|
-
from:
|
|
938
|
-
to:
|
|
939
|
-
eventName:
|
|
940
|
-
guard: {
|
|
888
|
+
from: 'IN_MEETING',
|
|
889
|
+
to: 'IN_MEETING',
|
|
890
|
+
eventName: 'director_departs',
|
|
891
|
+
guard: { '==': [1, 1] },
|
|
941
892
|
effect: {
|
|
942
893
|
merge: [
|
|
943
|
-
{ var:
|
|
894
|
+
{ var: 'state' },
|
|
944
895
|
{
|
|
945
896
|
currentMeeting: {
|
|
946
897
|
merge: [
|
|
947
|
-
{ var:
|
|
898
|
+
{ var: 'state.currentMeeting' },
|
|
948
899
|
{
|
|
949
900
|
attendees: {
|
|
950
901
|
map: [
|
|
951
|
-
{ var:
|
|
902
|
+
{ var: 'state.currentMeeting.attendees' },
|
|
952
903
|
{
|
|
953
904
|
if: [
|
|
954
905
|
{
|
|
955
|
-
|
|
956
|
-
{ var: "directorId" },
|
|
957
|
-
{ var: "event.directorId" },
|
|
958
|
-
],
|
|
906
|
+
'==': [{ var: 'directorId' }, { var: 'event.directorId' }],
|
|
959
907
|
},
|
|
960
908
|
{
|
|
961
909
|
merge: [
|
|
962
|
-
{ var:
|
|
910
|
+
{ var: '' },
|
|
963
911
|
{
|
|
964
912
|
present: false,
|
|
965
|
-
departedAt: { var:
|
|
913
|
+
departedAt: { var: 'event.departedAt' },
|
|
966
914
|
},
|
|
967
915
|
],
|
|
968
916
|
},
|
|
969
|
-
{ var:
|
|
917
|
+
{ var: '' },
|
|
970
918
|
],
|
|
971
919
|
},
|
|
972
920
|
],
|
|
@@ -980,143 +928,129 @@ export const corpBoardDef = defineFiberApp({
|
|
|
980
928
|
},
|
|
981
929
|
// IN_MEETING -> QUORUM_LOST
|
|
982
930
|
{
|
|
983
|
-
from:
|
|
984
|
-
to:
|
|
985
|
-
eventName:
|
|
986
|
-
guard: {
|
|
931
|
+
from: 'IN_MEETING',
|
|
932
|
+
to: 'QUORUM_LOST',
|
|
933
|
+
eventName: 'quorum_lost',
|
|
934
|
+
guard: { '==': [{ var: 'state.currentMeeting.quorumPresent' }, false] },
|
|
987
935
|
effect: {
|
|
988
936
|
merge: [
|
|
989
|
-
{ var:
|
|
990
|
-
{ status:
|
|
937
|
+
{ var: 'state' },
|
|
938
|
+
{ status: 'QUORUM_LOST' },
|
|
991
939
|
{
|
|
992
|
-
_emit: [
|
|
993
|
-
{ name: "BOARD_QUORUM_LOST", data: { var: "event" }, destination: "external" },
|
|
994
|
-
],
|
|
940
|
+
_emit: [{ name: 'BOARD_QUORUM_LOST', data: { var: 'event' }, destination: 'external' }],
|
|
995
941
|
},
|
|
996
942
|
],
|
|
997
943
|
},
|
|
998
944
|
},
|
|
999
945
|
// QUORUM_LOST -> IN_MEETING
|
|
1000
946
|
{
|
|
1001
|
-
from:
|
|
1002
|
-
to:
|
|
1003
|
-
eventName:
|
|
1004
|
-
guard: {
|
|
947
|
+
from: 'QUORUM_LOST',
|
|
948
|
+
to: 'IN_MEETING',
|
|
949
|
+
eventName: 'quorum_restored',
|
|
950
|
+
guard: { '==': [{ var: 'state.currentMeeting.quorumPresent' }, true] },
|
|
1005
951
|
effect: {
|
|
1006
952
|
merge: [
|
|
1007
|
-
{ var:
|
|
1008
|
-
{ status:
|
|
953
|
+
{ var: 'state' },
|
|
954
|
+
{ status: 'IN_MEETING' },
|
|
1009
955
|
{
|
|
1010
|
-
_emit: [
|
|
1011
|
-
{ name: "BOARD_QUORUM_RESTORED", data: { var: "event" }, destination: "external" },
|
|
1012
|
-
],
|
|
956
|
+
_emit: [{ name: 'BOARD_QUORUM_RESTORED', data: { var: 'event' }, destination: 'external' }],
|
|
1013
957
|
},
|
|
1014
958
|
],
|
|
1015
959
|
},
|
|
1016
960
|
},
|
|
1017
961
|
// IN_MEETING -> ACTIVE (adjourn)
|
|
1018
962
|
{
|
|
1019
|
-
from:
|
|
1020
|
-
to:
|
|
1021
|
-
eventName:
|
|
1022
|
-
guard: {
|
|
963
|
+
from: 'IN_MEETING',
|
|
964
|
+
to: 'ACTIVE',
|
|
965
|
+
eventName: 'adjourn',
|
|
966
|
+
guard: { '==': [1, 1] },
|
|
1023
967
|
effect: {
|
|
1024
968
|
merge: [
|
|
1025
|
-
{ var:
|
|
969
|
+
{ var: 'state' },
|
|
1026
970
|
{
|
|
1027
|
-
status:
|
|
971
|
+
status: 'ACTIVE',
|
|
1028
972
|
currentMeeting: null,
|
|
1029
973
|
meetingHistory: {
|
|
1030
974
|
merge: [
|
|
1031
|
-
{ var:
|
|
975
|
+
{ var: 'state.meetingHistory' },
|
|
1032
976
|
[
|
|
1033
977
|
{
|
|
1034
|
-
meetingId: { var:
|
|
1035
|
-
type: { var:
|
|
1036
|
-
date: { var:
|
|
978
|
+
meetingId: { var: 'state.currentMeeting.meetingId' },
|
|
979
|
+
type: { var: 'state.currentMeeting.type' },
|
|
980
|
+
date: { var: 'state.currentMeeting.scheduledDate' },
|
|
1037
981
|
quorumAchieved: {
|
|
1038
|
-
var:
|
|
982
|
+
var: 'state.currentMeeting.quorumPresent',
|
|
1039
983
|
},
|
|
1040
|
-
attendeeCount: { var:
|
|
1041
|
-
resolutionsPassed: { var:
|
|
1042
|
-
minutesRef: { var:
|
|
984
|
+
attendeeCount: { var: 'state.currentMeeting.quorumCount' },
|
|
985
|
+
resolutionsPassed: { var: 'event.resolutionsPassed' },
|
|
986
|
+
minutesRef: { var: 'event.minutesRef' },
|
|
1043
987
|
},
|
|
1044
988
|
],
|
|
1045
989
|
],
|
|
1046
990
|
},
|
|
1047
991
|
},
|
|
1048
992
|
{
|
|
1049
|
-
_emit: [
|
|
1050
|
-
{ name: "BOARD_MEETING_ADJOURNED", data: { var: "event" }, destination: "external" },
|
|
1051
|
-
],
|
|
993
|
+
_emit: [{ name: 'BOARD_MEETING_ADJOURNED', data: { var: 'event' }, destination: 'external' }],
|
|
1052
994
|
},
|
|
1053
995
|
],
|
|
1054
996
|
},
|
|
1055
997
|
},
|
|
1056
998
|
// QUORUM_LOST -> ACTIVE (adjourn)
|
|
1057
999
|
{
|
|
1058
|
-
from:
|
|
1059
|
-
to:
|
|
1060
|
-
eventName:
|
|
1061
|
-
guard: {
|
|
1000
|
+
from: 'QUORUM_LOST',
|
|
1001
|
+
to: 'ACTIVE',
|
|
1002
|
+
eventName: 'adjourn',
|
|
1003
|
+
guard: { '==': [1, 1] },
|
|
1062
1004
|
effect: {
|
|
1063
1005
|
merge: [
|
|
1064
|
-
{ var:
|
|
1006
|
+
{ var: 'state' },
|
|
1065
1007
|
{
|
|
1066
|
-
status:
|
|
1008
|
+
status: 'ACTIVE',
|
|
1067
1009
|
currentMeeting: null,
|
|
1068
1010
|
meetingHistory: {
|
|
1069
1011
|
merge: [
|
|
1070
|
-
{ var:
|
|
1012
|
+
{ var: 'state.meetingHistory' },
|
|
1071
1013
|
[
|
|
1072
1014
|
{
|
|
1073
|
-
meetingId: { var:
|
|
1074
|
-
type: { var:
|
|
1075
|
-
date: { var:
|
|
1015
|
+
meetingId: { var: 'state.currentMeeting.meetingId' },
|
|
1016
|
+
type: { var: 'state.currentMeeting.type' },
|
|
1017
|
+
date: { var: 'state.currentMeeting.scheduledDate' },
|
|
1076
1018
|
quorumAchieved: {
|
|
1077
|
-
var:
|
|
1019
|
+
var: 'state.currentMeeting.quorumPresent',
|
|
1078
1020
|
},
|
|
1079
|
-
attendeeCount: { var:
|
|
1080
|
-
resolutionsPassed: { var:
|
|
1081
|
-
minutesRef: { var:
|
|
1021
|
+
attendeeCount: { var: 'state.currentMeeting.quorumCount' },
|
|
1022
|
+
resolutionsPassed: { var: 'event.resolutionsPassed' },
|
|
1023
|
+
minutesRef: { var: 'event.minutesRef' },
|
|
1082
1024
|
},
|
|
1083
1025
|
],
|
|
1084
1026
|
],
|
|
1085
1027
|
},
|
|
1086
1028
|
},
|
|
1087
1029
|
{
|
|
1088
|
-
_emit: [
|
|
1089
|
-
{ name: "BOARD_MEETING_ADJOURNED", data: { var: "event" }, destination: "external" },
|
|
1090
|
-
],
|
|
1030
|
+
_emit: [{ name: 'BOARD_MEETING_ADJOURNED', data: { var: 'event' }, destination: 'external' }],
|
|
1091
1031
|
},
|
|
1092
1032
|
],
|
|
1093
1033
|
},
|
|
1094
1034
|
},
|
|
1095
1035
|
// ACTIVE -> ACTIVE (update_seats)
|
|
1096
1036
|
{
|
|
1097
|
-
from:
|
|
1098
|
-
to:
|
|
1099
|
-
eventName:
|
|
1037
|
+
from: 'ACTIVE',
|
|
1038
|
+
to: 'ACTIVE',
|
|
1039
|
+
eventName: 'update_seats',
|
|
1100
1040
|
guard: {
|
|
1101
|
-
|
|
1102
|
-
{ var: "event.newAuthorizedSeats" },
|
|
1103
|
-
{ var: "state.seats.filled" },
|
|
1104
|
-
],
|
|
1041
|
+
'>=': [{ var: 'event.newAuthorizedSeats' }, { var: 'state.seats.filled' }],
|
|
1105
1042
|
},
|
|
1106
1043
|
effect: {
|
|
1107
1044
|
merge: [
|
|
1108
|
-
{ var:
|
|
1045
|
+
{ var: 'state' },
|
|
1109
1046
|
{
|
|
1110
1047
|
seats: {
|
|
1111
1048
|
merge: [
|
|
1112
|
-
{ var:
|
|
1049
|
+
{ var: 'state.seats' },
|
|
1113
1050
|
{
|
|
1114
|
-
authorized: { var:
|
|
1051
|
+
authorized: { var: 'event.newAuthorizedSeats' },
|
|
1115
1052
|
vacant: {
|
|
1116
|
-
|
|
1117
|
-
{ var: "event.newAuthorizedSeats" },
|
|
1118
|
-
{ var: "state.seats.filled" },
|
|
1119
|
-
],
|
|
1053
|
+
'-': [{ var: 'event.newAuthorizedSeats' }, { var: 'state.seats.filled' }],
|
|
1120
1054
|
},
|
|
1121
1055
|
},
|
|
1122
1056
|
],
|