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

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    customerService: CustomerService

    Methods

    • Parameters

      • __namedParameters: { customerId: string }

      Returns Promise<{ amount: BigNumber; currency: "MOVEUSD" }>

      Current balance for the customer

    • Parameters

      • __namedParameters: PhoneOrEntityId<Pick<Reward, "phone">> & { customerId: string }

      Returns Promise<
          | { error: ServiceError; ok: false }
          | { ok: true; value: { amount: BigNumber; currency: "MOVEUSD" } },
      >

      Current balance for the entity

    • Parameters

      • __namedParameters: Partial<PhoneOrEntityId<Pick<Reward, "phone">>> & {
            category?: string;
            createdAt?: DbTimestampCriteria;
            customerId: string;
            idempotencyKey?: string;
            orderBy?: DbOrderByCriterion<
                Omit<
                    PgTableWithColumns<
                        {
                            columns: {
                                accountId: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    {},
                                >;
                                accountType: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    {},
                                >;
                                amount: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    {},
                                >;
                                category: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    {},
                                >;
                                createdAt: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    {},
                                >;
                                currency: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    { $type: ... },
                                >;
                                customerId: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    {},
                                >;
                                externalId: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    {},
                                >;
                                id: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    {},
                                >;
                                idempotencyKey: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    {},
                                >;
                                note: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    {},
                                >;
                                transactionType: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    { $type: ... },
                                >;
                                updatedAt: PgColumn<
                                    {
                                        baseColumn: ...;
                                        columnType: ...;
                                        data: ...;
                                        dataType: ...;
                                        driverParam: ...;
                                        enumValues: ...;
                                        generated: ...;
                                        hasDefault: ...;
                                        hasRuntimeDefault: ...;
                                        identity: ...;
                                        isAutoincrement: ...;
                                        isPrimaryKey: ...;
                                        name: ...;
                                        notNull: ...;
                                        tableName: ...;
                                    },
                                    {},
                                    {},
                                >;
                            };
                            dialect: "pg";
                            name: "reward_ledger";
                            schema: "b2b";
                        },
                    >,
                    "enableRLS",
                >,
                "createdAt"
                | "updatedAt",
            >[];
            page?: number;
            pageSize?: number;
            transactionType?: "CREDIT" | "DEBIT";
            updatedAt?: DbTimestampCriteria;
        }
        • Optionalcategory?: string
        • OptionalcreatedAt?: DbTimestampCriteria
        • customerId: string
        • OptionalidempotencyKey?: string
        • OptionalorderBy?: DbOrderByCriterion<
              Omit<
                  PgTableWithColumns<
                      {
                          columns: {
                              accountId: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  {},
                              >;
                              accountType: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  {},
                              >;
                              amount: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  {},
                              >;
                              category: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  {},
                              >;
                              createdAt: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  {},
                              >;
                              currency: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  { $type: ... },
                              >;
                              customerId: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  {},
                              >;
                              externalId: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  {},
                              >;
                              id: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  {},
                              >;
                              idempotencyKey: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  {},
                              >;
                              note: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  {},
                              >;
                              transactionType: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  { $type: ... },
                              >;
                              updatedAt: PgColumn<
                                  {
                                      baseColumn: ...;
                                      columnType: ...;
                                      data: ...;
                                      dataType: ...;
                                      driverParam: ...;
                                      enumValues: ...;
                                      generated: ...;
                                      hasDefault: ...;
                                      hasRuntimeDefault: ...;
                                      identity: ...;
                                      isAutoincrement: ...;
                                      isPrimaryKey: ...;
                                      name: ...;
                                      notNull: ...;
                                      tableName: ...;
                                  },
                                  {},
                                  {},
                              >;
                          };
                          dialect: "pg";
                          name: "reward_ledger";
                          schema: "b2b";
                      },
                  >,
                  "enableRLS",
              >,
              "createdAt"
              | "updatedAt",
          >[]
        • Optionalpage?: number

          Defaults to 1

        • OptionalpageSize?: number

          Defaults to 100

        • OptionaltransactionType?: "CREDIT" | "DEBIT"
        • OptionalupdatedAt?: DbTimestampCriteria

      Returns Promise<
          | { ok: true; value: { hasNext: boolean; items: Reward[] } }
          | { error: ServiceError; ok: false },
      >

      entity reward entries

      invalidPhone, notSupported and whatever EntityService throws