mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat(server): wip syncing Plaid transactions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user