db

package
v0.0.0-...-41aeeaa Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddCouponParams

type AddCouponParams struct {
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type AddCouponRow

type AddCouponRow struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type AddCouponToCartParams

type AddCouponToCartParams struct {
	Username string `json:"username"`
	CouponID int32  `json:"coupon_id"`
	CartID   int32  `json:"cart_id" param:"cart_id"`
}

type AddProductToCartParams

type AddProductToCartParams struct {
	Username string `json:"username"`
	ID       int32  `json:"id" param:"id"`
	Quantity int32  `json:"quantity"`
}

type AddShopParams

type AddShopParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	Name       string `form:"name" json:"name"`
}

type AddUserParams

type AddUserParams struct {
	Username string `json:"username"`
	Password string `json:"password"`
	Name     string `form:"name" json:"name"`
	Email    string `form:"email" json:"email"`
	Address  string `form:"address" json:"address"`
}

type Cart

type Cart struct {
	ID     int32 `json:"id" param:"cart_id"`
	UserID int32 `json:"user_id"`
	ShopID int32 `json:"shop_id"`
}

type CartCoupon

type CartCoupon struct {
	CartID   int32 `json:"cart_id"`
	CouponID int32 `json:"coupon_id"`
}

type CartProduct

type CartProduct struct {
	CartID    int32 `json:"cart_id"`
	ProductID int32 `json:"product_id" param:"id"`
	Quantity  int32 `json:"quantity"`
}

type CheckoutParams

type CheckoutParams struct {
	Username   string `json:"username"`
	Shipment   int32  `json:"shipment"`
	TotalPrice int32  `json:"total_price"`
	CartID     int32  `json:"cart_id" param:"cart_id"`
}

type Coupon

type Coupon struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	ShopID      pgtype.Int4        `json:"shop_id"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type CouponScope

type CouponScope string
const (
	CouponScopeGlobal CouponScope = "global"
	CouponScopeShop   CouponScope = "shop"
)

func (*CouponScope) Scan

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

type CouponTag

type CouponTag struct {
	CouponID int32 `json:"coupon_id" param:"id"`
	TagID    int32 `json:"tag_id"`
}

type CouponType

type CouponType string
const (
	CouponTypePercentage CouponType = "percentage"
	CouponTypeFixed      CouponType = "fixed"
	CouponTypeShipping   CouponType = "shipping"
)

func (*CouponType) Scan

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

type CreateAdminParams

type CreateAdminParams struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

type DB

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

func NewDB

func NewDB() (*DB, error)

func (*DB) Close

func (db *DB) Close()

func (*DB) NewTx

func (db *DB) NewTx(ctx context.Context) (pgx.Tx, error)

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 DeleteCouponFromCartParams

type DeleteCouponFromCartParams struct {
	Username string `json:"username"`
	CouponID int32  `json:"coupon_id"`
	CartID   int32  `json:"cart_id" param:"cart_id"`
}

type DeleteEmptyCartParams

type DeleteEmptyCartParams struct {
	Username string `json:"username"`
	CartID   int32  `json:"cart_id" param:"cart_id"`
}

type DeleteProductFromCartParams

type DeleteProductFromCartParams struct {
	Username  string `json:"username"`
	CartID    int32  `json:"cart_id" param:"cart_id"`
	ProductID int32  `json:"product_id" param:"id"`
}

type EditCouponParams

type EditCouponParams struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type EditCouponRow

type EditCouponRow struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type FindUserByRefreshTokenRow

type FindUserByRefreshTokenRow struct {
	Username string   `json:"username"`
	Role     RoleType `json:"role"`
}

type FindUserInfoAndPasswordRow

type FindUserInfoAndPasswordRow struct {
	Username string   `json:"username"`
	Role     RoleType `json:"role"`
	Password string   `json:"password"`
}

type GetCartRow

type GetCartRow struct {
	ID           int32  `json:"id" param:"cart_id"`
	SellerName   string `json:"seller_name" param:"seller_name"`
	ShopImageUrl string `json:"shop_image_url" swaggertype:"string"`
	ShopName     string `form:"name" json:"shop_name"`
}

type GetCouponDetailRow

type GetCouponDetailRow struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type GetCouponTagsRow

type GetCouponTagsRow struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

type GetCouponsFromCartParams

type GetCouponsFromCartParams struct {
	Username string `json:"username"`
	CartID   int32  `json:"cart_id" param:"cart_id"`
}

type GetCouponsFromCartRow

type GetCouponsFromCartRow struct {
	ID          int32          `json:"id" param:"id"`
	Name        string         `json:"name"`
	Type        CouponType     `json:"type"`
	Scope       CouponScope    `json:"scope"`
	Description string         `json:"description"`
	Discount    pgtype.Numeric `json:"discount" swaggertype:"number"`
}

type GetGlobalCouponDetailRow

type GetGlobalCouponDetailRow struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type GetGlobalCouponsParams

type GetGlobalCouponsParams struct {
	Limit  int64 `json:"limit"`
	Offset int64 `json:"offset"`
}

type GetGlobalCouponsRow

type GetGlobalCouponsRow struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type GetOrderDetailRow

type GetOrderDetailRow struct {
	ProductID   int32          `json:"product_id"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Price       pgtype.Numeric `json:"price" swaggertype:"number"`
	ImageUrl    string         `json:"image_url"`
	Quantity    int32          `json:"quantity"`
}

type GetOrderHistoryParams

type GetOrderHistoryParams struct {
	Username string `json:"username"`
	Offset   int64  `json:"offset"`
	Limit    int64  `json:"limit"`
}

type GetOrderHistoryRow

type GetOrderHistoryRow struct {
	ID           int32              `json:"id" param:"id"`
	ShopName     string             `form:"name" json:"shop_name"`
	ShopImageUrl string             `json:"shop_image_url" swaggertype:"string"`
	ThumbnailUrl string             `json:"thumbnail_url"`
	ProductName  string             `json:"product_name"`
	Shipment     int32              `json:"shipment"`
	TotalPrice   int32              `json:"total_price"`
	Status       OrderStatus        `json:"status"`
	CreatedAt    pgtype.Timestamptz `json:"created_at" swaggertype:"string"`
}

type GetOrderInfoParams

type GetOrderInfoParams struct {
	OrderID  int32  `json:"order_id" param:"id"`
	Username string `json:"username"`
}

type GetOrderInfoRow

type GetOrderInfoRow struct {
	ID           int32              `json:"id" param:"id"`
	ShopName     string             `form:"name" json:"shop_name"`
	ShopImageUrl string             `json:"shop_image_url" swaggertype:"string"`
	Shipment     int32              `json:"shipment"`
	TotalPrice   int32              `json:"total_price"`
	Status       OrderStatus        `json:"status"`
	CreatedAt    pgtype.Timestamptz `json:"created_at" swaggertype:"string"`
	Discount     int32              `json:"discount"`
}

type GetProductFromCartOrderByPriceDescRow

type GetProductFromCartOrderByPriceDescRow struct {
	ProductID int32          `json:"product_id" param:"id"`
	Name      string         `form:"name" json:"name"`
	ImageUrl  string         `json:"image_url"`
	Price     pgtype.Numeric `json:"price" swaggertype:"number"`
	Quantity  int32          `json:"quantity"`
	Stock     int32          `form:"stock" json:"stock"`
	Enabled   bool           `form:"enabled" json:"enabled"`
}

type GetProductInfoRow

