Options
All
  • Public
  • Public/Protected
  • All
Menu

Class BillingClient

Client to call Billing schema

Hierarchy

  • BillingClient

Index

Properties

Methods

Properties

Private client

Methods

get

  • get<B, BR, BR_UL, BR_UL_U, BR_UL_U_P, BR_UL_U_P_E, BR_UL_R, BR_FUL, BR_TUL>(fields: B[], args: ViewerBillingArgs, option: BillingOption<BR, BR_UL, BR_UL_U, BR_UL_U_P, BR_UL_U_P_E, BR_UL_R, BR_FUL, BR_TUL>): Promise<Result<BillingResult<B, BR, BR_UL, BR_UL_U, BR_UL_U_P, BR_UL_U_P_E, BR_UL_R, BR_FUL, BR_TUL>>>
  • Get billing information.

    client.billing.get(
      ['id', 'month', 'year'],
      { input: { year: Number(req.query.year), month: Number(req.query.month) } },
      {
        records: {
          fields: ['id', 'date'],
          with: {
            usages: {
              fields: ['paidSec', 'amount', 'ledgerType'],
              with: {
                user: {
                  fields: ['id'], with: { profile: { fields: ['firstName'] } }
                },
                room: { fields: ['name'] }
              }
            },
            freeCredits: { fields: ['paidSec', 'amount', 'ledgerType']},
            topups: { fields: ['paidSec', 'amount', 'ledgerType']},
          }
        }
      }
    )

    Type parameters

    Parameters

    • fields: B[]

      Array of Billing key names. Returns specified fields as result.

    • args: ViewerBillingArgs
    • option: BillingOption<BR, BR_UL, BR_UL_U, BR_UL_U_P, BR_UL_U_P_E, BR_UL_R, BR_FUL, BR_TUL>

    Returns Promise<Result<BillingResult<B, BR, BR_UL, BR_UL_U, BR_UL_U_P, BR_UL_U_P_E, BR_UL_R, BR_FUL, BR_TUL>>>

Generated using TypeDoc