Files
policy-service/lib/policy_service/aggregates/fire_contents_policy_application.ex
HaimKortovich 2a8f2ffc2d
All checks were successful
Build and Publish / build-release (push) Successful in 1m38s
refactor buyer and insured and add more policy types
2026-04-27 14:06:28 -05:00

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