@contractspec/example.wealth-snapshot 1.57.0 → 1.58.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/browser/docs/index.js +93 -0
- package/dist/browser/docs/wealth-snapshot.docblock.js +93 -0
- package/dist/browser/entities/index.js +191 -0
- package/dist/browser/events.js +111 -0
- package/dist/browser/example.js +42 -0
- package/dist/browser/handlers/index.js +5 -0
- package/dist/browser/index.js +885 -0
- package/dist/browser/operations/index.js +238 -0
- package/dist/browser/presentations/index.js +11 -0
- package/dist/browser/presentations.js +124 -0
- package/dist/browser/wealth-snapshot.capability.js +40 -0
- package/dist/browser/wealth-snapshot.feature.js +72 -0
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +94 -1
- package/dist/docs/wealth-snapshot.docblock.d.ts +2 -1
- package/dist/docs/wealth-snapshot.docblock.d.ts.map +1 -0
- package/dist/docs/wealth-snapshot.docblock.js +45 -55
- package/dist/entities/index.d.ts +120 -125
- package/dist/entities/index.d.ts.map +1 -1
- package/dist/entities/index.js +181 -219
- package/dist/events.d.ts +167 -173
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +103 -172
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +41 -54
- package/dist/handlers/index.d.ts +1 -4
- package/dist/handlers/index.d.ts.map +1 -1
- package/dist/handlers/index.js +5 -8
- package/dist/index.d.ts +12 -16
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +882 -23
- package/dist/node/docs/index.js +93 -0
- package/dist/node/docs/wealth-snapshot.docblock.js +93 -0
- package/dist/node/entities/index.js +191 -0
- package/dist/node/events.js +111 -0
- package/dist/node/example.js +42 -0
- package/dist/node/handlers/index.js +5 -0
- package/dist/node/index.js +885 -0
- package/dist/node/operations/index.js +238 -0
- package/dist/node/presentations/index.js +11 -0
- package/dist/node/presentations.js +124 -0
- package/dist/node/wealth-snapshot.capability.js +40 -0
- package/dist/node/wealth-snapshot.feature.js +72 -0
- package/dist/operations/index.d.ts +392 -398
- package/dist/operations/index.d.ts.map +1 -1
- package/dist/operations/index.js +237 -425
- package/dist/presentations/index.d.ts +1 -4
- package/dist/presentations/index.d.ts.map +1 -1
- package/dist/presentations/index.js +11 -11
- package/dist/presentations.d.ts +5 -10
- package/dist/presentations.d.ts.map +1 -1
- package/dist/presentations.js +120 -127
- package/dist/wealth-snapshot.capability.d.ts +3 -8
- package/dist/wealth-snapshot.capability.d.ts.map +1 -1
- package/dist/wealth-snapshot.capability.js +41 -46
- package/dist/wealth-snapshot.feature.d.ts +1 -6
- package/dist/wealth-snapshot.feature.d.ts.map +1 -1
- package/dist/wealth-snapshot.feature.js +71 -139
- package/package.json +144 -37
- package/dist/docs/wealth-snapshot.docblock.js.map +0 -1
- package/dist/entities/index.js.map +0 -1
- package/dist/events.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/handlers/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/operations/index.js.map +0 -1
- package/dist/presentations/index.js.map +0 -1
- package/dist/presentations.js.map +0 -1
- package/dist/wealth-snapshot.capability.js.map +0 -1
- package/dist/wealth-snapshot.feature.js.map +0 -1
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// src/operations/index.ts
|
|
2
|
+
import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
|
|
3
|
+
import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
|
|
4
|
+
var OWNERS = ["examples.wealth-snapshot"];
|
|
5
|
+
var AccountModel = defineSchemaModel({
|
|
6
|
+
name: "Account",
|
|
7
|
+
description: "Account model",
|
|
8
|
+
fields: {
|
|
9
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
10
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
11
|
+
type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
12
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
13
|
+
balance: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false }
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
var AssetModel = defineSchemaModel({
|
|
17
|
+
name: "Asset",
|
|
18
|
+
description: "Asset model",
|
|
19
|
+
fields: {
|
|
20
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
21
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
22
|
+
category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
23
|
+
value: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
24
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
var LiabilityModel = defineSchemaModel({
|
|
28
|
+
name: "Liability",
|
|
29
|
+
description: "Liability model",
|
|
30
|
+
fields: {
|
|
31
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
32
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
33
|
+
category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
34
|
+
balance: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
35
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
var GoalModel = defineSchemaModel({
|
|
39
|
+
name: "Goal",
|
|
40
|
+
description: "Goal model",
|
|
41
|
+
fields: {
|
|
42
|
+
id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
43
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
44
|
+
targetAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
45
|
+
currentAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
46
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
47
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
var NetWorthSnapshotModel = defineSchemaModel({
|
|
51
|
+
name: "NetWorthSnapshot",
|
|
52
|
+
description: "Net worth snapshot model",
|
|
53
|
+
fields: {
|
|
54
|
+
asOf: { type: ScalarTypeEnum.DateTime(), isOptional: false },
|
|
55
|
+
totalAssets: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
56
|
+
totalLiabilities: {
|
|
57
|
+
type: ScalarTypeEnum.Float_unsecure(),
|
|
58
|
+
isOptional: false
|
|
59
|
+
},
|
|
60
|
+
netWorth: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
61
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
var CreateAccountInput = defineSchemaModel({
|
|
65
|
+
name: "CreateAccountInput",
|
|
66
|
+
description: "Create account input",
|
|
67
|
+
fields: {
|
|
68
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
69
|
+
type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
70
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
71
|
+
balance: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true },
|
|
72
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
var AddAssetInput = defineSchemaModel({
|
|
76
|
+
name: "AddAssetInput",
|
|
77
|
+
description: "Add asset input",
|
|
78
|
+
fields: {
|
|
79
|
+
accountId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
80
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
81
|
+
category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
82
|
+
value: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
83
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
84
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
var AddLiabilityInput = defineSchemaModel({
|
|
88
|
+
name: "AddLiabilityInput",
|
|
89
|
+
description: "Add liability input",
|
|
90
|
+
fields: {
|
|
91
|
+
accountId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
92
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
93
|
+
category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
94
|
+
balance: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
95
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
96
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
var UpdateGoalInput = defineSchemaModel({
|
|
100
|
+
name: "UpdateGoalInput",
|
|
101
|
+
description: "Update goal progress",
|
|
102
|
+
fields: {
|
|
103
|
+
goalId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
104
|
+
currentAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
105
|
+
status: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
var CreateGoalInput = defineSchemaModel({
|
|
109
|
+
name: "CreateGoalInput",
|
|
110
|
+
description: "Create goal input",
|
|
111
|
+
fields: {
|
|
112
|
+
name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
113
|
+
targetAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
|
|
114
|
+
currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
|
|
115
|
+
targetDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
116
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
var NetWorthQueryInput = defineSchemaModel({
|
|
120
|
+
name: "NetWorthQueryInput",
|
|
121
|
+
description: "Filter for net worth snapshots",
|
|
122
|
+
fields: {
|
|
123
|
+
orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
|
|
124
|
+
from: { type: ScalarTypeEnum.DateTime(), isOptional: true },
|
|
125
|
+
to: { type: ScalarTypeEnum.DateTime(), isOptional: true }
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
var CreateAccountContract = defineCommand({
|
|
129
|
+
meta: {
|
|
130
|
+
key: "wealth.account.create",
|
|
131
|
+
version: "1.0.0",
|
|
132
|
+
stability: "stable",
|
|
133
|
+
owners: [...OWNERS],
|
|
134
|
+
tags: ["wealth", "account", "create"],
|
|
135
|
+
description: "Create a financial account.",
|
|
136
|
+
goal: "Track account balances.",
|
|
137
|
+
context: "Onboarding/import."
|
|
138
|
+
},
|
|
139
|
+
io: { input: CreateAccountInput, output: AccountModel },
|
|
140
|
+
policy: { auth: "user" }
|
|
141
|
+
});
|
|
142
|
+
var AddAssetContract = defineCommand({
|
|
143
|
+
meta: {
|
|
144
|
+
key: "wealth.asset.add",
|
|
145
|
+
version: "1.0.0",
|
|
146
|
+
stability: "stable",
|
|
147
|
+
owners: [...OWNERS],
|
|
148
|
+
tags: ["wealth", "asset", "add"],
|
|
149
|
+
description: "Add an asset position.",
|
|
150
|
+
goal: "Track holdings.",
|
|
151
|
+
context: "Asset onboarding/update."
|
|
152
|
+
},
|
|
153
|
+
io: { input: AddAssetInput, output: AssetModel },
|
|
154
|
+
policy: { auth: "user" }
|
|
155
|
+
});
|
|
156
|
+
var AddLiabilityContract = defineCommand({
|
|
157
|
+
meta: {
|
|
158
|
+
key: "wealth.liability.add",
|
|
159
|
+
version: "1.0.0",
|
|
160
|
+
stability: "stable",
|
|
161
|
+
owners: [...OWNERS],
|
|
162
|
+
tags: ["wealth", "liability", "add"],
|
|
163
|
+
description: "Add a liability.",
|
|
164
|
+
goal: "Track debts.",
|
|
165
|
+
context: "Debt onboarding/update."
|
|
166
|
+
},
|
|
167
|
+
io: { input: AddLiabilityInput, output: LiabilityModel },
|
|
168
|
+
policy: { auth: "user" }
|
|
169
|
+
});
|
|
170
|
+
var CreateGoalContract = defineCommand({
|
|
171
|
+
meta: {
|
|
172
|
+
key: "wealth.goal.create",
|
|
173
|
+
version: "1.0.0",
|
|
174
|
+
stability: "stable",
|
|
175
|
+
owners: [...OWNERS],
|
|
176
|
+
tags: ["wealth", "goal", "create"],
|
|
177
|
+
description: "Create a financial goal.",
|
|
178
|
+
goal: "Track progress toward goals.",
|
|
179
|
+
context: "Planning."
|
|
180
|
+
},
|
|
181
|
+
io: { input: CreateGoalInput, output: GoalModel },
|
|
182
|
+
policy: { auth: "user" }
|
|
183
|
+
});
|
|
184
|
+
var UpdateGoalContract = defineCommand({
|
|
185
|
+
meta: {
|
|
186
|
+
key: "wealth.goal.update",
|
|
187
|
+
version: "1.0.0",
|
|
188
|
+
stability: "stable",
|
|
189
|
+
owners: [...OWNERS],
|
|
190
|
+
tags: ["wealth", "goal", "update"],
|
|
191
|
+
description: "Update goal progress.",
|
|
192
|
+
goal: "Keep progress current.",
|
|
193
|
+
context: "Periodic update."
|
|
194
|
+
},
|
|
195
|
+
io: { input: UpdateGoalInput, output: GoalModel },
|
|
196
|
+
policy: { auth: "user" }
|
|
197
|
+
});
|
|
198
|
+
var GetNetWorthContract = defineQuery({
|
|
199
|
+
meta: {
|
|
200
|
+
key: "wealth.networth.get",
|
|
201
|
+
version: "1.0.0",
|
|
202
|
+
stability: "stable",
|
|
203
|
+
owners: [...OWNERS],
|
|
204
|
+
tags: ["wealth", "networth"],
|
|
205
|
+
description: "Get net worth snapshots for a period.",
|
|
206
|
+
goal: "Render charts and indicators.",
|
|
207
|
+
context: "Dashboard."
|
|
208
|
+
},
|
|
209
|
+
io: {
|
|
210
|
+
input: NetWorthQueryInput,
|
|
211
|
+
output: defineSchemaModel({
|
|
212
|
+
name: "NetWorthQueryOutput",
|
|
213
|
+
description: "Snapshots + latest indicators",
|
|
214
|
+
fields: {
|
|
215
|
+
snapshots: {
|
|
216
|
+
type: NetWorthSnapshotModel,
|
|
217
|
+
isArray: true,
|
|
218
|
+
isOptional: false
|
|
219
|
+
},
|
|
220
|
+
latest: { type: NetWorthSnapshotModel, isOptional: true }
|
|
221
|
+
}
|
|
222
|
+
})
|
|
223
|
+
},
|
|
224
|
+
policy: { auth: "user" }
|
|
225
|
+
});
|
|
226
|
+
export {
|
|
227
|
+
UpdateGoalContract,
|
|
228
|
+
NetWorthSnapshotModel,
|
|
229
|
+
LiabilityModel,
|
|
230
|
+
GoalModel,
|
|
231
|
+
GetNetWorthContract,
|
|
232
|
+
CreateGoalContract,
|
|
233
|
+
CreateAccountContract,
|
|
234
|
+
AssetModel,
|
|
235
|
+
AddLiabilityContract,
|
|
236
|
+
AddAssetContract,
|
|
237
|
+
AccountModel
|
|
238
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/presentations/index.ts
|
|
2
|
+
var WealthSnapshotPresentations = [
|
|
3
|
+
"wealth-snapshot.dashboard",
|
|
4
|
+
"wealth-snapshot.accounts.list",
|
|
5
|
+
"wealth-snapshot.assets.list",
|
|
6
|
+
"wealth-snapshot.liabilities.list",
|
|
7
|
+
"wealth-snapshot.goals.list"
|
|
8
|
+
];
|
|
9
|
+
export {
|
|
10
|
+
WealthSnapshotPresentations
|
|
11
|
+
};
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// src/presentations.ts
|
|
2
|
+
import { definePresentation, StabilityEnum } from "@contractspec/lib.contracts";
|
|
3
|
+
var WealthDashboardPresentation = definePresentation({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "wealth-snapshot.dashboard",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
title: "Wealth Dashboard",
|
|
8
|
+
description: "Wealth snapshot dashboard with net worth overview",
|
|
9
|
+
domain: "finance",
|
|
10
|
+
owners: ["@wealth-snapshot"],
|
|
11
|
+
tags: ["finance", "wealth", "dashboard"],
|
|
12
|
+
stability: StabilityEnum.Experimental,
|
|
13
|
+
goal: "Overview of wealth",
|
|
14
|
+
context: "Dashboard"
|
|
15
|
+
},
|
|
16
|
+
source: {
|
|
17
|
+
type: "component",
|
|
18
|
+
framework: "react",
|
|
19
|
+
componentKey: "WealthDashboard"
|
|
20
|
+
},
|
|
21
|
+
targets: ["react", "markdown"],
|
|
22
|
+
policy: {
|
|
23
|
+
flags: ["wealth.dashboard.enabled"]
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
var AccountsListPresentation = definePresentation({
|
|
27
|
+
meta: {
|
|
28
|
+
key: "wealth-snapshot.accounts.list",
|
|
29
|
+
version: "1.0.0",
|
|
30
|
+
title: "Accounts List",
|
|
31
|
+
description: "List of financial accounts",
|
|
32
|
+
domain: "finance",
|
|
33
|
+
owners: ["@wealth-snapshot"],
|
|
34
|
+
tags: ["finance", "accounts", "list"],
|
|
35
|
+
stability: StabilityEnum.Experimental,
|
|
36
|
+
goal: "List accounts",
|
|
37
|
+
context: "Overview"
|
|
38
|
+
},
|
|
39
|
+
source: {
|
|
40
|
+
type: "component",
|
|
41
|
+
framework: "react",
|
|
42
|
+
componentKey: "AccountsList"
|
|
43
|
+
},
|
|
44
|
+
targets: ["react", "markdown"],
|
|
45
|
+
policy: {
|
|
46
|
+
flags: ["wealth.accounts.enabled"]
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
var AssetsListPresentation = definePresentation({
|
|
50
|
+
meta: {
|
|
51
|
+
key: "wealth-snapshot.assets.list",
|
|
52
|
+
version: "1.0.0",
|
|
53
|
+
title: "Assets List",
|
|
54
|
+
description: "List of assets with valuations",
|
|
55
|
+
domain: "finance",
|
|
56
|
+
owners: ["@wealth-snapshot"],
|
|
57
|
+
tags: ["finance", "assets", "list"],
|
|
58
|
+
stability: StabilityEnum.Experimental,
|
|
59
|
+
goal: "List assets",
|
|
60
|
+
context: "Overview"
|
|
61
|
+
},
|
|
62
|
+
source: {
|
|
63
|
+
type: "component",
|
|
64
|
+
framework: "react",
|
|
65
|
+
componentKey: "AssetsList"
|
|
66
|
+
},
|
|
67
|
+
targets: ["react", "markdown"],
|
|
68
|
+
policy: {
|
|
69
|
+
flags: ["wealth.assets.enabled"]
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
var LiabilitiesListPresentation = definePresentation({
|
|
73
|
+
meta: {
|
|
74
|
+
key: "wealth-snapshot.liabilities.list",
|
|
75
|
+
version: "1.0.0",
|
|
76
|
+
title: "Liabilities List",
|
|
77
|
+
description: "List of liabilities and debts",
|
|
78
|
+
domain: "finance",
|
|
79
|
+
owners: ["@wealth-snapshot"],
|
|
80
|
+
tags: ["finance", "liabilities", "list"],
|
|
81
|
+
stability: StabilityEnum.Experimental,
|
|
82
|
+
goal: "List liabilities",
|
|
83
|
+
context: "Overview"
|
|
84
|
+
},
|
|
85
|
+
source: {
|
|
86
|
+
type: "component",
|
|
87
|
+
framework: "react",
|
|
88
|
+
componentKey: "LiabilitiesList"
|
|
89
|
+
},
|
|
90
|
+
targets: ["react", "markdown"],
|
|
91
|
+
policy: {
|
|
92
|
+
flags: ["wealth.liabilities.enabled"]
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
var GoalsListPresentation = definePresentation({
|
|
96
|
+
meta: {
|
|
97
|
+
key: "wealth-snapshot.goals.list",
|
|
98
|
+
version: "1.0.0",
|
|
99
|
+
title: "Goals List",
|
|
100
|
+
description: "List of financial goals with progress",
|
|
101
|
+
domain: "finance",
|
|
102
|
+
owners: ["@wealth-snapshot"],
|
|
103
|
+
tags: ["finance", "goals", "list"],
|
|
104
|
+
stability: StabilityEnum.Experimental,
|
|
105
|
+
goal: "List goals",
|
|
106
|
+
context: "Overview"
|
|
107
|
+
},
|
|
108
|
+
source: {
|
|
109
|
+
type: "component",
|
|
110
|
+
framework: "react",
|
|
111
|
+
componentKey: "GoalsList"
|
|
112
|
+
},
|
|
113
|
+
targets: ["react", "markdown"],
|
|
114
|
+
policy: {
|
|
115
|
+
flags: ["wealth.goals.enabled"]
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
export {
|
|
119
|
+
WealthDashboardPresentation,
|
|
120
|
+
LiabilitiesListPresentation,
|
|
121
|
+
GoalsListPresentation,
|
|
122
|
+
AssetsListPresentation,
|
|
123
|
+
AccountsListPresentation
|
|
124
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/wealth-snapshot.capability.ts
|
|
2
|
+
import { defineCapability, StabilityEnum } from "@contractspec/lib.contracts";
|
|
3
|
+
var AccountsCapability = defineCapability({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "accounts",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
kind: "data",
|
|
8
|
+
stability: StabilityEnum.Experimental,
|
|
9
|
+
description: "Financial accounts tracking and aggregation",
|
|
10
|
+
owners: ["platform.finance"],
|
|
11
|
+
tags: ["accounts", "finance", "wealth"]
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
var NetWorthCapability = defineCapability({
|
|
15
|
+
meta: {
|
|
16
|
+
key: "net-worth",
|
|
17
|
+
version: "1.0.0",
|
|
18
|
+
kind: "ui",
|
|
19
|
+
stability: StabilityEnum.Experimental,
|
|
20
|
+
description: "Net worth visualization and tracking",
|
|
21
|
+
owners: ["platform.finance"],
|
|
22
|
+
tags: ["net-worth", "wealth", "dashboard"]
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var GoalsCapability = defineCapability({
|
|
26
|
+
meta: {
|
|
27
|
+
key: "goals",
|
|
28
|
+
version: "1.0.0",
|
|
29
|
+
kind: "ui",
|
|
30
|
+
stability: StabilityEnum.Experimental,
|
|
31
|
+
description: "Financial goal setting and progress tracking",
|
|
32
|
+
owners: ["platform.finance"],
|
|
33
|
+
tags: ["goals", "planning", "wealth"]
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
export {
|
|
37
|
+
NetWorthCapability,
|
|
38
|
+
GoalsCapability,
|
|
39
|
+
AccountsCapability
|
|
40
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// src/wealth-snapshot.feature.ts
|
|
2
|
+
import { defineFeature } from "@contractspec/lib.contracts";
|
|
3
|
+
var WealthSnapshotFeature = defineFeature({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "wealth-snapshot",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
title: "Wealth Snapshot",
|
|
8
|
+
description: "Mini-app for accounts, assets, liabilities, goals, and net worth.",
|
|
9
|
+
domain: "finance",
|
|
10
|
+
owners: ["@wealth-snapshot"],
|
|
11
|
+
tags: ["finance", "net-worth", "goals"],
|
|
12
|
+
stability: "experimental"
|
|
13
|
+
},
|
|
14
|
+
operations: [
|
|
15
|
+
{ key: "wealth.account.create", version: "1.0.0" },
|
|
16
|
+
{ key: "wealth.asset.add", version: "1.0.0" },
|
|
17
|
+
{ key: "wealth.liability.add", version: "1.0.0" },
|
|
18
|
+
{ key: "wealth.goal.create", version: "1.0.0" },
|
|
19
|
+
{ key: "wealth.goal.update", version: "1.0.0" },
|
|
20
|
+
{ key: "wealth.networth.get", version: "1.0.0" }
|
|
21
|
+
],
|
|
22
|
+
events: [
|
|
23
|
+
{ key: "wealth.asset.added", version: "1.0.0" },
|
|
24
|
+
{ key: "wealth.liability.added", version: "1.0.0" },
|
|
25
|
+
{ key: "wealth.goal.updated", version: "1.0.0" },
|
|
26
|
+
{ key: "wealth.networth.snapshot_created", version: "1.0.0" }
|
|
27
|
+
],
|
|
28
|
+
presentations: [
|
|
29
|
+
{ key: "wealth-snapshot.dashboard", version: "1.0.0" },
|
|
30
|
+
{ key: "wealth-snapshot.accounts.list", version: "1.0.0" },
|
|
31
|
+
{ key: "wealth-snapshot.assets.list", version: "1.0.0" },
|
|
32
|
+
{ key: "wealth-snapshot.liabilities.list", version: "1.0.0" },
|
|
33
|
+
{ key: "wealth-snapshot.goals.list", version: "1.0.0" }
|
|
34
|
+
],
|
|
35
|
+
presentationsTargets: [
|
|
36
|
+
{
|
|
37
|
+
key: "wealth-snapshot.dashboard",
|
|
38
|
+
version: "1.0.0",
|
|
39
|
+
targets: ["react", "markdown"]
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
key: "wealth-snapshot.assets.list",
|
|
43
|
+
version: "1.0.0",
|
|
44
|
+
targets: ["react", "markdown"]
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
key: "wealth-snapshot.liabilities.list",
|
|
48
|
+
version: "1.0.0",
|
|
49
|
+
targets: ["react", "markdown"]
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: "wealth-snapshot.goals.list",
|
|
53
|
+
version: "1.0.0",
|
|
54
|
+
targets: ["react", "markdown"]
|
|
55
|
+
}
|
|
56
|
+
],
|
|
57
|
+
capabilities: {
|
|
58
|
+
requires: [
|
|
59
|
+
{ key: "identity", version: "1.0.0" },
|
|
60
|
+
{ key: "audit-trail", version: "1.0.0" },
|
|
61
|
+
{ key: "notifications", version: "1.0.0" }
|
|
62
|
+
],
|
|
63
|
+
provides: [
|
|
64
|
+
{ key: "accounts", version: "1.0.0" },
|
|
65
|
+
{ key: "net-worth", version: "1.0.0" },
|
|
66
|
+
{ key: "goals", version: "1.0.0" }
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
WealthSnapshotFeature
|
|
72
|
+
};
|
package/dist/docs/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import './wealth-snapshot.docblock';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/docs/index.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC"}
|
package/dist/docs/index.js
CHANGED
|
@@ -1 +1,94 @@
|
|
|
1
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/docs/wealth-snapshot.docblock.ts
|
|
3
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
|
|
4
|
+
var wealthSnapshotDocBlocks = [
|
|
5
|
+
{
|
|
6
|
+
id: "docs.examples.wealth-snapshot",
|
|
7
|
+
title: "Wealth Snapshot",
|
|
8
|
+
summary: "Simple wealth overview with accounts, assets, liabilities, goals, and net-worth snapshots.",
|
|
9
|
+
kind: "reference",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
route: "/docs/examples/wealth-snapshot",
|
|
12
|
+
tags: ["finance", "net-worth", "goals"],
|
|
13
|
+
body: `## Features
|
|
14
|
+
|
|
15
|
+
- Accounts with balances/currencies.
|
|
16
|
+
- Assets & liabilities categorized for net worth.
|
|
17
|
+
- Goals with target amounts/dates and status.
|
|
18
|
+
- Net worth snapshots for charting; events emitted for analytics.
|
|
19
|
+
|
|
20
|
+
## Modules reused
|
|
21
|
+
- Identity/RBAC for scoping to household/org
|
|
22
|
+
- Notifications for threshold crossings/goal reminders
|
|
23
|
+
- Audit trail for financial changes
|
|
24
|
+
|
|
25
|
+
## Presentations
|
|
26
|
+
- Dashboard, accounts list, assets list, liabilities list, goals list (React + Markdown targets).
|
|
27
|
+
`
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: "docs.examples.wealth-snapshot.goal",
|
|
31
|
+
title: "Wealth Snapshot \u2014 Goal",
|
|
32
|
+
summary: "Why this personal/household finance template exists.",
|
|
33
|
+
kind: "goal",
|
|
34
|
+
visibility: "public",
|
|
35
|
+
route: "/docs/examples/wealth-snapshot/goal",
|
|
36
|
+
tags: ["finance", "goal"],
|
|
37
|
+
body: `## Why it matters
|
|
38
|
+
- Provides a regenerable net-worth and goals view without bespoke finance code.
|
|
39
|
+
- Keeps accounts/assets/liabilities/goals consistent across surfaces with PII care.
|
|
40
|
+
|
|
41
|
+
## Business/Product goal
|
|
42
|
+
- Deliver clear net-worth visibility, goal tracking, and alerting for thresholds.
|
|
43
|
+
- Support safe regeneration while keeping currency/units explicit.
|
|
44
|
+
|
|
45
|
+
## Success criteria
|
|
46
|
+
- Spec changes to assets/liabilities/goals regenerate UI/API/events cleanly.
|
|
47
|
+
- PII and sensitive values are marked and redacted where needed.`
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: "docs.examples.wealth-snapshot.usage",
|
|
51
|
+
title: "Wealth Snapshot \u2014 Usage",
|
|
52
|
+
summary: "How to seed, extend, and regenerate wealth tracking safely.",
|
|
53
|
+
kind: "usage",
|
|
54
|
+
visibility: "public",
|
|
55
|
+
route: "/docs/examples/wealth-snapshot/usage",
|
|
56
|
+
tags: ["finance", "usage"],
|
|
57
|
+
body: `## Setup
|
|
58
|
+
1) Seed (if provided) or add accounts/assets/liabilities/goals via UI.
|
|
59
|
+
2) Configure Notifications for goal reminders/threshold alerts; Audit for changes.
|
|
60
|
+
|
|
61
|
+
## Extend & regenerate
|
|
62
|
+
1) Adjust schemas for asset classes, liability terms, goal metrics; keep currency/units explicit.
|
|
63
|
+
2) Regenerate to update dashboards and events; mark PII paths (account numbers, holder names).
|
|
64
|
+
3) Use Feature Flags to trial new indicators or alerting rules.
|
|
65
|
+
|
|
66
|
+
## Guardrails
|
|
67
|
+
- Emit events for asset/liability/goal changes; log in Audit Trail.
|
|
68
|
+
- Redact sensitive identifiers in presentations.
|
|
69
|
+
- Keep calculations (net worth) transparent and driven by spec fields.`
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
id: "docs.examples.wealth-snapshot.constraints",
|
|
73
|
+
title: "Wealth Snapshot \u2014 Constraints & Safety",
|
|
74
|
+
summary: "Internal guardrails for finance data, PII, and regeneration semantics.",
|
|
75
|
+
kind: "reference",
|
|
76
|
+
visibility: "internal",
|
|
77
|
+
route: "/docs/examples/wealth-snapshot/constraints",
|
|
78
|
+
tags: ["finance", "constraints", "internal"],
|
|
79
|
+
body: `## Constraints
|
|
80
|
+
- Net worth and goal calculations must stay spec-driven; avoid hidden math.
|
|
81
|
+
- Events to emit: asset.created/updated, liability.created/updated, goal.created/updated, snapshot.recorded.
|
|
82
|
+
- Regeneration should not alter currency/unit semantics without explicit spec change.
|
|
83
|
+
|
|
84
|
+
## PII & Sensitivity
|
|
85
|
+
- Mark account identifiers, holder names, and addresses as PII; redact in presentations.
|
|
86
|
+
- Avoid exposing raw balances in MCP/web without policy checks; prefer summaries.
|
|
87
|
+
|
|
88
|
+
## Verification
|
|
89
|
+
- Add fixtures for currency/unit changes and snapshot calculations.
|
|
90
|
+
- Ensure Audit Trail covers all financial mutations; Notifications optional for goals/thresholds.
|
|
91
|
+
- Use Feature Flags for new indicators/alert rules; default safe/off.`
|
|
92
|
+
}
|
|
93
|
+
];
|
|
94
|
+
registerDocBlocks(wealthSnapshotDocBlocks);
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=wealth-snapshot.docblock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wealth-snapshot.docblock.d.ts","sourceRoot":"","sources":["../../src/docs/wealth-snapshot.docblock.ts"],"names":[],"mappings":""}
|