defmodule CustomerService.Projections.QuickLead do use Ecto.Schema @derive {Jason.Encoder, only: [ :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: [: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, :binary_id, autogenerate: false} @timestamps_opts [type: :utc_datetime_usec] schema "quick_leads" do 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, :map timestamps() end end