models

package
v0.0.0-...-73c3907 Latest Latest
Warning

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

Go to latest
Published: May 6, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OrderStatus_Pending     OrderStatus = "Pending"
	OrderStatus_Authorised  OrderStatus = "Authorised"
	OrderStatus_Cancelled   OrderStatus = "Cancelled"
	OrderStatus_AuthUnknown OrderStatus = "AuthUnknown"
	OrderStatus_Sending     OrderStatus = "Sending"
	OrderStatus_CheckedIn   OrderStatus = "CheckedIn"
	OrderStatus_Refunded    OrderStatus = "Refunded"
	OrderStatus_Validating  OrderStatus = "Validating"
	OrderStatus_Paid        OrderStatus = "Paid"

	OrderStatusColor_Grey   = "#e0e0e0"
	OrderStatusColor_Orange = "#ffa600"
	OrderStatusColor_Blue   = "#2194f3"
	OrderStatusColor_Green  = "#4caf4f"
	OrderStatusColor_Purple = "#4a148c"
	OrderStatusColor_Brown  = "#9f6d6d"
	OrderStatusColor_Red    = "#f44336"
)
View Source
const (
	RoleAdmin   = "Admin"
	RoleManager = "Manager"
	RoleEditor  = "Editor"
	RoleViewer  = "Viewer"

	OAuthProviderGoogle          = "google"
	OAuthProviderMicrosoftOnline = "microsoftonline"
	OAuthProviderGithub          = "github"
)

Variables

Functions

This section is empty.

Types

type Address

type Address struct {
	ID         uint `gorm:"primarykey"`
	CustomerID uint

	Street    string
	HomeImage media_library.MediaBox `sql:"type:text;"`
	UpdatedAt time.Time
	CreatedAt time.Time

	publish.Status
	Phones []*Phone
}

type Category

type Category struct {
	gorm.Model

	Name     string
	Products pq.StringArray `gorm:"type:text[]"`
	publish.Status
	publish.Schedule
	publish.Version
}

func (*Category) GetPublishActions

func (c *Category) GetPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (objs []*publish.PublishAction, err error)

func (*Category) GetUnPublishActions

func (c *Category) GetUnPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (objs []*publish.PublishAction, err error)

func (*Category) PermissionRN

func (c *Category) PermissionRN() []string

func (*Category) PrimaryColumnValuesBySlug

func (c *Category) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*Category) PrimarySlug

func (c *Category) PrimarySlug() string

type Customer

type Customer struct {
	ID             uint `gorm:"primarykey"`
	Name           string
	Addresses      []*Address
	MembershipCard *MembershipCard
}

type InputDemo

type InputDemo struct {
	ID               uint
	TextField1       string
	TextArea1        string
	Switch1          bool
	Slider1          int
	Select1          string
	RangeSlider1     pq.Int64Array `gorm:"type:integer[]"`
	Radio1           string
	FileInput1       string
	Combobox1        string
	Checkbox1        bool
	Autocomplete1    pq.StringArray `gorm:"type:text[]"`
	ButtonGroup1     string
	ChipGroup1       string
	ItemGroup1       string
	ListItemGroup1   string
	SlideGroup1      string
	ColorPicker1     string
	DatePicker1      string
	DatePickerMonth1 string
	TimePicker1      string
	MediaLibrary1    media_library.MediaBox `sql:"type:text;"`
	UpdatedAt        time.Time
	CreatedAt        time.Time
}

type L10nModel

type L10nModel struct {
	gorm.Model
	Title string

	l10n.Locale
}

func (*L10nModel) PermissionRN

func (lm *L10nModel) PermissionRN() []string

func (*L10nModel) PrimaryColumnValuesBySlug

func (lm *L10nModel) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*L10nModel) PrimarySlug

func (lm *L10nModel) PrimarySlug() string

type L10nModelWithVersion

type L10nModelWithVersion struct {
	gorm.Model
	Title string

	publish.Status
	publish.Version
	publish.Schedule
	l10n.Locale
}

func (*L10nModelWithVersion) GetPublishActions

func (lmv *L10nModelWithVersion) GetPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (objs []*publish.PublishAction, err error)

func (*L10nModelWithVersion) GetUnPublishActions

func (lmv *L10nModelWithVersion) GetUnPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (objs []*publish.PublishAction, err error)

func (*L10nModelWithVersion) PermissionRN

func (lmv *L10nModelWithVersion) PermissionRN() []string

func (*L10nModelWithVersion) PrimaryColumnValuesBySlug

func (lmv *L10nModelWithVersion) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*L10nModelWithVersion) PrimarySlug

func (lmv *L10nModelWithVersion) PrimarySlug() string

type ListModel

func (ListModel) GetListContent

func (this ListModel) GetListContent(db *gorm.DB, onePageItems *publish.OnePageItems) string

func (ListModel) GetListUrl

func (this ListModel) GetListUrl(pageNumber string) string

func (*ListModel) GetPublishActions

func (this *ListModel) GetPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (objs []*publish.PublishAction, err error)

func (*ListModel) GetUnPublishActions

func (this *ListModel) GetUnPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (objs []*publish.PublishAction, err error)

func (*ListModel) PermissionRN

func (this *ListModel) PermissionRN() []string

func (*ListModel) PrimaryColumnValuesBySlug

func (this *ListModel) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*ListModel) PrimarySlug

func (this *ListModel) PrimarySlug() string

func (ListModel) Sort

func (this ListModel) Sort(array []interface{})

type LoginSession

type LoginSession struct {
	gorm.Model

	UserID    uint `sql:"index"`
	Device    string
	IP        string
	TokenHash string `sql:"index"`
	ExpiredAt time.Time

	Time   string `gorm:"-"`
	Status string `gorm:"-"`
}

type MembershipCard

type MembershipCard struct {
	ID          uint `gorm:"primarykey"`
	CustomerID  uint
	Number      int
	ValidBefore *time.Time
}

type MicrositeModel

type MicrositeModel struct {
	Name        string
	Description string
	microsite.MicroSite
}

type Order

type Order struct {
	gorm.Model

	Source         string
	Status         OrderStatus
	DeliveryMethod string
	PaymentMethod  string
	ConfirmedAt    *time.Time
	OrderItems     []*OrderItem `gorm:"type:text[]"`
}

type OrderItem

type OrderItem struct {
	ProductCode     string
	Quantity        int32
	UnitPrice       float64
	TaxUnknown      bool
	TotalPriceExTax *float64
	TotalPrice      float64

	Name  string
	Image string
}

type OrderStatus

type OrderStatus string

type Phone

type Phone struct {
	ID        uint `gorm:"primarykey"`
	AddressID uint
	Number    int
}

type Post

type Post struct {
	gorm.Model

	Title         string
	TitleWithSlug slug.Slug
	Seo           seo.Setting
	Body          string
	HeroImage     media_library.MediaBox `sql:"type:text;"`
	BodyImage     media_library.MediaBox `sql:"type:text;"`
	UpdatedAt     time.Time
	CreatedAt     time.Time

	publish.Status
	publish.Schedule
	publish.Version
}

func (*Post) GetPublishActions

func (p *Post) GetPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (objs []*publish.PublishAction, err error)

func (*Post) GetUnPublishActions

func (p *Post) GetUnPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (objs []*publish.PublishAction, err error)

func (*Post) PermissionRN

func (p *Post) PermissionRN() []string

func (*Post) PrimaryColumnValuesBySlug

func (p *Post) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*Post) PrimarySlug

func (p *Post) PrimarySlug() string

type Product

type Product struct {
	gorm.Model

	Code  string
	Name  string
	Price int
	Image media_library.MediaBox `sql:"type:text;"`
	publish.Status
	publish.Schedule
	publish.Version
}

func (*Product) GetPublishActions

func (p *Product) GetPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (objs []*publish.PublishAction, err error)

func (*Product) GetUnPublishActions

func (p *Product) GetUnPublishActions(db *gorm.DB, ctx context.Context, storage oss.StorageInterface) (objs []*publish.PublishAction, err error)

func (*Product) PermissionRN

func (p *Product) PermissionRN() []string

func (*Product) PrimaryColumnValuesBySlug

func (p *Product) PrimaryColumnValuesBySlug(slug string) map[string]string

func (*Product) PrimarySlug

func (p *Product) PrimarySlug() string

type SliceListModel

type SliceListModel []*ListModel

func (SliceListModel) Len

func (x SliceListModel) Len() int

func (SliceListModel) Less

func (x SliceListModel) Less(i, j int) bool

func (SliceListModel) Swap

func (x SliceListModel) Swap(i, j int)

type User

type User struct {
	gorm.Model

	Name             string
	Company          string
	Roles            []role.Role `gorm:"many2many:user_role_join;"`
	Status           string
	UpdatedAt        time.Time
	CreatedAt        time.Time
	FavorPostID      uint
	RegistrationDate time.Time `gorm:"type:date"`

	Position        string
	IsSubscribed    bool
	IsInfoCompleted bool

	// Username is email
	login.UserPass
	login.OAuthInfo
	login.SessionSecure
}

func (User) GetID

func (u User) GetID() uint

func (User) GetName

func (u User) GetName() string

func (User) GetRoles

func (u User) GetRoles() (rs []string)

func (User) IsOAuthUser

func (u User) IsOAuthUser() bool

Jump to

Keyboard shortcuts

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