Command (reactive_commons v0.6.2) View Source
Commands represent a intention for doing something, that intention must to be done by the domain context with that responsibility. An example of a command may be: "RegisterUser" or "SendNotification".
Link to this section Summary
Functions
Creates a new Command structure with a generated command_id
Creates a new Command structure
Link to this section Functions
Creates a new Command structure with a generated command_id
Examples
iex> Command.new("RegisterUser", %{name: "username", email: "user@example.com"})
%Command{
commandId: "a313623c-4701-40d3-95e0-bde25e02b52a",
data: %{email: "user@example.com", name: "username"},
name: "registerUser"
}
Creates a new Command structure
Examples
iex> Command.new("RegisterUser", %{name: "username", email: "user@example.com"}, "4016ab59-16d0-41cd-ba4f-52ce200f8ea8")
%Command{
commandId: "4016ab59-16d0-41cd-ba4f-52ce200f8ea8",
data: %{email: "user@example.com", name: "username"},
name: "registerUser"
}