type GetProductInfoRow struct {
	ID              int32              `json:"id" param:"id"`
	Name            string             `form:"name" json:"name"`
	Description     string             `form:"description" json:"description"`
	Price           pgtype.Numeric     `json:"price" swaggertype:"number"`
	ProductImageUrl string             `json:"product_image_url"`
	ExpireDate      pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
	Stock           int32              `form:"stock" json:"stock"`
	Sales           int32              `json:"sales"`
	ShopName        string             `form:"name" json:"shop_name"`
	ShopImageUrl    string             `json:"shop_image_url" swaggertype:"string"`
	SellerName      string             `json:"seller_name" param:"seller_name"`
}

type GetProductTagsRow

type GetProductTagsRow struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

type GetProductsFromNearByShopRow

type GetProductsFromNearByShopRow struct {
	ID          int32          `json:"id" param:"id"`
	Name        string         `form:"name" json:"name"`
	Description string         `form:"description" json:"description"`
	Price       pgtype.Numeric `json:"price" swaggertype:"number"`
	ImageUrl    string         `json:"image_url"`
	Sales       int32          `json:"sales"`
}

type GetProductsFromPopularShopRow

type GetProductsFromPopularShopRow struct {
	ID          int32          `json:"id" param:"id"`
	Name        string         `form:"name" json:"name"`
	Description string         `form:"description" json:"description"`
	Price       pgtype.Numeric `json:"price" swaggertype:"number"`
	ImageUrl    string         `json:"image_url"`
	Sales       int32          `json:"sales"`
}

type GetRandomProductsParams

type GetRandomProductsParams struct {
	Limit  int64 `json:"limit"`
	Offset int64 `json:"offset"`
}

type GetRandomProductsRow

type GetRandomProductsRow struct {
	ID          int32          `json:"id" param:"id"`
	Name        string         `form:"name" json:"name"`
	Description string         `form:"description" json:"description"`
	Price       pgtype.Numeric `json:"price" swaggertype:"number"`
	ImageUrl    string         `json:"image_url"`
	Sales       int32          `json:"sales"`
}

type GetShopCouponDetailsParams

type GetShopCouponDetailsParams struct {
	ID     int32       `json:"id" param:"id"`
	ShopID pgtype.Int4 `json:"shop_id"`
}

type GetShopCouponDetailsRow

type GetShopCouponDetailsRow struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type GetShopCouponsParams

type GetShopCouponsParams struct {
	ShopID pgtype.Int4 `json:"shop_id"`
	Limit  int64       `json:"limit"`
	Offset int64       `json:"offset"`
}

type GetShopCouponsRow

type GetShopCouponsRow struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type GetShopInfoRow

type GetShopInfoRow struct {
	SellerName  string `json:"seller_name" param:"seller_name"`
	ImageUrl    string `json:"image_url" swaggertype:"string"`
	Name        string `form:"name" json:"name"`
	Description string `form:"description" json:"description"`
}

type GetShopProductsParams

type GetShopProductsParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	Limit      int64  `json:"limit"`
	Offset     int64  `json:"offset"`
}

type GetShopProductsRow

