The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import * as Domain from "@alchemy.run/domain"; |
| 2 | import { Bank } from "./Bank.model.ts"; |
| 3 | |
| 4 | /** |
| 5 | * What the customer app reaches: commands to change things, and the Account |
| 6 | * aggregate and views to read and watch. Each entry authorizes itself, |
| 7 | * through its `decide` or `validate`. |
| 8 | */ |
| 9 | export class CustomerApi extends Domain.Api("CustomerApi", { |
| 10 | model: Bank, |
| 11 | commands: [ |
| 12 | "RegisterCustomer", |
| 13 | "DepositMoney", |
| 14 | "WithdrawMoney", |
| 15 | "CloseAccount", |
| 16 | "RequestTransfer", |
| 17 | ], |
| 18 | views: ["CustomerDashboard", "AccountSummary", "Statement", "AccountTransfers", "TransferStatus"], |
| 19 | streams: ["AccountCard"], |
| 20 | aggregates: ["Account"], |
| 21 | }) {} |