All checks were successful
Build and Publish / build-release (push) Successful in 3m7s
63 lines
1.5 KiB
Elixir
63 lines
1.5 KiB
Elixir
defmodule CustomerService.Projections.QuickLead do
|
|
use Ecto.Schema
|
|
|
|
@derive {Jason.Encoder,
|
|
only: [
|
|
:id,
|
|
:org_id,
|
|
:lead_id,
|
|
:name,
|
|
:email,
|
|
:phone,
|
|
:company_name,
|
|
:status,
|
|
:priority,
|
|
:source,
|
|
:notes,
|
|
:assigned_to,
|
|
:estimated_value,
|
|
:expected_close_date,
|
|
:status_history,
|
|
:inserted_at,
|
|
:updated_at
|
|
]}
|
|
|
|
@derive {
|
|
Flop.Schema,
|
|
filterable: [:org_id, :status, :priority, :source, :assigned_to, :search],
|
|
sortable: [:name, :company_name, :status, :priority, :inserted_at],
|
|
default_limit: 20,
|
|
max_limit: 100,
|
|
custom_fields: [
|
|
search: [
|
|
filter: {CustomerService.Lead.Filters, :search, []},
|
|
ecto_type: :string,
|
|
operators: [:==]
|
|
]
|
|
]
|
|
}
|
|
|
|
@primary_key {:id, :string, autogenerate: false}
|
|
@timestamps_opts [type: :utc_datetime_usec]
|
|
|
|
schema "quick_leads" do
|
|
field :org_id, :string
|
|
field :lead_id, :string
|
|
|
|
field :name, :string
|
|
field :email, :string
|
|
field :phone, :string
|
|
field :company_name, :string
|
|
field :status, :string
|
|
field :priority, :string
|
|
field :source, :string
|
|
field :notes, :string
|
|
field :assigned_to, :string
|
|
field :estimated_value, :decimal
|
|
field :expected_close_date, :date
|
|
field :status_history, {:array, :map}, default: []
|
|
|
|
timestamps()
|
|
end
|
|
end
|