customer.update¶
Direction: server → modules. External Moleculer event name: customer.update.
Source and occurrence¶
C++ payload: CustomerUpdatedRecord. Internal EventBus name: customer.updated.
Every customer update in CustomerManager — a manager's card or bulk edit, a workflow action, a KYC aggregate update, a lifecycle flags change or a conversion — captures current and previous values under the cache lock before replacing the customer. It then emits a separate customer.updated domain record. An update that would leave the stored record as it is writes nothing and emits no event. Password, OTP and last-login writes do not emit it either. The ordinary internal customer.push record is not exported by this mapping.
previous_status, previous_lifecycle_flags and previous_customer_kind are producer snapshots. Updating unrelated fields may leave them unchanged. This is not customer creation, and it does not export password, name, email or phone.
JSON payload¶
The payload is flat; there is no data wrapper. All listed fields are emitted.
{
"event_id": "a89e743cf46a4855986aa6769e47a075",
"event_code": 1,
"occurred_at": 1789080000,
"schema_version": 2,
"customer_id": 1001,
"brand": "ion4",
"desk": "1",
"status": 1,
"lifecycle_flags": 6,
"customer_kind": 1,
"previous_status": 1,
"previous_lifecycle_flags": 2,
"previous_customer_kind": 0,
"country_of_residence": "UA",
"address_of_residence": "12 Example Street, Kyiv"
}
| Domain field | JSON type |
|---|---|
customer_id |
integer |
brand |
string |
desk |
string |
status |
integer |
lifecycle_flags |
integer |
customer_kind |
integer |
previous_status |
integer |
previous_lifecycle_flags |
integer |
previous_customer_kind |
integer |
country_of_residence |
string |
address_of_residence |
string |
Common fields: event_id (32-character random hex string), event_code (original integer code), occurred_at (Unix seconds), schema_version (integer, currently 2).
occurred_at uses the source timestamp; zero remains zero. Margin uses transition time.
address_of_residence is the current residence address, unmasked; there is no previous
value. Treat it as personal data: keep it out of ordinary logs, analytics and error messages.
Subscription and delivery¶
Subscribe through the module's normal Moleculer event handler for customer.update.
Enabled with server nats.enable. Publication is asynchronous, fire-and-forget,
without ACK, retry or durable replay. Queue limit: 4096 business messages; JSON limit:
16 KiB. New messages can be dropped at either limit; order is not guaranteed.
event_id supports consumer deduplication, not exactly-once delivery.
See shared outbound rules for lifecycle, observability and trust limits. See outbound catalogue for other event families.