models

package
v0.0.0-...-54eb6b5 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 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 Cart

type Cart struct {
	ProductID uint `json:"product_id"`
	Quantity  int  `json:"quantity"`
}

type Customer

type Customer struct {
	gorm.Model
	Name     string `json:"name" gorm:"text;not null;default:null"`
	Phone    string `json:"phone" gorm:"text;not null;unique"`
	Password string `json:"password" gorm:"text;not null;default:null"`
}

type Order

type Order struct {
	gorm.Model
	Customer   Customer `gorm:"foreignKey:CustomerID"`
	CustomerID uint     `json:"customer_id" gorm:"integer;not null;default:null"`
	Product    Product  `gorm:"foreignKey:ProductID"`
	ProductID  uint     `json:"product_id" gorm:"integer;not null;default:null"`
	Quantity   int      `json:"quantity" gorm:"integer;not null;default:null"`
	Amount     int      `json:"amount" gorm:"float;not null;default:null"`
	Time       string   `json:"time" gorm:"text;not null;default:null"`
	Status     string   `json:"status" gorm:"text;not null;default:null"`
}

type Product

type Product struct {
	gorm.Model
	Name  string `json:"name" gorm:"text;not null;default:null"`
	Price int    `json:"price" gorm:"float;not null;default:null"`
	Stock int    `json:"stock" gorm:"integer;not null;default:null"`
}

Jump to

Keyboard shortcuts

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