model

package
v0.0.0-...-69ebceb Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 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 Buyer

type Buyer struct {
	gorm.Model
	Email            string `gorm:"size:45; not_null; unique" json:"email"`
	Name             string `gorm:"size:45; not_null;" json:"name"`
	Password         string `gorm:"size:255; not_null;" json:"password"`
	AlamatPengiriman string `gorm:"size:255;" json:"alamat_pengiriman"`
}

func (*Buyer) BeforeSave

func (b *Buyer) BeforeSave() error

type Order

type Order struct {
	gorm.Model
	BuyerId               uint    `gorm:"not_null"`
	SellerId              uint    `gorm:"not_null"`
	DeliverySourceAddress string  `gorm:"size:255; not_null"`
	DeliveryDestAddress   string  `gorm:"size:255; not_null"`
	Items                 uint    `gorm:"not_null"`
	Quantity              int     `gorm:"not_null"`
	Price                 float32 `gorm:"not_null"`
	TotalPrice            float64 `gorm:"not_null"`
	Status                string  `gorm:"not_null"`
}

type Product

type Product struct {
	gorm.Model
	Name        string  `gorm:"size:100; not_null" json:"product_name"`
	Description string  `gorm:"size:255;" json:"description"`
	Price       float32 `gorm:"type:decimal(20,3)" json:"price"`
	SellerID    uint    `gorm:"not_null"`
}

type Seller

type Seller struct {
	gorm.Model
	Email        string    `gorm:"size:45; not_null; unique" json:"email"`
	Name         string    `gorm:"size:45; not_null;" json:"name"`
	Password     string    `gorm:"size:255; not_null;" json:"password"`
	AlamatPickUp string    `gorm:"size:255;" json:"alamat_pickup"`
	Products     []Product `gorm:"foreignKey:SellerID"`
}

func (*Seller) BeforeSave

func (s *Seller) BeforeSave() error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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