Skip to content

Commit

Permalink
update plaid and vezgo endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronk-bixly committed May 5, 2022
1 parent 75e91cf commit 2e7b2bc
Show file tree
Hide file tree
Showing 8 changed files with 169 additions and 23 deletions.
16 changes: 11 additions & 5 deletions src/common/rest/index.ts
Expand Up @@ -5,9 +5,11 @@ import * as accounts from './accounts';
import * as getCountries from './get-countries';
import * as postCountry from './post-country';

import * as getVezgoProviders from './vezgo/get-providers';
import * as getVezgoLink from './vezgo/get-link';
import * as storeVezgoAccount from './vezgo/store-account';
import * as listVezgoProviders from './vezgo/list-providers';
import * as listVezgoAccounts from './vezgo/list-accounts';
import * as listVezgoTransactions from './vezgo/list-transactions';
import * as syncVezgo from './vezgo/sync-vezgo';

import * as getPlaidAccount from './plaid/get-plaid-account';
import * as getPlaidLinkToken from './plaid/get-plaid-link-token';
Expand All @@ -17,6 +19,7 @@ import * as listPlaidTransaction from './plaid/list-plaid-transactions';
import * as getPlaidAccessToken from './plaid/get-plaid-access-token';
import * as savePlaidAccounts from './plaid/save-plaid-accounts';
import * as savePlaidTransaction from './plaid/save-plaid-transactions';
import * as syncPlaid from './plaid/sync-plaid';

import * as postUser from './post-user';
import * as getProductInterests from './get-product-interests';
Expand All @@ -43,17 +46,20 @@ export const masaRestClient = {
accounts,
getClient,
postClient,
getVezgoProviders,
getVezgoLink,
storeVezgoAccount,
listVezgoProviders,
listVezgoAccounts,
listVezgoTransactions,
syncVezgo,
getPlaidAccount,
getPlaidLinkToken,
getPlaidTransaction,
getPlaidAccessToken,
listPlaidAccounts,
listPlaidTransaction,
getPlaidAccessToken,
savePlaidAccounts,
savePlaidTransaction,
syncPlaid,
getCountries,
postUser,
postCountry,
Expand Down
27 changes: 22 additions & 5 deletions src/common/rest/plaid/list-plaid-transactions/index.ts
Expand Up @@ -2,7 +2,8 @@ import { MethodMetadata, Parameter } from '../..';
import { useRestCall } from '../../../helpers/rest-calls';
import { Headers } from '../../../helpers/axios';

const path = 'plaid-transactions/:userId';
const path =
'plaid-transactions/:accountId/?pageNbr=:pageNbr&pageSize=:pageSize';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
Expand All @@ -17,18 +18,34 @@ export function useMethod({ pathParameters, body }: any) {
const parameters: Parameter[] = [
{
key: 1,
name: 'userId',
description: 'User ID',
name: 'accountId',
description: 'Account ID',
required: 'yes',
default: '',
dataType: 'string'
dataType: 'string',
},
{
key: 2,
name: 'pageNbr',
description: 'Pagination page number',
required: 'no',
default: '',
dataType: 'number',
},
{
key: 3,
name: 'pageSize',
description: 'pageSize',
required: 'no',
default: '',
dataType: 'number',
},
];

export const metadata: MethodMetadata = {
author: 'Aaron Knott',
authorPicture: '',
description: "Get a list of user's Plaid Account Transactions",
description: 'Get a list of Plaid transactions for a given account',
name: path,
method: 'GET',
parameters,
Expand Down
44 changes: 44 additions & 0 deletions src/common/rest/plaid/sync-plaid/index.ts
@@ -0,0 +1,44 @@
import { MethodMetadata, Parameter } from '../..';
import { useRestCall } from '../../../helpers/rest-calls';
import { Headers } from '../../../helpers/axios';

const path = 'sync-plaid/:userId/?publicToken=:publicToken';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
pathParameters,
headers: Headers,
body,
metadata,
});
return { data, error, loading, getData };
}

