// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.26.0

package product

import (
	"database/sql/driver"
	"fmt"

	"github.com/jackc/pgx/v5/pgtype"
	"github.com/shopspring/decimal"
)

type ProductStatus string

const (
	ProductStatusDraft           ProductStatus = "Draft"
	ProductStatusPendingApproval ProductStatus = "PendingApproval"
	ProductStatusPublished       ProductStatus = "Published"
)

func (e *ProductStatus) Scan(src interface{}) error {
	switch s := src.(type) {
	case []byte:
		*e = ProductStatus(s)
	case string:
		*e = ProductStatus(s)
	default:
		return fmt.Errorf("unsupported scan type for ProductStatus: %T", src)
	}
	return nil
}

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

// Scan implements the Scanner interface.
func (ns *NullProductStatus) Scan(value interface{}) error {
	if value == nil {
		ns.ProductStatus, ns.Valid = "", false
		return nil
	}
	ns.Valid = true
	return ns.ProductStatus.Scan(value)
}

// Value implements the driver Valuer interface.
func (ns NullProductStatus) Value() (driver.Value, error) {
	if !ns.Valid {
		return nil, nil
	}
	return string(ns.ProductStatus), nil
}

type Product struct {
	ID               int64
	StoreID          int32
	CategoryID       int32
	Name             string
	Brand            *string
	Handle           string
	ImageUrls        ImageUrls
	ShortInformation []string
	Specifications   Specifications
	Status           ProductStatus
	CreatedAt        pgtype.Timestamptz
	UpdatedAt        pgtype.Timestamptz
}

type ProductAttribute struct {
	ID        int64
	ProductID int64
	Attribute string
}

type ProductPricing struct {
	ProductID       int64
	BasePrice       decimal.Decimal
	CurrencyCode    string
	Discount        decimal.Decimal
	DiscountedPrice decimal.Decimal
	IsOnSale        bool
}

type ProductVariant struct {
	ID               int64
	ProductID        int64
	Sku              string
	Qty              int32
	IsCustomPriced   bool
	ImageIdentifiers []int16
	CreatedAt        pgtype.Timestamptz
	UpdatedAt        pgtype.Timestamptz
}

type ProductVariantPricing struct {
	VariantID       int64
	BasePrice       decimal.Decimal
	CurrencyCode    string
	Discount        decimal.Decimal
	DiscountedPrice decimal.Decimal
	IsOnSale        bool
}

type Store struct {
	ID          int32
	Handle      string
	UserID      int64
	Name        string
	Description string
	CreatedAt   pgtype.Timestamptz
	UpdatedAt   pgtype.Timestamptz
}