type GetShopProductsRow struct {
	ID          int32              `json:"id" param:"id"`
	Name        string             `form:"name" json:"name"`
	Description string             `form:"description" json:"description"`
	Price       pgtype.Numeric     `json:"price" swaggertype:"number"`
	ImageUrl    string             `json:"image_url"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
	Stock       int32              `form:"stock" json:"stock"`
	Sales       int32              `json:"sales"`
}

type GetSortedCouponsFromCartParams

type GetSortedCouponsFromCartParams struct {
	Username string `json:"username"`
	CartID   int32  `json:"cart_id" param:"cart_id"`
}

type GetSortedCouponsFromCartRow

type GetSortedCouponsFromCartRow struct {
	ID          int32              `json:"id" param:"id"`
	Name        string             `json:"name"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type GetSortedUsableCouponsParams

type GetSortedUsableCouponsParams struct {
	Username string `json:"username"`
	CartID   int32  `json:"cart_id" param:"cart_id"`
}

type GetSortedUsableCouponsRow

type GetSortedUsableCouponsRow struct {
	ID          int32              `json:"id" param:"id"`
	Name        string             `json:"name"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type GetTagInfoRow

type GetTagInfoRow struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

type GetTopSellerRow

type GetTopSellerRow struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	Name       string `form:"name" json:"name"`
	ImageUrl   string `json:"image_url" swaggertype:"string"`
	TotalSales int64  `json:"total_sales"`
}

type GetUsersParams

type GetUsersParams struct {
	Limit  int64 `json:"limit"`
	Offset int64 `json:"offset"`
}

type GetUsersRow

type GetUsersRow struct {
	Username   string          `json:"username"`
	Name       string          `form:"name" json:"name"`
	Email      string          `form:"email" json:"email"`
	Address    string          `form:"address" json:"address"`
	IconUrl    string          `json:"icon_url" swaggertype:"string"`
	Role       RoleType        `json:"role"`
	CreditCard json.RawMessage `json:"credit_card"`
	Enabled    bool            `json:"enabled"`
}

type HaveTagNameParams

type HaveTagNameParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	Name       string `json:"name"`
}

type NullCouponScope

type NullCouponScope struct {
	CouponScope CouponScope `json:"coupon_scope"`
	Valid       bool        `json:"valid"` // Valid is true if CouponScope is not NULL
}

func (*NullCouponScope) Scan

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

Scan implements the Scanner interface.

func (NullCouponScope) Value

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

Value implements the driver Valuer interface.

type NullCouponType

type NullCouponType struct {
	CouponType CouponType `json:"coupon_type"`
	Valid      bool       `json:"valid"` // Valid is true if CouponType is not NULL
}

func (*NullCouponType) Scan

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

Scan implements the Scanner interface.

func (NullCouponType) Value

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

Value implements the driver Valuer interface.

type NullOrderStatus

type NullOrderStatus struct {
	OrderStatus OrderStatus `json:"order_status"`
	Valid       bool        `json:"valid"` // Valid is true if OrderStatus is not NULL
}

func (*NullOrderStatus) Scan

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

Scan implements the Scanner interface.

func (NullOrderStatus) Value

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

Value implements the driver Valuer interface.

type NullRoleType

type NullRoleType struct {
	RoleType RoleType `json:"role_type"`
	Valid    bool     `json:"valid"` // Valid is true if RoleType is not NULL
}

func (*NullRoleType) Scan

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

Scan implements the Scanner interface.

func (NullRoleType) Value

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

Value implements the driver Valuer interface.

type OrderDetail

type OrderDetail struct {
	OrderID        int32 `json:"order_id" param:"id"`
	ProductID      int32 `json:"product_id"`
	ProductVersion int32 `json:"product_version"`
	Quantity       int32 `json:"quantity"`
}

type OrderHistory

type OrderHistory struct {
	ID         int32              `json:"id" param:"id"`
	UserID     int32              `json:"user_id"`
	ShopID     int32              `json:"shop_id"`
	Shipment   int32              `json:"shipment"`
	TotalPrice int32              `json:"total_price"`
	Status     OrderStatus        `json:"status"`
	CreatedAt  pgtype.Timestamptz `json:"created_at" swaggertype:"string"`
}

type OrderStatus

type OrderStatus string
const (
	OrderStatusPaid      OrderStatus = "paid"
	OrderStatusShipped   OrderStatus = "shipped"
	OrderStatusDelivered OrderStatus = "delivered"
	OrderStatusCancelled OrderStatus = "cancelled"
	OrderStatusFinished  OrderStatus = "finished"
)

func (*OrderStatus) Scan

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

type Product

type Product struct {
	ID          int32              `json:"id" param:"id"`
	Version     int32              `json:"version"`
	ShopID      int32              `json:"shop_id"`
	Name        string             `form:"name" json:"name"`
	Description string             `form:"description" json:"description"`
	Price       pgtype.Numeric     `json:"price" swaggertype:"number"`
	ImageID     string             `json:"image_id"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
	EditDate    pgtype.Timestamptz `json:"edit_date" swaggertype:"string"`
	Stock       int32              `form:"stock" json:"stock"`
	Sales       int32              `json:"sales"`
	Enabled     bool               `form:"enabled" json:"enabled"`
}

type ProductArchive

type ProductArchive struct {
	ID          int32          `json:"id"`
	Version     int32          `json:"version"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Price       pgtype.Numeric `json:"price" swaggertype:"number"`
	ImageID     string         `json:"image_id"`
}

type ProductTag

type ProductTag struct {
	TagID     int32 `json:"tag_id"`
	ProductID int32 `json:"product_id" param:"id"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddCoupon

func (q *Queries) AddCoupon(ctx context.Context, arg AddCouponParams) (AddCouponRow, error)

func (*Queries) AddCouponToCart

func (q *Queries) AddCouponToCart(ctx context.Context, arg AddCouponToCartParams) (int64, error)

func (*Queries) AddProductToCart

func (q *Queries) AddProductToCart(ctx context.Context, arg AddProductToCartParams) (int64, error)

check product enabled ⬆️

func (*Queries) AddShop

func (q *Queries) AddShop(ctx context.Context, arg AddShopParams) error

func (*Queries) AddUser

func (q *Queries) AddUser(ctx context.Context, arg AddUserParams) error

func (*Queries) Checkout

func (q *Queries) Checkout(ctx context.Context, arg CheckoutParams) error

func (*Queries) CouponExists

func (q *Queries) CouponExists(ctx context.Context, id int32) (bool, error)

func (*Queries) CreateAdmin

func (q *Queries) CreateAdmin(ctx context.Context, arg CreateAdminParams) error

func (*Queries) DeleteCoupon

func (q *Queries) DeleteCoupon(ctx context.Context, id int32) (int64, error)

func (*Queries) DeleteCouponFromCart

func (q *Queries) DeleteCouponFromCart(ctx context.Context, arg DeleteCouponFromCartParams) (int64, error)

func (*Queries) DeleteEmptyCart

func (q *Queries) DeleteEmptyCart(ctx context.Context, arg DeleteEmptyCartParams) error

func (*Queries) DeleteProductFromCart

func (q *Queries) DeleteProductFromCart(ctx context.Context, arg DeleteProductFromCartParams) (bool, error)

func (*Queries) DeleteRefreshToken

func (q *Queries) DeleteRefreshToken(ctx context.Context, refreshToken string) error

func (*Queries) DeleteTestUser

func (q *Queries) DeleteTestUser(ctx context.Context) error

func (*Queries) DisableProductsFromShop

func (q *Queries) DisableProductsFromShop(ctx context.Context, shopID int32) (int64, error)

func (*Queries) DisableShop

func (q *Queries) DisableShop(ctx context.Context, sellerName string) error

func (*Queries) DisableUser

func (q *Queries) DisableUser(ctx context.Context, username string) (int64, error)

func (*Queries) EditCoupon

func (q *Queries) EditCoupon(ctx context.Context, arg EditCouponParams) (EditCouponRow, error)

func (*Queries) EnabledShop

func (q *Queries) EnabledShop(ctx context.Context, sellerName string) (int64, error)

func (*Queries) FindUserByRefreshToken

func (q *Queries) FindUserByRefreshToken(ctx context.Context, refreshToken string) (FindUserByRefreshTokenRow, error)

func (*Queries) FindUserInfoAndPassword

func (q *Queries) FindUserInfoAndPassword(ctx context.Context, username string) (FindUserInfoAndPasswordRow, error)

user can enter both username and email to verify but writing "usernameOrEmail" is too long

func (*Queries) GetCart

func (q *Queries) GetCart(ctx context.Context, username string) ([]GetCartRow, error)

func (*Queries) GetCouponDetail

func (q *Queries) GetCouponDetail(ctx context.Context, id int32) (GetCouponDetailRow, error)

func (*Queries) GetCouponTag

func (q *Queries) GetCouponTag(ctx context.Context, couponID int32) ([]int32, error)

func (*Queries) GetCouponTags

func (q *Queries) GetCouponTags(ctx context.Context, couponID int32) ([]GetCouponTagsRow, error)

func (*Queries) GetCouponsFromCart

func (q *Queries) GetCouponsFromCart(ctx context.Context, arg GetCouponsFromCartParams) ([]GetCouponsFromCartRow, error)

func (*Queries) GetCreditCard

func (q *Queries) GetCreditCard(ctx context.Context, username string) (json.RawMessage, error)

func (*Queries) GetGlobalCouponDetail

func (q *Queries) GetGlobalCouponDetail(ctx context.Context, id int32) (GetGlobalCouponDetailRow, error)

func (*Queries) GetGlobalCoupons

func (q *Queries) GetGlobalCoupons(ctx context.Context, arg GetGlobalCouponsParams) ([]GetGlobalCouponsRow, error)

func (*Queries) GetOrderDetail

func (q *Queries) GetOrderDetail(ctx context.Context, orderID int32) ([]GetOrderDetailRow, error)

func (*Queries) GetOrderHistory

func (q *Queries) GetOrderHistory(ctx context.Context, arg GetOrderHistoryParams) ([]GetOrderHistoryRow, error)

func (*Queries) GetOrderInfo

func (q *Queries) GetOrderInfo(ctx context.Context, arg GetOrderInfoParams) (GetOrderInfoRow, error)

func (*Queries) GetProductFromCartOrderByPriceDesc

func (q *Queries) GetProductFromCartOrderByPriceDesc(ctx context.Context, cartID int32) ([]GetProductFromCartOrderByPriceDescRow, error)

func (*Queries) GetProductInfo

func (q *Queries) GetProductInfo(ctx context.Context, id int32) (GetProductInfoRow, error)

func (*Queries) GetProductTag

func (q *Queries) GetProductTag(ctx context.Context, productID int32) ([]int32, error)

returning the number of products in any cart for US-SC-2 in SRS ⬆️

func (*Queries) GetProductTags

func (q *Queries) GetProductTags(ctx context.Context, productID int32) ([]GetProductTagsRow, error)

func (*Queries) GetProductsFromNearByShop

func (q *Queries) GetProductsFromNearByShop(ctx context.Context) ([]GetProductsFromNearByShopRow, error)

func (*Queries) GetProductsFromPopularShop

func (q *Queries) GetProductsFromPopularShop(ctx context.Context) ([]GetProductsFromPopularShopRow, error)

func (*Queries) GetRandomProducts

func (q *Queries) GetRandomProducts(ctx context.Context, arg GetRandomProductsParams) ([]GetRandomProductsRow, error)

func (*Queries) GetSellerNameByShopID

func (q *Queries) GetSellerNameByShopID(ctx context.Context, id int32) (string, error)

func (*Queries) GetShopCouponDetails

func (q *Queries) GetShopCouponDetails(ctx context.Context, arg GetShopCouponDetailsParams) (GetShopCouponDetailsRow, error)

func (*Queries) GetShopCoupons

func (q *Queries) GetShopCoupons(ctx context.Context, arg GetShopCouponsParams) ([]GetShopCouponsRow, error)

func (*Queries) GetShopIDBySellerName

func (q *Queries) GetShopIDBySellerName(ctx context.Context, sellerName string) (int32, error)

func (*Queries) GetShopInfo

func (q *Queries) GetShopInfo(ctx context.Context, sellerName string) (GetShopInfoRow, error)

func (*Queries) GetShopProducts

func (q *Queries) GetShopProducts(ctx context.Context, arg GetShopProductsParams) ([]GetShopProductsRow, error)

func (*Queries) GetSortedCouponsFromCart

func (q *Queries) GetSortedCouponsFromCart(ctx context.Context, arg GetSortedCouponsFromCartParams) ([]GetSortedCouponsFromCartRow, error)

func (*Queries) GetSortedUsableCoupons

func (q *Queries) GetSortedUsableCoupons(ctx context.Context, arg GetSortedUsableCouponsParams) ([]GetSortedUsableCouponsRow, error)

func (*Queries) GetTagInfo

func (q *Queries) GetTagInfo(ctx context.Context, id int32) (GetTagInfoRow, error)

func (*Queries) GetTopSeller

func (q *Queries) GetTopSeller(ctx context.Context, date pgtype.Timestamptz) ([]GetTopSellerRow, error)

func (*Queries) GetTotalSales

func (q *Queries) GetTotalSales(ctx context.Context, date pgtype.Timestamptz) (int32, error)

func (*Queries) GetUserIDByUsername

func (q *Queries) GetUserIDByUsername(ctx context.Context, username string) (int32, error)

func (*Queries) GetUsers

func (q *Queries) GetUsers(ctx context.Context, arg GetUsersParams) ([]GetUsersRow, error)

func (*Queries) HaveTagName

func (q *Queries) HaveTagName(ctx context.Context, arg HaveTagNameParams) (bool, error)

func (*Queries) InsertTestUser

func (q *Queries) InsertTestUser(ctx context.Context, imageID pgtype.UUID) error

func (*Queries) SearchProducts

func (q *Queries) SearchProducts(ctx context.Context, arg SearchProductsParams) ([]SearchProductsRow, error)

func (*Queries) SearchProductsByShop

func (q *Queries) SearchProductsByShop(ctx context.Context, arg SearchProductsByShopParams) ([]SearchProductsByShopRow, error)

func (*Queries) SearchShops

func (q *Queries) SearchShops(ctx context.Context, arg SearchShopsParams) ([]SearchShopsRow, error)

func (*Queries) SearchTestUser

func (q *Queries) SearchTestUser(ctx context.Context) (User, error)

func (*Queries) SellerBestSellProduct

func (q *Queries) SellerBestSellProduct(ctx context.Context, arg SellerBestSellProductParams) ([]SellerBestSellProductRow, error)

func (*Queries) SellerCheckTags

func (q *Queries) SellerCheckTags(ctx context.Context, arg SellerCheckTagsParams) (bool, error)

func (*Queries) SellerDeleteCoupon

func (q *Queries) SellerDeleteCoupon(ctx context.Context, arg SellerDeleteCouponParams) (int64, error)

func (*Queries) SellerDeleteCouponTag

func (q *Queries) SellerDeleteCouponTag(ctx context.Context, arg SellerDeleteCouponTagParams) (int64, error)

func (*Queries) SellerDeleteProduct

func (q *Queries) SellerDeleteProduct(ctx context.Context, arg SellerDeleteProductParams) (int64, error)

func (*Queries) SellerDeleteProductTag

func (q *Queries) SellerDeleteProductTag(ctx context.Context, arg SellerDeleteProductTagParams) (int64, error)

func (*Queries) SellerGetCoupon

func (q *Queries) SellerGetCoupon(ctx context.Context, arg SellerGetCouponParams) ([]SellerGetCouponRow, error)

func (*Queries) SellerGetCouponDetail

func (q *Queries) SellerGetCouponDetail(ctx context.Context, arg SellerGetCouponDetailParams) (SellerGetCouponDetailRow, error)

func (*Queries) SellerGetCouponTag

func (q *Queries) SellerGetCouponTag(ctx context.Context, arg SellerGetCouponTagParams) ([]SellerGetCouponTagRow, error)

func (*Queries) SellerGetInfo

func (q *Queries) SellerGetInfo(ctx context.Context, sellerName string) (SellerGetInfoRow, error)

func (*Queries) SellerGetOrder

func (q *Queries) SellerGetOrder(ctx context.Context, arg SellerGetOrderParams) ([]SellerGetOrderRow, error)

func (*Queries) SellerGetOrderDetail

func (q *Queries) SellerGetOrderDetail(ctx context.Context, arg SellerGetOrderDetailParams) ([]SellerGetOrderDetailRow, error)

func (*Queries) SellerGetOrderHistory

func (q *Queries) SellerGetOrderHistory(ctx context.Context, arg SellerGetOrderHistoryParams) (SellerGetOrderHistoryRow, error)

func (*Queries) SellerGetProductDetail

func (q *Queries) SellerGetProductDetail(ctx context.Context, arg SellerGetProductDetailParams) (SellerGetProductDetailRow, error)

func (*Queries) SellerGetProductTag

func (q *Queries) SellerGetProductTag(ctx context.Context, arg SellerGetProductTagParams) ([]SellerGetProductTagRow, error)

func (*Queries) SellerInsertCoupon

func (q *Queries) SellerInsertCoupon(ctx context.Context, arg SellerInsertCouponParams) (SellerInsertCouponRow, error)

func (*Queries) SellerInsertCouponTag

func (q *Queries) SellerInsertCouponTag(ctx context.Context, arg SellerInsertCouponTagParams) (CouponTag, error)

func (*Queries) SellerInsertCouponTags

func (q *Queries) SellerInsertCouponTags(ctx context.Context, arg SellerInsertCouponTagsParams) error

func (*Queries) SellerInsertProduct

func (q *Queries) SellerInsertProduct(ctx context.Context, arg SellerInsertProductParams) (SellerInsertProductRow, error)

func (*Queries) SellerInsertProductTag

func (q *Queries) SellerInsertProductTag(ctx context.Context, arg SellerInsertProductTagParams) (ProductTag, error)

func (*Queries) SellerInsertProductTags

func (q *Queries) SellerInsertProductTags(ctx context.Context, arg SellerInsertProductTagsParams) error

func (*Queries) SellerInsertTag

func (q *Queries) SellerInsertTag(ctx context.Context, arg SellerInsertTagParams) (SellerInsertTagRow, error)

func (*Queries) SellerProductList

func (q *Queries) SellerProductList(ctx context.Context, arg SellerProductListParams) ([]SellerProductListRow, error)

func (*Queries) SellerReport

func (q *Queries) SellerReport(ctx context.Context, arg SellerReportParams) (SellerReportRow, error)

func (*Queries) SellerSearchTag

func (q *Queries) SellerSearchTag(ctx context.Context, arg SellerSearchTagParams) ([]SellerSearchTagRow, error)

func (*Queries) SellerUpdateCouponInfo

func (q *Queries) SellerUpdateCouponInfo(ctx context.Context, arg SellerUpdateCouponInfoParams) (SellerUpdateCouponInfoRow, error)

func (*Queries) SellerUpdateInfo

func (q *Queries) SellerUpdateInfo(ctx context.Context, arg SellerUpdateInfoParams) (SellerUpdateInfoRow, error)

func (*Queries) SellerUpdateOrderStatus

func (q *Queries) SellerUpdateOrderStatus(ctx context.Context, arg SellerUpdateOrderStatusParams) (SellerUpdateOrderStatusRow, error)

func (*Queries) SellerUpdateProductInfo

func (q *Queries) SellerUpdateProductInfo(ctx context.Context, arg SellerUpdateProductInfoParams) (SellerUpdateProductInfoRow, error)

func (*Queries) SetRefreshToken

func (q *Queries) SetRefreshToken(ctx context.Context, arg SetRefreshTokenParams) error

func (*Queries) ShopExists

func (q *Queries) ShopExists(ctx context.Context, sellerName string) (int32, error)

func (*Queries) TestDeleteCoupon

func (q *Queries) TestDeleteCoupon(ctx context.Context) error

func (*Queries) TestDeleteCouponById

func (q *Queries) TestDeleteCouponById(ctx context.Context, id int32) (Coupon, error)

func (*Queries) TestDeleteOrderById

func (q *Queries) TestDeleteOrderById(ctx context.Context, id int32) (OrderHistory, error)

func (*Queries) TestDeleteOrderDetail

func (q *Queries) TestDeleteOrderDetail(ctx context.Context) error

func (*Queries) TestDeleteOrderDetailByOrderId

func (q *Queries) TestDeleteOrderDetailByOrderId(ctx context.Context, arg TestDeleteOrderDetailByOrderIdParams) (OrderDetail, error)

func (*Queries) TestDeleteOrderHistory

func (q *Queries) TestDeleteOrderHistory(ctx context.Context) error

func (*Queries) TestDeleteProduct

func (q *Queries) TestDeleteProduct(ctx context.Context) error

func (*Queries) TestDeleteProductArchive

func (q *Queries) TestDeleteProductArchive(ctx context.Context) error

func (*Queries) TestDeleteProductArchiveByIdVersion

func (q *Queries) TestDeleteProductArchiveByIdVersion(ctx context.Context, arg TestDeleteProductArchiveByIdVersionParams) (ProductArchive, error)

func (*Queries) TestDeleteProductById

func (q *Queries) TestDeleteProductById(ctx context.Context, id int32) (Product, error)

func (*Queries) TestDeleteShop

func (q *Queries) TestDeleteShop(ctx context.Context) error

func (*Queries) TestDeleteShopById

func (q *Queries) TestDeleteShopById(ctx context.Context, id int32) (Shop, error)

func (*Queries) TestDeleteTag

func (q *Queries) TestDeleteTag(ctx context.Context) error

func (*Queries) TestDeleteTagById

func (q *Queries) TestDeleteTagById(ctx context.Context, id int32) (Tag, error)

func (*Queries) TestDeleteUser

func (q *Queries) TestDeleteUser(ctx context.Context) error

func (*Queries) TestDeleteUserById

func (q *Queries) TestDeleteUserById(ctx context.Context, id int32) (TestDeleteUserByIdRow, error)

func (*Queries) TestInsertCart

func (q *Queries) TestInsertCart(ctx context.Context, arg TestInsertCartParams) (Cart, error)

func (*Queries) TestInsertCartCoupon

func (q *Queries) TestInsertCartCoupon(ctx context.Context, arg TestInsertCartCouponParams) (CartCoupon, error)

func (*Queries) TestInsertCartProduct

func (q *Queries) TestInsertCartProduct(ctx context.Context, arg TestInsertCartProductParams) (CartProduct, error)

func (*Queries) TestInsertCoupon

func (q *Queries) TestInsertCoupon(ctx context.Context, arg TestInsertCouponParams) (Coupon, error)

func (*Queries) TestInsertCouponTag

func (q *Queries) TestInsertCouponTag(ctx context.Context, arg TestInsertCouponTagParams) (CouponTag, error)

func (*Queries) TestInsertOrderDetail

func (q *Queries) TestInsertOrderDetail(ctx context.Context, arg TestInsertOrderDetailParams) (OrderDetail, error)

func (*Queries) TestInsertOrderHistory

func (q *Queries) TestInsertOrderHistory(ctx context.Context, arg TestInsertOrderHistoryParams) (OrderHistory, error)

func (*Queries) TestInsertProduct

func (q *Queries) TestInsertProduct(ctx context.Context, arg TestInsertProductParams) (Product, error)

func (*Queries) TestInsertProductArchive

func (q *Queries) TestInsertProductArchive(ctx context.Context, arg TestInsertProductArchiveParams) (ProductArchive, error)

func (*Queries) TestInsertProductTag

func (q *Queries) TestInsertProductTag(ctx context.Context, arg TestInsertProductTagParams) (ProductTag, error)

func (*Queries) TestInsertShop

func (q *Queries) TestInsertShop(ctx context.Context, arg TestInsertShopParams) (Shop, error)

func (*Queries) TestInsertTag

func (q *Queries) TestInsertTag(ctx context.Context, arg TestInsertTagParams) (Tag, error)

func (*Queries) TestInsertUser

func (q *Queries) TestInsertUser(ctx context.Context, arg TestInsertUserParams) (TestInsertUserRow, error)

func (*Queries) UpdateOrderStatus

func (q *Queries) UpdateOrderStatus(ctx context.Context, arg UpdateOrderStatusParams) (int64, error)

func (*Queries) UpdateProductFromCart

func (q *Queries) UpdateProductFromCart(ctx context.Context, arg UpdateProductFromCartParams) (int64, error)

func (*Queries) UpdateProductVersion

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

func (*Queries) UserExists

func (q *Queries) UserExists(ctx context.Context, arg UserExistsParams) (bool, error)

func (*Queries) UserGetCreditCard

func (q *Queries) UserGetCreditCard(ctx context.Context, username string) (json.RawMessage, error)

func (*Queries) UserGetInfo

func (q *Queries) UserGetInfo(ctx context.Context, username string) (UserGetInfoRow, error)

func (*Queries) UserGetPassword

func (q *Queries) UserGetPassword(ctx context.Context, username string) (string, error)

func (*Queries) UserUpdateCreditCard

func (q *Queries) UserUpdateCreditCard(ctx context.Context, arg UserUpdateCreditCardParams) (json.RawMessage, error)

func (*Queries) UserUpdateInfo

func (q *Queries) UserUpdateInfo(ctx context.Context, arg UserUpdateInfoParams) (UserUpdateInfoRow, error)

func (*Queries) UserUpdatePassword

func (q *Queries) UserUpdatePassword(ctx context.Context, arg UserUpdatePasswordParams) (UserUpdatePasswordRow, error)

func (*Queries) ValidatePayment

func (q *Queries) ValidatePayment(ctx context.Context, arg ValidatePaymentParams) (bool, error)

func (*Queries) ValidateProductsInCart

func (q *Queries) ValidateProductsInCart(ctx context.Context, arg ValidateProductsInCartParams) (pgtype.Bool, error)

func (*Queries) WithTx

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

type RoleType

type RoleType string
const (
	RoleTypeAdmin    RoleType = "admin"
	RoleTypeCustomer RoleType = "customer"
)

func (*RoleType) Scan

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

type SearchProductsByShopParams

type SearchProductsByShopParams struct {
	SellerName string         `json:"seller_name" param:"seller_name"`
	Query      string         `json:"query"`
	MinPrice   pgtype.Numeric `json:"min_price"`
	MaxPrice   pgtype.Numeric `json:"max_price"`
	MinStock   pgtype.Int4    `json:"min_stock"`
	MaxStock   pgtype.Int4    `json:"max_stock"`
	HasCoupon  pgtype.Bool    `json:"has_coupon"`
	SortBy     string         `json:"sort_by"`
	Order      string         `json:"order"`
	Offset     int32          `json:"offset"`
	Limit      int32          `json:"limit"`
}

type SearchProductsByShopRow

type SearchProductsByShopRow struct {
	ID       pgtype.Int4    `json:"id"`
	Name     string         `json:"name"`
	Price    pgtype.Numeric `json:"price"`
	ImageUrl string         `json:"image_url"`
	Sales    pgtype.Int4    `json:"sales"`
}

type SearchProductsParams

type SearchProductsParams struct {
	Query     string         `json:"query"`
	MinPrice  pgtype.Numeric `json:"min_price"`
	MaxPrice  pgtype.Numeric `json:"max_price"`
	MinStock  pgtype.Int4    `json:"min_stock"`
	MaxStock  pgtype.Int4    `json:"max_stock"`
	HasCoupon pgtype.Bool    `json:"has_coupon"`
	SortBy    string         `json:"sort_by"`
	Order     string         `json:"order"`
	Offset    int32          `json:"offset"`
	Limit     int32          `json:"limit"`
}

type SearchProductsRow

type SearchProductsRow struct {
	ID       pgtype.Int4    `json:"id"`
	Name     string         `json:"name"`
	Price    pgtype.Numeric `json:"price"`
	ImageUrl string         `json:"image_url"`
	Sales    pgtype.Int4    `json:"sales"`
}

type SearchShopsParams

type SearchShopsParams struct {
	Query  string `json:"query"`
	Offset int32  `json:"offset"`
	Limit  int32  `json:"limit"`
}

type SearchShopsRow

type SearchShopsRow struct {
	Name       string `json:"name"`
	SellerName string `json:"seller_name"`
	ImageUrl   string `json:"image_url"`
}

type SellerBestSellProductParams

type SellerBestSellProductParams struct {
	SellerName string             `json:"seller_name" param:"seller_name"`
	Limit      int64              `json:"limit"`
	Time       pgtype.Timestamptz `json:"time" swaggertype:"string"`
}

type SellerBestSellProductRow

type SellerBestSellProductRow struct {
	ProductID     int32          `json:"product_id"`
	Name          string         `json:"name"`
	Price         pgtype.Numeric `json:"price" swaggertype:"number"`
	ImageUrl      string         `json:"image_url"`
	TotalQuantity int64          `json:"total_quantity"`
	TotalSell     pgtype.Numeric `json:"total_sell"`
	OrderCount    int64          `json:"order_count"`
}

type SellerCheckTagsParams

type SellerCheckTagsParams struct {
	SellerName string  `json:"seller_name" param:"seller_name"`
	Tags       []int32 `json:"tags"`
}

type SellerDeleteCouponParams

type SellerDeleteCouponParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	ID         int32  `json:"id" param:"id"`
}

type SellerDeleteCouponTagParams

type SellerDeleteCouponTagParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	TagID      int32  `json:"tag_id"`
	ID         int32  `json:"id" param:"id"`
}