const parameters: Parameter[] = [
{
key: 1,
name: 'userId',
description: 'User ID',
required: 'yes',
default: '',
dataType: 'string',
},
{
key: 2,
name: 'publicToken',
description: 'Public Token',
required: 'yes',
default: '',
dataType: 'string',
},
];

export const metadata: MethodMetadata = {
author: 'Aaron Knott',
authorPicture: '',
description:
'Send Public Token to be exchanged for access token and to sync plaid data with user accounts',
name: path,
method: 'GET',
parameters,
};
2 changes: 1 addition & 1 deletion src/common/rest/vezgo/get-link/index.ts
Expand Up @@ -4,7 +4,7 @@ import { Headers } from '../../../helpers/axios';
import { useRestCall } from '../../../helpers/rest-calls';


const path = 'vezgo-connect/:userProfileId/:provider';
const path = 'vezgo-url/:userProfileId/?provider=:provider';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
Expand Down
35 changes: 35 additions & 0 deletions src/common/rest/vezgo/list-accounts/index.ts
@@ -0,0 +1,35 @@
import { MethodMetadata } from '..';
import { Headers } from '../../helpers/axios';
import { useRestCall } from '../../helpers/rest-calls';

const path = 'vezgo-accounts/:userId';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
pathParameters,
headers: Headers,
body,
metadata,
});
return { data, error, loading, getData };
}

const parameters: Parameter[] = [
{
key: 1,
name: 'userId',
description: 'User ID',
required: 'yes',
default: '',
dataType: 'string',
},
];

export const metadata: MethodMetadata = {
author: 'Aaron Knott',
authorPicture: '',
description: 'Get all Vezgo Accounts of a user',
name: path,
method: 'GET',
parameters,
};
52 changes: 52 additions & 0 deletions src/common/rest/vezgo/list-transactions/index.ts
@@ -0,0 +1,52 @@
import { MethodMetadata } from '..';
import { Headers } from '../../helpers/axios';
import { useRestCall } from '../../helpers/rest-calls';

const path =
'vezgo-transactions/:accountId/?pageNbr=:pageNbr&pageSize=:pageSize';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
pathParameters,
headers: Headers,
body,
metadata,
});
return { data, error, loading, getData };
}

const parameters: Parameter[] = [
{
key: 1,
name: 'accountId',
description: 'Account ID',
required: 'yes',
default: '',
dataType: 'string',
},
{
key: 2,
name: 'pageNbr',
description: 'Pagination page number',
required: 'no',
default: '',
dataType: 'number',
},
{
key: 3,
name: 'pageSize',
description: 'pageSize',
required: 'no',
default: '',
dataType: 'number',
},
];

export const metadata: MethodMetadata = {
author: 'Aaron Knott',
authorPicture: '',
description: 'Get list of Vezgo Transactions for a given account',
name: path,
method: 'GET',
parameters,
};
Expand Up @@ -2,7 +2,7 @@ import { MethodMetadata, Parameter } from "../..";
import { useRestCall } from "../../../helpers/rest-calls";


const path = 'store-account/';
const path = 'sync-vezgo/:userId';

export function useMethod({ pathParameters, body }: any) {
const { data, error, loading, getData } = useRestCall({
Expand All @@ -17,16 +17,8 @@ export function useMethod({ pathParameters, body }: any) {
const parameters: Parameter[] = [
{
key: 1,
name: 'code',
description: 'Vezgo Account ID',
required: 'yes',
default: '',
dataType: 'string',
},
{
key: 2,
name: 'institution',
description: 'Vezgo Account Name',
name: 'userId',
description: 'User ID',
required: 'yes',
default: '',
dataType: 'string',
Expand All @@ -36,7 +28,7 @@ const parameters: Parameter[] = [
export const metadata: MethodMetadata = {
author: 'Aaron Knott',
authorPicture: '',
description: 'Store account credentials ',
description: 'Initialize BE sync of Vezgo data',
name: path,
method: 'POST',
parameters,
Expand Down

0 comments on commit 2e7b2bc

Please sign in to comment.