feat: add plaid sync
This commit is contained in:
@@ -65,6 +65,7 @@ export const plaidAccessTokens = pgTable("plaidAccessToken", {
|
||||
logoUrl: text("logoUrl").notNull(),
|
||||
userId: text("user_id").notNull(),
|
||||
token: text("token").notNull(),
|
||||
syncCursor: text("sync_cursor"),
|
||||
createdAt: timestamp("created_at").notNull().defaultNow(),
|
||||
});
|
||||
|
||||
|
||||
@@ -10,8 +10,10 @@ export function createMutators(authData: AuthData | null) {
|
||||
link: {
|
||||
async create() {},
|
||||
async get(tx: Tx, { link_token }: { link_token: string }) {},
|
||||
async updateTransactions() {},
|
||||
async updateBalences() {},
|
||||
async webhook() {},
|
||||
async sync() {},
|
||||
// async updateTransactions() {},
|
||||
// async updateBalences() {},
|
||||
async deleteAccounts(tx: Tx, { accountIds }: { accountIds: string[] }) {
|
||||
isLoggedIn(authData);
|
||||
for (const id of accountIds) {
|
||||
|
||||
@@ -345,6 +345,16 @@ export const schema = {
|
||||
"token"
|
||||
>,
|
||||
},
|
||||
syncCursor: {
|
||||
type: "string",
|
||||
optional: true,
|
||||
customType: null as unknown as ZeroCustomType<
|
||||
ZeroSchema,
|
||||
"plaidAccessTokens",
|
||||
"syncCursor"
|
||||
>,
|
||||
serverName: "sync_cursor",
|
||||
},
|
||||
createdAt: {
|
||||
type: "number",
|
||||
optional: true,
|
||||
|
||||
Reference in New Issue
Block a user