Skip to content

customer.update

Direction: server → modules. External Moleculer event name: customer.update.

Source and occurrence

C++ payload: CustomerUpdatedRecord. Internal EventBus name: customer.updated.

CustomerManager::UpdateCustomer captures current and previous statuses under the cache lock before replacing the customer. It then emits a separate customer.updated domain record. The ordinary internal customer.push record is not exported by this mapping.

previous_status and previous_lifecycle_stage are producer snapshots. Updating unrelated fields may leave both 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": 1,
  "customer_id": 1001,
  "brand": "ion4",
  "desk": "1",
  "status": 1,
  "lifecycle_stage": 2,
  "previous_status": 1,
  "previous_lifecycle_stage": 0,
  "country_of_residence": "UA"
}
Domain field JSON type
customer_id integer
brand string
desk string
status integer
lifecycle_stage integer
previous_status integer
previous_lifecycle_stage integer
country_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 1).

occurred_at uses the source timestamp; zero remains zero. Margin uses transition time.

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.