@lssm-tech/example.wealth-snapshot 3.8.5
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/LICENSE +21 -0
- package/README.md +79 -0
- package/dist/browser/docs/index.js +49 -0
- package/dist/browser/docs/wealth-snapshot.docblock.js +49 -0
- package/dist/browser/entities/index.js +1 -0
- package/dist/browser/events.js +1 -0
- package/dist/browser/example.js +1 -0
- package/dist/browser/handlers/index.js +1 -0
- package/dist/browser/index.js +49 -0
- package/dist/browser/operations/index.js +1 -0
- package/dist/browser/presentations/index.js +1 -0
- package/dist/browser/presentations.js +1 -0
- package/dist/browser/ui/WealthSnapshotPreview.js +1 -0
- package/dist/browser/ui/index.js +1 -0
- package/dist/browser/ui/wealth-snapshot-preview.data.js +1 -0
- package/dist/browser/wealth-snapshot.capability.js +1 -0
- package/dist/browser/wealth-snapshot.feature.js +1 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +50 -0
- package/dist/docs/wealth-snapshot.docblock.d.ts +1 -0
- package/dist/docs/wealth-snapshot.docblock.js +50 -0
- package/dist/entities/index.d.ts +126 -0
- package/dist/entities/index.js +2 -0
- package/dist/events.d.ts +218 -0
- package/dist/events.js +2 -0
- package/dist/example.d.ts +3 -0
- package/dist/example.js +2 -0
- package/dist/handlers/index.d.ts +4 -0
- package/dist/handlers/index.js +2 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +50 -0
- package/dist/node/docs/index.js +49 -0
- package/dist/node/docs/wealth-snapshot.docblock.js +49 -0
- package/dist/node/entities/index.js +1 -0
- package/dist/node/events.js +1 -0
- package/dist/node/example.js +1 -0
- package/dist/node/handlers/index.js +1 -0
- package/dist/node/index.js +49 -0
- package/dist/node/operations/index.js +1 -0
- package/dist/node/presentations/index.js +1 -0
- package/dist/node/presentations.js +1 -0
- package/dist/node/ui/WealthSnapshotPreview.js +1 -0
- package/dist/node/ui/index.js +1 -0
- package/dist/node/ui/wealth-snapshot-preview.data.js +1 -0
- package/dist/node/wealth-snapshot.capability.js +1 -0
- package/dist/node/wealth-snapshot.feature.js +1 -0
- package/dist/operations/index.d.ts +403 -0
- package/dist/operations/index.js +2 -0
- package/dist/presentations/index.d.ts +1 -0
- package/dist/presentations/index.js +2 -0
- package/dist/presentations.d.ts +5 -0
- package/dist/presentations.js +2 -0
- package/dist/ui/WealthSnapshotPreview.d.ts +1 -0
- package/dist/ui/WealthSnapshotPreview.js +2 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +2 -0
- package/dist/ui/wealth-snapshot-preview.data.d.ts +51 -0
- package/dist/ui/wealth-snapshot-preview.data.js +2 -0
- package/dist/wealth-snapshot.capability.d.ts +3 -0
- package/dist/wealth-snapshot.capability.js +2 -0
- package/dist/wealth-snapshot.feature.d.ts +1 -0
- package/dist/wealth-snapshot.feature.js +2 -0
- package/package.json +253 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineEvent as j,StabilityEnum as k}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as q,ScalarTypeEnum as g}from"@contractspec/lib.schema";var w=q({name:"AssetEventPayload",description:"Payload for asset events",fields:{assetId:{type:g.String_unsecure(),isOptional:!1},category:{type:g.String_unsecure(),isOptional:!1},value:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1},orgId:{type:g.String_unsecure(),isOptional:!1},timestamp:{type:g.DateTime(),isOptional:!1}}}),x=q({name:"LiabilityEventPayload",description:"Payload for liability events",fields:{liabilityId:{type:g.String_unsecure(),isOptional:!1},category:{type:g.String_unsecure(),isOptional:!1},balance:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1},orgId:{type:g.String_unsecure(),isOptional:!1},timestamp:{type:g.DateTime(),isOptional:!1}}}),z=q({name:"GoalEventPayload",description:"Payload for goal events",fields:{goalId:{type:g.String_unsecure(),isOptional:!1},status:{type:g.String_unsecure(),isOptional:!1},currentAmount:{type:g.Float_unsecure(),isOptional:!1},targetAmount:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1},orgId:{type:g.String_unsecure(),isOptional:!1},timestamp:{type:g.DateTime(),isOptional:!1}}}),B=j({meta:{key:"wealth.asset.added",version:"1.0.0",description:"An asset was added or updated.",stability:k.Experimental,owners:[],tags:[]},payload:w}),D=j({meta:{key:"wealth.liability.added",version:"1.0.0",description:"A liability was added or updated.",stability:k.Experimental,owners:[],tags:[]},payload:x}),F=j({meta:{key:"wealth.goal.updated",version:"1.0.0",description:"A goal was updated.",stability:k.Experimental,owners:[],tags:[]},payload:z}),H=j({meta:{key:"wealth.networth.snapshot_created",version:"1.0.0",description:"A net worth snapshot was generated.",stability:k.Experimental,owners:[],tags:[]},payload:q({name:"NetWorthSnapshotEventPayload",description:"Net worth snapshot payload",fields:{netWorth:{type:g.Float_unsecure(),isOptional:!1},totalAssets:{type:g.Float_unsecure(),isOptional:!1},totalLiabilities:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1},orgId:{type:g.String_unsecure(),isOptional:!1},asOf:{type:g.DateTime(),isOptional:!1}}})}),K={AssetAddedEvent:B,LiabilityAddedEvent:D,GoalUpdatedEvent:F,NetWorthSnapshotCreatedEvent:H};export{K as WealthSnapshotEvents,H as NetWorthSnapshotCreatedEvent,D as LiabilityAddedEvent,F as GoalUpdatedEvent,B as AssetAddedEvent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineExample as g}from"@contractspec/lib.contracts-spec/examples";var j=g({meta:{key:"examples.wealth-snapshot",version:"1.0.0",title:"Wealth Snapshot",description:"Wealth Snapshot mini-app for accounts, assets, liabilities, and goals",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","wealth-snapshot"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.wealth-snapshot"}}),u=j;export{u as default,j as ExamplesWealthSnapshotExample};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function b(){}export{b as registerWealthSnapshotHandlers};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import{registerDocBlocks as B}from"@contractspec/lib.contracts-spec/docs";var Q=[{id:"docs.examples.wealth-snapshot",title:"Wealth Snapshot",summary:"Simple wealth overview with accounts, assets, liabilities, goals, and net-worth snapshots.",kind:"reference",visibility:"public",route:"/docs/examples/wealth-snapshot",tags:["finance","net-worth","goals"],body:`## Features
|
|
2
|
+
|
|
3
|
+
- Accounts with balances/currencies.
|
|
4
|
+
- Assets & liabilities categorized for net worth.
|
|
5
|
+
- Goals with target amounts/dates and status.
|
|
6
|
+
- Net worth snapshots for charting; events emitted for analytics.
|
|
7
|
+
|
|
8
|
+
## Modules reused
|
|
9
|
+
- Identity/RBAC for scoping to household/org
|
|
10
|
+
- Notifications for threshold crossings/goal reminders
|
|
11
|
+
- Audit trail for financial changes
|
|
12
|
+
|
|
13
|
+
## Presentations
|
|
14
|
+
- Dashboard, accounts list, assets list, liabilities list, goals list (React + Markdown targets).
|
|
15
|
+
`},{id:"docs.examples.wealth-snapshot.goal",title:"Wealth Snapshot — Goal",summary:"Why this personal/household finance template exists.",kind:"goal",visibility:"public",route:"/docs/examples/wealth-snapshot/goal",tags:["finance","goal"],body:`## Why it matters
|
|
16
|
+
- Provides a regenerable net-worth and goals view without bespoke finance code.
|
|
17
|
+
- Keeps accounts/assets/liabilities/goals consistent across surfaces with PII care.
|
|
18
|
+
|
|
19
|
+
## Business/Product goal
|
|
20
|
+
- Deliver clear net-worth visibility, goal tracking, and alerting for thresholds.
|
|
21
|
+
- Support safe regeneration while keeping currency/units explicit.
|
|
22
|
+
|
|
23
|
+
## Success criteria
|
|
24
|
+
- Spec changes to assets/liabilities/goals regenerate UI/API/events cleanly.
|
|
25
|
+
- PII and sensitive values are marked and redacted where needed.`},{id:"docs.examples.wealth-snapshot.usage",title:"Wealth Snapshot — Usage",summary:"How to seed, extend, and regenerate wealth tracking safely.",kind:"usage",visibility:"public",route:"/docs/examples/wealth-snapshot/usage",tags:["finance","usage"],body:`## Setup
|
|
26
|
+
1) Seed (if provided) or add accounts/assets/liabilities/goals via UI.
|
|
27
|
+
2) Configure Notifications for goal reminders/threshold alerts; Audit for changes.
|
|
28
|
+
|
|
29
|
+
## Extend & regenerate
|
|
30
|
+
1) Adjust schemas for asset classes, liability terms, goal metrics; keep currency/units explicit.
|
|
31
|
+
2) Regenerate to update dashboards and events; mark PII paths (account numbers, holder names).
|
|
32
|
+
3) Use Feature Flags to trial new indicators or alerting rules.
|
|
33
|
+
|
|
34
|
+
## Guardrails
|
|
35
|
+
- Emit events for asset/liability/goal changes; log in Audit Trail.
|
|
36
|
+
- Redact sensitive identifiers in presentations.
|
|
37
|
+
- Keep calculations (net worth) transparent and driven by spec fields.`},{id:"docs.examples.wealth-snapshot.constraints",title:"Wealth Snapshot — Constraints & Safety",summary:"Internal guardrails for finance data, PII, and regeneration semantics.",kind:"reference",visibility:"internal",route:"/docs/examples/wealth-snapshot/constraints",tags:["finance","constraints","internal"],body:`## Constraints
|
|
38
|
+
- Net worth and goal calculations must stay spec-driven; avoid hidden math.
|
|
39
|
+
- Events to emit: asset.created/updated, liability.created/updated, goal.created/updated, snapshot.recorded.
|
|
40
|
+
- Regeneration should not alter currency/unit semantics without explicit spec change.
|
|
41
|
+
|
|
42
|
+
## PII & Sensitivity
|
|
43
|
+
- Mark account identifiers, holder names, and addresses as PII; redact in presentations.
|
|
44
|
+
- Avoid exposing raw balances in MCP/web without policy checks; prefer summaries.
|
|
45
|
+
|
|
46
|
+
## Verification
|
|
47
|
+
- Add fixtures for currency/unit changes and snapshot calculations.
|
|
48
|
+
- Ensure Audit Trail covers all financial mutations; Notifications optional for goals/thresholds.
|
|
49
|
+
- Use Feature Flags for new indicators/alert rules; default safe/off.`}];B(Q);import{defineEntity as C,defineEntityEnum as L,field as i,index as g}from"@contractspec/lib.schema";var A="lssm_wealth_snapshot",R=L({name:"AccountType",schema:A,values:["CHECKING","SAVINGS","INVESTMENT","CREDIT_CARD","LOAN"],description:"Account categories for holdings and debts."}),c=L({name:"AssetCategory",schema:A,values:["CASH","EQUITY","REAL_ESTATE","CRYPTO","OTHER"],description:"Asset categories."}),v=L({name:"LiabilityCategory",schema:A,values:["CREDIT_CARD","LOAN","MORTGAGE","TAX","OTHER"],description:"Liability categories."}),K=L({name:"GoalStatus",schema:A,values:["ACTIVE","ON_TRACK","AT_RISK","OFF_TRACK","COMPLETED"],description:"Goal health/status."}),a=C({name:"Account",description:"Financial account representing holdings or debts.",schema:A,map:"account",fields:{id:i.id({description:"Account ID"}),name:i.string({description:"Account name"}),type:i.enum("AccountType",{description:"Account type"}),currency:i.string({description:"Currency code",default:'"USD"'}),balance:i.decimal({description:"Current balance"}),institution:i.string({description:"Institution",isOptional:!0}),orgId:i.string({description:"Org/household id"}),ownerId:i.string({description:"Owner user id",isOptional:!0}),createdAt:i.createdAt(),updatedAt:i.updatedAt()},enums:[R],indexes:[g.on(["orgId"]),g.on(["type"]),g.on(["ownerId"])]}),W=C({name:"Asset",description:"Individual asset position.",schema:A,map:"asset",fields:{id:i.id({description:"Asset ID"}),accountId:i.foreignKey({description:"Holding account",isOptional:!0}),name:i.string({description:"Asset name"}),category:i.enum("AssetCategory",{description:"Asset category"}),value:i.decimal({description:"Current value"}),currency:i.string({description:"Currency",default:'"USD"'}),orgId:i.string({description:"Org/household id"}),metadata:i.json({description:"Metadata",isOptional:!0}),updatedAt:i.updatedAt(),createdAt:i.createdAt(),account:i.belongsTo("Account",["accountId"],["id"],{onDelete:"SetNull"})},enums:[c],indexes:[g.on(["orgId"]),g.on(["category"])]}),f=C({name:"Liability",description:"Debt or obligation.",schema:A,map:"liability",fields:{id:i.id({description:"Liability ID"}),accountId:i.foreignKey({description:"Liability account",isOptional:!0}),name:i.string({description:"Liability name"}),category:i.enum("LiabilityCategory",{description:"Liability category"}),balance:i.decimal({description:"Outstanding balance"}),currency:i.string({description:"Currency",default:'"USD"'}),interestRate:i.decimal({description:"Interest rate (e.g., 0.05 for 5%)",isOptional:!0}),orgId:i.string({description:"Org/household id"}),metadata:i.json({description:"Metadata",isOptional:!0}),updatedAt:i.updatedAt(),createdAt:i.createdAt(),account:i.belongsTo("Account",["accountId"],["id"],{onDelete:"SetNull"})},enums:[v],indexes:[g.on(["orgId"]),g.on(["category"])]}),x=C({name:"Goal",description:"Financial goal with target amount/date.",schema:A,map:"goal",fields:{id:i.id({description:"Goal ID"}),name:i.string({description:"Goal name"}),targetAmount:i.decimal({description:"Target amount"}),currentAmount:i.decimal({description:"Current progress amount",default:0}),currency:i.string({description:"Currency",default:'"USD"'}),targetDate:i.dateTime({description:"Target completion date",isOptional:!0}),status:i.enum("GoalStatus",{description:"Goal status",default:"ACTIVE"}),orgId:i.string({description:"Org/household id"}),ownerId:i.string({description:"Owner user id",isOptional:!0}),createdAt:i.createdAt(),updatedAt:i.updatedAt()},enums:[K],indexes:[g.on(["orgId"]),g.on(["status"]),g.on(["targetDate"])]}),M=C({name:"NetWorthSnapshot",description:"Aggregated net worth snapshot for a date.",schema:A,map:"networth_snapshot",fields:{id:i.id({description:"Snapshot ID"}),asOf:i.dateTime({description:"Snapshot date"}),totalAssets:i.decimal({description:"Total assets"}),totalLiabilities:i.decimal({description:"Total liabilities"}),netWorth:i.decimal({description:"Net worth"}),currency:i.string({description:"Currency",default:'"USD"'}),orgId:i.string({description:"Org/household id"}),createdAt:i.createdAt()},indexes:[g.unique(["orgId","asOf"],{name:"networth_unique"})]}),l=[a,W,f,x,M],$={moduleId:"@contractspec/example.wealth-snapshot",entities:l,enums:[R,c,v,K]};import{defineEvent as b,StabilityEnum as h}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as _,ScalarTypeEnum as o}from"@contractspec/lib.schema";var j=_({name:"AssetEventPayload",description:"Payload for asset events",fields:{assetId:{type:o.String_unsecure(),isOptional:!1},category:{type:o.String_unsecure(),isOptional:!1},value:{type:o.Float_unsecure(),isOptional:!1},currency:{type:o.String_unsecure(),isOptional:!1},orgId:{type:o.String_unsecure(),isOptional:!1},timestamp:{type:o.DateTime(),isOptional:!1}}}),y=_({name:"LiabilityEventPayload",description:"Payload for liability events",fields:{liabilityId:{type:o.String_unsecure(),isOptional:!1},category:{type:o.String_unsecure(),isOptional:!1},balance:{type:o.Float_unsecure(),isOptional:!1},currency:{type:o.String_unsecure(),isOptional:!1},orgId:{type:o.String_unsecure(),isOptional:!1},timestamp:{type:o.DateTime(),isOptional:!1}}}),m=_({name:"GoalEventPayload",description:"Payload for goal events",fields:{goalId:{type:o.String_unsecure(),isOptional:!1},status:{type:o.String_unsecure(),isOptional:!1},currentAmount:{type:o.Float_unsecure(),isOptional:!1},targetAmount:{type:o.Float_unsecure(),isOptional:!1},currency:{type:o.String_unsecure(),isOptional:!1},orgId:{type:o.String_unsecure(),isOptional:!1},timestamp:{type:o.DateTime(),isOptional:!1}}}),T=b({meta:{key:"wealth.asset.added",version:"1.0.0",description:"An asset was added or updated.",stability:h.Experimental,owners:[],tags:[]},payload:j}),E=b({meta:{key:"wealth.liability.added",version:"1.0.0",description:"A liability was added or updated.",stability:h.Experimental,owners:[],tags:[]},payload:y}),S=b({meta:{key:"wealth.goal.updated",version:"1.0.0",description:"A goal was updated.",stability:h.Experimental,owners:[],tags:[]},payload:m}),tt=b({meta:{key:"wealth.networth.snapshot_created",version:"1.0.0",description:"A net worth snapshot was generated.",stability:h.Experimental,owners:[],tags:[]},payload:_({name:"NetWorthSnapshotEventPayload",description:"Net worth snapshot payload",fields:{netWorth:{type:o.Float_unsecure(),isOptional:!1},totalAssets:{type:o.Float_unsecure(),isOptional:!1},totalLiabilities:{type:o.Float_unsecure(),isOptional:!1},currency:{type:o.String_unsecure(),isOptional:!1},orgId:{type:o.String_unsecure(),isOptional:!1},asOf:{type:o.DateTime(),isOptional:!1}}})}),Nt={AssetAddedEvent:T,LiabilityAddedEvent:E,GoalUpdatedEvent:S,NetWorthSnapshotCreatedEvent:tt};import{defineExample as it}from"@contractspec/lib.contracts-spec/examples";var ot=it({meta:{key:"examples.wealth-snapshot",version:"1.0.0",title:"Wealth Snapshot",description:"Wealth Snapshot mini-app for accounts, assets, liabilities, and goals",kind:"template",visibility:"experimental",stability:"experimental",owners:["@contractspec-core"],tags:["package","examples","wealth-snapshot"]},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["playground","specs"]},studio:{enabled:!1,installable:!1},mcp:{enabled:!1}},entrypoints:{packageName:"@contractspec/example.wealth-snapshot"}}),st=ot;function qt(){}import{defineCommand as D,defineQuery as et}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as d,ScalarTypeEnum as t}from"@contractspec/lib.schema";var O=["examples.wealth-snapshot"],rt=d({name:"Account",description:"Account model",fields:{id:{type:t.String_unsecure(),isOptional:!1},name:{type:t.String_unsecure(),isOptional:!1},type:{type:t.String_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!1},balance:{type:t.Float_unsecure(),isOptional:!1}}}),nt=d({name:"Asset",description:"Asset model",fields:{id:{type:t.String_unsecure(),isOptional:!1},name:{type:t.String_unsecure(),isOptional:!1},category:{type:t.String_unsecure(),isOptional:!1},value:{type:t.Float_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!1}}}),dt=d({name:"Liability",description:"Liability model",fields:{id:{type:t.String_unsecure(),isOptional:!1},name:{type:t.String_unsecure(),isOptional:!1},category:{type:t.String_unsecure(),isOptional:!1},balance:{type:t.Float_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!1}}}),N=d({name:"Goal",description:"Goal model",fields:{id:{type:t.String_unsecure(),isOptional:!1},name:{type:t.String_unsecure(),isOptional:!1},targetAmount:{type:t.Float_unsecure(),isOptional:!1},currentAmount:{type:t.Float_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!1},status:{type:t.String_unsecure(),isOptional:!1}}}),p=d({name:"NetWorthSnapshot",description:"Net worth snapshot model",fields:{asOf:{type:t.DateTime(),isOptional:!1},totalAssets:{type:t.Float_unsecure(),isOptional:!1},totalLiabilities:{type:t.Float_unsecure(),isOptional:!1},netWorth:{type:t.Float_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!1}}}),gt=d({name:"CreateAccountInput",description:"Create account input",fields:{name:{type:t.String_unsecure(),isOptional:!1},type:{type:t.String_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!0},balance:{type:t.Float_unsecure(),isOptional:!0},orgId:{type:t.String_unsecure(),isOptional:!1}}}),At=d({name:"AddAssetInput",description:"Add asset input",fields:{accountId:{type:t.String_unsecure(),isOptional:!0},name:{type:t.String_unsecure(),isOptional:!1},category:{type:t.String_unsecure(),isOptional:!1},value:{type:t.Float_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!0},orgId:{type:t.String_unsecure(),isOptional:!1}}}),It=d({name:"AddLiabilityInput",description:"Add liability input",fields:{accountId:{type:t.String_unsecure(),isOptional:!0},name:{type:t.String_unsecure(),isOptional:!1},category:{type:t.String_unsecure(),isOptional:!1},balance:{type:t.Float_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!0},orgId:{type:t.String_unsecure(),isOptional:!1}}}),Ot=d({name:"UpdateGoalInput",description:"Update goal progress",fields:{goalId:{type:t.String_unsecure(),isOptional:!1},currentAmount:{type:t.Float_unsecure(),isOptional:!1},status:{type:t.String_unsecure(),isOptional:!0}}}),Ct=d({name:"CreateGoalInput",description:"Create goal input",fields:{name:{type:t.String_unsecure(),isOptional:!1},targetAmount:{type:t.Float_unsecure(),isOptional:!1},currency:{type:t.String_unsecure(),isOptional:!0},targetDate:{type:t.DateTime(),isOptional:!0},orgId:{type:t.String_unsecure(),isOptional:!1}}}),Dt=d({name:"NetWorthQueryInput",description:"Filter for net worth snapshots",fields:{orgId:{type:t.String_unsecure(),isOptional:!1},from:{type:t.DateTime(),isOptional:!0},to:{type:t.DateTime(),isOptional:!0}}}),kt=D({meta:{key:"wealth.account.create",version:"1.0.0",stability:"stable",owners:[...O],tags:["wealth","account","create"],description:"Create a financial account.",goal:"Track account balances.",context:"Onboarding/import."},io:{input:gt,output:rt},policy:{auth:"user"}}),Xt=D({meta:{key:"wealth.asset.add",version:"1.0.0",stability:"stable",owners:[...O],tags:["wealth","asset","add"],description:"Add an asset position.",goal:"Track holdings.",context:"Asset onboarding/update."},io:{input:At,output:nt},policy:{auth:"user"}}),zt=D({meta:{key:"wealth.liability.add",version:"1.0.0",stability:"stable",owners:[...O],tags:["wealth","liability","add"],description:"Add a liability.",goal:"Track debts.",context:"Debt onboarding/update."},io:{input:It,output:dt},policy:{auth:"user"}}),Jt=D({meta:{key:"wealth.goal.create",version:"1.0.0",stability:"stable",owners:[...O],tags:["wealth","goal","create"],description:"Create a financial goal.",goal:"Track progress toward goals.",context:"Planning."},io:{input:Ct,output:N},policy:{auth:"user"}}),Zt=D({meta:{key:"wealth.goal.update",version:"1.0.0",stability:"stable",owners:[...O],tags:["wealth","goal","update"],description:"Update goal progress.",goal:"Keep progress current.",context:"Periodic update."},io:{input:Ot,output:N},policy:{auth:"user"}}),Bt=et({meta:{key:"wealth.networth.get",version:"1.0.0",stability:"stable",owners:[...O],tags:["wealth","networth"],description:"Get net worth snapshots for a period.",goal:"Render charts and indicators.",context:"Dashboard."},io:{input:Dt,output:d({name:"NetWorthQueryOutput",description:"Snapshots + latest indicators",fields:{snapshots:{type:p,isArray:!0,isOptional:!1},latest:{type:p,isOptional:!0}}})},policy:{auth:"user"}});import{definePresentation as u,StabilityEnum as w}from"@contractspec/lib.contracts-spec";var U=u({meta:{key:"wealth-snapshot.dashboard",version:"1.0.0",title:"Wealth Dashboard",description:"Wealth snapshot dashboard with net worth overview",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","wealth","dashboard"],stability:w.Experimental,goal:"Overview of wealth",context:"Dashboard"},source:{type:"component",framework:"react",componentKey:"WealthDashboard"},targets:["react","markdown"],policy:{flags:["wealth.dashboard.enabled"]}}),V=u({meta:{key:"wealth-snapshot.accounts.list",version:"1.0.0",title:"Accounts List",description:"List of financial accounts",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","accounts","list"],stability:w.Experimental,goal:"List accounts",context:"Overview"},source:{type:"component",framework:"react",componentKey:"AccountsList"},targets:["react","markdown"],policy:{flags:["wealth.accounts.enabled"]}}),F=u({meta:{key:"wealth-snapshot.assets.list",version:"1.0.0",title:"Assets List",description:"List of assets with valuations",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","assets","list"],stability:w.Experimental,goal:"List assets",context:"Overview"},source:{type:"component",framework:"react",componentKey:"AssetsList"},targets:["react","markdown"],policy:{flags:["wealth.assets.enabled"]}}),q=u({meta:{key:"wealth-snapshot.liabilities.list",version:"1.0.0",title:"Liabilities List",description:"List of liabilities and debts",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","liabilities","list"],stability:w.Experimental,goal:"List liabilities",context:"Overview"},source:{type:"component",framework:"react",componentKey:"LiabilitiesList"},targets:["react","markdown"],policy:{flags:["wealth.liabilities.enabled"]}}),H=u({meta:{key:"wealth-snapshot.goals.list",version:"1.0.0",title:"Goals List",description:"List of financial goals with progress",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","goals","list"],stability:w.Experimental,goal:"List goals",context:"Overview"},source:{type:"component",framework:"react",componentKey:"GoalsList"},targets:["react","markdown"],policy:{flags:["wealth.goals.enabled"]}});var P=[{label:"Net worth",value:"$1.42M",tone:"positive"},{label:"Assets",value:"$1.78M",tone:"neutral"},{label:"Liabilities",value:"$360K",tone:"warning"},{label:"Goals",value:"4 active",tone:"neutral"}],Y=[{name:"Operating cash",type:"Checking",balance:"$42,400",institution:"Northstar Bank"},{name:"Brokerage",type:"Investment",balance:"$684,900",institution:"Atlas Wealth"},{name:"Primary mortgage",type:"Loan",balance:"-$312,000",institution:"Home Credit"}],k=[{name:"Emergency runway",progress:"92%",status:"On track"},{name:"Retirement bridge",progress:"68%",status:"Active"},{name:"Education reserve",progress:"41%",status:"At risk"}],X=[U,V,F,q,H].map((s)=>({key:s.meta.key,title:s.meta.title,description:s.meta.description}));import{HStack as G,VStack as I}from"@contractspec/lib.design-system/layout";import{H2 as ut,H3 as wt,Text as r}from"@contractspec/lib.design-system/typography";import{jsx as e,jsxs as n}from"react/jsx-runtime";function Lt(){return n(I,{as:"section",gap:"xl",className:"p-4 sm:p-6",children:[n(I,{gap:"sm",className:"rounded-lg border border-border bg-card p-5 shadow-sm",children:[e(r,{className:"font-semibold text-muted-foreground text-xs uppercase",children:"Wealth template"}),e(ut,{className:"font-serif text-3xl tracking-normal",children:"Wealth Snapshot"}),e(r,{className:"max-w-3xl text-muted-foreground text-sm leading-6",children:"An inline preview of the finance template contracts for accounts, assets, liabilities, goals, net-worth snapshots, and presentation surfaces."})]}),e(G,{align:"stretch",className:"gap-3 lg:flex-nowrap",children:P.map((s)=>n(I,{gap:"xs",className:"min-w-0 flex-1 rounded-lg border border-border bg-background p-4",children:[e(r,{className:"text-muted-foreground text-xs uppercase",children:s.label}),e(r,{className:"font-semibold text-2xl",children:s.value}),e(r,{className:"text-muted-foreground text-xs capitalize",children:s.tone})]},s.label))}),n(G,{align:"start",className:"gap-6 xl:flex-nowrap",children:[e(z,{title:"Household accounts",description:"Sample balances show how account and debt entities sit behind the dashboard surface.",children:Y.map((s)=>n(G,{justify:"between",wrap:"nowrap",className:"rounded-md border border-border bg-background p-3",children:[n(I,{gap:"xs",className:"min-w-0",children:[e(r,{className:"font-semibold text-sm",children:s.name}),n(r,{className:"text-muted-foreground text-xs",children:[s.type," · ",s.institution]})]}),e(r,{className:"font-semibold text-sm",children:s.balance})]},s.name))}),n(z,{title:"Goals and surfaces",description:"The example also publishes presentation specs that host apps can map to their own UI.",children:[k.map((s)=>n(I,{gap:"xs",className:"rounded-md border border-border bg-background p-3",children:[n(G,{justify:"between",wrap:"nowrap",children:[e(r,{className:"font-semibold text-sm",children:s.name}),e(r,{className:"text-muted-foreground text-xs",children:s.status})]}),n(r,{className:"text-muted-foreground text-xs",children:["Progress ",s.progress]})]},s.name)),e(I,{gap:"xs",className:"rounded-md border border-border bg-muted/40 p-3",children:X.map((s)=>e(r,{className:"text-xs",children:s.title},s.key))})]})]})]})}function z({title:s,description:J,children:Z}){return n(I,{as:"article",gap:"md",className:"min-w-0 flex-1 rounded-lg border border-border bg-card p-4 shadow-sm",children:[n(I,{as:"header",gap:"xs",children:[e(wt,{className:"font-semibold text-lg",children:s}),e(r,{className:"text-muted-foreground text-sm leading-6",children:J})]}),Z]})}import{defineFeature as bt}from"@contractspec/lib.contracts-spec/features";var ti=bt({meta:{key:"wealth-snapshot",version:"1.0.0",title:"Wealth Snapshot",description:"Mini-app for accounts, assets, liabilities, goals, and net worth.",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","net-worth","goals"],stability:"experimental"},operations:[{key:"wealth.account.create",version:"1.0.0"},{key:"wealth.asset.add",version:"1.0.0"},{key:"wealth.liability.add",version:"1.0.0"},{key:"wealth.goal.create",version:"1.0.0"},{key:"wealth.goal.update",version:"1.0.0"},{key:"wealth.networth.get",version:"1.0.0"}],events:[{key:"wealth.asset.added",version:"1.0.0"},{key:"wealth.liability.added",version:"1.0.0"},{key:"wealth.goal.updated",version:"1.0.0"},{key:"wealth.networth.snapshot_created",version:"1.0.0"}],presentations:[{key:"wealth-snapshot.dashboard",version:"1.0.0"},{key:"wealth-snapshot.accounts.list",version:"1.0.0"},{key:"wealth-snapshot.assets.list",version:"1.0.0"},{key:"wealth-snapshot.liabilities.list",version:"1.0.0"},{key:"wealth-snapshot.goals.list",version:"1.0.0"}],presentationsTargets:[{key:"wealth-snapshot.dashboard",version:"1.0.0",targets:["react","markdown"]},{key:"wealth-snapshot.assets.list",version:"1.0.0",targets:["react","markdown"]},{key:"wealth-snapshot.liabilities.list",version:"1.0.0",targets:["react","markdown"]},{key:"wealth-snapshot.goals.list",version:"1.0.0",targets:["react","markdown"]}],capabilities:{requires:[{key:"identity",version:"1.0.0"},{key:"audit-trail",version:"1.0.0"},{key:"notifications",version:"1.0.0"}],provides:[{key:"accounts",version:"1.0.0"},{key:"net-worth",version:"1.0.0"},{key:"goals",version:"1.0.0"}]},telemetry:[{key:"wealth-snapshot.telemetry",version:"1.0.0"}],docs:["docs.examples.wealth-snapshot","docs.examples.wealth-snapshot.goal","docs.examples.wealth-snapshot.usage","docs.examples.wealth-snapshot.constraints"]});import{identityRbacSchemaContribution as ht}from"@contractspec/lib.identity-rbac";import{auditTrailSchemaContribution as _t}from"@contractspec/module.audit-trail";import{notificationsSchemaContribution as Gt}from"@contractspec/lib.notification";var di={modules:[ht,_t,Gt,$],provider:"postgresql",outputPath:"./prisma/schema/generated.prisma"};export{$ as wealthSnapshotSchemaContribution,l as wealthSnapshotEntities,di as schemaComposition,qt as registerWealthSnapshotHandlers,st as example,Lt as WealthSnapshotPreview,ti as WealthSnapshotFeature,Nt as WealthSnapshotEvents,U as WealthDashboardPresentation,Zt as UpdateGoalContract,p as NetWorthSnapshotModel,M as NetWorthSnapshotEntity,tt as NetWorthSnapshotCreatedEvent,dt as LiabilityModel,f as LiabilityEntity,v as LiabilityCategoryEnum,E as LiabilityAddedEvent,q as LiabilitiesListPresentation,H as GoalsListPresentation,S as GoalUpdatedEvent,K as GoalStatusEnum,N as GoalModel,x as GoalEntity,Bt as GetNetWorthContract,ot as ExamplesWealthSnapshotExample,Jt as CreateGoalContract,kt as CreateAccountContract,F as AssetsListPresentation,nt as AssetModel,W as AssetEntity,c as AssetCategoryEnum,T as AssetAddedEvent,zt as AddLiabilityContract,Xt as AddAssetContract,V as AccountsListPresentation,R as AccountTypeEnum,rt as AccountModel,a as AccountEntity};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineCommand as q,defineQuery as x}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as j,ScalarTypeEnum as g}from"@contractspec/lib.schema";var k=["examples.wealth-snapshot"],z=j({name:"Account",description:"Account model",fields:{id:{type:g.String_unsecure(),isOptional:!1},name:{type:g.String_unsecure(),isOptional:!1},type:{type:g.String_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1},balance:{type:g.Float_unsecure(),isOptional:!1}}}),B=j({name:"Asset",description:"Asset model",fields:{id:{type:g.String_unsecure(),isOptional:!1},name:{type:g.String_unsecure(),isOptional:!1},category:{type:g.String_unsecure(),isOptional:!1},value:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1}}}),D=j({name:"Liability",description:"Liability model",fields:{id:{type:g.String_unsecure(),isOptional:!1},name:{type:g.String_unsecure(),isOptional:!1},category:{type:g.String_unsecure(),isOptional:!1},balance:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1}}}),w=j({name:"Goal",description:"Goal model",fields:{id:{type:g.String_unsecure(),isOptional:!1},name:{type:g.String_unsecure(),isOptional:!1},targetAmount:{type:g.Float_unsecure(),isOptional:!1},currentAmount:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1},status:{type:g.String_unsecure(),isOptional:!1}}}),v=j({name:"NetWorthSnapshot",description:"Net worth snapshot model",fields:{asOf:{type:g.DateTime(),isOptional:!1},totalAssets:{type:g.Float_unsecure(),isOptional:!1},totalLiabilities:{type:g.Float_unsecure(),isOptional:!1},netWorth:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1}}}),F=j({name:"CreateAccountInput",description:"Create account input",fields:{name:{type:g.String_unsecure(),isOptional:!1},type:{type:g.String_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!0},balance:{type:g.Float_unsecure(),isOptional:!0},orgId:{type:g.String_unsecure(),isOptional:!1}}}),H=j({name:"AddAssetInput",description:"Add asset input",fields:{accountId:{type:g.String_unsecure(),isOptional:!0},name:{type:g.String_unsecure(),isOptional:!1},category:{type:g.String_unsecure(),isOptional:!1},value:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!0},orgId:{type:g.String_unsecure(),isOptional:!1}}}),J=j({name:"AddLiabilityInput",description:"Add liability input",fields:{accountId:{type:g.String_unsecure(),isOptional:!0},name:{type:g.String_unsecure(),isOptional:!1},category:{type:g.String_unsecure(),isOptional:!1},balance:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!0},orgId:{type:g.String_unsecure(),isOptional:!1}}}),K=j({name:"UpdateGoalInput",description:"Update goal progress",fields:{goalId:{type:g.String_unsecure(),isOptional:!1},currentAmount:{type:g.Float_unsecure(),isOptional:!1},status:{type:g.String_unsecure(),isOptional:!0}}}),P=j({name:"CreateGoalInput",description:"Create goal input",fields:{name:{type:g.String_unsecure(),isOptional:!1},targetAmount:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!0},targetDate:{type:g.DateTime(),isOptional:!0},orgId:{type:g.String_unsecure(),isOptional:!1}}}),V=j({name:"NetWorthQueryInput",description:"Filter for net worth snapshots",fields:{orgId:{type:g.String_unsecure(),isOptional:!1},from:{type:g.DateTime(),isOptional:!0},to:{type:g.DateTime(),isOptional:!0}}}),Z=q({meta:{key:"wealth.account.create",version:"1.0.0",stability:"stable",owners:[...k],tags:["wealth","account","create"],description:"Create a financial account.",goal:"Track account balances.",context:"Onboarding/import."},io:{input:F,output:z},policy:{auth:"user"}}),_=q({meta:{key:"wealth.asset.add",version:"1.0.0",stability:"stable",owners:[...k],tags:["wealth","asset","add"],description:"Add an asset position.",goal:"Track holdings.",context:"Asset onboarding/update."},io:{input:H,output:B},policy:{auth:"user"}}),$=q({meta:{key:"wealth.liability.add",version:"1.0.0",stability:"stable",owners:[...k],tags:["wealth","liability","add"],description:"Add a liability.",goal:"Track debts.",context:"Debt onboarding/update."},io:{input:J,output:D},policy:{auth:"user"}}),U=q({meta:{key:"wealth.goal.create",version:"1.0.0",stability:"stable",owners:[...k],tags:["wealth","goal","create"],description:"Create a financial goal.",goal:"Track progress toward goals.",context:"Planning."},io:{input:P,output:w},policy:{auth:"user"}}),L=q({meta:{key:"wealth.goal.update",version:"1.0.0",stability:"stable",owners:[...k],tags:["wealth","goal","update"],description:"Update goal progress.",goal:"Keep progress current.",context:"Periodic update."},io:{input:K,output:w},policy:{auth:"user"}}),Q=x({meta:{key:"wealth.networth.get",version:"1.0.0",stability:"stable",owners:[...k],tags:["wealth","networth"],description:"Get net worth snapshots for a period.",goal:"Render charts and indicators.",context:"Dashboard."},io:{input:V,output:j({name:"NetWorthQueryOutput",description:"Snapshots + latest indicators",fields:{snapshots:{type:v,isArray:!0,isOptional:!1},latest:{type:v,isOptional:!0}}})},policy:{auth:"user"}});export{L as UpdateGoalContract,v as NetWorthSnapshotModel,D as LiabilityModel,w as GoalModel,Q as GetNetWorthContract,U as CreateGoalContract,Z as CreateAccountContract,B as AssetModel,$ as AddLiabilityContract,_ as AddAssetContract,z as AccountModel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=["wealth-snapshot.dashboard","wealth-snapshot.accounts.list","wealth-snapshot.assets.list","wealth-snapshot.liabilities.list","wealth-snapshot.goals.list"];export{s as WealthSnapshotPresentations};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{definePresentation as g,StabilityEnum as h}from"@contractspec/lib.contracts-spec";var k=g({meta:{key:"wealth-snapshot.dashboard",version:"1.0.0",title:"Wealth Dashboard",description:"Wealth snapshot dashboard with net worth overview",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","wealth","dashboard"],stability:h.Experimental,goal:"Overview of wealth",context:"Dashboard"},source:{type:"component",framework:"react",componentKey:"WealthDashboard"},targets:["react","markdown"],policy:{flags:["wealth.dashboard.enabled"]}}),q=g({meta:{key:"wealth-snapshot.accounts.list",version:"1.0.0",title:"Accounts List",description:"List of financial accounts",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","accounts","list"],stability:h.Experimental,goal:"List accounts",context:"Overview"},source:{type:"component",framework:"react",componentKey:"AccountsList"},targets:["react","markdown"],policy:{flags:["wealth.accounts.enabled"]}}),v=g({meta:{key:"wealth-snapshot.assets.list",version:"1.0.0",title:"Assets List",description:"List of assets with valuations",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","assets","list"],stability:h.Experimental,goal:"List assets",context:"Overview"},source:{type:"component",framework:"react",componentKey:"AssetsList"},targets:["react","markdown"],policy:{flags:["wealth.assets.enabled"]}}),w=g({meta:{key:"wealth-snapshot.liabilities.list",version:"1.0.0",title:"Liabilities List",description:"List of liabilities and debts",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","liabilities","list"],stability:h.Experimental,goal:"List liabilities",context:"Overview"},source:{type:"component",framework:"react",componentKey:"LiabilitiesList"},targets:["react","markdown"],policy:{flags:["wealth.liabilities.enabled"]}}),x=g({meta:{key:"wealth-snapshot.goals.list",version:"1.0.0",title:"Goals List",description:"List of financial goals with progress",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","goals","list"],stability:h.Experimental,goal:"List goals",context:"Overview"},source:{type:"component",framework:"react",componentKey:"GoalsList"},targets:["react","markdown"],policy:{flags:["wealth.goals.enabled"]}});export{k as WealthDashboardPresentation,w as LiabilitiesListPresentation,x as GoalsListPresentation,v as AssetsListPresentation,q as AccountsListPresentation};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{definePresentation as v,StabilityEnum as l}from"@contractspec/lib.contracts-spec";var h=v({meta:{key:"wealth-snapshot.dashboard",version:"1.0.0",title:"Wealth Dashboard",description:"Wealth snapshot dashboard with net worth overview",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","wealth","dashboard"],stability:l.Experimental,goal:"Overview of wealth",context:"Dashboard"},source:{type:"component",framework:"react",componentKey:"WealthDashboard"},targets:["react","markdown"],policy:{flags:["wealth.dashboard.enabled"]}}),p=v({meta:{key:"wealth-snapshot.accounts.list",version:"1.0.0",title:"Accounts List",description:"List of financial accounts",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","accounts","list"],stability:l.Experimental,goal:"List accounts",context:"Overview"},source:{type:"component",framework:"react",componentKey:"AccountsList"},targets:["react","markdown"],policy:{flags:["wealth.accounts.enabled"]}}),A=v({meta:{key:"wealth-snapshot.assets.list",version:"1.0.0",title:"Assets List",description:"List of assets with valuations",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","assets","list"],stability:l.Experimental,goal:"List assets",context:"Overview"},source:{type:"component",framework:"react",componentKey:"AssetsList"},targets:["react","markdown"],policy:{flags:["wealth.assets.enabled"]}}),L=v({meta:{key:"wealth-snapshot.liabilities.list",version:"1.0.0",title:"Liabilities List",description:"List of liabilities and debts",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","liabilities","list"],stability:l.Experimental,goal:"List liabilities",context:"Overview"},source:{type:"component",framework:"react",componentKey:"LiabilitiesList"},targets:["react","markdown"],policy:{flags:["wealth.liabilities.enabled"]}}),$=v({meta:{key:"wealth-snapshot.goals.list",version:"1.0.0",title:"Goals List",description:"List of financial goals with progress",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","goals","list"],stability:l.Experimental,goal:"List goals",context:"Overview"},source:{type:"component",framework:"react",componentKey:"GoalsList"},targets:["react","markdown"],policy:{flags:["wealth.goals.enabled"]}});var b=[{label:"Net worth",value:"$1.42M",tone:"positive"},{label:"Assets",value:"$1.78M",tone:"neutral"},{label:"Liabilities",value:"$360K",tone:"warning"},{label:"Goals",value:"4 active",tone:"neutral"}],m=[{name:"Operating cash",type:"Checking",balance:"$42,400",institution:"Northstar Bank"},{name:"Brokerage",type:"Investment",balance:"$684,900",institution:"Atlas Wealth"},{name:"Primary mortgage",type:"Loan",balance:"-$312,000",institution:"Home Credit"}],w=[{name:"Emergency runway",progress:"92%",status:"On track"},{name:"Retirement bridge",progress:"68%",status:"Active"},{name:"Education reserve",progress:"41%",status:"At risk"}],i=[h,p,A,L,$].map((e)=>({key:e.meta.key,title:e.meta.title,description:e.meta.description}));import{HStack as n,VStack as o}from"@contractspec/lib.design-system/layout";import{H2 as B,H3 as C,Text as a}from"@contractspec/lib.design-system/typography";import{jsx as t,jsxs as r}from"react/jsx-runtime";function D(){return r(o,{as:"section",gap:"xl",className:"p-4 sm:p-6",children:[r(o,{gap:"sm",className:"rounded-lg border border-border bg-card p-5 shadow-sm",children:[t(a,{className:"font-semibold text-muted-foreground text-xs uppercase",children:"Wealth template"}),t(B,{className:"font-serif text-3xl tracking-normal",children:"Wealth Snapshot"}),t(a,{className:"max-w-3xl text-muted-foreground text-sm leading-6",children:"An inline preview of the finance template contracts for accounts, assets, liabilities, goals, net-worth snapshots, and presentation surfaces."})]}),t(n,{align:"stretch",className:"gap-3 lg:flex-nowrap",children:b.map((e)=>r(o,{gap:"xs",className:"min-w-0 flex-1 rounded-lg border border-border bg-background p-4",children:[t(a,{className:"text-muted-foreground text-xs uppercase",children:e.label}),t(a,{className:"font-semibold text-2xl",children:e.value}),t(a,{className:"text-muted-foreground text-xs capitalize",children:e.tone})]},e.label))}),r(n,{align:"start",className:"gap-6 xl:flex-nowrap",children:[t(g,{title:"Household accounts",description:"Sample balances show how account and debt entities sit behind the dashboard surface.",children:m.map((e)=>r(n,{justify:"between",wrap:"nowrap",className:"rounded-md border border-border bg-background p-3",children:[r(o,{gap:"xs",className:"min-w-0",children:[t(a,{className:"font-semibold text-sm",children:e.name}),r(a,{className:"text-muted-foreground text-xs",children:[e.type," · ",e.institution]})]}),t(a,{className:"font-semibold text-sm",children:e.balance})]},e.name))}),r(g,{title:"Goals and surfaces",description:"The example also publishes presentation specs that host apps can map to their own UI.",children:[w.map((e)=>r(o,{gap:"xs",className:"rounded-md border border-border bg-background p-3",children:[r(n,{justify:"between",wrap:"nowrap",children:[t(a,{className:"font-semibold text-sm",children:e.name}),t(a,{className:"text-muted-foreground text-xs",children:e.status})]}),r(a,{className:"text-muted-foreground text-xs",children:["Progress ",e.progress]})]},e.name)),t(o,{gap:"xs",className:"rounded-md border border-border bg-muted/40 p-3",children:i.map((e)=>t(a,{className:"text-xs",children:e.title},e.key))})]})]})]})}function g({title:e,description:k,children:y}){return r(o,{as:"article",gap:"md",className:"min-w-0 flex-1 rounded-lg border border-border bg-card p-4 shadow-sm",children:[r(o,{as:"header",gap:"xs",children:[t(C,{className:"font-semibold text-lg",children:e}),t(a,{className:"text-muted-foreground text-sm leading-6",children:k})]}),y]})}export{D as WealthSnapshotPreview};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{definePresentation as v,StabilityEnum as l}from"@contractspec/lib.contracts-spec";var n=v({meta:{key:"wealth-snapshot.dashboard",version:"1.0.0",title:"Wealth Dashboard",description:"Wealth snapshot dashboard with net worth overview",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","wealth","dashboard"],stability:l.Experimental,goal:"Overview of wealth",context:"Dashboard"},source:{type:"component",framework:"react",componentKey:"WealthDashboard"},targets:["react","markdown"],policy:{flags:["wealth.dashboard.enabled"]}}),p=v({meta:{key:"wealth-snapshot.accounts.list",version:"1.0.0",title:"Accounts List",description:"List of financial accounts",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","accounts","list"],stability:l.Experimental,goal:"List accounts",context:"Overview"},source:{type:"component",framework:"react",componentKey:"AccountsList"},targets:["react","markdown"],policy:{flags:["wealth.accounts.enabled"]}}),A=v({meta:{key:"wealth-snapshot.assets.list",version:"1.0.0",title:"Assets List",description:"List of assets with valuations",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","assets","list"],stability:l.Experimental,goal:"List assets",context:"Overview"},source:{type:"component",framework:"react",componentKey:"AssetsList"},targets:["react","markdown"],policy:{flags:["wealth.assets.enabled"]}}),L=v({meta:{key:"wealth-snapshot.liabilities.list",version:"1.0.0",title:"Liabilities List",description:"List of liabilities and debts",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","liabilities","list"],stability:l.Experimental,goal:"List liabilities",context:"Overview"},source:{type:"component",framework:"react",componentKey:"LiabilitiesList"},targets:["react","markdown"],policy:{flags:["wealth.liabilities.enabled"]}}),m=v({meta:{key:"wealth-snapshot.goals.list",version:"1.0.0",title:"Goals List",description:"List of financial goals with progress",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","goals","list"],stability:l.Experimental,goal:"List goals",context:"Overview"},source:{type:"component",framework:"react",componentKey:"GoalsList"},targets:["react","markdown"],policy:{flags:["wealth.goals.enabled"]}});var w=[{label:"Net worth",value:"$1.42M",tone:"positive"},{label:"Assets",value:"$1.78M",tone:"neutral"},{label:"Liabilities",value:"$360K",tone:"warning"},{label:"Goals",value:"4 active",tone:"neutral"}],$=[{name:"Operating cash",type:"Checking",balance:"$42,400",institution:"Northstar Bank"},{name:"Brokerage",type:"Investment",balance:"$684,900",institution:"Atlas Wealth"},{name:"Primary mortgage",type:"Loan",balance:"-$312,000",institution:"Home Credit"}],b=[{name:"Emergency runway",progress:"92%",status:"On track"},{name:"Retirement bridge",progress:"68%",status:"Active"},{name:"Education reserve",progress:"41%",status:"At risk"}],i=[n,p,A,L,m].map((e)=>({key:e.meta.key,title:e.meta.title,description:e.meta.description}));import{HStack as h,VStack as o}from"@contractspec/lib.design-system/layout";import{H2 as P,H3 as W,Text as a}from"@contractspec/lib.design-system/typography";import{jsx as t,jsxs as r}from"react/jsx-runtime";function B(){return r(o,{as:"section",gap:"xl",className:"p-4 sm:p-6",children:[r(o,{gap:"sm",className:"rounded-lg border border-border bg-card p-5 shadow-sm",children:[t(a,{className:"font-semibold text-muted-foreground text-xs uppercase",children:"Wealth template"}),t(P,{className:"font-serif text-3xl tracking-normal",children:"Wealth Snapshot"}),t(a,{className:"max-w-3xl text-muted-foreground text-sm leading-6",children:"An inline preview of the finance template contracts for accounts, assets, liabilities, goals, net-worth snapshots, and presentation surfaces."})]}),t(h,{align:"stretch",className:"gap-3 lg:flex-nowrap",children:w.map((e)=>r(o,{gap:"xs",className:"min-w-0 flex-1 rounded-lg border border-border bg-background p-4",children:[t(a,{className:"text-muted-foreground text-xs uppercase",children:e.label}),t(a,{className:"font-semibold text-2xl",children:e.value}),t(a,{className:"text-muted-foreground text-xs capitalize",children:e.tone})]},e.label))}),r(h,{align:"start",className:"gap-6 xl:flex-nowrap",children:[t(g,{title:"Household accounts",description:"Sample balances show how account and debt entities sit behind the dashboard surface.",children:$.map((e)=>r(h,{justify:"between",wrap:"nowrap",className:"rounded-md border border-border bg-background p-3",children:[r(o,{gap:"xs",className:"min-w-0",children:[t(a,{className:"font-semibold text-sm",children:e.name}),r(a,{className:"text-muted-foreground text-xs",children:[e.type," · ",e.institution]})]}),t(a,{className:"font-semibold text-sm",children:e.balance})]},e.name))}),r(g,{title:"Goals and surfaces",description:"The example also publishes presentation specs that host apps can map to their own UI.",children:[b.map((e)=>r(o,{gap:"xs",className:"rounded-md border border-border bg-background p-3",children:[r(h,{justify:"between",wrap:"nowrap",children:[t(a,{className:"font-semibold text-sm",children:e.name}),t(a,{className:"text-muted-foreground text-xs",children:e.status})]}),r(a,{className:"text-muted-foreground text-xs",children:["Progress ",e.progress]})]},e.name)),t(o,{gap:"xs",className:"rounded-md border border-border bg-muted/40 p-3",children:i.map((e)=>t(a,{className:"text-xs",children:e.title},e.key))})]})]})]})}function g({title:e,description:k,children:y}){return r(o,{as:"article",gap:"md",className:"min-w-0 flex-1 rounded-lg border border-border bg-card p-4 shadow-sm",children:[r(o,{as:"header",gap:"xs",children:[t(W,{className:"font-semibold text-lg",children:e}),t(a,{className:"text-muted-foreground text-sm leading-6",children:k})]}),y]})}export{B as WealthSnapshotPreview};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{definePresentation as e,StabilityEnum as t}from"@contractspec/lib.contracts-spec";var s=e({meta:{key:"wealth-snapshot.dashboard",version:"1.0.0",title:"Wealth Dashboard",description:"Wealth snapshot dashboard with net worth overview",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","wealth","dashboard"],stability:t.Experimental,goal:"Overview of wealth",context:"Dashboard"},source:{type:"component",framework:"react",componentKey:"WealthDashboard"},targets:["react","markdown"],policy:{flags:["wealth.dashboard.enabled"]}}),o=e({meta:{key:"wealth-snapshot.accounts.list",version:"1.0.0",title:"Accounts List",description:"List of financial accounts",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","accounts","list"],stability:t.Experimental,goal:"List accounts",context:"Overview"},source:{type:"component",framework:"react",componentKey:"AccountsList"},targets:["react","markdown"],policy:{flags:["wealth.accounts.enabled"]}}),r=e({meta:{key:"wealth-snapshot.assets.list",version:"1.0.0",title:"Assets List",description:"List of assets with valuations",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","assets","list"],stability:t.Experimental,goal:"List assets",context:"Overview"},source:{type:"component",framework:"react",componentKey:"AssetsList"},targets:["react","markdown"],policy:{flags:["wealth.assets.enabled"]}}),n=e({meta:{key:"wealth-snapshot.liabilities.list",version:"1.0.0",title:"Liabilities List",description:"List of liabilities and debts",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","liabilities","list"],stability:t.Experimental,goal:"List liabilities",context:"Overview"},source:{type:"component",framework:"react",componentKey:"LiabilitiesList"},targets:["react","markdown"],policy:{flags:["wealth.liabilities.enabled"]}}),i=e({meta:{key:"wealth-snapshot.goals.list",version:"1.0.0",title:"Goals List",description:"List of financial goals with progress",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","goals","list"],stability:t.Experimental,goal:"List goals",context:"Overview"},source:{type:"component",framework:"react",componentKey:"GoalsList"},targets:["react","markdown"],policy:{flags:["wealth.goals.enabled"]}});var h=[{label:"Net worth",value:"$1.42M",tone:"positive"},{label:"Assets",value:"$1.78M",tone:"neutral"},{label:"Liabilities",value:"$360K",tone:"warning"},{label:"Goals",value:"4 active",tone:"neutral"}],m=[{name:"Operating cash",type:"Checking",balance:"$42,400",institution:"Northstar Bank"},{name:"Brokerage",type:"Investment",balance:"$684,900",institution:"Atlas Wealth"},{name:"Primary mortgage",type:"Loan",balance:"-$312,000",institution:"Home Credit"}],v=[{name:"Emergency runway",progress:"92%",status:"On track"},{name:"Retirement bridge",progress:"68%",status:"Active"},{name:"Education reserve",progress:"41%",status:"At risk"}],g=[s,o,r,n,i].map((a)=>({key:a.meta.key,title:a.meta.title,description:a.meta.description}));export{g as wealthSnapshotPreviewPresentations,h as wealthSnapshotPreviewMetrics,v as wealthSnapshotPreviewGoals,m as wealthSnapshotPreviewAccounts};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineCapability as g,StabilityEnum as h}from"@contractspec/lib.contracts-spec";var k=g({meta:{key:"accounts",version:"1.0.0",kind:"data",stability:h.Experimental,description:"Financial accounts tracking and aggregation",owners:["platform.finance"],tags:["accounts","finance","wealth"]}}),q=g({meta:{key:"net-worth",version:"1.0.0",kind:"ui",stability:h.Experimental,description:"Net worth visualization and tracking",owners:["platform.finance"],tags:["net-worth","wealth","dashboard"]}}),v=g({meta:{key:"goals",version:"1.0.0",kind:"ui",stability:h.Experimental,description:"Financial goal setting and progress tracking",owners:["platform.finance"],tags:["goals","planning","wealth"]}});export{q as NetWorthCapability,v as GoalsCapability,k as AccountsCapability};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{defineFeature as g}from"@contractspec/lib.contracts-spec/features";var j=g({meta:{key:"wealth-snapshot",version:"1.0.0",title:"Wealth Snapshot",description:"Mini-app for accounts, assets, liabilities, goals, and net worth.",domain:"finance",owners:["@wealth-snapshot"],tags:["finance","net-worth","goals"],stability:"experimental"},operations:[{key:"wealth.account.create",version:"1.0.0"},{key:"wealth.asset.add",version:"1.0.0"},{key:"wealth.liability.add",version:"1.0.0"},{key:"wealth.goal.create",version:"1.0.0"},{key:"wealth.goal.update",version:"1.0.0"},{key:"wealth.networth.get",version:"1.0.0"}],events:[{key:"wealth.asset.added",version:"1.0.0"},{key:"wealth.liability.added",version:"1.0.0"},{key:"wealth.goal.updated",version:"1.0.0"},{key:"wealth.networth.snapshot_created",version:"1.0.0"}],presentations:[{key:"wealth-snapshot.dashboard",version:"1.0.0"},{key:"wealth-snapshot.accounts.list",version:"1.0.0"},{key:"wealth-snapshot.assets.list",version:"1.0.0"},{key:"wealth-snapshot.liabilities.list",version:"1.0.0"},{key:"wealth-snapshot.goals.list",version:"1.0.0"}],presentationsTargets:[{key:"wealth-snapshot.dashboard",version:"1.0.0",targets:["react","markdown"]},{key:"wealth-snapshot.assets.list",version:"1.0.0",targets:["react","markdown"]},{key:"wealth-snapshot.liabilities.list",version:"1.0.0",targets:["react","markdown"]},{key:"wealth-snapshot.goals.list",version:"1.0.0",targets:["react","markdown"]}],capabilities:{requires:[{key:"identity",version:"1.0.0"},{key:"audit-trail",version:"1.0.0"},{key:"notifications",version:"1.0.0"}],provides:[{key:"accounts",version:"1.0.0"},{key:"net-worth",version:"1.0.0"},{key:"goals",version:"1.0.0"}]},telemetry:[{key:"wealth-snapshot.telemetry",version:"1.0.0"}],docs:["docs.examples.wealth-snapshot","docs.examples.wealth-snapshot.goal","docs.examples.wealth-snapshot.usage","docs.examples.wealth-snapshot.constraints"]});export{j as WealthSnapshotFeature};
|
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
export declare const AccountModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
2
|
+
id: {
|
|
3
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
4
|
+
isOptional: false;
|
|
5
|
+
};
|
|
6
|
+
name: {
|
|
7
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
8
|
+
isOptional: false;
|
|
9
|
+
};
|
|
10
|
+
type: {
|
|
11
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
12
|
+
isOptional: false;
|
|
13
|
+
};
|
|
14
|
+
currency: {
|
|
15
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
16
|
+
isOptional: false;
|
|
17
|
+
};
|
|
18
|
+
balance: {
|
|
19
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
20
|
+
isOptional: false;
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
23
|
+
export declare const AssetModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
24
|
+
id: {
|
|
25
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
26
|
+
isOptional: false;
|
|
27
|
+
};
|
|
28
|
+
name: {
|
|
29
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
30
|
+
isOptional: false;
|
|
31
|
+
};
|
|
32
|
+
category: {
|
|
33
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
34
|
+
isOptional: false;
|
|
35
|
+
};
|
|
36
|
+
value: {
|
|
37
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
38
|
+
isOptional: false;
|
|
39
|
+
};
|
|
40
|
+
currency: {
|
|
41
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
42
|
+
isOptional: false;
|
|
43
|
+
};
|
|
44
|
+
}>;
|
|
45
|
+
export declare const LiabilityModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
46
|
+
id: {
|
|
47
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
48
|
+
isOptional: false;
|
|
49
|
+
};
|
|
50
|
+
name: {
|
|
51
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
52
|
+
isOptional: false;
|
|
53
|
+
};
|
|
54
|
+
category: {
|
|
55
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
56
|
+
isOptional: false;
|
|
57
|
+
};
|
|
58
|
+
balance: {
|
|
59
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
60
|
+
isOptional: false;
|
|
61
|
+
};
|
|
62
|
+
currency: {
|
|
63
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
64
|
+
isOptional: false;
|
|
65
|
+
};
|
|
66
|
+
}>;
|
|
67
|
+
export declare const GoalModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
68
|
+
id: {
|
|
69
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
70
|
+
isOptional: false;
|
|
71
|
+
};
|
|
72
|
+
name: {
|
|
73
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
74
|
+
isOptional: false;
|
|
75
|
+
};
|
|
76
|
+
targetAmount: {
|
|
77
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
78
|
+
isOptional: false;
|
|
79
|
+
};
|
|
80
|
+
currentAmount: {
|
|
81
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
82
|
+
isOptional: false;
|
|
83
|
+
};
|
|
84
|
+
currency: {
|
|
85
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
86
|
+
isOptional: false;
|
|
87
|
+
};
|
|
88
|
+
status: {
|
|
89
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
90
|
+
isOptional: false;
|
|
91
|
+
};
|
|
92
|
+
}>;
|
|
93
|
+
export declare const NetWorthSnapshotModel: import("@contractspec/lib.schema").SchemaModel<{
|
|
94
|
+
asOf: {
|
|
95
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
96
|
+
isOptional: false;
|
|
97
|
+
};
|
|
98
|
+
totalAssets: {
|
|
99
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
100
|
+
isOptional: false;
|
|
101
|
+
};
|
|
102
|
+
totalLiabilities: {
|
|
103
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
104
|
+
isOptional: false;
|
|
105
|
+
};
|
|
106
|
+
netWorth: {
|
|
107
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
108
|
+
isOptional: false;
|
|
109
|
+
};
|
|
110
|
+
currency: {
|
|
111
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
112
|
+
isOptional: false;
|
|
113
|
+
};
|
|
114
|
+
}>;
|
|
115
|
+
export declare const CreateAccountContract: import("@contractspec/lib.contracts-spec").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
116
|
+
name: {
|
|
117
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
118
|
+
isOptional: false;
|
|
119
|
+
};
|
|
120
|
+
type: {
|
|
121
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
122
|
+
isOptional: false;
|
|
123
|
+
};
|
|
124
|
+
currency: {
|
|
125
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
126
|
+
isOptional: true;
|
|
127
|
+
};
|
|
128
|
+
balance: {
|
|
129
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
130
|
+
isOptional: true;
|
|
131
|
+
};
|
|
132
|
+
orgId: {
|
|
133
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
134
|
+
isOptional: false;
|
|
135
|
+
};
|
|
136
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
137
|
+
id: {
|
|
138
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
139
|
+
isOptional: false;
|
|
140
|
+
};
|
|
141
|
+
name: {
|
|
142
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
143
|
+
isOptional: false;
|
|
144
|
+
};
|
|
145
|
+
type: {
|
|
146
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
147
|
+
isOptional: false;
|
|
148
|
+
};
|
|
149
|
+
currency: {
|
|
150
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
151
|
+
isOptional: false;
|
|
152
|
+
};
|
|
153
|
+
balance: {
|
|
154
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
155
|
+
isOptional: false;
|
|
156
|
+
};
|
|
157
|
+
}>, undefined>;
|
|
158
|
+
export declare const AddAssetContract: import("@contractspec/lib.contracts-spec").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
159
|
+
accountId: {
|
|
160
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
161
|
+
isOptional: true;
|
|
162
|
+
};
|
|
163
|
+
name: {
|
|
164
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
165
|
+
isOptional: false;
|
|
166
|
+
};
|
|
167
|
+
category: {
|
|
168
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
169
|
+
isOptional: false;
|
|
170
|
+
};
|
|
171
|
+
value: {
|
|
172
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
173
|
+
isOptional: false;
|
|
174
|
+
};
|
|
175
|
+
currency: {
|
|
176
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
177
|
+
isOptional: true;
|
|
178
|
+
};
|
|
179
|
+
orgId: {
|
|
180
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
181
|
+
isOptional: false;
|
|
182
|
+
};
|
|
183
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
184
|
+
id: {
|
|
185
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
186
|
+
isOptional: false;
|
|
187
|
+
};
|
|
188
|
+
name: {
|
|
189
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
190
|
+
isOptional: false;
|
|
191
|
+
};
|
|
192
|
+
category: {
|
|
193
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
194
|
+
isOptional: false;
|
|
195
|
+
};
|
|
196
|
+
value: {
|
|
197
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
198
|
+
isOptional: false;
|
|
199
|
+
};
|
|
200
|
+
currency: {
|
|
201
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
202
|
+
isOptional: false;
|
|
203
|
+
};
|
|
204
|
+
}>, undefined>;
|
|
205
|
+
export declare const AddLiabilityContract: import("@contractspec/lib.contracts-spec").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
206
|
+
accountId: {
|
|
207
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
208
|
+
isOptional: true;
|
|
209
|
+
};
|
|
210
|
+
name: {
|
|
211
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
212
|
+
isOptional: false;
|
|
213
|
+
};
|
|
214
|
+
category: {
|
|
215
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
216
|
+
isOptional: false;
|
|
217
|
+
};
|
|
218
|
+
balance: {
|
|
219
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
220
|
+
isOptional: false;
|
|
221
|
+
};
|
|
222
|
+
currency: {
|
|
223
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
224
|
+
isOptional: true;
|
|
225
|
+
};
|
|
226
|
+
orgId: {
|
|
227
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
228
|
+
isOptional: false;
|
|
229
|
+
};
|
|
230
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
231
|
+
id: {
|
|
232
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
233
|
+
isOptional: false;
|
|
234
|
+
};
|
|
235
|
+
name: {
|
|
236
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
237
|
+
isOptional: false;
|
|
238
|
+
};
|
|
239
|
+
category: {
|
|
240
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
241
|
+
isOptional: false;
|
|
242
|
+
};
|
|
243
|
+
balance: {
|
|
244
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
245
|
+
isOptional: false;
|
|
246
|
+
};
|
|
247
|
+
currency: {
|
|
248
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
249
|
+
isOptional: false;
|
|
250
|
+
};
|
|
251
|
+
}>, undefined>;
|
|
252
|
+
export declare const CreateGoalContract: import("@contractspec/lib.contracts-spec").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
253
|
+
name: {
|
|
254
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
255
|
+
isOptional: false;
|
|
256
|
+
};
|
|
257
|
+
targetAmount: {
|
|
258
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
259
|
+
isOptional: false;
|
|
260
|
+
};
|
|
261
|
+
currency: {
|
|
262
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
263
|
+
isOptional: true;
|
|
264
|
+
};
|
|
265
|
+
targetDate: {
|
|
266
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
267
|
+
isOptional: true;
|
|
268
|
+
};
|
|
269
|
+
orgId: {
|
|
270
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
271
|
+
isOptional: false;
|
|
272
|
+
};
|
|
273
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
274
|
+
id: {
|
|
275
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
276
|
+
isOptional: false;
|
|
277
|
+
};
|
|
278
|
+
name: {
|
|
279
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
280
|
+
isOptional: false;
|
|
281
|
+
};
|
|
282
|
+
targetAmount: {
|
|
283
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
284
|
+
isOptional: false;
|
|
285
|
+
};
|
|
286
|
+
currentAmount: {
|
|
287
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
288
|
+
isOptional: false;
|
|
289
|
+
};
|
|
290
|
+
currency: {
|
|
291
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
292
|
+
isOptional: false;
|
|
293
|
+
};
|
|
294
|
+
status: {
|
|
295
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
296
|
+
isOptional: false;
|
|
297
|
+
};
|
|
298
|
+
}>, undefined>;
|
|
299
|
+
export declare const UpdateGoalContract: import("@contractspec/lib.contracts-spec").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
300
|
+
goalId: {
|
|
301
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
302
|
+
isOptional: false;
|
|
303
|
+
};
|
|
304
|
+
currentAmount: {
|
|
305
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
306
|
+
isOptional: false;
|
|
307
|
+
};
|
|
308
|
+
status: {
|
|
309
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
310
|
+
isOptional: true;
|
|
311
|
+
};
|
|
312
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
313
|
+
id: {
|
|
314
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
315
|
+
isOptional: false;
|
|
316
|
+
};
|
|
317
|
+
name: {
|
|
318
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
319
|
+
isOptional: false;
|
|
320
|
+
};
|
|
321
|
+
targetAmount: {
|
|
322
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
323
|
+
isOptional: false;
|
|
324
|
+
};
|
|
325
|
+
currentAmount: {
|
|
326
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
327
|
+
isOptional: false;
|
|
328
|
+
};
|
|
329
|
+
currency: {
|
|
330
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
331
|
+
isOptional: false;
|
|
332
|
+
};
|
|
333
|
+
status: {
|
|
334
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
335
|
+
isOptional: false;
|
|
336
|
+
};
|
|
337
|
+
}>, undefined>;
|
|
338
|
+
export declare const GetNetWorthContract: import("@contractspec/lib.contracts-spec").OperationSpec<import("@contractspec/lib.schema").SchemaModel<{
|
|
339
|
+
orgId: {
|
|
340
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
341
|
+
isOptional: false;
|
|
342
|
+
};
|
|
343
|
+
from: {
|
|
344
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
345
|
+
isOptional: true;
|
|
346
|
+
};
|
|
347
|
+
to: {
|
|
348
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
349
|
+
isOptional: true;
|
|
350
|
+
};
|
|
351
|
+
}>, import("@contractspec/lib.schema").SchemaModel<{
|
|
352
|
+
snapshots: {
|
|
353
|
+
type: import("@contractspec/lib.schema").SchemaModel<{
|
|
354
|
+
asOf: {
|
|
355
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
356
|
+
isOptional: false;
|
|
357
|
+
};
|
|
358
|
+
totalAssets: {
|
|
359
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
360
|
+
isOptional: false;
|
|
361
|
+
};
|
|
362
|
+
totalLiabilities: {
|
|
363
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
364
|
+
isOptional: false;
|
|
365
|
+
};
|
|
366
|
+
netWorth: {
|
|
367
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
368
|
+
isOptional: false;
|
|
369
|
+
};
|
|
370
|
+
currency: {
|
|
371
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
372
|
+
isOptional: false;
|
|
373
|
+
};
|
|
374
|
+
}>;
|
|
375
|
+
isArray: true;
|
|
376
|
+
isOptional: false;
|
|
377
|
+
};
|
|
378
|
+
latest: {
|
|
379
|
+
type: import("@contractspec/lib.schema").SchemaModel<{
|
|
380
|
+
asOf: {
|
|
381
|
+
type: import("@contractspec/lib.schema").FieldType<Date, string>;
|
|
382
|
+
isOptional: false;
|
|
383
|
+
};
|
|
384
|
+
totalAssets: {
|
|
385
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
386
|
+
isOptional: false;
|
|
387
|
+
};
|
|
388
|
+
totalLiabilities: {
|
|
389
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
390
|
+
isOptional: false;
|
|
391
|
+
};
|
|
392
|
+
netWorth: {
|
|
393
|
+
type: import("@contractspec/lib.schema").FieldType<number, number>;
|
|
394
|
+
isOptional: false;
|
|
395
|
+
};
|
|
396
|
+
currency: {
|
|
397
|
+
type: import("@contractspec/lib.schema").FieldType<string, string>;
|
|
398
|
+
isOptional: false;
|
|
399
|
+
};
|
|
400
|
+
}>;
|
|
401
|
+
isOptional: true;
|
|
402
|
+
};
|
|
403
|
+
}>, undefined>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{defineCommand as q,defineQuery as x}from"@contractspec/lib.contracts-spec";import{defineSchemaModel as j,ScalarTypeEnum as g}from"@contractspec/lib.schema";var k=["examples.wealth-snapshot"],z=j({name:"Account",description:"Account model",fields:{id:{type:g.String_unsecure(),isOptional:!1},name:{type:g.String_unsecure(),isOptional:!1},type:{type:g.String_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1},balance:{type:g.Float_unsecure(),isOptional:!1}}}),B=j({name:"Asset",description:"Asset model",fields:{id:{type:g.String_unsecure(),isOptional:!1},name:{type:g.String_unsecure(),isOptional:!1},category:{type:g.String_unsecure(),isOptional:!1},value:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1}}}),D=j({name:"Liability",description:"Liability model",fields:{id:{type:g.String_unsecure(),isOptional:!1},name:{type:g.String_unsecure(),isOptional:!1},category:{type:g.String_unsecure(),isOptional:!1},balance:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1}}}),w=j({name:"Goal",description:"Goal model",fields:{id:{type:g.String_unsecure(),isOptional:!1},name:{type:g.String_unsecure(),isOptional:!1},targetAmount:{type:g.Float_unsecure(),isOptional:!1},currentAmount:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1},status:{type:g.String_unsecure(),isOptional:!1}}}),v=j({name:"NetWorthSnapshot",description:"Net worth snapshot model",fields:{asOf:{type:g.DateTime(),isOptional:!1},totalAssets:{type:g.Float_unsecure(),isOptional:!1},totalLiabilities:{type:g.Float_unsecure(),isOptional:!1},netWorth:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!1}}}),F=j({name:"CreateAccountInput",description:"Create account input",fields:{name:{type:g.String_unsecure(),isOptional:!1},type:{type:g.String_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!0},balance:{type:g.Float_unsecure(),isOptional:!0},orgId:{type:g.String_unsecure(),isOptional:!1}}}),H=j({name:"AddAssetInput",description:"Add asset input",fields:{accountId:{type:g.String_unsecure(),isOptional:!0},name:{type:g.String_unsecure(),isOptional:!1},category:{type:g.String_unsecure(),isOptional:!1},value:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!0},orgId:{type:g.String_unsecure(),isOptional:!1}}}),J=j({name:"AddLiabilityInput",description:"Add liability input",fields:{accountId:{type:g.String_unsecure(),isOptional:!0},name:{type:g.String_unsecure(),isOptional:!1},category:{type:g.String_unsecure(),isOptional:!1},balance:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!0},orgId:{type:g.String_unsecure(),isOptional:!1}}}),K=j({name:"UpdateGoalInput",description:"Update goal progress",fields:{goalId:{type:g.String_unsecure(),isOptional:!1},currentAmount:{type:g.Float_unsecure(),isOptional:!1},status:{type:g.String_unsecure(),isOptional:!0}}}),P=j({name:"CreateGoalInput",description:"Create goal input",fields:{name:{type:g.String_unsecure(),isOptional:!1},targetAmount:{type:g.Float_unsecure(),isOptional:!1},currency:{type:g.String_unsecure(),isOptional:!0},targetDate:{type:g.DateTime(),isOptional:!0},orgId:{type:g.String_unsecure(),isOptional:!1}}}),V=j({name:"NetWorthQueryInput",description:"Filter for net worth snapshots",fields:{orgId:{type:g.String_unsecure(),isOptional:!1},from:{type:g.DateTime(),isOptional:!0},to:{type:g.DateTime(),isOptional:!0}}}),Z=q({meta:{key:"wealth.account.create",version:"1.0.0",stability:"stable",owners:[...k],tags:["wealth","account","create"],description:"Create a financial account.",goal:"Track account balances.",context:"Onboarding/import."},io:{input:F,output:z},policy:{auth:"user"}}),_=q({meta:{key:"wealth.asset.add",version:"1.0.0",stability:"stable",owners:[...k],tags:["wealth","asset","add"],description:"Add an asset position.",goal:"Track holdings.",context:"Asset onboarding/update."},io:{input:H,output:B},policy:{auth:"user"}}),$=q({meta:{key:"wealth.liability.add",version:"1.0.0",stability:"stable",owners:[...k],tags:["wealth","liability","add"],description:"Add a liability.",goal:"Track debts.",context:"Debt onboarding/update."},io:{input:J,output:D},policy:{auth:"user"}}),U=q({meta:{key:"wealth.goal.create",version:"1.0.0",stability:"stable",owners:[...k],tags:["wealth","goal","create"],description:"Create a financial goal.",goal:"Track progress toward goals.",context:"Planning."},io:{input:P,output:w},policy:{auth:"user"}}),L=q({meta:{key:"wealth.goal.update",version:"1.0.0",stability:"stable",owners:[...k],tags:["wealth","goal","update"],description:"Update goal progress.",goal:"Keep progress current.",context:"Periodic update."},io:{input:K,output:w},policy:{auth:"user"}}),Q=x({meta:{key:"wealth.networth.get",version:"1.0.0",stability:"stable",owners:[...k],tags:["wealth","networth"],description:"Get net worth snapshots for a period.",goal:"Render charts and indicators.",context:"Dashboard."},io:{input:V,output:j({name:"NetWorthQueryOutput",description:"Snapshots + latest indicators",fields:{snapshots:{type:v,isArray:!0,isOptional:!1},latest:{type:v,isOptional:!0}}})},policy:{auth:"user"}});export{L as UpdateGoalContract,v as NetWorthSnapshotModel,D as LiabilityModel,w as GoalModel,Q as GetNetWorthContract,U as CreateGoalContract,Z as CreateAccountContract,B as AssetModel,$ as AddLiabilityContract,_ as AddAssetContract,z as AccountModel};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WealthSnapshotPresentations: string[];
|