This commit is contained in:
11
lib/policy_service/aggregates/fire_policy_application.ex
Normal file
11
lib/policy_service/aggregates/fire_policy_application.ex
Normal file
@@ -0,0 +1,11 @@
|
||||
defmodule PolicyService.Aggregates.FirePolicyApplication do
|
||||
use PolicyService.Aggregates.PolicyApplication,
|
||||
policy_type: "fire",
|
||||
commands: PolicyService.Commands.FirePolicy
|
||||
|
||||
def validate_details(%{property_address: addr, property_value: val})
|
||||
when is_binary(addr) and byte_size(addr) > 0 and is_number(val) and val > 0,
|
||||
do: :ok
|
||||
|
||||
def validate_details(_), do: {:error, :invalid_fire_details}
|
||||
end
|
||||
Reference in New Issue
Block a user