@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.
Files changed (72) hide show
  1. package/dist/browser/docs/index.js +93 -0
  2. package/dist/browser/docs/wealth-snapshot.docblock.js +93 -0
  3. package/dist/browser/entities/index.js +191 -0
  4. package/dist/browser/events.js +111 -0
  5. package/dist/browser/example.js +42 -0
  6. package/dist/browser/handlers/index.js +5 -0
  7. package/dist/browser/index.js +885 -0
  8. package/dist/browser/operations/index.js +238 -0
  9. package/dist/browser/presentations/index.js +11 -0
  10. package/dist/browser/presentations.js +124 -0
  11. package/dist/browser/wealth-snapshot.capability.js +40 -0
  12. package/dist/browser/wealth-snapshot.feature.js +72 -0
  13. package/dist/docs/index.d.ts +2 -1
  14. package/dist/docs/index.d.ts.map +1 -0
  15. package/dist/docs/index.js +94 -1
  16. package/dist/docs/wealth-snapshot.docblock.d.ts +2 -1
  17. package/dist/docs/wealth-snapshot.docblock.d.ts.map +1 -0
  18. package/dist/docs/wealth-snapshot.docblock.js +45 -55
  19. package/dist/entities/index.d.ts +120 -125
  20. package/dist/entities/index.d.ts.map +1 -1
  21. package/dist/entities/index.js +181 -219
  22. package/dist/events.d.ts +167 -173
  23. package/dist/events.d.ts.map +1 -1
  24. package/dist/events.js +103 -172
  25. package/dist/example.d.ts +2 -6
  26. package/dist/example.d.ts.map +1 -1
  27. package/dist/example.js +41 -54
  28. package/dist/handlers/index.d.ts +1 -4
  29. package/dist/handlers/index.d.ts.map +1 -1
  30. package/dist/handlers/index.js +5 -8
  31. package/dist/index.d.ts +12 -16
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +882 -23
  34. package/dist/node/docs/index.js +93 -0
  35. package/dist/node/docs/wealth-snapshot.docblock.js +93 -0
  36. package/dist/node/entities/index.js +191 -0
  37. package/dist/node/events.js +111 -0
  38. package/dist/node/example.js +42 -0
  39. package/dist/node/handlers/index.js +5 -0
  40. package/dist/node/index.js +885 -0
  41. package/dist/node/operations/index.js +238 -0
  42. package/dist/node/presentations/index.js +11 -0
  43. package/dist/node/presentations.js +124 -0
  44. package/dist/node/wealth-snapshot.capability.js +40 -0
  45. package/dist/node/wealth-snapshot.feature.js +72 -0
  46. package/dist/operations/index.d.ts +392 -398
  47. package/dist/operations/index.d.ts.map +1 -1
  48. package/dist/operations/index.js +237 -425
  49. package/dist/presentations/index.d.ts +1 -4
  50. package/dist/presentations/index.d.ts.map +1 -1
  51. package/dist/presentations/index.js +11 -11
  52. package/dist/presentations.d.ts +5 -10
  53. package/dist/presentations.d.ts.map +1 -1
  54. package/dist/presentations.js +120 -127
  55. package/dist/wealth-snapshot.capability.d.ts +3 -8
  56. package/dist/wealth-snapshot.capability.d.ts.map +1 -1
  57. package/dist/wealth-snapshot.capability.js +41 -46
  58. package/dist/wealth-snapshot.feature.d.ts +1 -6
  59. package/dist/wealth-snapshot.feature.d.ts.map +1 -1
  60. package/dist/wealth-snapshot.feature.js +71 -139
  61. package/package.json +144 -37
  62. package/dist/docs/wealth-snapshot.docblock.js.map +0 -1
  63. package/dist/entities/index.js.map +0 -1
  64. package/dist/events.js.map +0 -1
  65. package/dist/example.js.map +0 -1
  66. package/dist/handlers/index.js.map +0 -1
  67. package/dist/index.js.map +0 -1
  68. package/dist/operations/index.js.map +0 -1
  69. package/dist/presentations/index.js.map +0 -1
  70. package/dist/presentations.js.map +0 -1
  71. package/dist/wealth-snapshot.capability.js.map +0 -1
  72. package/dist/wealth-snapshot.feature.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/operations/index.ts"],"mappings":";;;;cAKa,YAAA,4BAAY,WAAA;;UAUvB,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAEW,UAAA,4BAAU,WAAA;;UAUrB,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAEW,cAAA,4BAAc,WAAA;;UAUzB,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAEW,SAAA,4BAAS,WAAA;;UAWpB,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;cAEW,qBAAA,4BAAqB,WAAA;;;;;;;;;;;;;;;;;;;;;;cAuFrB,qBAAA,+BAAqB,aAAA,2BAAA,WAAA;;UAahC,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;UAbgC,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAerB,gBAAA,+BAAgB,aAAA,2BAAA,WAAA;;UAa3B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;UAb2B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAehB,oBAAA,+BAAoB,aAAA,2BAAA,WAAA;;UAa/B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;UAb+B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;cAepB,kBAAA,+BAAkB,aAAA,2BAAA,WAAA;;UAa7B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;UAb6B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;cAelB,kBAAA,+BAAkB,aAAA,2BAAA,WAAA;;UAa7B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;UAb6B,yBAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;cAgBlB,mBAAA,+BAAmB,aAAA,2BAAA,WAAA;;UA2B9B,yBAAA,CAAA,SAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/operations/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;EAUvB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;EAUrB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;EAUzB,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;EAWpB,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;EAahC,CAAC;AA0EH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAahC,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAa3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAa/B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAa7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAa7B,CAAC;AAGH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA2B9B,CAAC"}