type SellerDeleteProductParams

type SellerDeleteProductParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	ID         int32  `json:"id" param:"id"`
}

type SellerDeleteProductTagParams

type SellerDeleteProductTagParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	TagID      int32  `json:"tag_id"`
	ID         int32  `json:"id" param:"id"`
}

type SellerGetCouponDetailParams

type SellerGetCouponDetailParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	ID         int32  `json:"id" param:"id"`
}

type SellerGetCouponDetailRow

type SellerGetCouponDetailRow struct {
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Name        string             `json:"name"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	Description string             `json:"description"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type SellerGetCouponParams

type SellerGetCouponParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	Limit      int64  `json:"limit"`
	Offset     int64  `json:"offset"`
}

type SellerGetCouponRow

type SellerGetCouponRow struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type SellerGetCouponTagParams

type SellerGetCouponTagParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	CouponID   int32  `json:"coupon_id" param:"id"`
}

type SellerGetCouponTagRow

type SellerGetCouponTagRow struct {
	TagID int32  `json:"tag_id"`
	Name  string `json:"name"`
}

type SellerGetInfoRow

type SellerGetInfoRow struct {
	Name        string `form:"name" json:"name"`
	ImageUrl    string `json:"image_url" swaggertype:"string"`
	Description string `form:"description" json:"description"`
	Enabled     bool   `form:"enabled" json:"enabled"`
}

