models

package
v0.0.0-...-e688a44 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

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"`
	User        User      `json:"user"`
	UserID      uint32    `gorm:"not null" json:"user_id"`
	ItemID      string    `json:"itemid"`
	AccessToken string    `json:"accesstoken"`
	PaymentID   string    `json:"paymentid"`
	CreatedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"created_at"`
	UpdatedAt   time.Time `gorm:"default:CURRENT_TIMESTAMP" json:"updated_at"`
}

PlaidIntegration Table that stores plaid access info needed for requests to linked bank accounts

func (*PlaidIntegration) DeleteAIntegration

func (i *PlaidIntegration) DeleteAIntegration(db *gorm.DB) (int64, error)

func (*PlaidIntegration) DeleteUserIntegrations

func (i *PlaidIntegration) DeleteUserIntegrations(db *gorm.DB, uid uint32) (int64, error)

When a user is deleted, we also delete the post that the user had

func (*PlaidIntegration) FindUserIntegrations

func (i *PlaidIntegration) FindUserIntegrations(db *gorm.DB, uid uint32) (*[]PlaidIntegration, error)

func (*PlaidIntegration) Prepare

func (i *PlaidIntegration) Prepare()

func (*PlaidIntegration) SaveToken

func (i *PlaidIntegration) SaveToken(db *gorm.DB) (*PlaidIntegration, error)

func (*PlaidIntegration) UpdateAIntegration

func (i *PlaidIntegration) UpdateAIntegration(db *gorm.DB) (*PlaidIntegration, error)

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"`
	Username   string    `gorm:"size:255;not null;unique" json:"username"`
	Email      string    `gorm:"size:100;not null;unique" json:"email"`
	Password   string    `gorm:"size:100;not null;" json:"password"`
	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) AfterFind

func (u *User) AfterFind() (err error)

func (*User) BeforeSave

func (u *User) BeforeSave() error

func (*User) DeleteAUser

func (u *User) DeleteAUser(db *gorm.DB, uid uint32) (int64, error)

func (*User) FindAllUsers

func (u *User) FindAllUsers(db *gorm.DB) (*[]User, error)

THE ONLY PERSON THAT NEED TO DO THIS IS THE ADMIN, SO I HAVE COMMENTED THE ROUTES, SO SOMEONE ELSE DONT VIEW THIS DETAILS.

func (*User) FindUserByID

func (u *User) FindUserByID(db *gorm.DB, uid uint32) (*User, error)

func (*User) Prepare

func (u *User) Prepare()

func (*User) SaveUser

func (u *User) SaveUser(db *gorm.DB) (*User, error)

func (*User) UpdateAUser

func (u *User) UpdateAUser(db *gorm.DB, uid uint32) (*User, error)

func (*User) UpdateAUserAvatar

func (u *User) UpdateAUserAvatar(db *gorm.DB, uid uint32) (*User, error)

func (*User) UpdatePassword

func (u *User) UpdatePassword(db *gorm.DB) error

func (*User) Validate

func (u *User) Validate(action string) map[string]string

Jump to

Keyboard shortcuts

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