model

package
v0.0.0-...-b1d2da9 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Transaction

type Transaction struct {
	ID         uint32    `gorm:"primary_key"`
	SenderID   uint32    `gorm:"index"`
	Sender     User      `gorm:"foreignKey:SenderID;references:ID"`
	ReceiverID uint32    `gorm:"index"`
	Receiver   User      `gorm:"foreignKey:ReceiverID;references:ID"`
	Amount     float64   `gorm:"type:decimal(10,2)"`
	Fee        float64   `gorm:"type:decimal(10,2)"`
	Type       string    `gorm:"type:enum('deposit', 'withdraw', 'transfer')"`
	CreatedAt  time.Time `gorm:"autoCreateTime"`
	UpdatedAt  time.Time `gorm:"autoUpdateTime"`
}

type User

type User struct {
	ID            uint32  `gorm:"primary_key"`
	AccountNumber string  `gorm:"type:varchar(100);unique"`
	Name          string  `gorm:"type:varchar(100)"`
	Surname       string  `gorm:"type:varchar(100)"`
	Email         string  `gorm:"type:varchar(100);unique"`
	Password      string  `gorm:"type:varchar(100)"`
	Balance       float64 `gorm:"type:decimal(10,2)"`
}

Jump to

Keyboard shortcuts

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