model

package
v0.0.0-...-80d63af Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Author

type Author struct {
	ID   types.ID  `db:"id"`
	Name string    `db:"name"`
	Dob  time.Time `db:"dob"`
}

type Book

type Book struct {
	ID          types.ID        `db:"id"`
	Title       string          `db:"title"`
	Description string          `db:"description"`
	ISBN        string          `db:"isbn"`
	AuthorID    types.ID        `db:"author_id"`
	Price       decimal.Decimal `db:"price"`
}

Book model

type Entity

type Entity interface {
	common | business | Property
}

Entity is an interface for entity constraints

type Property

type Property interface {
	TermOfService
}

type Signin

type Signin struct {
	AccessToken  types.Token
	Type         string
	ExpiresIn    int64
	RefreshToken types.Token
}

Signin model

type TermOfService

type TermOfService struct {
	TOS string `json:"tos"`
}

type User

type User struct {
	ID       types.UserID   `db:"user_id"`
	Username types.Username `db:"username"`
	Password types.Password `db:"password"`
	Data     UserData       `jsonb:"user_data"`
}

User is a model for user

func (*User) GetAppError

func (u *User) GetAppError() error

GetAppError by user status

func (*User) String

func (u *User) String() string

String

type UserData

type UserData struct {
	FirstName string     `json:"firstname,omitempty"`
	LastName  string     `json:"lastname,omitempty"`
	Email     string     `json:"email,omitempty"`
	Plan      string     `json:"user_plan,omitempty"`
	Status    UserStatus `json:"status,omitempty"`
}

UserData is a model for user info

func (*UserData) String

func (ui *UserData) String() string

String

type UserStatus

type UserStatus string

UserStatus codes

const (
	UserStatusActive       UserStatus = ""
	UserStatusNotActivated UserStatus = "user_status_not_activated"
)

UserStatus codes

Jump to

Keyboard shortcuts

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