partition by org_id and add auth
All checks were successful
Build and Publish / build-release (push) Successful in 3m7s
All checks were successful
Build and Publish / build-release (push) Successful in 3m7s
This commit is contained in:
@@ -4,6 +4,8 @@ defmodule CustomerService.Projections.Customer do
|
||||
@derive {Jason.Encoder,
|
||||
only: [
|
||||
:id,
|
||||
:org_id,
|
||||
:customer_id,
|
||||
:customer_type,
|
||||
# individual
|
||||
:first_name,
|
||||
@@ -27,7 +29,7 @@ defmodule CustomerService.Projections.Customer do
|
||||
|
||||
@derive {
|
||||
Flop.Schema,
|
||||
filterable: [:customer_type, :email, :phone, :document_id, :ruc, :search],
|
||||
filterable: [:org_id, :customer_type, :email, :phone, :document_id, :ruc, :search],
|
||||
sortable: [:last_name, :legal_name, :inserted_at],
|
||||
default_limit: 20,
|
||||
max_limit: 100,
|
||||
@@ -40,10 +42,13 @@ defmodule CustomerService.Projections.Customer do
|
||||
]
|
||||
}
|
||||
|
||||
@primary_key {:id, :binary_id, autogenerate: false}
|
||||
@primary_key {:id, :string, autogenerate: false}
|
||||
@timestamps_opts [type: :utc_datetime_usec]
|
||||
|
||||
schema "customers" do
|
||||
field :org_id, :string
|
||||
field :customer_id, :string
|
||||
|
||||
field :customer_type, :string, default: "individual"
|
||||
|
||||
# individual fields
|
||||
|
||||
@@ -4,6 +4,8 @@ defmodule CustomerService.Projections.QuickLead do
|
||||
@derive {Jason.Encoder,
|
||||
only: [
|
||||
:id,
|
||||
:org_id,
|
||||
:lead_id,
|
||||
:name,
|
||||
:email,
|
||||
:phone,
|
||||
@@ -22,7 +24,7 @@ defmodule CustomerService.Projections.QuickLead do
|
||||
|
||||
@derive {
|
||||
Flop.Schema,
|
||||
filterable: [:status, :priority, :source, :assigned_to, :search],
|
||||
filterable: [:org_id, :status, :priority, :source, :assigned_to, :search],
|
||||
sortable: [:name, :company_name, :status, :priority, :inserted_at],
|
||||
default_limit: 20,
|
||||
max_limit: 100,
|
||||
@@ -35,10 +37,13 @@ defmodule CustomerService.Projections.QuickLead do
|
||||
]
|
||||
}
|
||||
|
||||
@primary_key {:id, :binary_id, autogenerate: false}
|
||||
@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
|
||||
|
||||
Reference in New Issue
Block a user