Implement local SQLite backend and reactive UI
This commit is contained in:
@@ -196,6 +196,7 @@ export type RpcRequestMap = {
|
||||
"company.setActive": { companyId: string };
|
||||
"workspace.getSection": { companyId: string; section: string };
|
||||
"workspace.listSources": { companyId: string };
|
||||
"workspace.updateSection": { companyId: string; section: string; content: string };
|
||||
"catalyst.list": { companyId: string };
|
||||
"alert.list": { companyId?: string; since?: string };
|
||||
"risk.list": { companyId: string };
|
||||
@@ -204,6 +205,8 @@ export type RpcRequestMap = {
|
||||
"filing.list": { companyId: string; since?: string };
|
||||
"model.get": { companyId: string; tab: string };
|
||||
"model.updateCell": { companyId: string; tab: string; row: number; col: number; value: string };
|
||||
"model.createRow": { companyId: string; tab: string; label: string; kind: "actual" | "forecast" | "total"; values?: string[] };
|
||||
"model.deleteRow": { companyId: string; tab: string; row: number };
|
||||
"model.runScenario": { companyId: string; scenario: string; overrides: Record<string, string> };
|
||||
"memo.get": { companyId: string };
|
||||
"memo.updateSection": {
|
||||
@@ -256,6 +259,7 @@ export type RpcResponseMap = {
|
||||
"company.setActive": { ok: boolean };
|
||||
"workspace.getSection": { content: WorkspaceSection; validationState: string };
|
||||
"workspace.listSources": { sources: Array<{ type: string; title: string; metadata: string }> };
|
||||
"workspace.updateSection": { content: WorkspaceSection; savedAt: string };
|
||||
"catalyst.list": { catalysts: Catalyst[] };
|
||||
"alert.list": { alerts: Alert[] };
|
||||
"risk.list": { risks: Risk[] };
|
||||
@@ -264,6 +268,8 @@ export type RpcResponseMap = {
|
||||
"filing.list": { filings: Filing[] };
|
||||
"model.get": { headers: string[]; rows: ModelRow[] };
|
||||
"model.updateCell": { ok: boolean; affectedCells: string[] };
|
||||
"model.createRow": { row: ModelRow; position: number };
|
||||
"model.deleteRow": { ok: boolean };
|
||||
"model.runScenario": { headers: string[]; rows: ModelRow[] };
|
||||
"memo.get": {
|
||||
status: "draft" | "review" | "final";
|
||||
|
||||
@@ -57,6 +57,7 @@ export const RpcRequestSchemas = {
|
||||
"company.setActive": z.object({ companyId: idString }),
|
||||
"workspace.getSection": z.object({ companyId: idString, section: nonEmptyString }),
|
||||
"workspace.listSources": z.object({ companyId: idString }),
|
||||
"workspace.updateSection": z.object({ companyId: idString, section: nonEmptyString, content: z.string() }),
|
||||
"catalyst.list": z.object({ companyId: idString }),
|
||||
"alert.list": z.object({ companyId: idString.optional(), since: z.string().optional() }),
|
||||
"risk.list": z.object({ companyId: idString }),
|
||||
@@ -71,6 +72,14 @@ export const RpcRequestSchemas = {
|
||||
col: nonNegativeIndex,
|
||||
value: z.string(),
|
||||
}),
|
||||
"model.createRow": z.object({
|
||||
companyId: idString,
|
||||
tab: nonEmptyString,
|
||||
label: nonEmptyString,
|
||||
kind: z.enum(["actual", "forecast", "total"]),
|
||||
values: z.array(z.string()).optional(),
|
||||
}),
|
||||
"model.deleteRow": z.object({ companyId: idString, tab: nonEmptyString, row: nonNegativeIndex }),
|
||||
"model.runScenario": z.object({
|
||||
companyId: idString,
|
||||
scenario: nonEmptyString,
|
||||
@@ -141,6 +150,7 @@ export const RpcResponseSchemas = {
|
||||
"company.setActive": z.object({ ok: z.boolean() }),
|
||||
"workspace.getSection": z.object({ content: WorkspaceSectionSchema, validationState: z.string() }),
|
||||
"workspace.listSources": z.object({ sources: z.array(z.object({ type: z.string(), title: z.string(), metadata: z.string() })) }),
|
||||
"workspace.updateSection": z.object({ content: WorkspaceSectionSchema, savedAt: z.string() }),
|
||||
"catalyst.list": z.object({ catalysts: z.array(CatalystSchema) }),
|
||||
"alert.list": z.object({ alerts: z.array(AlertSchema) }),
|
||||
"risk.list": z.object({ risks: z.array(RiskSchema) }),
|
||||
@@ -149,6 +159,8 @@ export const RpcResponseSchemas = {
|
||||
"filing.list": z.object({ filings: z.array(FilingSchema) }),
|
||||
"model.get": z.object({ headers: z.array(z.string()), rows: z.array(ModelRowSchema) }),
|
||||
"model.updateCell": z.object({ ok: z.boolean(), affectedCells: z.array(z.string()) }),
|
||||
"model.createRow": z.object({ row: ModelRowSchema, position: z.number().int().min(0) }),
|
||||
"model.deleteRow": z.object({ ok: z.boolean() }),
|
||||
"model.runScenario": z.object({ headers: z.array(z.string()), rows: z.array(ModelRowSchema) }),
|
||||
"memo.get": z.object({
|
||||
status: z.enum(["draft", "review", "final"]),
|
||||
|
||||
Reference in New Issue
Block a user