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

    Type Alias Event<TYPE, DATA>

    The common event structure, published by services

    Example usage:

    type MyEvent = Event<"myDomain.myEntity.someEvent", {
    field1: string,
    field2: Date
    }>
    type Event<TYPE, DATA> = {
        createdAt?: Date;
        customerId: string;
        data: DATA;
        event: TYPE;
    }

    Type Parameters

    • TYPE

      The type of the event, should be uique within its domain

    • DATA

      The event data for this specific event type and domain. It must be (de)seriable to/from JSON

    Index

    Properties

    createdAt?: Date

    The timestamp of when the publisher created the event

    customerId: string

    B2B Customer ID

    data: DATA
    event: TYPE

    Event type, in the format:

    <domain>.<entity>.<event>, e.g. deposit.cashDepositRequest.statusUpdated