mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat(server): wip syncing Plaid transactions
This commit is contained in:
29
packages/server/src/lib/Plaid/PlaidFetchTransactionsJob.ts
Normal file
29
packages/server/src/lib/Plaid/PlaidFetchTransactionsJob.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
import Container, { Service } from 'typedi';
|
||||
|
||||
@Service()
|
||||
export class PlaidFetchTransactionsJob {
|
||||
/**
|
||||
* Constructor method.
|
||||
*/
|
||||
constructor(agenda) {
|
||||
agenda.define(
|
||||
'plaid-update-account-transactions',
|
||||
{ priority: 'high', concurrency: 2 },
|
||||
this.handler
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers the function.
|
||||
*/
|
||||
private handler = async (job, done: Function) => {
|
||||
const {} = job.attrs.data;
|
||||
|
||||
try {
|
||||
done();
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
done(error);
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user