Foodtruck Order — TypeScript Reference - v0.1.0
    Preparing search index...

    Application-level abstraction for persisting and retrieving Message objects.

    Implementations encapsulate the database-specific details. Callers of this abstraction should not need to know whether messages are stored in PostgreSQL, how the connection is managed, or how rows are mapped.

    interface MessageRepository {
        createMessage(message: Message): Promise<Message>;
        getMessageById(id: number): Promise<Message | null>;
    }
    Index
    • Retrieve a message by its identifier.

      Returns null when no message with the given identifier exists. Database failures are not swallowed and propagate to the caller.

      Parameters

      • id: number

      Returns Promise<Message | null>