refactor buyer and insured and add more policy types
All checks were successful
Build and Publish / build-release (push) Successful in 1m38s
All checks were successful
Build and Publish / build-release (push) Successful in 1m38s
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
defmodule PolicyService.Aggregates.FireStructurePolicyApplication do
|
||||
use PolicyService.Aggregates.PolicyApplication,
|
||||
policy_type: "fire_structure",
|
||||
commands: PolicyService.Commands.FireStructurePolicy
|
||||
|
||||
def validate_details(%{
|
||||
"location" => location,
|
||||
"property_value" => value,
|
||||
"property_use" => use_type,
|
||||
"security_measures" => measures,
|
||||
"market_value" => market_value
|
||||
})
|
||||
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_number(market_value) and market_value > 0 do
|
||||
:ok
|
||||
end
|
||||
|
||||
def validate_details(_), do: {:error, :invalid_fire_structure_details}
|
||||
end
|
||||
Reference in New Issue
Block a user