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 Schema from "effect/Schema"; |
| 3 | import { Actor } from "../Actor.ts"; |
| 4 | import { Session } from "../Session.middleware.ts"; |
| 5 | import { AccountId } from "./Account.id.ts"; |
| 6 | import { NotOpen } from "./NotOpen.rejection.ts"; |
| 7 | import { NotOwner } from "./NotOwner.rejection.ts"; |
| 8 | |
| 9 | export class AccountFrozen extends Domain.Event("AccountFrozen", { |
| 10 | reason: Schema.String, |
| 11 | by: Actor, |
| 12 | }) {} |
| 13 | |
| 14 | /** Stop money leaving an account. Freezing a frozen account records nothing. */ |
| 15 | export class FreezeAccount extends Domain.Command("FreezeAccount", { |
| 16 | target: AccountId, |
| 17 | middleware: [Session], |
| 18 | input: { reason: Schema.String }, |
| 19 | events: [AccountFrozen], |
| 20 | rejects: [NotOpen, NotOwner], |
| 21 | }) {} |