@@ -1,427 +1,239 @@
1
+ // @bun
2
+ // src/operations/index.ts
1
3
  import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
4
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts";
3
-
4
- //#region src/operations/index.ts
5
- const OWNERS = ["examples.wealth-snapshot"];
6
- const AccountModel = defineSchemaModel({
7
- name: "Account",
8
- description: "Account model",
9
- fields: {
10
- id: {
11
- type: ScalarTypeEnum.String_unsecure(),
12
- isOptional: false
13
- },
14
- name: {
15
- type: ScalarTypeEnum.String_unsecure(),
16
- isOptional: false
17
- },
18
- type: {
19
- type: ScalarTypeEnum.String_unsecure(),
20
- isOptional: false
21
- },
22
- currency: {
23
- type: ScalarTypeEnum.String_unsecure(),
24
- isOptional: false
25
- },
26
- balance: {
27
- type: ScalarTypeEnum.Float_unsecure(),
28
- isOptional: false
29
- }
30
- }
31
- });
32
- const AssetModel = defineSchemaModel({
33
- name: "Asset",
34
- description: "Asset model",
35
- fields: {
36
- id: {
37
- type: ScalarTypeEnum.String_unsecure(),
38
- isOptional: false
39
- },
40
- name: {
41
- type: ScalarTypeEnum.String_unsecure(),
42
- isOptional: false
43
- },
44
- category: {
45
- type: ScalarTypeEnum.String_unsecure(),
46
- isOptional: false
47
- },
48
- value: {
49
- type: ScalarTypeEnum.Float_unsecure(),
50
- isOptional: false
51
- },
52
- currency: {
53
- type: ScalarTypeEnum.String_unsecure(),
54
- isOptional: false
55
- }
56
- }
57
- });
58
- const LiabilityModel = defineSchemaModel({
59
- name: "Liability",
60
- description: "Liability model",
61
- fields: {
62
- id: {
63
- type: ScalarTypeEnum.String_unsecure(),
64
- isOptional: false
65
- },
66
- name: {
67
- type: ScalarTypeEnum.String_unsecure(),
68
- isOptional: false
69
- },
70
- category: {
71
- type: ScalarTypeEnum.String_unsecure(),
72
- isOptional: false
73
- },
74
- balance: {
75
- type: ScalarTypeEnum.Float_unsecure(),
76
- isOptional: false
77
- },
78
- currency: {
79
- type: ScalarTypeEnum.String_unsecure(),
80
- isOptional: false
81
- }
82
- }
83
- });
84
- const GoalModel = defineSchemaModel({
85
- name: "Goal",
86
- description: "Goal model",
87
- fields: {
88
- id: {
89
- type: ScalarTypeEnum.String_unsecure(),
90
- isOptional: false
91
- },
92
- name: {
93
- type: ScalarTypeEnum.String_unsecure(),
94
- isOptional: false
95
- },
96
- targetAmount: {
97
- type: ScalarTypeEnum.Float_unsecure(),
98
- isOptional: false
99
- },
100
- currentAmount: {
101
- type: ScalarTypeEnum.Float_unsecure(),
102
- isOptional: false
103
- },
104
- currency: {
105
- type: ScalarTypeEnum.String_unsecure(),
106
- isOptional: false
107
- },
108
- status: {
109
- type: ScalarTypeEnum.String_unsecure(),
110
- isOptional: false
111
- }
112
- }
113
- });
114
- const NetWorthSnapshotModel = defineSchemaModel({
115
- name: "NetWorthSnapshot",
116
- description: "Net worth snapshot model",
117
- fields: {
118
- asOf: {
119
- type: ScalarTypeEnum.DateTime(),
120
- isOptional: false
121
- },
122
- totalAssets: {
123
- type: ScalarTypeEnum.Float_unsecure(),
124
- isOptional: false
125
- },
126
- totalLiabilities: {
127
- type: ScalarTypeEnum.Float_unsecure(),
128
- isOptional: false
129
- },
130
- netWorth: {
131
- type: ScalarTypeEnum.Float_unsecure(),
132
- isOptional: false
133
- },
134
- currency: {
135
- type: ScalarTypeEnum.String_unsecure(),
136
- isOptional: false
137
- }
138
- }
139
- });
140
- const CreateAccountInput = defineSchemaModel({
141
- name: "CreateAccountInput",
142
- description: "Create account input",
143
- fields: {
144
- name: {
145
- type: ScalarTypeEnum.String_unsecure(),
146
- isOptional: false
147
- },
148
- type: {
149
- type: ScalarTypeEnum.String_unsecure(),
150
- isOptional: false
151
- },
152
- currency: {
153
- type: ScalarTypeEnum.String_unsecure(),
154
- isOptional: true
155
- },
156
- balance: {
157
- type: ScalarTypeEnum.Float_unsecure(),
158
- isOptional: true
159
- },
160
- orgId: {
161
- type: ScalarTypeEnum.String_unsecure(),
162
- isOptional: false
163
- }
164
- }
165
- });
166
- const AddAssetInput = defineSchemaModel({
167
- name: "AddAssetInput",
168
- description: "Add asset input",
169
- fields: {
170
- accountId: {
171
- type: ScalarTypeEnum.String_unsecure(),
172
- isOptional: true
173
- },
174
- name: {
175
- type: ScalarTypeEnum.String_unsecure(),
176
- isOptional: false
177
- },
178
- category: {
179
- type: ScalarTypeEnum.String_unsecure(),
180
- isOptional: false
181
- },
182
- value: {
183
- type: ScalarTypeEnum.Float_unsecure(),
184
- isOptional: false
185
- },
186
- currency: {
187
- type: ScalarTypeEnum.String_unsecure(),
188
- isOptional: true
189
- },
190
- orgId: {
191
- type: ScalarTypeEnum.String_unsecure(),
192
- isOptional: false
193
- }
194
- }
195
- });
196
- const AddLiabilityInput = defineSchemaModel({
197
- name: "AddLiabilityInput",
198
- description: "Add liability input",
199
- fields: {
200
- accountId: {
201
- type: ScalarTypeEnum.String_unsecure(),
202
- isOptional: true
203
- },
204
- name: {
205
- type: ScalarTypeEnum.String_unsecure(),
206
- isOptional: false
207
- },
208
- category: {
209
- type: ScalarTypeEnum.String_unsecure(),
210
- isOptional: false
211
- },
212
- balance: {
213
- type: ScalarTypeEnum.Float_unsecure(),
214
- isOptional: false
215
- },
216
- currency: {
217
- type: ScalarTypeEnum.String_unsecure(),
218
- isOptional: true
219
- },
220
- orgId: {
221
- type: ScalarTypeEnum.String_unsecure(),
222
- isOptional: false
223
- }
224
- }
225
- });
226
- const UpdateGoalInput = defineSchemaModel({
227
- name: "UpdateGoalInput",
228
- description: "Update goal progress",
229
- fields: {
230
- goalId: {
231
- type: ScalarTypeEnum.String_unsecure(),
232
- isOptional: false
233
- },
234
- currentAmount: {
235
- type: ScalarTypeEnum.Float_unsecure(),
236
- isOptional: false
237
- },
238
- status: {
239
- type: ScalarTypeEnum.String_unsecure(),
240
- isOptional: true
241
- }
242
- }
243
- });
244
- const CreateGoalInput = defineSchemaModel({
245
- name: "CreateGoalInput",
246
- description: "Create goal input",
247
- fields: {
248
- name: {
249
- type: ScalarTypeEnum.String_unsecure(),
250
- isOptional: false
251
- },
252
- targetAmount: {
253
- type: ScalarTypeEnum.Float_unsecure(),
254
- isOptional: false
255
- },
256
- currency: {
257
- type: ScalarTypeEnum.String_unsecure(),
258
- isOptional: true
259
- },
260
- targetDate: {
261
- type: ScalarTypeEnum.DateTime(),
262
- isOptional: true
263
- },
264
- orgId: {
265
- type: ScalarTypeEnum.String_unsecure(),
266
- isOptional: false
267
- }
268
- }
269
- });
270
- const NetWorthQueryInput = defineSchemaModel({
271
- name: "NetWorthQueryInput",
272
- description: "Filter for net worth snapshots",
273
- fields: {
274
- orgId: {
275
- type: ScalarTypeEnum.String_unsecure(),
276
- isOptional: false
277
- },
278
- from: {
279
- type: ScalarTypeEnum.DateTime(),
280
- isOptional: true
281
- },
282
- to: {
283
- type: ScalarTypeEnum.DateTime(),
284
- isOptional: true
285
- }
286
- }
287
- });
288
- const CreateAccountContract = defineCommand({
289
- meta: {
290
- key: "wealth.account.create",
291
- version: "1.0.0",
292
- stability: "stable",
293
- owners: [...OWNERS],
294
- tags: [
295
- "wealth",
296
- "account",
297
- "create"
298
- ],
299
- description: "Create a financial account.",
300
- goal: "Track account balances.",
301
- context: "Onboarding/import."
302
- },
303
- io: {
304
- input: CreateAccountInput,
305
- output: AccountModel
306
- },
307
- policy: { auth: "user" }
308
- });
309
- const AddAssetContract = defineCommand({
310
- meta: {
311
- key: "wealth.asset.add",
312
- version: "1.0.0",
313
- stability: "stable",
314
- owners: [...OWNERS],
315
- tags: [
316
- "wealth",
317
- "asset",
318
- "add"
319
- ],
320
- description: "Add an asset position.",
321
- goal: "Track holdings.",
322
- context: "Asset onboarding/update."
323
- },
324
- io: {
325
- input: AddAssetInput,
326
- output: AssetModel
327
- },
328
- policy: { auth: "user" }
329
- });
330
- const AddLiabilityContract = defineCommand({
331
- meta: {
332
- key: "wealth.liability.add",
333
- version: "1.0.0",
334
- stability: "stable",
335
- owners: [...OWNERS],
336
- tags: [
337
- "wealth",
338
- "liability",
339
- "add"
340
- ],
341
- description: "Add a liability.",
342
- goal: "Track debts.",
343
- context: "Debt onboarding/update."
344
- },
345
- io: {
346
- input: AddLiabilityInput,
347
- output: LiabilityModel
348
- },
349
- policy: { auth: "user" }
350
- });
351
- const CreateGoalContract = defineCommand({
352
- meta: {
353
- key: "wealth.goal.create",
354
- version: "1.0.0",
355
- stability: "stable",
356
- owners: [...OWNERS],
357
- tags: [
358
- "wealth",
359
- "goal",
360
- "create"
361
- ],
362
- description: "Create a financial goal.",
363
- goal: "Track progress toward goals.",
364
- context: "Planning."
365
- },
366
- io: {
367
- input: CreateGoalInput,
368
- output: GoalModel
369
- },
370
- policy: { auth: "user" }
371
- });
372
- const UpdateGoalContract = defineCommand({
373
- meta: {
374
- key: "wealth.goal.update",
375
- version: "1.0.0",
376
- stability: "stable",
377
- owners: [...OWNERS],
378
- tags: [
379
- "wealth",
380
- "goal",
381
- "update"
382
- ],
383
- description: "Update goal progress.",
384
- goal: "Keep progress current.",
385
- context: "Periodic update."
386
- },
387
- io: {
388
- input: UpdateGoalInput,
389
- output: GoalModel
390
- },
391
- policy: { auth: "user" }
392
- });
393
- const GetNetWorthContract = defineQuery({
394
- meta: {
395
- key: "wealth.networth.get",
396
- version: "1.0.0",
397
- stability: "stable",
398
- owners: [...OWNERS],
399
- tags: ["wealth", "networth"],
400
- description: "Get net worth snapshots for a period.",
401
- goal: "Render charts and indicators.",
402
- context: "Dashboard."
403
- },
404
- io: {
405
- input: NetWorthQueryInput,
406
- output: defineSchemaModel({
407
- name: "NetWorthQueryOutput",
408
- description: "Snapshots + latest indicators",
409
- fields: {
410
- snapshots: {
411
- type: NetWorthSnapshotModel,
412
- isArray: true,
413
- isOptional: false
414
- },
415
- latest: {
416
- type: NetWorthSnapshotModel,
417
- isOptional: true
418
- }
419
- }
420
- })
421
- },
422
- policy: { auth: "user" }
423
- });
424
-
425
- //#endregion
426
- export { AccountModel, AddAssetContract, AddLiabilityContract, AssetModel, CreateAccountContract, CreateGoalContract, GetNetWorthContract, GoalModel, LiabilityModel, NetWorthSnapshotModel, UpdateGoalContract };
427
- //# sourceMappingURL=index.js.map
5
+ var OWNERS = ["examples.wealth-snapshot"];
6
+ var AccountModel = defineSchemaModel({
7
+ name: "Account",
8
+ description: "Account model",
9
+ fields: {
10
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
11
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
12
+ type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
13
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
14
+ balance: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false }
15
+ }
16
+ });
17
+ var AssetModel = defineSchemaModel({
18
+ name: "Asset",
19
+ description: "Asset model",
20
+ fields: {
21
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
22
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
23
+ category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
24
+ value: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
25
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
26
+ }
27
+ });
28
+ var LiabilityModel = defineSchemaModel({
29
+ name: "Liability",
30
+ description: "Liability model",
31
+ fields: {
32
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
33
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
34
+ category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
35
+ balance: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
36
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
37
+ }
38
+ });
39
+ var GoalModel = defineSchemaModel({
40
+ name: "Goal",
41
+ description: "Goal model",
42
+ fields: {
43
+ id: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
44
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
45
+ targetAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
46
+ currentAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
47
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
48
+ status: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
49
+ }
50
+ });
51
+ var NetWorthSnapshotModel = defineSchemaModel({
52
+ name: "NetWorthSnapshot",
53
+ description: "Net worth snapshot model",
54
+ fields: {
55
+ asOf: { type: ScalarTypeEnum.DateTime(), isOptional: false },
56
+ totalAssets: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
57
+ totalLiabilities: {
58
+ type: ScalarTypeEnum.Float_unsecure(),
59
+ isOptional: false
60
+ },
61
+ netWorth: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
62
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
63
+ }
64
+ });
65
+ var CreateAccountInput = defineSchemaModel({
66
+ name: "CreateAccountInput",
67
+ description: "Create account input",
68
+ fields: {
69
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
70
+ type: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
71
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
72
+ balance: { type: ScalarTypeEnum.Float_unsecure(), isOptional: true },
73
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
74
+ }
75
+ });
76
+ var AddAssetInput = defineSchemaModel({
77
+ name: "AddAssetInput",
78
+ description: "Add asset input",
79
+ fields: {
80
+ accountId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
81
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
82
+ category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
83
+ value: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
84
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
85
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
86
+ }
87
+ });
88
+ var AddLiabilityInput = defineSchemaModel({
89
+ name: "AddLiabilityInput",
90
+ description: "Add liability input",
91
+ fields: {
92
+ accountId: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
93
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
94
+ category: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
95
+ balance: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
96
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
97
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
98
+ }
99
+ });
100
+ var UpdateGoalInput = defineSchemaModel({
101
+ name: "UpdateGoalInput",
102
+ description: "Update goal progress",
103
+ fields: {
104
+ goalId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
105
+ currentAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
106
+ status: { type: ScalarTypeEnum.String_unsecure(), isOptional: true }
107
+ }
108
+ });
109
+ var CreateGoalInput = defineSchemaModel({
110
+ name: "CreateGoalInput",
111
+ description: "Create goal input",
112
+ fields: {
113
+ name: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
114
+ targetAmount: { type: ScalarTypeEnum.Float_unsecure(), isOptional: false },
115
+ currency: { type: ScalarTypeEnum.String_unsecure(), isOptional: true },
116
+ targetDate: { type: ScalarTypeEnum.DateTime(), isOptional: true },
117
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false }
118
+ }
119
+ });
120
+ var NetWorthQueryInput = defineSchemaModel({
121
+ name: "NetWorthQueryInput",
122
+ description: "Filter for net worth snapshots",
123
+ fields: {
124
+ orgId: { type: ScalarTypeEnum.String_unsecure(), isOptional: false },
125
+ from: { type: ScalarTypeEnum.DateTime(), isOptional: true },
126
+ to: { type: ScalarTypeEnum.DateTime(), isOptional: true }
127
+ }
128
+ });
129
+ var CreateAccountContract = defineCommand({
130
+ meta: {
131
+ key: "wealth.account.create",
132
+ version: "1.0.0",
133
+ stability: "stable",
134
+ owners: [...OWNERS],
135
+ tags: ["wealth", "account", "create"],
136
+ description: "Create a financial account.",
137
+ goal: "Track account balances.",
138
+ context: "Onboarding/import."
139
+ },
140
+ io: { input: CreateAccountInput, output: AccountModel },
141
+ policy: { auth: "user" }
142
+ });
143
+ var AddAssetContract = defineCommand({
144
+ meta: {
145
+ key: "wealth.asset.add",
146
+ version: "1.0.0",
147
+ stability: "stable",
148
+ owners: [...OWNERS],
149
+ tags: ["wealth", "asset", "add"],
150
+ description: "Add an asset position.",
151
+ goal: "Track holdings.",
152
+ context: "Asset onboarding/update."
153
+ },
154
+ io: { input: AddAssetInput, output: AssetModel },
155
+ policy: { auth: "user" }
156
+ });
157
+ var AddLiabilityContract = defineCommand({
158
+ meta: {
159
+ key: "wealth.liability.add",
160
+ version: "1.0.0",
161
+ stability: "stable",
162
+ owners: [...OWNERS],
163
+ tags: ["wealth", "liability", "add"],
164
+ description: "Add a liability.",
165
+ goal: "Track debts.",
166
+ context: "Debt onboarding/update."
167
+ },
168
+ io: { input: AddLiabilityInput, output: LiabilityModel },
169
+ policy: { auth: "user" }
170
+ });
171
+ var CreateGoalContract = defineCommand({
172
+ meta: {
173
+ key: "wealth.goal.create",
174
+ version: "1.0.0",
175
+ stability: "stable",
176
+ owners: [...OWNERS],
177
+ tags: ["wealth", "goal", "create"],
178
+ description: "Create a financial goal.",
179
+ goal: "Track progress toward goals.",
180
+ context: "Planning."
181
+ },
182
+ io: { input: CreateGoalInput, output: GoalModel },
183
+ policy: { auth: "user" }
184
+ });
185
+ var UpdateGoalContract = defineCommand({
186
+ meta: {
187
+ key: "wealth.goal.update",
188
+ version: "1.0.0",
189
+ stability: "stable",
190
+ owners: [...OWNERS],
191
+ tags: ["wealth", "goal", "update"],
192
+ description: "Update goal progress.",
193
+ goal: "Keep progress current.",
194
+ context: "Periodic update."
195
+ },
196
+ io: { input: UpdateGoalInput, output: GoalModel },
197
+ policy: { auth: "user" }
198
+ });
199
+ var GetNetWorthContract = defineQuery({
200
+ meta: {
201
+ key: "wealth.networth.get",
202
+ version: "1.0.0",
203
+ stability: "stable",
204
+ owners: [...OWNERS],
205
+ tags: ["wealth", "networth"],
206
+ description: "Get net worth snapshots for a period.",
207
+ goal: "Render charts and indicators.",
208
+ context: "Dashboard."
209
+ },
210
+ io: {
211
+ input: NetWorthQueryInput,
212
+ output: defineSchemaModel({
213
+ name: "NetWorthQueryOutput",
214
+ description: "Snapshots + latest indicators",
215
+ fields: {
216
+ snapshots: {
217
+ type: NetWorthSnapshotModel,
218
+ isArray: true,
219
+ isOptional: false
220
+ },
221
+ latest: { type: NetWorthSnapshotModel, isOptional: true }
222
+ }
223
+ })
224
+ },
225
+ policy: { auth: "user" }
226
+ });
227
+ export {
228
+ UpdateGoalContract,
229
+ NetWorthSnapshotModel,
230
+ LiabilityModel,
231
+ GoalModel,
232
+ GetNetWorthContract,
233
+ CreateGoalContract,
234
+ CreateAccountContract,
235
+ AssetModel,
236
+ AddLiabilityContract,
237
+ AddAssetContract,
238
+ AccountModel
239
+ };