All checks were successful
Build and Publish / build-release (push) Successful in 1m41s
76 lines
1.9 KiB
Elixir
76 lines
1.9 KiB
Elixir
defmodule PolicyService.Projections.PolicyApplication do
|
|
use Ecto.Schema
|
|
|
|
@derive {Jason.Encoder,
|
|
only: [
|
|
:id,
|
|
:application_id,
|
|
:org_id,
|
|
:submitted_by,
|
|
:policy_type,
|
|
:applicant_info,
|
|
:policy_details,
|
|
:selected_providers,
|
|
:quotes,
|
|
:accepted_plan_id,
|
|
:accepted_by,
|
|
:provider_policy_number,
|
|
:premium,
|
|
:effective_date,
|
|
:expiry_date,
|
|
:status,
|
|
:submitted_at,
|
|
:solicitation_sent_at,
|
|
:issued_at,
|
|
:inserted_at,
|
|
:updated_at
|
|
]}
|
|
|
|
@derive {
|
|
Flop.Schema,
|
|
filterable: [:org_id, :policy_type, :status, :search],
|
|
sortable: [:submitted_at, :policy_type, :status],
|
|
default_limit: 20,
|
|
max_limit: 100,
|
|
custom_fields: [
|
|
search: [
|
|
filter: {PolicyService.Projections.PolicyApplicationFilters, :search, []},
|
|
ecto_type: :string,
|
|
operators: [:==]
|
|
]
|
|
]
|
|
}
|
|
|
|
@primary_key {:id, :string, autogenerate: false}
|
|
@timestamps_opts [type: :utc_datetime_usec]
|
|
|
|
schema "policy_applications" do
|
|
field :application_id, :string
|
|
field :org_id, :string
|
|
field :submitted_by, :string
|
|
field :policy_type, :string
|
|
|
|
field :applicant_info, :map
|
|
field :policy_details, :map
|
|
|
|
field :selected_providers, {:array, :string}, default: []
|
|
field :quotes, :map, default: %{}
|
|
|
|
field :accepted_plan_id, :string
|
|
field :accepted_by, :string
|
|
|
|
field :provider_policy_number, :string
|
|
|
|
field :premium, :decimal
|
|
field :effective_date, :date
|
|
field :expiry_date, :date
|
|
|
|
field :status, :string
|
|
field :submitted_at, :utc_datetime_usec
|
|
field :solicitation_sent_at, :utc_datetime_usec
|
|
field :issued_at, :utc_datetime_usec
|
|
|
|
timestamps()
|
|
end
|
|
end
|