Handles all interactions with the comics-db 'transactions' table.

Read operations:

  • getTransaction(txId): Promise - Reads a single Transaction by ID.
  • getTransactionsForShops(shopId): Promise<Transaction[]> - Reads Transactions by shop ID.
  • getTransactions(): Promise - Reads all Transactions.

Hierarchy

  • Dao
    • TransactionsDao

Constructors

Properties

db: Knex<any, any[]>

Accessors

  • get primaryKey(): string
  • The primary key of the table as defined in the database.

    Returns string

  • get tableName(): string
  • The name of the table as defined in the database.

    Returns string

Methods

  • Reads a single Transaction by ID.

    Parameters

    • txId: string

      The ID of the Transaction.

    Returns Promise<null | Transaction>

    Transaction or null if txId does not exist.

  • Reads Transactions by shop ID.

    Parameters

    • shopId: string

      The ID of the Shop.

    Returns Promise<Transaction[]>

    Transaction[]