category

package
v0.0.0-...-7f62264 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	ID       int32
	Category string
	Slug     string
	ParentID *int32
}

type CreateChildCategoryIfNotExistsRow

type CreateChildCategoryIfNotExistsRow struct {
	ID       int32
	Category string
	Slug     string
	ParentID *int32
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type GetCategoryRow

type GetCategoryRow struct {
	ID             int32
	Category       string
	Slug           string
	ParentID       *int32
	IsLeafCategory bool
}

type GetCategoryWithAncestorsRow

type GetCategoryWithAncestorsRow struct {
	ID       int32
	Category string
	Slug     string
	ParentID *int32
	Level    int32
}

type NullProductStatus

type NullProductStatus struct {
	ProductStatus ProductStatus
	Valid         bool // Valid is true if ProductStatus is not NULL
}

func (*NullProductStatus) Scan

func (ns *NullProductStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullProductStatus) Value

func (ns NullProductStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type NullUserStatus

type NullUserStatus struct {
	UserStatus UserStatus
	Valid      bool // Valid is true if UserStatus is not NULL
}

func (*NullUserStatus) Scan

func (ns *NullUserStatus) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullUserStatus) Value

func (ns NullUserStatus) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Product

type Product struct {
	ID         int64
	StoreID    int32
	CategoryID int32
	Name       string
	Brand      *string
	Slug       string
	ShortInfo  []string
	ImageUrls  []byte
	Specs      []byte
	Status     ProductStatus
	CreatedAt  pgtype.Timestamptz
	UpdatedAt  pgtype.Timestamptz
}

type ProductAttribute

type ProductAttribute struct {
	ID        int64
	ProductID int64
	Attribute string
}

type ProductPricing

type ProductPricing struct {
	ProductID        int64
	BasePrice        decimal.Decimal
	CurrencyCode     string
	DiscountLevel    decimal.Decimal
	DiscountedAmount decimal.Decimal
	IsOnSale         bool
}

type ProductRating

type ProductRating struct {
	ID        int64
	ProductID int64
	UserID    *int64
	Rating    int16
	Review    *string
	ImageUrls []string
	CreatedAt pgtype.Timestamptz
}

type ProductStatus

type ProductStatus string
const (
	ProductStatusDraft           ProductStatus = "Draft"
	ProductStatusPendingApproval ProductStatus = "PendingApproval"
	ProductStatusActive          ProductStatus = "Active"
)

func (*ProductStatus) Scan

func (e *ProductStatus) Scan(src interface{}) error

type Querier

type Querier interface {
	CreateChildCategoryIfNotExists(ctx context.Context, category string, slug string, parentID *int32) (*CreateChildCategoryIfNotExistsRow, error)
	CreateTopCategory(ctx context.Context, category string, slug string) (*Category, error)
	GetCategory(ctx context.Context, id int32) (*GetCategoryRow, error)
	GetCategoryByName(ctx context.Context, category string) (*Category, error)
	GetCategoryWithAncestors(ctx context.Context, id int32) ([]*GetCategoryWithAncestorsRow, error)
	GetCategoryWithSiblings(ctx context.Context, id int32) ([]*Category, error)
	GetChildCategories(ctx context.Context, parentID *int32) ([]*Category, error)
	GetLeafCategoryIDs(ctx context.Context, id int32) ([][]int32, error)
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CreateChildCategoryIfNotExists

func (q *Queries) CreateChildCategoryIfNotExists(ctx context.Context, category string, slug string, parentID *int32) (*CreateChildCategoryIfNotExistsRow, error)

func (*Queries) CreateTopCategory

func (q *Queries) CreateTopCategory(ctx context.Context, category string, slug string) (*Category, error)

func (*Queries) GetCategory

func (q *Queries) GetCategory(ctx context.Context, id int32) (*GetCategoryRow, error)

func (*Queries) GetCategoryByName

func (q *Queries) GetCategoryByName(ctx context.Context, category string) (*Category, error)

func (*Queries) GetCategoryWithAncestors

func (q *Queries) GetCategoryWithAncestors(ctx context.Context, id int32) ([]*GetCategoryWithAncestorsRow, error)

func (*Queries) GetCategoryWithSiblings

func (q *Queries) GetCategoryWithSiblings(ctx context.Context, id int32) ([]*Category, error)

func (*Queries) GetChildCategories

func (q *Queries) GetChildCategories(ctx context.Context, parentID *int32) ([]*Category, error)

func (*Queries) GetLeafCategoryIDs

func (q *Queries) GetLeafCategoryIDs(ctx context.Context, id int32) ([][]int32, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type Role

type Role struct {
	ID   int16
	Role string
}

type SellerStore

type SellerStore struct {
	ID          int32
	PublicID    string
	SellerID    int64
	Name        string
	Description string
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
}

type Session

type Session struct {
	Token  string
	Data   []byte
	Expiry pgtype.Timestamptz
}

type Sku

type Sku struct {
	ID              int64
	ProductID       int64
	Sku             string
	QuantityInStock int32
	HasSepPricing   bool
	ImageRefs       []int16
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
}

type SkuPricing

type SkuPricing struct {
	SkuID            int64
	BasePrice        decimal.Decimal
	CurrencyCode     string
	DiscountLevel    decimal.Decimal
	DiscountedAmount decimal.Decimal
	IsOnSale         bool
}

type SkuProductAttributeValue

type SkuProductAttributeValue struct {
	SkuID              int64
	ProductAttributeID int64
	AttributeValue     string
}

type Store

type Store interface {
	Querier
}

func NewStore

func NewStore(db *pgxpool.Pool) Store

type User

type User struct {
	ID          int64
	Email       string
	Password    string
	PhoneNumber *string
	FullName    string
	Status      UserStatus
	Otp         *string
	OtpExpiry   *int64
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
}

type UserRole

type UserRole struct {
	UserID int64
	RoleID int16
}

type UserStatus

type UserStatus string
const (
	UserStatusBlocked             UserStatus = "Blocked"
	UserStatusRegistrationPending UserStatus = "RegistrationPending"
	UserStatusActive              UserStatus = "Active"
	UserStatusInactice            UserStatus = "Inactice"
)

func (*UserStatus) Scan

func (e *UserStatus) Scan(src interface{}) error

Jump to

Keyboard shortcuts

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