s-private API Documentation - v3.8.1
    Preparing search index...

    Domain event emitted when a book is created.

    Part of the event-driven architecture for cross-cutting concerns like notifications, logging, and analytics.

    const event = new BookCreatedEvent({
    isbn: "978-4-06-521234-5",
    title: "The Pragmatic Programmer",
    userId: "user-123",
    caller: "addBook",
    });

    // event.eventType === "book.created"
    await eventHandler.handle(event);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Constructors

    • Creates a new BookCreatedEvent.

      Parameters

      • data: { caller: string; isbn: string; title: string; userId: string }

        Event data containing book details and metadata

        • caller: string

          The function/method that triggered the event

        • isbn: string

          The book's ISBN identifier

        • title: string

          The book title

        • userId: string

          The user who created the book

      Returns BookCreatedEvent

    Properties

    eventType: string

    The type of event (e.g., "article.created")

    metadata: { caller: string; timestamp: Date; userId: string }

    Contextual information about the event

    Event-specific data