feat(server): wip syncing Plaid transactions

This commit is contained in:
Ahmed Bouhuolia
2024-02-02 02:23:49 +02:00
parent b43cd26ecc
commit b940c6dd17
15 changed files with 491 additions and 7 deletions

View File

@@ -1,18 +1,33 @@
import { Inject, Service } from 'typedi';
import { PlaidLinkTokenService } from './PlaidLinkToken';
import { PlaidItemService } from './PlaidItem';
import { PlaidItemDTO } from './_types';
@Service()
export class PlaidApplication {
@Inject()
private getLinkTokenService: PlaidLinkTokenService;
@Inject()
private plaidItemService: PlaidItemService;
/**
*
* @param tenantId
* @param itemId
* @returns
* Retrieves the Plaid link token.
* @param {number} tenantId
* @param {number} itemId
* @returns
*/
public getLinkToken(tenantId: number) {
return this.getLinkTokenService.getLinkToken(tenantId);
}
/**
* Exchanges the Plaid access token.
* @param {number} tenantId
* @param {PlaidItemDTO} itemDTO
* @returns
*/
public exchangeToken(tenantId: number, itemDTO: PlaidItemDTO) {
return this.plaidItemService.item(tenantId, itemDTO);
}
}