Skip to content

Instantly share code, notes, and snippets.

@fredgrott
Created February 22, 2025 15:14
Show Gist options
  • Save fredgrott/3575e6853b4cd66bb11e487089e2f692 to your computer and use it in GitHub Desktop.
Save fredgrott/3575e6853b4cd66bb11e487089e2f692 to your computer and use it in GitHub Desktop.
cqrs command
abstract class ForAccount {
final String forAggregate = "account";
}
class CreateAccountCmd extends Command with ForAccount {
final String modelId;
final String owner;
CreateAccountCmd({@required this.owner, @required this.modelId});
}
class DepositCmd extends Command with ForAccount {
final String modelId;
final double amount;
DepositCmd({@required this.amount, @required this.modelId});
}
class WithdrawCmd extends Command with ForAccount {
final String modelId;
final double amount;
WithdrawCmd({@required this.amount, @required this.modelId});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment