models

package
v0.9.6 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2022 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cart added in v0.3.0

type Cart struct {
	gorm.Model
	UserId     string `json:"user_id"`
	StoreId    int    `json:"store_id"`
	Status     string `json:"status"`
	InternalId string `json:"internal_id"`
}

func (*Cart) BeforeCreate added in v0.3.2

func (s *Cart) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate will set a UUID rather than numeric ID.

type CartDetail added in v0.3.7

type CartDetail struct {
	Cart       *Cart       `json:"cart"`
	CartItems  *[]CartItem `json:"cart_items"`
	Amount     float64     `json:"amount"`
	TotalItems int         `json:"total_items"`
}

type CartItem added in v0.3.0

type CartItem struct {
	gorm.Model
	CartId         int      `json:"cart_id" bson:"cart_id"`
	StoreProductId int      `json:"store_product_id"`
	ProductId      string   `json:"product_id"`
	Quantity       int      `json:"quantity"`
	Price          float64  `json:"price"`
	Product        *Product `json:"product" gorm:"-"`
}

type Checkout added in v0.3.8

type Checkout struct {
	gorm.Model
	CartId             int            `gorm:"column:cart_id" json:"cart_id"`
	PaymentMethodId    string         `gorm:"column:payment_method_id" json:"payment_method_id"`
	Amount             float32        `gorm:"column:amount" json:"amount"`
	Currency           enums.Currency `gorm:"column:currency" json:"currency"`
	Discount           float32        `gorm:"column:discount" json:"discount"`
	DiscountPercentage float32        `gorm:"column:discount_percentage" json:"discount_percent"`
	StoreId            int            `gorm:"column:store_id" json:"store_id"`
	InternalId         string         `json:"internal_id"`
}

func (*Checkout) BeforeCreate added in v0.6.4

func (s *Checkout) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate will set a UUID rather than numeric ID.

type Discount added in v0.3.2

type Discount struct {
	Id             int64  `json:"id"`
	StoreProductId int    `json:"store_product_id"`
	StoreId        int    `json:"store_id"`
	Name           string `json:"name"`
	Description    string `json:"description"`
	Disclaimer     string `json:"disclaimer"`
	Percent        int    `json:"percent"`
	StartDate      string `json:"start_date"`
	EndDate        string `json:"end_date"`
	Status         string `json:"status"`
}

type Image

type Image struct {
	URL   string `json:"name:url" type:"float"`
	Title string `json:"name:title" type:"string"`
}

type Invoice added in v0.8.2

type Invoice struct {
}

type JWTPayload added in v0.3.7

type JWTPayload struct {
	UserID    string   `json:"user_id"`
	Roles     []string `json:"roles"`
	FirstName string   `json:"first_name"`
	LastName  string   `json:"last_name"`
	Email     string   `json:"email"`
}

type Measures

type Measures struct {
	Height float64 `json:"height" type:"float"`
	Width  float64 `json:"width" type:"float"`
	Depth  float64 `json:"depth" type:"float"`
}

type Pagination added in v0.1.8

type Pagination struct {
	Page           int `json:"page"`
	ResultsPerPage int `json:"limit"`
}

type Product

type Product struct {
	ID             string    `json:"id" type:"string"`
	Name           string    `json:"name"`
	Status         string    `json:"status" default:"ACTIVE"`
	Category       string    `json:"category"`
	SubCategory    string    `json:"sub_category"`
	Description    string    `json:"description"`
	ReferencePrice float64   `json:"reference_price" bson:"reference_price"`
	Discontinued   bool      `json:"discontinued" default:"false"`
	InternalId     string    `json:"internal_id"`
	IsPharma       bool      `json:"is_pharma" bson:"is_pharma" default:"false"`
	IsAlcoholic    bool      `json:"is_alcoholic" bson:"is_alcoholic" default:"false"`
	IsCigarette    bool      `json:"is_cigarette" bson:"is_cigarette" default:"false"`
	NeedsRx        bool      `json:"needs_rx" bson:"needs_rx" default:"false"`
	Maker          string    `json:"maker"`
	TradeMark      string    `json:"trade_mark" bson:"trade_mark"`
	Images         []Image   `json:"images"`
	Measures       Measures  `json:"measures"`
	Metadata       string    `json:"metadata"`
	Packing        string    `json:"packing"`
	Weight         float64   `json:"weight"`
	ContainedUnits uint32    `json:"contained_units" bson:"contained_units"`
	Ean            string    `json:"ean" bson:"ean"`
	Sku            string    `json:"sku" bson:"sku"`
	IsForAdult     bool      `json:"is_for_adult" bson:"is_for_adult" default:"false"`
	CreatedAt      time.Time `json:"created_at" bson:"created_at"`
	UpdatedAt      time.Time `json:"updated_at"`
	DeletedAt      time.Time `json:"deleted_at"`
}

