add quick leads
All checks were successful
Build and Publish / build-release (push) Successful in 2m13s

This commit is contained in:
2026-04-30 16:40:40 -05:00
parent 3a22776568
commit cfd810beba
20 changed files with 1054 additions and 11 deletions

View File

@@ -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