Event and message catalogue
Four unrelated things are called "events" in this codebase. This page catalogues all four.
1. Domain event types
src/app/manage/event-rules/event-rule.models.ts — what an event rule can
match.
eventTypes member |
Produced by |
|---|---|
|
The analytics stream. |
|
API-originated events. |
|
CLI service operations. |
|
Generic domain events. |
|
Outbound message log entries. |
|
Delivery results. |
|
CRM task transitions. |
|
Underwriting decisions and changes. |
eventTargets member |
Subject of the event |
|---|---|
|
A compliance/KYC action. |
|
A CRM task. |
|
An email. |
|
A marketplace or marketplace link. |
|
A supplier — the common case; the target id is the supplier key. |
The target id travels as a header: X-EventLogger-TargetUUID on event-logger calls,
X-Actions-TargetUUID on Actions Tools calls. X-InstanceId /
X-EventLogger-InstanceId carry env.instanceId (8001) — except
MonitorService, which hardcodes 8003.
Stores: eventLoggerUrl (v2 — es-changelog, track) and
eventRulesOldUrl (v1 — event_rules/, plus a raw Elasticsearch endpoint at es
against the index em_events).
See events.
2. Event-rule actions
Action static members in the same file:
| Constant | Wire value | Status |
|---|---|---|
|
|
Active |
|
|
Active |
|
|
Active |
|
|
Active |
|
|
Defined but commented out of |
Action fields: type, template, to, contextMapping, dataMapping, data,
delay, delayTime, delayPeriod, delayEnabled.
Delay units (send-email.component.ts): MINUTES = 60, DAYS = 86400,
WEEKS = 604800 seconds. No hours, no seconds.
EventBridge action names must start with em_event_rule_
(PREFIX_EVNET_RULE, misspelled constant, correct value).
Filter operators
Filter parses expressions into { name, op, val }:
| Expression | Stored op |
Rendered back as |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Regex: /([a-zA-Z.]+ ) *(!=|=|<|>|>=|⇐|=<|⇒) *([^ ]+)/ — note the required
trailing space in the field-name group, and that field names may contain dots
(data.target_type).
The same { name, op, val } shape is the API’s query language, used by
EventsService.historyList.
3. Iframe postMessage protocol
src/app/shared/iframe/communication/message-type.enum.ts. Values are
human-readable strings. Envelope:
{ pluginIframeId, payload: { type: MESSAGE_TYPE, data? } }.
MESSAGE_SOURCE is PARENT ('parent') or CHILD ('child').
Configuration
| Type | Value | Dir. | Payload / effect |
|---|---|---|---|
|
|
EVA→IA |
EVA asks for its config. |
|
|
IA→EVA |
|
|
|
EVA→IA |
EVA reports its own available/build flags. |
|
|
IA→EVA |
Clear EVA’s flag overrides. |
Navigation
| Type | Value | Dir. | Effect |
|---|---|---|---|
|
|
EVA→IA |
|
|
|
EVA→IA |
Same handler — behaviourally identical today. |
|
|
IA→EVA |
Sent to the top bar on every |
|
|
EVA→IA |
Jump to the external sales CRM via |
Supplier state
| Type | Value | Dir. | Effect |
|---|---|---|---|
|
|
EVA→IA |
IA waits for a matching |
|
|
IA→EVA |
Push details into EVA’s store — sent on every change. |
|
|
EVA→IA |
Dispatches |
|
|
IA→EVA |
Ask EVA’s header to re-fetch. |
|
|
both |
IA replies |
Actions
| Type | Value | Dir. | Effect |
|---|---|---|---|
|
|
EVA→IA |
Login-as-supplier flow (needs the browser extension). |
|
|
EVA→IA |
Amazon login flow. |
|
|
EVA→IA |
Start an earnings load. |
|
|
EVA→IA |
Refresh the contracts page. |
|
|
EVA→IA |
|
Sizing
| Type | Value | Effect |
|---|---|---|
|
|
Set height and width. |
|
|
Set width. |
|
|
Set height. |
|
|
Back to |
|
|
Expand the supplier top bar. |
|
|
Restore it. |
Resize payloads may carry differentFrameSelector to resize another frame.
Iframe host selectors
shared/eva/const/eva-iframe-selector.enum.ts — how the parent addresses a frame:
| Member | Selector |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Cookie key: EVA_COOKIE_TOKEN_KEY = 'PYBEvaToken'
(shared/eva/const/eva.ts).
|
|
4. In-app event bus
src/app/shared/table-events.service.ts — string-named Subject bus.
| Event | Broadcast by → consumed by |
|---|---|
|
|
|
|
|
Transaction dialogs → transaction grids refresh. |
|
Sidebar → layout listeners. |
on() has no unsubscribe — register once. A throwing listener kills the shared
Subject for everyone. See
the in-app event bus.
Other Subject buses
| Service | Emits |
|---|---|
|
|
|
|
|
|
|
Card save/error feedback. |
|
The shared SSE stream plus an internal |
Server-sent events
One stream: GET <workflowApiUrl>tasksMonitoring, opened by
B2bWorkflowService.taskMonitoring() through SseService
(EventSourcePolyfill with an X-Session-Token header). Messages are arbitrary JSON
carrying at least taskName.
No reconnect logic — any error or parse failure terminates the stream. See real-time streams.
CRM timeline item types
Not events, but the adjacent vocabulary — the type discriminator in the
activity/ feed (CrmService.listActions):
type |
Model |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
(anything else) |
|
See CRM.
Analytics events
| Event | Sent by |
|---|---|
|
|
|
|
|
|
|
|
Arbitrary |
|
|
Segment |
See observability.