@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 19 lines 662 Bytes
Raw
1 import * as Domain from "@alchemy.run/domain";
2 import * as Schema from "effect/Schema";
3 import { CustomerId } from "../Customer/Customer.id.ts";
4 import { AccountId } from "./Account.id.ts";
5
6 export class AlreadyOpen extends Domain.Rejection("AlreadyOpen") {}
7
8 export class AccountOpened extends Domain.Event("AccountOpened", {
9 customerId: CustomerId,
10 owner: Schema.String,
11 }) {}
12
13 /** Open an account for a customer. Sent by `MainAccountProvisioning`. */
14 export class OpenAccount extends Domain.Command("OpenAccount", {
15 target: AccountId,
16 input: { customerId: CustomerId, owner: Schema.String },
17 events: [AccountOpened],
18 rejects: [AlreadyOpen],
19 }) {}