The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import * as Domain from "@alchemy.run/domain"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import { Account } from "./Account/Account.aggregate.ts"; |
| 4 | import { AccountActivity } from "./Account/AccountActivity.view.ts"; |
| 5 | import { AccountCard } from "./Account/AccountCard.stream.ts"; |
| 6 | import { AccountCards, AccountCardsLive } from "./Account/AccountCards.projection.ts"; |
| 7 | import { AccountSummary } from "./Account/AccountSummary.view.ts"; |
| 8 | import { Statement } from "./Account/Statement.view.ts"; |
| 9 | import { Customer } from "./Customer/Customer.aggregate.ts"; |
| 10 | import { CustomerDashboard } from "./Customer/CustomerDashboard.view.ts"; |
| 11 | import { |
| 12 | MainAccountProvisioning, |
| 13 | MainAccountProvisioningLive, |
| 14 | } from "./Customer/MainAccountProvisioning.policy.ts"; |
| 15 | import { UsernameClaim } from "./Customer/UsernameClaim.aggregate.ts"; |
| 16 | import { |
| 17 | UsernameReservation, |
| 18 | UsernameReservationLive, |
| 19 | } from "./Customer/UsernameReservation.policy.ts"; |
| 20 | import { DailyOutflow } from "./Fraud/DailyOutflow.view.ts"; |
| 21 | import { FraudReview, FraudReviewLive } from "./Fraud/FraudReview.policy.ts"; |
| 22 | import { Ledger, LedgerLive } from "./Ledger/Ledger.projection.ts"; |
| 23 | import { SettlementRefund, SettlementRefundLive } from "./Settlement/SettlementRefund.policy.ts"; |
| 24 | import { AccountTransfers } from "./Transfer/AccountTransfers.view.ts"; |
| 25 | import { ExecuteTransfer, ExecuteTransferLive } from "./Transfer/ExecuteTransfer.saga.ts"; |
| 26 | import { Transfer } from "./Transfer/Transfer.aggregate.ts"; |
| 27 | import { |
| 28 | TransferApprovalDeadline, |
| 29 | TransferApprovalDeadlineLive, |
| 30 | } from "./Transfer/TransferApprovalDeadline.policy.ts"; |
| 31 | import { TransferExecution, TransferExecutionLive } from "./Transfer/TransferExecution.policy.ts"; |
| 32 | import { TransferStatus } from "./Transfer/TransferStatus.view.ts"; |
| 33 | |
| 34 | /** The bank: every aggregate, view, policy, projection, stream and saga, hosted together. */ |
| 35 | export class Bank extends Domain.Model("Bank", { |
| 36 | aggregates: [Customer, UsernameClaim, Account, Transfer], |
| 37 | views: [ |
| 38 | AccountSummary, |
| 39 | CustomerDashboard, |
| 40 | Statement, |
| 41 | AccountActivity, |
| 42 | TransferStatus, |
| 43 | AccountTransfers, |
| 44 | DailyOutflow, |
| 45 | ], |
| 46 | policies: [ |
| 47 | UsernameReservation, |
| 48 | MainAccountProvisioning, |
| 49 | TransferExecution, |
| 50 | TransferApprovalDeadline, |
| 51 | FraudReview, |
| 52 | SettlementRefund, |
| 53 | ], |
| 54 | projections: [Ledger, AccountCards], |
| 55 | streams: [AccountCard], |
| 56 | sagas: [ExecuteTransfer], |
| 57 | }) {} |
| 58 | |
| 59 | /** |
| 60 | * The policies' and projections' implementations. They require the FraudCheck |
| 61 | * and Payments external systems, and the LedgerStore. |
| 62 | */ |
| 63 | export const BankHandlers = Layer.mergeAll( |
| 64 | UsernameReservationLive, |
| 65 | MainAccountProvisioningLive, |
| 66 | TransferExecutionLive, |
| 67 | ExecuteTransferLive, |
| 68 | TransferApprovalDeadlineLive, |
| 69 | FraudReviewLive, |
| 70 | SettlementRefundLive, |
| 71 | LedgerLive, |
| 72 | AccountCardsLive, |
| 73 | ); |