All checks were successful
Build and Publish / build-release (push) Successful in 1m38s
23 lines
757 B
Elixir
23 lines
757 B
Elixir
defmodule PolicyService.Aggregates.FireContentsPolicyApplication do
|
|
use PolicyService.Aggregates.PolicyApplication,
|
|
policy_type: "fire_contents",
|
|
commands: PolicyService.Commands.FireContentsPolicy
|
|
|
|
def validate_details(%{
|
|
"location" => location,
|
|
"contents_value" => value,
|
|
"property_use" => use_type,
|
|
"security_measures" => measures,
|
|
"high_value_items" => items
|
|
})
|
|
when is_binary(location) and byte_size(location) > 0 and
|
|
is_number(value) and value > 0 and
|
|
is_binary(use_type) and byte_size(use_type) > 0 and
|
|
is_list(measures) and
|
|
is_list(items) do
|
|
:ok
|
|
end
|
|
|
|
def validate_details(_), do: {:error, :invalid_fire_contents_details}
|
|
end
|