Socket
Socket
Sign inDemoInstall

@ffdc/api_corporate-accounts

Package Overview
Dependencies
84
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ffdc/api_corporate-accounts

Here are some helpers for the [Accounts & Balances APIs](https://developer.fusionfabric.cloud/api/corporate-accounteinfo-me-v1-831cb09d-cc10-4772-8ed5-8a6b72ec8e01/docs#operation/getAccountsForCustomerUser) from Corporate Banking


Version published
Weekly downloads
7
increased by600%
Maintainers
5
Created
Weekly downloads
 

Readme

Source

Corporate Accounts Helpers

Here are some helpers for the Accounts & Balances APIs from Corporate Banking

Interfaces for frontend usage

import {
  AccountDetail,
  AccountType,
  AccountStatement,
} from '@ffdc/api_corporate-accounts/interfaces';

When the importing the interfaces from a frontend only application, be sure to preprend by /interfaces.

GraphQL setup

configs/graphql-config.service.ts

import { GqlOptionsFactory, GqlModuleOptions } from '@nestjs/graphql';
import { Injectable } from '@nestjs/common';
import { CorporateAccountsModule } from '@ffdc/api_corporate-accounts';

@Injectable()
export class GqlConfigService implements GqlOptionsFactory {
  createGqlOptions(): GqlModuleOptions {
    const playgroundDevOptions = {
      settings: {
        'request.credentials': 'include',
      },
    };
    return {
      typePaths: ['./node_modules/@ffdc/api_corporate-accounts/**/*.graphql'],
      include: [CorporateAccountsModule],
      playground:
        process.env.NODE_ENV === 'production' ? false : playgroundDevOptions,
    };
  }
}

app.module.ts

import { Module } from '@nestjs/common';
import { GraphQLModule } from '@nestjs/graphql';
import { CorporateAccountsModule } from '@ffdc/api_corporate-accounts';
import { GqlConfigService } from './configs/graphql-config.service';

@Module({
  imports: [
    CorporateAccountsModule.forRoot({}),
    GraphQLModule.forRootAsync({
      useClass: GqlConfigService,
    }),
  ],
})
export class AppModule {}

Example GQL queries

Get accounts

query {
  accounts(
    limit: 10
    offset: 7
    fromDate: "2018-01-03"
    toDate: "2020-03-05"
    statementLimit: 1
  ) {
    items {
      id
      number
      type
      currency
      balances {
        availableBalance
      }
      statement {
        items {
          amount
        }
      }
    }
    _meta {
      itemCount
    }
  }
}

Get accounts with details and balance

query {
  accountsBalance(
    accountType: CURRENT
    equivalentCurrency: "EUR"
    fromDate: "2018-01-03"
    toDate: "2020-03-05"
  ) {
    items {
      id
      type
      currency
      availableBalance
      availableBalanceEquivalent
      equivalentCurrency
      details {
        number
        country
        bankShortName
      }
      statement {
        items {
          amount
        }
      }
    }
    _meta {
      itemCount
    }
  }
}

Get specific account detail

query($accountId: ID!) {
  account(id: $accountId) {
    id
    currency
    cutomerReference
  }
}

Get specific account balances

query($accountId: ID!) {
  accountBalance(id: $accountId) {
    id
    currency
    availableBalance
  }
}

Get specific account statement

query($accountId: ID!) {
  accountStatement(
    id: $accountId
    fromDate: "2018-01-03"
    toDate: "2020-03-05"
  ) {
    items {
      currency
      balance
      amount
      postingDate
      valueDate
      transactionType
    }
    _meta {
      itemCount
    }
  }
}

FAQs

Last updated on 24 Jul 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc