Bank Actions

Server actions for managing bank accounts and transactions.

getAccounts

Retrieves all bank accounts for a user.

const { data, totalBanks, totalCurrentBalance } = await getAccounts({ 
  userId: "user_123" 
})

getAccount

Retrieves details for a specific bank account.

const { data, transactions } = await getAccount({
  appwriteItemId: "item_123"
})

getTransactions

Retrieves transactions for a bank account.

const transactions = await getTransactions({
  accessToken: "access_token_123"
})

Type Definitions

interface Account {
  id: string
  availableBalance: number
  currentBalance: number
  institutionId: string
  name: string
  officialName?: string
  mask: string
  type: string
  subtype: string
  appwriteItemId: string
  shareableId?: string
}

interface Transaction {
  id: string
  name: string
  paymentChannel: string
  type: string
  accountId: string
  amount: number
  pending: boolean
  category: string
  date: string
  image?: string
}