type Receipt added in v0.8.2

type Receipt struct {
	gorm.Model
	SaleId     string  `json:"sale_id"`
	Amount     float64 `json:"amount"`
	Currency   string  `json:"currency"`
	StoreId    string  `json:"store_id"`
	CompanyId  string  `json:"company_id"`
	InternalId string  `json:"internal_id"`
}

func (*Receipt) BeforeCreate added in v0.8.2

func (s *Receipt) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate will set a UUID rather than numeric ID.

type Sale added in v0.4.2

type Sale struct {
	gorm.Model
	CartId             string  `gorm:"column:cart_id" json:"cart_id"`
	StoreId            string  `gorm:"column:store_id" json:"store_id"`
	Amount             float32 `gorm:"column:amount" json:"amount"`
	Currency           string  `gorm:"column:currency" json:"currency"`
	Discount           float32 `gorm:"column:discount" json:"discount"`
	DiscountPercentage float32 `gorm:"column:discount_percentage" json:"discount_percentage"`
	PaymentMethod      string  `gorm:"column:payment_method" json:"payment_method"`
	SellerId           string  `gorm:"column:seller_id" json:"seller_id"`
	IssueReceipt       bool    `gorm:"column:issue_receipt" json:"issue_receipt"`
	ReceiptId          string  `gorm:"column:receipt_id" json:"receipt_id"`
	Status             string  `gorm:"column:status" json:"status"`
	InternalId         string  `gorm:"column:internal_id" json:"internal_id"`
}

func (*Sale) BeforeCreate added in v0.4.2

func (s *Sale) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate will set a UUID rather than numeric ID.

type Store

type Store struct {
	gorm.Model
	Name         string  `json:"name"`
	Status       string  `gorm:"default:ACTIVE" json:"status"`
	Country      string  `json:"country"`
	City         string  `json:"city"`
	Street       string  `json:"street"`
	StreetNumber string  `json:"street_number"`
	Latitude     float32 `json:"latitude"`
	Longitude    float32 `json:"longitude"`
	PostalCode   string  `json:"postal_code"`
	Phone        string  `json:"phone"`
	Email        string  `json:"email"`
	InternalId   string  `json:"internal_id"`
}

func (*Store) BeforeCreate

func (s *Store) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate will set a UUID rather than numeric ID.

type StoreProduct

type StoreProduct struct {
	gorm.Model
	StoreId        uint    `json:"store_id"`
	Category       string  `json:"category"`
	SubCategory    string  `json:"sub_category"`
	ProductId      string  `json:"product_id"`
	AvailableUnits int     `json:"available_units"`
	ReservedUnits  int     `json:"reserved_units"`
	Price          float32 `json:"price"`
	Status         string  `json:"status" gorm:"default:'ACTIVE'"`
	InternalId     string  `json:"internal_id"`
	IsCustom       bool    `json:"is_custom" gorm:"default:false"`
	Ean            string  `json:"ean"`
	Sku            string  `json:"sku"`
	ProductName    string  `json:"product_name"`
}

func (*StoreProduct) BeforeCreate added in v0.1.9

func (s *StoreProduct) BeforeCreate(tx *gorm.DB) (err error)

BeforeCreate will set a UUID rather than numeric ID.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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