type SellerGetOrderDetailParams

type SellerGetOrderDetailParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	OrderID    int32  `json:"order_id" param:"id"`
}

type SellerGetOrderDetailRow

type SellerGetOrderDetailRow struct {
	ID          pgtype.Int4    `json:"id"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Price       pgtype.Numeric `json:"price" swaggertype:"number"`
	ImageUrl    string         `json:"image_url"`
	Quantity    int32          `json:"quantity"`
}

type SellerGetOrderHistoryParams

type SellerGetOrderHistoryParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	ID         int32  `json:"id" param:"id"`
}

type SellerGetOrderHistoryRow

type SellerGetOrderHistoryRow struct {
	ID           int32              `json:"id" param:"id"`
	Shipment     int32              `json:"shipment"`
	TotalPrice   int32              `json:"total_price"`
	Status       OrderStatus        `json:"status"`
	CreatedAt    pgtype.Timestamptz `json:"created_at" swaggertype:"string"`
	UserID       int32              `json:"user_id" param:"id"`
	UserName     string             `form:"name" json:"user_name"`
	UserImageUrl string             `json:"user_image_url" swaggertype:"string"`
}

type SellerGetOrderParams

type SellerGetOrderParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	Limit      int64  `json:"limit"`
	Offset     int64  `json:"offset"`
}

type SellerGetOrderRow

type SellerGetOrderRow struct {
	ID           int32              `json:"id" param:"id"`
	ProductName  string             `json:"product_name"`
	ThumbnailUrl string             `json:"thumbnail_url"`
	UserName     string             `form:"name" json:"user_name"`
	UserImageUrl string             `json:"user_image_url" swaggertype:"string"`
	Shipment     int32              `json:"shipment"`
	TotalPrice   int32              `json:"total_price"`
	Status       OrderStatus        `json:"status"`
	CreatedAt    pgtype.Timestamptz `json:"created_at" swaggertype:"string"`
}

type SellerGetProductDetailParams

type SellerGetProductDetailParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	ID         int32  `json:"id" param:"id"`
}

type SellerGetProductDetailRow

type SellerGetProductDetailRow struct {
	ID          int32              `json:"id" param:"id"`
	Name        string             `form:"name" json:"name"`
	Description string             `form:"description" json:"description"`
	ImageUrl    string             `json:"image_url"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
	Price       pgtype.Numeric     `json:"price" swaggertype:"number"`
	Sales       int32              `json:"sales"`
	Stock       int32              `form:"stock" json:"stock"`
	Enabled     bool               `form:"enabled" json:"enabled"`
}

type SellerGetProductTagParams

type SellerGetProductTagParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	ProductID  int32  `json:"product_id" param:"id"`
}

type SellerGetProductTagRow

type SellerGetProductTagRow struct {
	TagID int32  `json:"tag_id"`
	Name  string `json:"name"`
}

type SellerInsertCouponParams

type SellerInsertCouponParams struct {
	SellerName  string             `json:"seller_name" param:"seller_name"`
	Type        CouponType         `json:"type"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type SellerInsertCouponRow

type SellerInsertCouponRow struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Name        string             `json:"name"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	Description string             `json:"description"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type SellerInsertCouponTagParams

type SellerInsertCouponTagParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	TagID      int32  `json:"tag_id"`
	CouponID   int32  `json:"coupon_id" param:"id"`
}

type SellerInsertCouponTagsParams

type SellerInsertCouponTagsParams struct {
	CouponID int32   `json:"coupon_id" param:"id"`
	Tags     []int32 `json:"tags"`
}

type SellerInsertProductParams

type SellerInsertProductParams struct {
	SellerName  string             `json:"seller_name" param:"seller_name"`
	Name        string             `form:"name" json:"name"`
	Description string             `form:"description" json:"description"`
	Price       pgtype.Numeric     `json:"price" swaggertype:"number"`
	ImageID     string             `json:"image_id"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
	Stock       int32              `form:"stock" json:"stock"`
	Enabled     bool               `form:"enabled" json:"enabled"`
}

