model

package
v0.0.0-...-731f7f8 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2021 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 Author

type Author struct {
	gorm.Model
	Name        string `json:"name" form:"name"`
	BookAuthors []BookAuthor
}

type Book

type Book struct {
	gorm.Model
	PublisherID      uint   `json:"publisher_id" form:"publisher_id"`
	CategoryID       uint   `json:"category_id" form:"category_id"`
	ISBN             string `json:"isbn" form:"isbn"`
	Title            string `json:"title" form:"title"`
	Price            int    `json:"price" form:"price"`
	PublicationYear  int    `json:"publication_year" form:"publication_year"`
	PageCount        int    `json:"page_count" form:"page_count"`
	Description      string `json:"description" form:"description"`
	BookAuthors      []BookAuthor
	BookTransactions []BookTransaction
}

type BookAuthor

type BookAuthor struct {
	gorm.Model
	BookID    uint `gorm:"primaryKey"`
	AuthorID  uint `gorm:"primaryKey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type BookTransaction

type BookTransaction struct {
	BookID        uint `gorm:"primaryKey"`
	TransactionID uint `gorm:"primaryKey"`
	Quantity      int
	PricePerUnit  int
	TotalPrice    int
	CreatedAt     time.Time
	UpdatedAt     time.Time
	DeletedAt     gorm.DeletedAt `gorm:"index"`
}

type Category

type Category struct {
	gorm.Model
	Name  string `json:"name" form:"name"`
	Books []Book
}

type Publisher

type Publisher struct {
	gorm.Model
	Name  string `json:"name" form:"name"`
	Books []Book
}

type Transaction

type Transaction struct {
	gorm.Model
	TotalPrice       int  `json:"total_price" form:"total_price"`
	Status           int  `json:"status" form:"status"`
	UserID           uint `json:"user_id" form:"user_id"`
	BookTransactions []BookTransaction
}

type User

type User struct {
	gorm.Model
	Name         string `json:"name" form:"name"`
	Email        string `json:"email" form:"email"`
	Password     string `json:"password" form:"password"`
	Balance      int    `json:"balance" form:"balance"`
	Token        string `json:"token" form:"token"`
	Transactions []Transaction
}

Jump to

Keyboard shortcuts

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