adsa-cms: github.com/mmanjoura/adsa-cms/qor-example/app/models Index | Files

package models

import "github.com/mmanjoura/adsa-cms/qor-example/app/models"

Index

Package Files

address.go category.go chart.go collection.go color.go order.go product.go seo.go setting.go size.go store.go user.go

Variables

var (
    OrderState = transition.New(&Order{})
    ItemState  = transition.New(&OrderItem{})
)

func GetChartData Uses

func GetChartData(table, start, end string) (res []Chart)

date format 2015-01-23

func SizeVariations Uses

func SizeVariations() []SizeVariation

type Address Uses

type Address struct {
    gorm.Model
    UserID      uint
    ContactName string
    Phone       string
    City        string
    Address1    string
    Address2    string
}

func (Address) Stringify Uses

func (address Address) Stringify() string

type Category Uses

type Category struct {
    gorm.Model
    l10n.Locale
    publish.Status
    sorting.Sorting
    Name string
}

func (Category) Validate Uses

func (category Category) Validate(db *gorm.DB)

type Chart Uses

type Chart struct {
    Total string
    Date  time.Time
}

type Collection Uses

type Collection struct {
    gorm.Model
    Name string
    l10n.LocaleCreatable
    publish.Status
}

type Color Uses

type Color struct {
    gorm.Model
    l10n.Locale
    publish.Status
    sorting.Sorting
    Name string
    Code string `l10n:"sync"`
}

func (Color) Validate Uses

func (color Color) Validate(db *gorm.DB)

type ColorVariation Uses

type ColorVariation struct {
    gorm.Model
    ProductID      uint
    Product        Product
    ColorID        uint
    Color          Color
    ColorCode      string
    Images         []ColorVariationImage
    SizeVariations []SizeVariation
}

func (ColorVariation) MainImageUrl Uses

func (colorVariation ColorVariation) MainImageUrl() string

type ColorVariationImage Uses

type ColorVariationImage struct {
    gorm.Model
    ColorVariationID uint
    Image            ColorVariationImageStorage `sql:"type:varchar(4096)"`
}

type ColorVariationImageStorage Uses

type ColorVariationImageStorage struct{ media_library.FileSystem }

func (ColorVariationImageStorage) GetSizes Uses

func (ColorVariationImageStorage) GetSizes() map[string]media_library.Size

type FeeSetting Uses

type FeeSetting struct {
    ShippingFee     uint
    GiftWrappingFee uint
    CODFee          uint `gorm:"column:cod_fee"`
    TaxRate         int
}

type Order Uses

type Order struct {
    gorm.Model
    UserID            uint
    User              User
    PaymentAmount     float32
    AbandonedReason   string
    DiscountValue     uint
    TrackingNumber    *string
    ShippedAt         *time.Time
    CancelledAt       *time.Time
    ShippingAddressID uint
    ShippingAddress   Address
    BillingAddressID  uint
    BillingAddress    Address
    OrderItems        []OrderItem
    transition.Transition
}

func (Order) Amount Uses

func (order Order) Amount() (amount float32)

type OrderItem Uses

type OrderItem struct {
    gorm.Model
    OrderID         uint
    SizeVariationID uint
    SizeVariation   SizeVariation
    Quantity        uint
    Price           float32
    DiscountRate    uint
    transition.Transition
}

func (OrderItem) Amount Uses

func (item OrderItem) Amount() float32

type Product Uses

type Product struct {
    gorm.Model
    l10n.Locale
    publish.Status
    sorting.SortingDESC

    Name                  string
    NameWithSlug          slug.Slug    `l10n:"sync"`
    Code                  string       `l10n:"sync"`
    CategoryID            uint         `l10n:"sync"`
    Category              Category     `l10n:"sync"`
    Collections           []Collection `l10n:"sync" gorm:"many2many:product_collections;ForeignKey:id;AssociationForeignKey:id"`
    CollectionsSorter     sorting.SortableCollection
    MadeCountry           string           `l10n:"sync"`
    Price                 float32          `l10n:"sync"`
    Description           string           `sql:"size:2000"`
    ColorVariations       []ColorVariation `l10n:"sync"`
    ColorVariationsSorter sorting.SortableCollection
    Enabled               bool
}

func (Product) DefaultPath Uses

func (product Product) DefaultPath() string

func (Product) MainImageUrl Uses

func (product Product) MainImageUrl() string

func (Product) Validate Uses

func (product Product) Validate(db *gorm.DB)

type SEOSetting Uses

type SEOSetting struct {
    gorm.Model
    l10n.Locale
    SiteName    string
    DefaultPage seo.Setting
    HomePage    seo.Setting
    ProductPage seo.Setting `seo:"Name,Code"`
}

type Setting Uses

type Setting struct {
    gorm.Model
    FeeSetting
    location.Location `location:"name:Company Address"`
    l10n.Locale
}

type Size Uses

type Size struct {
    gorm.Model
    l10n.Locale
    publish.Status
    sorting.Sorting
    Name string
    Code string `l10n:"sync"`
}

func (Size) Validate Uses

func (size Size) Validate(db *gorm.DB)

type SizeVariation Uses

type SizeVariation struct {
    gorm.Model
    ColorVariationID  uint
    ColorVariation    ColorVariation
    SizeID            uint
    Size              Size
    AvailableQuantity uint
}

func (SizeVariation) Stringify Uses

func (sizeVariation SizeVariation) Stringify() string

type Store Uses

type Store struct {
    gorm.Model
    Name  string
    Phone string
    Email string
    location.Location
    sorting.Sorting
}

type User Uses

type User struct {
    gorm.Model
    Email     string
    Password  string
    Name      string
    Gender    string
    Role      string
    Addresses []Address

    // Confirm
    ConfirmToken string
    Confirmed    bool

    // Recover
    RecoverToken       string
    RecoverTokenExpiry *time.Time
}

func (User) AvailableLocales Uses

func (user User) AvailableLocales() []string

func (User) DisplayName Uses

func (user User) DisplayName() string

Package models imports 16 packages (graph) and is imported by 5 packages. Updated 2017-06-20. Refresh now. Tools for package owners.