type SellerInsertProductRow

type SellerInsertProductRow struct {
	ID          int32              `json:"id" param:"id"`
	Name        string             `form:"name" json:"name"`
	Description string             `form:"description" json:"description"`
	Price       pgtype.Numeric     `json:"price" swaggertype:"number"`
	ImageUrl    string             `json:"image_url"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
	EditDate    pgtype.Timestamptz `json:"edit_date" swaggertype:"string"`
	Stock       int32              `form:"stock" json:"stock"`
	Sales       int32              `json:"sales"`
	Enabled     bool               `form:"enabled" json:"enabled"`
}

type SellerInsertProductTagParams

type SellerInsertProductTagParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	TagID      int32  `json:"tag_id"`
	ProductID  int32  `json:"product_id" param:"id"`
}

type SellerInsertProductTagsParams

type SellerInsertProductTagsParams struct {
	ProductID int32   `json:"product_id" param:"id"`
	Tags      []int32 `json:"tags"`
}

type SellerInsertTagParams

type SellerInsertTagParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	Name       string `json:"name"`
}

type SellerInsertTagRow

type SellerInsertTagRow struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

type SellerProductListParams

type SellerProductListParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	Limit      int64  `json:"limit"`
	Offset     int64  `json:"offset"`
}

type SellerProductListRow

type SellerProductListRow struct {
	ID          int32              `json:"id" param:"id"`
	Name        string             `form:"name" json:"name"`
	Description string             `form:"description" json:"description"`
	ImageUrl    string             `json:"image_url"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
	Price       pgtype.Numeric     `json:"price" swaggertype:"number"`
	Sales       int32              `json:"sales"`
	Stock       int32              `form:"stock" json:"stock"`
	Enabled     bool               `form:"enabled" json:"enabled"`
}

type SellerReportParams

type SellerReportParams struct {
	SellerName string             `json:"seller_name" param:"seller_name"`
	Time       pgtype.Timestamptz `json:"time" swaggertype:"string"`
}

type SellerReportRow

type SellerReportRow struct {
	TotalIncome pgtype.Numeric `json:"total_income"`
	OrderCount  int64          `json:"order_count"`
}

type SellerSearchTagParams

type SellerSearchTagParams struct {
	SellerName string `json:"seller_name" param:"seller_name"`
	Name       string `json:"name"`
	Limit      int64  `json:"limit"`
}

type SellerSearchTagRow

type SellerSearchTagRow struct {
	ID   int32  `json:"id"`
	Name string `json:"name"`
}

type SellerUpdateCouponInfoParams

