models

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessResponse

type AccessResponse struct {
	AccessToken     string `json:"access_token"`
	ItemID          string `json:"item_id"`
	InstitutionName string `json:"institution_name"`
	RequestID       string `json:"request_id"` // Request ID returned from Plaid API call
}

type AccessTokenRequest

type AccessTokenRequest struct {
	PublicToken string `json:"public_token"`
	Nickname    string `json:"nickname"`
}

type Account

type Account struct {
	Id               string    `json:"id"`
	CreatedAt        time.Time `json:"created_at"`
	UpdatedAt        time.Time `json:"updated_at"`
	Name             string    `json:"name:"`
	Type             string    `json:"type"`
	Subtype          string    `json:"subtype"`
	Mask             string    `json:"mask"`
	OfficialName     string    `json:"official_name"`
	AvailableBalance string    `json:"available_balance"`
	CurrentBalance   string    `json:"current_balance"`
	IsoCurrencyCode  string    `json:"iso_currency_code"`
	ItemId           string    `json:"item_id"`
}

type Accounts

type Accounts struct {
	Accounts  []Account `json:"accounts"`
	RequestID string    `json:"request_id"` // This field is the request ID returned from the Plaid API call
}

type Credentials

type Credentials struct {
	User         User   `json:"user"`
	RefreshToken string `json:"refresh_token"`
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
}

type EmailVerification

type EmailVerification struct {
	UserID uuid.UUID `json:"user_id"`
	Email  string    `json:"email"`
}

type EmailVerificationWithCode

type EmailVerificationWithCode struct {
	UserID uuid.UUID `json:"user_id"`
	Code   string    `json:"code"`
}

type ItemName

type ItemName struct {
	Nickname        string `json:"nickname"`
	ItemId          string `json:"item_id"`
	InstitutionName string `json:"institution_name"`
}

type LinkResponse

type LinkResponse struct {
	LinkToken string `json:"link_token"`
}

type MerchantSummary

type MerchantSummary struct {
	Merchant    string `json:"merchant"`
	TxnCount    int64  `json:"txn_count"`
	Category    string `json:"category"`
	TotalAmount string `json:"total_amount"`
	Month       string `json:"month"`
}

For getting merchant summaries on transactions call

type MonetaryData

type MonetaryData struct {
	Income    string `json:"income"`
	Expenses  string `json:"expenses"`
	NetIncome string `json:"net_income"`
	Date      string `json:"date"`
}

For credit/debit account types, fields are straightforward. For loan accounts, income = loan payments, expenses = interest, netincome = income - expenses

type ProcessWebhook

type ProcessWebhook struct {
	ItemID      string `json:"item_id"`
	WebhookCode string `json:"webhook_code"`
	WebhookType string `json:"webhook_type"`
}

type RefreshRequest

type RefreshRequest struct {
	RefreshToken string `json:"refresh_token"`
}

type RefreshResponse

type RefreshResponse struct {
	RefreshToken string `json:"refresh_token"`
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
}

type ResetPassword

type ResetPassword struct {
	Email       string `json:"email"`
	Code        string `json:"code"` // email verification code
	NewPassword string `json:"new_password"`
}

type Transaction

type Transaction struct {
	Id                      string    `json:"id"`
	AccountId               string    `json:"account_id"`
	Amount                  string    `json:"amount"`
	IsoCurrencyCode         string    `json:"iso_currency_code"`
	Date                    time.Time `json:"date"`
	MerchantName            string    `json:"merchant_name"`
	PaymentChannel          string    `json:"payment_channel"`
	PersonalFinanceCategory string    `json:"personal_finance_category"`
}

type UpdateItemName

type UpdateItemName struct {
	Nickname string `json:"nickname"`
}

Structs used in http requests

type UpdatePassword

type UpdatePassword struct {
	NewPassword string `json:"new_password"`
	Code        string `json:"code"` // email verification code
}

type UpdatedBalance

type UpdatedBalance struct {
	Id               string `json:"id"`
	AvailableBalance string `json:"available_balance"`
	CurrentBalance   string `json:"current_balance"`
	ItemId           string `json:"item_id"`
	RequestID        string `json:"request_id"`
}

type UpdatedPassword

type UpdatedPassword struct {
	HashPassword string `json:"hash_password"`
}

type User

type User struct {
	ID             uuid.UUID `json:"id"`
	Name           string    `json:"name"`
	Email          string    `json:"email"`
	HashedPassword string    `json:"hashed_password"`
	CreatedAt      time.Time `json:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
}

type UserDetails

type UserDetails struct {
	Name     string `json:"name"`
	Password string `json:"password"`
	Email    string `json:"email"`
}

type WebhookRecord

type WebhookRecord struct {
	WebhookType string    `json:"webhook_type"`
	WebhookCode string    `json:"webhook_code"`
	ItemID      string    `json:"item_id"`
	UserID      uuid.UUID `json:"user_id"`
	CreatedAt   string    `json:"created_at"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL