Documentation
¶
Overview ¶
models/plaid_integration.go
Index ¶
- type PlaidIntegration
- func (i *PlaidIntegration) Delete(db *gorm.DB, id uint32) error
- func (i *PlaidIntegration) DeleteByUserID(db *gorm.DB, userID uint32) error
- func (i *PlaidIntegration) FindByID(db *gorm.DB, id uint32) (*PlaidIntegration, error)
- func (i *PlaidIntegration) FindByUserID(db *gorm.DB, userID uint32) ([]PlaidIntegration, error)
- func (i *PlaidIntegration) Prepare()
- func (i *PlaidIntegration) Save(db *gorm.DB) (*PlaidIntegration, error)
- func (i *PlaidIntegration) Update(db *gorm.DB, updateData map[string]interface{}) (*PlaidIntegration, error)
- type ResetPassword
- type User
- func (u *User) AfterFind() (err error)
- func (u *User) BeforeSave(tx *gorm.DB) (err error)
- func (u *User) DeleteAUser(db *gorm.DB, uid uint32) (int64, error)
- func (u *User) DeleteIntegrationsByUserID(db *gorm.DB) error
- func (u *User) FindAllUsers(db *gorm.DB) (*[]User, error)
- func (u *User) FindUserByID(db *gorm.DB, uid uint32) (*User, error)
- func (u *User) GetIntegrations(db *gorm.DB) ([]PlaidIntegration, error)
- func (u *User) Prepare()
- func (u *User) SaveUser(db *gorm.DB) (*User, error)
- func (u *User) UpdateAUser(db *gorm.DB, uid uint32, updateData map[string]interface{}) (*User, error)
- func (u *User) UpdateAUserAvatar(db *gorm.DB, uid uint32) (*User, error)
- func (u *User) UpdatePassword(db *gorm.DB) error
- func (u *User) Validate(action string) map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PlaidIntegration ¶
type PlaidIntegration struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id"` UserID uint32 `gorm:"not null;index" json:"user_id"` // Add index for faster queries PlaidItemID string `gorm:"not null" json:"plaid_item_id"` AccessToken string `gorm:"not null" json:"access_token"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"` }
PlaidIntegration represents a user's linked bank account via Plaid.
func (*PlaidIntegration) Delete ¶
func (i *PlaidIntegration) Delete(db *gorm.DB, id uint32) error
Delete removes a specific PlaidIntegration.
func (*PlaidIntegration) DeleteByUserID ¶
func (i *PlaidIntegration) DeleteByUserID(db *gorm.DB, userID uint32) error
DeleteByUserID removes all PlaidIntegrations for a given UserID.
func (*PlaidIntegration) FindByID ¶
func (i *PlaidIntegration) FindByID(db *gorm.DB, id uint32) (*PlaidIntegration, error)
FindByID retrieves a specific PlaidIntegration by its ID.
func (*PlaidIntegration) FindByUserID ¶
func (i *PlaidIntegration) FindByUserID(db *gorm.DB, userID uint32) ([]PlaidIntegration, error)
FindByUserID retrieves all PlaidIntegrations for a user.
func (*PlaidIntegration) Prepare ¶
func (i *PlaidIntegration) Prepare()
Prepare sanitizes input and initializes timestamps.
func (*PlaidIntegration) Save ¶
func (i *PlaidIntegration) Save(db *gorm.DB) (*PlaidIntegration, error)
Save creates a new PlaidIntegration record.
func (*PlaidIntegration) Update ¶
func (i *PlaidIntegration) Update(db *gorm.DB, updateData map[string]interface{}) (*PlaidIntegration, error)
Update updates an existing PlaidIntegration.
type ResetPassword ¶
type ResetPassword struct { gorm.Model Email string `gorm:"size:100;not null;" json:"email"` Token string `gorm:"size:255;not null;" json:"token"` }
func (*ResetPassword) DeleteDatails ¶
func (resetPassword *ResetPassword) DeleteDatails(db *gorm.DB) (int64, error)
func (*ResetPassword) Prepare ¶
func (resetPassword *ResetPassword) Prepare()
func (*ResetPassword) SaveDatails ¶
func (resetPassword *ResetPassword) SaveDatails(db *gorm.DB) (*ResetPassword, error)
type User ¶
type User struct { ID uint32 `gorm:"primary_key;auto_increment" json:"id"` Firstname string `gorm:"size:255;not null;" json:"firstname"` Lastname string `gorm:"size:255;not null;" json:"lastname"` Username string `gorm:"size:255;not null;unique_index" json:"username"` // Add unique index Email string `gorm:"size:100;not null;unique_index" json:"email"` // Add unique index Password string `gorm:"size:100;not null;" json:"password"` // Don't expose password in JSON responses AvatarPath string `gorm:"size:255;null;" json:"avatar_path"` CreatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"` UpdatedAt time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"` }
func (*User) DeleteIntegrationsByUserID ¶
DeleteIntegrationsByUserID deletes all PlaidIntegrations associated with a user ID.
func (*User) GetIntegrations ¶
func (u *User) GetIntegrations(db *gorm.DB) ([]PlaidIntegration, error)
GetIntegrations retrieves all PlaidIntegrations associated with a user.
func (*User) UpdateAUser ¶
func (*User) UpdateAUserAvatar ¶
Click to show internal directories.
Click to hide internal directories.