Current section
Files
Jump to
Current section
Files
test/support/test_command_simple_label.ex
defmodule TestCommandSimpleLabel do
defstruct [
:id,
:name
]
end
defimpl Commanded.Middleware.Uniqueness.UniqueFields, for: TestCommandSimpleLabel do
def unique(%TestCommandSimpleLabel{id: id}),
do: [
{:name, "has already been taken", id, label: :another_label}
]
end