add quick leads
All checks were successful
Build and Publish / build-release (push) Successful in 2m13s
All checks were successful
Build and Publish / build-release (push) Successful in 2m13s
This commit is contained in:
@@ -47,4 +47,34 @@ defmodule CustomerService.Projectors.Customer do
|
||||
address: e.address
|
||||
})
|
||||
end)
|
||||
|
||||
project(%Events.CustomerUpdated{} = e, _meta, fn multi ->
|
||||
Ecto.Multi.update_all(multi, :customer, from(c in Customer, where: c.id == ^e.id),
|
||||
set: [
|
||||
first_name: e.first_name,
|
||||
last_name: e.last_name,
|
||||
birth_date: parse_date(e.birth_date),
|
||||
gender: e.gender,
|
||||
email: e.email,
|
||||
phone: e.phone,
|
||||
address: e.address,
|
||||
document_id: e.document_id
|
||||
]
|
||||
)
|
||||
end)
|
||||
|
||||
project(%Events.CorporateCustomerUpdated{} = e, _meta, fn multi ->
|
||||
Ecto.Multi.update_all(multi, :customer, from(c in Customer, where: c.id == ^e.id),
|
||||
set: [
|
||||
legal_name: e.legal_name,
|
||||
commercial_name: e.commercial_name,
|
||||
ruc: e.ruc,
|
||||
legal_rep_name: e.legal_rep_name,
|
||||
legal_rep_document_id: e.legal_rep_document_id,
|
||||
email: e.email,
|
||||
phone: e.phone,
|
||||
address: e.address
|
||||
]
|
||||
)
|
||||
end)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user