@cfxlabsinc/b2b-services
    Preparing search index...

    Type Alias CustomerEventEnvelope<N>

    CustomerEventEnvelope: {
        createdAt: string;
        customerId: string;
        data: Static<typeof customerEvents[N]["data"]>;
        event: N;
        id: string;
    } & EntityRefs

    Wire-side envelope — what a consumer receives off the SNS topic, and the type counterpart of customerEventSchemas. The customer-bus analogue of InternalEventEnvelope (../internal), differing from the publish-side CustomerEvent the same two ways: id is present here (the publisher mints it; consumers dedupe on it) and createdAt is the ISO string the publisher's Date serialised to.

    Spelled out rather than intersected with CustomerEvent: CustomerEventBase types createdAt as an optional Date, and an intersection would collapse Date & string to never. Omit is out for the same reason it is on CustomerEventBase — it flattens the EntityRefs union arm.

    Type Parameters

    Type Declaration

    • createdAt: string
    • customerId: string
    • data: Static<typeof customerEvents[N]["data"]>
    • event: N
    • id: string

      Minted at publish. Internal only — never delivered to a customer.