type SellerUpdateCouponInfoParams struct {
	SellerName  string             `json:"seller_name" param:"seller_name"`
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type SellerUpdateCouponInfoRow

type SellerUpdateCouponInfoRow struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type SellerUpdateInfoParams

type SellerUpdateInfoParams struct {
	SellerName  string `json:"seller_name" param:"seller_name"`
	Name        string `form:"name" json:"name"`
	Description string `form:"description" json:"description"`
	Enabled     bool   `form:"enabled" json:"enabled"`
	ImageID     string `json:"image_id"`
}

type SellerUpdateInfoRow

type SellerUpdateInfoRow struct {
	Name        string `form:"name" json:"name"`
	ImageUrl    string `json:"image_url" swaggertype:"string"`
	Description string `form:"description" json:"description"`
	Enabled     bool   `form:"enabled" json:"enabled"`
}

type SellerUpdateOrderStatusParams

type SellerUpdateOrderStatusParams struct {
	SellerName    string      `json:"seller_name" param:"seller_name"`
	ID            int32       `json:"id" param:"id"`
	SetStatus     OrderStatus `json:"set_status"`
	CurrentStatus OrderStatus `json:"current_status"`
}

type SellerUpdateOrderStatusRow

type SellerUpdateOrderStatusRow struct {
	ID         int32              `json:"id" param:"id"`
	Shipment   int32              `json:"shipment"`
	TotalPrice int32              `json:"total_price"`
	Status     OrderStatus        `json:"status"`
	CreatedAt  pgtype.Timestamptz `json:"created_at" swaggertype:"string"`
}

type SellerUpdateProductInfoParams

type SellerUpdateProductInfoParams struct {
	SellerName  string             `json:"seller_name" param:"seller_name"`
	ID          int32              `json:"id" param:"id"`
	Name        string             `form:"name" json:"name"`
	Description string             `form:"description" json:"description"`
	Price       pgtype.Numeric     `json:"price" swaggertype:"number"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
	Enabled     bool               `form:"enabled" json:"enabled"`
	Stock       int32              `form:"stock" json:"stock"`
	ImageID     string             `json:"image_id"`
}

type SellerUpdateProductInfoRow

type SellerUpdateProductInfoRow struct {
	ID          int32              `json:"id" param:"id"`
	Name        string             `form:"name" json:"name"`
	Description string             `form:"description" json:"description"`
	Price       pgtype.Numeric     `json:"price" swaggertype:"number"`
	ImageUrl    string             `json:"image_url"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
	EditDate    pgtype.Timestamptz `json:"edit_date" swaggertype:"string"`
	Stock       int32              `form:"stock" json:"stock"`
	Sales       int32              `json:"sales"`
	Enabled     bool               `form:"enabled" json:"enabled"`
}

type SetRefreshTokenParams

type SetRefreshTokenParams struct {
	RefreshToken string             `json:"refresh_token"`
	ExpireDate   pgtype.Timestamptz `json:"expire_date"`
	Username     string             `json:"username"`
}

type Shop

type Shop struct {
	ID          int32  `json:"id"`
	SellerName  string `json:"seller_name" param:"seller_name"`
	ImageID     string `json:"image_id" swaggertype:"string"`
	Name        string `form:"name" json:"name"`
	Description string `form:"description" json:"description"`
	Enabled     bool   `form:"enabled" json:"enabled"`
}

type Tag

type Tag struct {
	ID     int32  `json:"id"`
	ShopID int32  `json:"shop_id"`
	Name   string `json:"name"`
}

type TestDeleteOrderDetailByOrderIdParams

type TestDeleteOrderDetailByOrderIdParams struct {
	OrderID        int32 `json:"order_id" param:"id"`
	ProductID      int32 `json:"product_id"`
	ProductVersion int32 `json:"product_version"`
}

type TestDeleteProductArchiveByIdVersionParams

type TestDeleteProductArchiveByIdVersionParams struct {
	ID      int32 `json:"id"`
	Version int32 `json:"version"`
}

type TestDeleteUserByIdRow

type TestDeleteUserByIdRow struct {
	ID         int32           `json:"id" param:"id"`
	Username   string          `json:"username"`
	Password   string          `json:"password"`
	Name       string          `form:"name" json:"name"`
	Email      string          `form:"email" json:"email"`
	Address    string          `form:"address" json:"address"`
	ImageID    string          `json:"image_id" swaggertype:"string"`
	Role       RoleType        `json:"role"`
	CreditCard json.RawMessage `json:"credit_card"`
	Enabled    bool            `json:"enabled"`
}

type TestInsertCartCouponParams

type TestInsertCartCouponParams struct {
	CartID   int32 `json:"cart_id"`
	CouponID int32 `json:"coupon_id"`
}

type TestInsertCartParams

type TestInsertCartParams struct {
	ID     int32 `json:"id" param:"cart_id"`
	UserID int32 `json:"user_id"`
	ShopID int32 `json:"shop_id"`
}

type TestInsertCartProductParams

type TestInsertCartProductParams struct {
	CartID    int32 `json:"cart_id"`
	ProductID int32 `json:"product_id" param:"id"`
	Quantity  int32 `json:"quantity"`
}

type TestInsertCouponParams

type TestInsertCouponParams struct {
	ID          int32              `json:"id" param:"id"`
	Type        CouponType         `json:"type"`
	Scope       CouponScope        `json:"scope"`
	ShopID      pgtype.Int4        `json:"shop_id"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	Discount    pgtype.Numeric     `json:"discount" swaggertype:"number"`
	StartDate   pgtype.Timestamptz `json:"start_date" swaggertype:"string"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
}

type TestInsertCouponTagParams

type TestInsertCouponTagParams struct {
	TagID    int32 `json:"tag_id"`
	CouponID int32 `json:"coupon_id" param:"id"`
}

type TestInsertOrderDetailParams

type TestInsertOrderDetailParams struct {
	OrderID        int32 `json:"order_id" param:"id"`
	ProductID      int32 `json:"product_id"`
	ProductVersion int32 `json:"product_version"`
	Quantity       int32 `json:"quantity"`
}

type TestInsertOrderHistoryParams

type TestInsertOrderHistoryParams struct {
	ID         int32       `json:"id" param:"id"`
	UserID     int32       `json:"user_id"`
	ShopID     int32       `json:"shop_id"`
	Shipment   int32       `json:"shipment"`
	TotalPrice int32       `json:"total_price"`
	Status     OrderStatus `json:"status"`
}

type TestInsertProductArchiveParams

type TestInsertProductArchiveParams struct {
	ID          int32          `json:"id"`
	Version     int32          `json:"version"`
	Name        string         `json:"name"`
	Description string         `json:"description"`
	Price       pgtype.Numeric `json:"price" swaggertype:"number"`
	ImageID     string         `json:"image_id"`
}

type TestInsertProductParams

type TestInsertProductParams struct {
	ID          int32              `json:"id" param:"id"`
	Version     int32              `json:"version"`
	ShopID      int32              `json:"shop_id"`
	Name        string             `form:"name" json:"name"`
	Description string             `form:"description" json:"description"`
	Price       pgtype.Numeric     `json:"price" swaggertype:"number"`
	ImageID     string             `json:"image_id"`
	ExpireDate  pgtype.Timestamptz `json:"expire_date" swaggertype:"string"`
	Stock       int32              `form:"stock" json:"stock"`
	Sales       int32              `json:"sales"`
	Enabled     bool               `form:"enabled" json:"enabled"`
}

type TestInsertProductTagParams

type TestInsertProductTagParams struct {
	TagID     int32 `json:"tag_id"`
	ProductID int32 `json:"product_id" param:"id"`
}

type TestInsertShopParams

type TestInsertShopParams struct {
	ID          int32  `json:"id"`
	SellerName  string `json:"seller_name" param:"seller_name"`
	Name        string `form:"name" json:"name"`
	ImageID     string `json:"image_id" swaggertype:"string"`
	Description string `form:"description" json:"description"`
	Enabled     bool   `form:"enabled" json:"enabled"`
}

type TestInsertTagParams

type TestInsertTagParams struct {
	ID     int32  `json:"id"`
	ShopID int32  `json:"shop_id"`
	Name   string `json:"name"`
}

type TestInsertUserParams

type TestInsertUserParams struct {
	ID         int32           `json:"id" param:"id"`
	Username   string          `json:"username"`
	Password   string          `json:"password"`
	Name       string          `form:"name" json:"name"`
	Email      string          `form:"email" json:"email"`
	Address    string          `form:"address" json:"address"`
	ImageID    string          `json:"image_id" swaggertype:"string"`
	Role       RoleType        `json:"role"`
	CreditCard json.RawMessage `json:"credit_card"`
	Enabled    bool            `json:"enabled"`
}

type TestInsertUserRow

type TestInsertUserRow struct {
	ID         int32           `json:"id" param:"id"`
	Username   string          `json:"username"`
	Password   string          `json:"password"`
	Name       string          `form:"name" json:"name"`
	Email      string          `form:"email" json:"email"`
	Address    string          `form:"address" json:"address"`
	ImageID    string          `json:"image_id" swaggertype:"string"`
	Role       RoleType        `json:"role"`
	CreditCard json.RawMessage `json:"credit_card"`
	Enabled    bool            `json:"enabled"`
}

type UpdateOrderStatusParams

type UpdateOrderStatusParams struct {
	Status   NullOrderStatus `json:"status"`
	ID       pgtype.Int4     `json:"id"`
	Username string          `json:"username"`
}

type UpdateProductFromCartParams

type UpdateProductFromCartParams struct {
	CartID    int32  `json:"cart_id"`
	ProductID int32  `json:"product_id" param:"id"`
	Quantity  int32  `json:"quantity"`
	Username  string `json:"username"`
}

type User

type User struct {
	ID                     int32              `json:"id" param:"id"`
	Username               string             `json:"username"`
	Password               string             `json:"password"`
	Name                   string             `form:"name" json:"name"`
	Email                  string             `form:"email" json:"email"`
	Address                string             `form:"address" json:"address"`
	ImageID                string             `json:"image_id" swaggertype:"string"`
	Role                   RoleType           `json:"role"`
	CreditCard             json.RawMessage    `json:"credit_card"`
	RefreshToken           string             `json:"refresh_token"`
	Enabled                bool               `json:"enabled"`
	RefreshTokenExpireDate pgtype.Timestamptz `json:"refresh_token_expire_date"`
}

type UserExistsParams

type UserExistsParams struct {
	Username string `json:"username"`
	Email    string `form:"email" json:"email"`
}

type UserGetInfoRow

type UserGetInfoRow struct {
	Name     string `form:"name" json:"name"`
	Email    string `form:"email" json:"email"`
	Address  string `form:"address" json:"address"`
	ImageUrl string `json:"image_url" swaggertype:"string"`
}

type UserUpdateCreditCardParams

type UserUpdateCreditCardParams struct {
	Username   string          `json:"username"`
	CreditCard json.RawMessage `json:"credit_card"`
}

type UserUpdateInfoParams

type UserUpdateInfoParams struct {
	Username string `json:"username"`
	Name     string `form:"name" json:"name"`
	Email    string `form:"email" json:"email"`
	Address  string `form:"address" json:"address"`
	ImageID  string `json:"image_id"`
}

type UserUpdateInfoRow

type UserUpdateInfoRow struct {
	Name     string `form:"name" json:"name"`
	Email    string `form:"email" json:"email"`
	Address  string `form:"address" json:"address"`
	ImageUrl string `json:"image_url" swaggertype:"string"`
}

type UserUpdatePasswordParams

type UserUpdatePasswordParams struct {
	Username    string `json:"username"`
	NewPassword string `json:"new_password"`
}

type UserUpdatePasswordRow

type UserUpdatePasswordRow struct {
	Name     string `form:"name" json:"name"`
	Email    string `form:"email" json:"email"`
	Address  string `form:"address" json:"address"`
	ImageUrl string `json:"image_url" swaggertype:"string"`
}

type ValidatePaymentParams

type ValidatePaymentParams struct {
	Username   string          `json:"username"`
	CreditCard json.RawMessage `json:"credit_card"`
}

type ValidateProductsInCartParams

type ValidateProductsInCartParams struct {
	Username string `json:"username"`
	CartID   int32  `json:"cart_id" param:"cart_id"`
}

Jump to

Keyboard shortcuts

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