shopstore

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: AGPL-3.0 Imports: 19 Imported by: 0

README

Shop Store Open in Gitpod

Tests Status Go Report Card PkgGoDev

License

This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). You can find a copy of the license at https://www.gnu.org/licenses/agpl-3.0.en.html

For commercial use, please use my contact page to obtain a commercial license.

Installation

go get -u github.com/gouniverse/shopstore

Usage

ShopStore, err := shopstore.NewStore(shopstore.NewStoreOptions{
  DB:                     Database.DB(),
  CategoryTableName:      "shop_category",
  DiscountTableName:      "shop_discount",
  MediaTableName:         "shop_media",
  OrderTableName:         "shop_order",
  OrderLineItemTableName: "shop_order_line_item",
  ProductTableName:       "shop_product",
  AutomigrateEnabled: true,
})

if err != nil {
  panic(err)
}

if ShopStore == nil {
  panic("ShopStore is nil")
}

Documentation

Index

Constants

View Source
const CATEGORY_STATUS_ACTIVE = "active"
View Source
const CATEGORY_STATUS_DRAFT = "draft"
View Source
const CATEGORY_STATUS_INACTIVE = "inactive"
View Source
const COLUMN_AMOUNT = "amount"
View Source
const COLUMN_CODE = "code"
View Source
const COLUMN_CREATED_AT = "created_at"
View Source
const COLUMN_CUSTOMER_ID = "customer_id"
View Source
const COLUMN_DESCRIPTION = "description"
View Source
const COLUMN_ENDS_AT = "ends_at"
View Source
const COLUMN_ENTITY_ID = "entity_id"
View Source
const COLUMN_ID = "id"
View Source
const COLUMN_MEDIA_TYPE = "media_type"
View Source
const COLUMN_MEDIA_URL = "media_url"
View Source
const COLUMN_MEMO = "memo"
View Source
const COLUMN_METAS = "metas"
View Source
const COLUMN_ORDER_ID = "order_id"
View Source
const COLUMN_PARENT_ID = "parent_id"
View Source
const COLUMN_PRICE = "price"
View Source
const COLUMN_PRODUCT_ID = "product_id"
View Source
const COLUMN_QUANTITY = "quantity"
View Source
const COLUMN_SEQUENCE = "sequence"
View Source
const COLUMN_SHORT_DESCRIPTION = "short_description"
View Source
const COLUMN_SOFT_DELETED_AT = "soft_deleted_at"
View Source
const COLUMN_STARTS_AT = "starts_at"
View Source
const COLUMN_STATUS = "status"
View Source
const COLUMN_TITLE = "title"
View Source
const COLUMN_TYPE = "type"
View Source
const COLUMN_UPDATED_AT = "updated_at"
View Source
const DISCOUNT_DURATION_FOREVER = "forever"
View Source
const DISCOUNT_DURATION_MONTHS = "months"
View Source
const DISCOUNT_DURATION_ONCE = "once"
View Source
const DISCOUNT_STATUS_ACTIVE = "active"
View Source
const DISCOUNT_STATUS_DRAFT = "draft"
View Source
const DISCOUNT_STATUS_INACTIVE = "inactive"
View Source
const DISCOUNT_TYPE_AMOUNT = "amount"
View Source
const DISCOUNT_TYPE_PERCENT = "percent"
View Source
const MEDIA_STATUS_ACTIVE = "active"
View Source
const MEDIA_STATUS_DRAFT = "draft"
View Source
const MEDIA_STATUS_INACTIVE = "inactive"
View Source
const MEDIA_TYPE_IMAGE_JPG = "image/jpeg"
View Source
const MEDIA_TYPE_IMAGE_PNG = "image/png"
View Source
const MEDIA_TYPE_VIDEO_MP4 = "video/mp4"
View Source
const ORDER_STATUS_AWAITING_FULFILLMENT = "awaiting_fulfillment"

Customer has completed the checkout process and payment has been confirmed.

View Source
const ORDER_STATUS_AWAITING_PAYMENT = "awaiting_payment"

Customer has completed the checkout process, but payment has yet to be confirmed.

View Source
const ORDER_STATUS_AWAITING_PICKUP = "awaiting_pickup"

Order has been packaged and is awaiting customer pickup from a seller-specified location.

View Source
const ORDER_STATUS_AWAITING_SHIPMENT = "awaiting_shipment"

Order has been pulled and packaged and is awaiting collection from a shipping provider.

View Source
const ORDER_STATUS_CANCELLED = "cancelled"

Seller has cancelled an order, due to a stock inconsistency or other reasons. Cancelling an order will not refund the order.

View Source
const ORDER_STATUS_COMPLETED = "completed"

Order has been shipped/picked up, and receipt is confirmed; client has paid for their digital product, and their file(s) are available for download.

View Source
const ORDER_STATUS_DECLINED = "declined"

Seller has marked the order as declined.

View Source
const ORDER_STATUS_DISPUTED = "disputed"

Customer has initiated a dispute resolution process for the PayPal transaction that paid for the order or the seller has marked the order as a fraudulent order.

View Source
const ORDER_STATUS_MANUAL_VERIFICATION_REQUIRED = "manual_verification_required"

Order on hold while some aspect, such as tax-exempt documentation, is manually confirmed. Orders with this status must be updated manually.

View Source
const ORDER_STATUS_PARTIALLY_REFUNDED = "partially_refunded"

Seller has partially refunded the order.

View Source
const ORDER_STATUS_PARTIALLY_SHIPPED = "partially_shipped"

Only some items in the order have been shipped.

View Source
const ORDER_STATUS_PENDING = "pending"

Customer started the checkout process but did not complete it.

View Source
const ORDER_STATUS_REFUNDED = "refunded"

Seller has used the Refund action to refund the whole order. A listing of all orders with a "Refunded" status can be found under the More tab of the View Orders screen.

View Source
const ORDER_STATUS_SHIPPED = "shipped"

Order has been shipped, but receipt has not been confirmed; seller has used the Ship Items action. A listing of all orders with a "Shipped" status can be found under the More tab of the View Orders screen.

View Source
const PRODUCT_STATUS_ACTIVE = "active"
View Source
const PRODUCT_STATUS_DISABLED = "disabled"
View Source
const PRODUCT_STATUS_DRAFT = "draft"

Variables

This section is empty.

Functions

This section is empty.

Types

type Category added in v0.8.0

type Category struct {
	dataobject.DataObject
}

func NewCategoryFromExistingData added in v0.8.0

func NewCategoryFromExistingData(data map[string]string) *Category

func (*Category) CreatedAt added in v0.8.0

func (category *Category) CreatedAt() string

func (*Category) CreatedAtCarbon added in v0.8.0

func (category *Category) CreatedAtCarbon() *carbon.Carbon

func (*Category) CustomerID added in v0.8.0

func (category *Category) CustomerID() string

func (*Category) Description added in v0.8.0

func (category *Category) Description() string

func (*Category) ID added in v0.8.0

func (category *Category) ID() string

func (*Category) IsActive added in v0.8.0

func (category *Category) IsActive() bool

func (*Category) IsDraft added in v0.8.0

func (category *Category) IsDraft() bool

func (*Category) IsInactive added in v0.8.0

func (category *Category) IsInactive() bool

func (*Category) IsSoftDeleted added in v0.8.0

func (category *Category) IsSoftDeleted() bool

func (*Category) Memo added in v0.8.0

func (category *Category) Memo() string

func (*Category) Meta added in v0.8.0

func (category *Category) Meta(name string) string

func (*Category) Metas added in v0.8.0

func (category *Category) Metas() (map[string]string, error)

func (*Category) ParentID added in v0.8.0

func (category *Category) ParentID() string

func (*Category) SetCreatedAt added in v0.8.0

func (category *Category) SetCreatedAt(createdAt string) CategoryInterface

func (*Category) SetCustomerID added in v0.8.0

func (category *Category) SetCustomerID(id string) CategoryInterface

func (*Category) SetDescription added in v0.8.0

func (category *Category) SetDescription(description string) CategoryInterface

func (*Category) SetID added in v0.8.0

func (category *Category) SetID(id string) CategoryInterface

func (*Category) SetMemo added in v0.8.0

func (category *Category) SetMemo(memo string) CategoryInterface

func (*Category) SetMeta added in v0.8.0

func (category *Category) SetMeta(name string, value string) error

func (*Category) SetMetas added in v0.8.0

func (category *Category) SetMetas(metas map[string]string) error

SetMetas stores metas as json string Warning: it overwrites any existing metas

func (*Category) SetParentID added in v0.8.0

func (category *Category) SetParentID(parentID string) CategoryInterface

func (*Category) SetSoftDeletedAt added in v0.8.0

func (category *Category) SetSoftDeletedAt(softDeletedAt string) CategoryInterface

func (*Category) SetStatus added in v0.8.0

func (category *Category) SetStatus(status string) CategoryInterface

func (*Category) SetTitle added in v0.8.0

func (category *Category) SetTitle(title string) CategoryInterface

func (*Category) SetUpdatedAt added in v0.8.0

func (category *Category) SetUpdatedAt(updatedAt string) CategoryInterface

func (*Category) SoftDeletedAt added in v0.8.0

func (category *Category) SoftDeletedAt() string

func (*Category) SoftDeletedAtCarbon added in v0.8.0

func (category *Category) SoftDeletedAtCarbon() *carbon.Carbon

func (*Category) Status added in v0.8.0

func (category *Category) Status() string

func (*Category) Title added in v0.8.0

func (category *Category) Title() string

func (*Category) UpdatedAt added in v0.8.0

func (category *Category) UpdatedAt() string

func (*Category) UpdatedAtCarbon added in v0.8.0

func (category *Category) UpdatedAtCarbon() *carbon.Carbon

func (*Category) UpsertMetas added in v0.8.0

func (category *Category) UpsertMetas(metas map[string]string) error

type CategoryInterface added in v0.8.0

type CategoryInterface interface {
	Data() map[string]string
	DataChanged() map[string]string
	MarkAsNotDirty()

	CreatedAt() string
	CreatedAtCarbon() *carbon.Carbon
	SetCreatedAt(createdAt string) CategoryInterface

	Description() string
	SetDescription(description string) CategoryInterface

	ID() string
	SetID(id string) CategoryInterface

	Memo() string
	SetMemo(memo string) CategoryInterface

	Metas() (map[string]string, error)
	Meta(name string) string
	SetMeta(name string, value string) error
	SetMetas(metas map[string]string) error
	UpsertMetas(metas map[string]string) error

	ParentID() string
	SetParentID(parentID string) CategoryInterface

	Status() string
	SetStatus(status string) CategoryInterface

	Title() string
	SetTitle(title string) CategoryInterface

	SoftDeletedAt() string
	SoftDeletedAtCarbon() *carbon.Carbon
	SetSoftDeletedAt(deletedAt string) CategoryInterface

	UpdatedAt() string
	UpdatedAtCarbon() *carbon.Carbon
	SetUpdatedAt(updatedAt string) CategoryInterface
}

func NewCategory added in v0.8.0

func NewCategory() CategoryInterface

type CategoryQueryInterface added in v0.8.0

type CategoryQueryInterface interface {
	Validate() error

	Columns() []string
	SetColumns(columns []string) CategoryQueryInterface

	HasCountOnly() bool
	IsCountOnly() bool
	SetCountOnly(countOnly bool) CategoryQueryInterface

	HasID() bool
	ID() string
	SetID(id string) CategoryQueryInterface

	HasIDIn() bool
	IDIn() []string
	SetIDIn(idIn []string) CategoryQueryInterface

	HasLimit() bool
	Limit() int
	SetLimit(limit int) CategoryQueryInterface

	HasOffset() bool
	Offset() int
	SetOffset(offset int) CategoryQueryInterface

	HasOrderBy() bool
	OrderBy() string
	SetOrderBy(orderBy string) CategoryQueryInterface

	HasSortDirection() bool
	SortDirection() string
	SetSortDirection(sortDirection string) CategoryQueryInterface

	HasParentID() bool
	ParentID() string
	SetParentID(parentID string) CategoryQueryInterface

	HasSoftDeletedIncluded() bool
	SoftDeletedIncluded() bool
	SetSoftDeletedIncluded(softDeletedIncluded bool) CategoryQueryInterface

	HasStatus() bool
	Status() string
	SetStatus(status string) CategoryQueryInterface

	HasTitleLike() bool
	TitleLike() string
	SetTitleLike(titleLike string) CategoryQueryInterface
	// contains filtered or unexported methods
}

func NewCategoryQuery added in v0.8.0

func NewCategoryQuery() CategoryQueryInterface

type Discount

type Discount struct {
	dataobject.DataObject
}

func (*Discount) Amount

func (d *Discount) Amount() float64

func (*Discount) Code

func (d *Discount) Code() string

func (*Discount) CreatedAt

func (d *Discount) CreatedAt() string

func (*Discount) CreatedAtCarbon

func (d *Discount) CreatedAtCarbon() *carbon.Carbon

func (*Discount) Description

func (d *Discount) Description() string

func (*Discount) EndsAt

func (d *Discount) EndsAt() string

func (*Discount) EndsAtCarbon

func (d *Discount) EndsAtCarbon() *carbon.Carbon

func (*Discount) ID

func (o *Discount) ID() string

ID returns the ID of the exam

func (*Discount) Memo added in v0.14.0

func (d *Discount) Memo() string

func (*Discount) Meta added in v0.14.0

func (d *Discount) Meta(name string) string

func (*Discount) MetaRemove added in v0.14.0

func (d *Discount) MetaRemove(name string) error

func (*Discount) Metas added in v0.14.0

func (d *Discount) Metas() (map[string]string, error)

func (*Discount) MetasRemove added in v0.14.0

func (d *Discount) MetasRemove(names []string) error

func (*Discount) MetasUpsert added in v0.14.0

func (d *Discount) MetasUpsert(metas map[string]string) error

func (*Discount) SetAmount

func (d *Discount) SetAmount(amount float64) DiscountInterface

func (*Discount) SetCode

func (d *Discount) SetCode(code string) DiscountInterface

func (*Discount) SetCreatedAt

func (d *Discount) SetCreatedAt(createdAt string) DiscountInterface

func (*Discount) SetDescription

func (d *Discount) SetDescription(description string) DiscountInterface

func (*Discount) SetEndsAt

func (d *Discount) SetEndsAt(endsAt string) DiscountInterface

func (*Discount) SetID

func (o *Discount) SetID(id string) DiscountInterface

SetID sets the ID of the exam

func (*Discount) SetMemo added in v0.14.0

func (d *Discount) SetMemo(memo string) DiscountInterface

func (*Discount) SetMeta added in v0.14.0

func (d *Discount) SetMeta(name string, value string) error

func (*Discount) SetMetas added in v0.14.0

func (d *Discount) SetMetas(metas map[string]string) error

SetMetas stores metas as json string Warning: it overwrites any existing metas

func (*Discount) SetSoftDeletedAt added in v0.13.0

func (d *Discount) SetSoftDeletedAt(deletedAt string) DiscountInterface

func (*Discount) SetStartsAt

func (d *Discount) SetStartsAt(startsAt string) DiscountInterface

func (*Discount) SetStatus

func (d *Discount) SetStatus(status string) DiscountInterface

func (*Discount) SetTitle

func (d *Discount) SetTitle(title string) DiscountInterface

func (*Discount) SetType

func (d *Discount) SetType(type_ string) DiscountInterface

func (*Discount) SetUpdatedAt

func (d *Discount) SetUpdatedAt(updatedAt string) DiscountInterface

func (*Discount) SoftDeletedAt added in v0.13.0

func (d *Discount) SoftDeletedAt() string

func (*Discount) SoftDeletedAtCarbon added in v0.13.0

func (d *Discount) SoftDeletedAtCarbon() *carbon.Carbon

func (*Discount) StartsAt

func (d *Discount) StartsAt() string

func (*Discount) StartsAtCarbon

func (d *Discount) StartsAtCarbon() *carbon.Carbon

func (*Discount) Status

func (d *Discount) Status() string

func (*Discount) Title

func (d *Discount) Title() string

func (*Discount) Type

func (d *Discount) Type() string

func (*Discount) UpdatedAt

func (d *Discount) UpdatedAt() string

func (*Discount) UpdatedAtCarbon

func (d *Discount) UpdatedAtCarbon() *carbon.Carbon

type DiscountInterface added in v0.3.0

type DiscountInterface interface {
	Data() map[string]string
	DataChanged() map[string]string
	MarkAsNotDirty()

	Amount() float64
	SetAmount(amount float64) DiscountInterface

	Code() string
	SetCode(code string) DiscountInterface

	CreatedAt() string
	CreatedAtCarbon() *carbon.Carbon
	SetCreatedAt(createdAt string) DiscountInterface

	Description() string
	SetDescription(description string) DiscountInterface

	EndsAt() string
	EndsAtCarbon() *carbon.Carbon
	SetEndsAt(endsAt string) DiscountInterface

	ID() string
	SetID(id string) DiscountInterface

	Memo() string
	SetMemo(memo string) DiscountInterface

	Meta(name string) string
	MetaRemove(name string) error
	SetMeta(name string, value string) error

	Metas() (map[string]string, error)
	MetasRemove(names []string) error
	MetasUpsert(metas map[string]string) error
	SetMetas(metas map[string]string) error

	SoftDeletedAt() string
	SoftDeletedAtCarbon() *carbon.Carbon
	SetSoftDeletedAt(deletedAt string) DiscountInterface

	StartsAt() string
	StartsAtCarbon() *carbon.Carbon
	SetStartsAt(startsAt string) DiscountInterface

	Status() string
	SetStatus(status string) DiscountInterface

	Title() string
	SetTitle(title string) DiscountInterface

	Type() string
	SetType(type_ string) DiscountInterface

	UpdatedAt() string
	UpdatedAtCarbon() *carbon.Carbon
	SetUpdatedAt(updatedAt string) DiscountInterface
}

func NewDiscount

func NewDiscount() DiscountInterface

func NewDiscountFromExistingData

func NewDiscountFromExistingData(data map[string]string) DiscountInterface

type DiscountQueryInterface added in v0.11.0

type DiscountQueryInterface interface {
	Validate() error

	Columns() []string
	SetColumns(columns []string) DiscountQueryInterface

	HasCountOnly() bool
	IsCountOnly() bool
	SetCountOnly(countOnly bool) DiscountQueryInterface

	HasCreatedAtGte() bool
	CreatedAtGte() string
	SetCreatedAtGte(createdAtGte string) DiscountQueryInterface

	HasCreatedAtLte() bool
	CreatedAtLte() string
	SetCreatedAtLte(createdAtLte string) DiscountQueryInterface

	HasCode() bool
	Code() string
	SetCode(code string) DiscountQueryInterface

	HasID() bool
	ID() string
	SetID(id string) DiscountQueryInterface

	HasIDIn() bool
	IDIn() []string
	SetIDIn(idIn []string) DiscountQueryInterface

	HasLimit() bool
	Limit() int
	SetLimit(limit int) DiscountQueryInterface

	HasOffset() bool
	Offset() int
	SetOffset(offset int) DiscountQueryInterface

	HasOrderBy() bool
	OrderBy() string
	SetOrderBy(discountBy string) DiscountQueryInterface

	HasSortDirection() bool
	SortDirection() string
	SetSortDirection(sortDirection string) DiscountQueryInterface

	HasSoftDeletedIncluded() bool
	SoftDeletedIncluded() bool
	SetSoftDeletedIncluded(softDeletedIncluded bool) DiscountQueryInterface

	HasStatus() bool
	Status() string
	SetStatus(status string) DiscountQueryInterface

	HasStatusIn() bool
	StatusIn() []string
	SetStatusIn(statusIn []string) DiscountQueryInterface
	// contains filtered or unexported methods
}

func NewDiscountQuery added in v0.11.0

func NewDiscountQuery() DiscountQueryInterface

type Media added in v0.10.0

type Media struct {
	dataobject.DataObject
}

func NewMediaFromExistingData added in v0.10.0

func NewMediaFromExistingData(data map[string]string) *Media

func (*Media) CreatedAt added in v0.10.0

func (o *Media) CreatedAt() string

func (*Media) CreatedAtCarbon added in v0.10.0

func (o *Media) CreatedAtCarbon() *carbon.Carbon

func (*Media) Description added in v0.10.0

func (o *Media) Description() string

func (*Media) EntityID added in v0.10.0

func (o *Media) EntityID() string

func (*Media) ID added in v0.10.0

func (o *Media) ID() string

func (*Media) Memo added in v0.10.0

func (o *Media) Memo() string

func (*Media) Meta added in v0.10.0

func (order *Media) Meta(name string) string

func (*Media) Metas added in v0.10.0

func (order *Media) Metas() (map[string]string, error)

func (*Media) Sequence added in v0.10.0

func (o *Media) Sequence() int

func (*Media) SetCreatedAt added in v0.10.0

func (o *Media) SetCreatedAt(createdAt string) MediaInterface

func (*Media) SetDescription added in v0.10.0

func (o *Media) SetDescription(description string) MediaInterface

func (*Media) SetEntityID added in v0.10.0

func (o *Media) SetEntityID(entityID string) MediaInterface

func (*Media) SetID added in v0.10.0

func (o *Media) SetID(id string) MediaInterface

func (*Media) SetMemo added in v0.10.0

func (o *Media) SetMemo(memo string) MediaInterface

func (*Media) SetMeta added in v0.10.0

func (order *Media) SetMeta(name string, value string) error

func (*Media) SetMetas added in v0.10.0

func (order *Media) SetMetas(metas map[string]string) error

SetMetas stores metas as json string Warning: it overwrites any existing metas

func (*Media) SetSequence added in v0.10.0

func (o *Media) SetSequence(sequence int) MediaInterface

func (*Media) SetSoftDeletedAt added in v0.10.0

func (o *Media) SetSoftDeletedAt(softDeletedAt string) MediaInterface

func (*Media) SetStatus added in v0.10.0

func (o *Media) SetStatus(status string) MediaInterface

func (*Media) SetTitle added in v0.10.0

func (o *Media) SetTitle(title string) MediaInterface

func (*Media) SetType added in v0.10.0

func (o *Media) SetType(type_ string) MediaInterface

func (*Media) SetURL added in v0.10.0

func (o *Media) SetURL(url string) MediaInterface

func (*Media) SetUpdatedAt added in v0.10.0

func (o *Media) SetUpdatedAt(updatedAt string) MediaInterface

func (*Media) SoftDeletedAt added in v0.10.0

func (o *Media) SoftDeletedAt() string

func (*Media) SoftDeletedAtCarbon added in v0.10.0

func (o *Media) SoftDeletedAtCarbon() *carbon.Carbon

func (*Media) Status added in v0.10.0

func (o *Media) Status() string

func (*Media) Title added in v0.10.0

func (o *Media) Title() string

func (*Media) Type added in v0.10.0

func (o *Media) Type() string

func (*Media) URL added in v0.10.0

func (o *Media) URL() string

func (*Media) UpdatedAt added in v0.10.0

func (o *Media) UpdatedAt() string

func (*Media) UpdatedAtCarbon added in v0.10.0

func (o *Media) UpdatedAtCarbon() *carbon.Carbon

func (*Media) UpsertMetas added in v0.10.0

func (order *Media) UpsertMetas(metas map[string]string) error

type MediaInterface added in v0.10.0

type MediaInterface interface {
	Data() map[string]string
	DataChanged() map[string]string
	MarkAsNotDirty()

	CreatedAt() string
	CreatedAtCarbon() *carbon.Carbon
	SetCreatedAt(createdAt string) MediaInterface

	Description() string
	SetDescription(description string) MediaInterface

	EntityID() string
	SetEntityID(entityID string) MediaInterface

	ID() string
	SetID(id string) MediaInterface

	Memo() string
	SetMemo(memo string) MediaInterface

	Metas() (map[string]string, error)
	Meta(name string) string
	SetMeta(name string, value string) error
	SetMetas(metas map[string]string) error
	UpsertMetas(metas map[string]string) error

	Sequence() int
	SetSequence(sequence int) MediaInterface

	SoftDeletedAt() string
	SoftDeletedAtCarbon() *carbon.Carbon
	SetSoftDeletedAt(softDeletedAt string) MediaInterface

	Status() string
	SetStatus(status string) MediaInterface

	Title() string
	SetTitle(title string) MediaInterface

	Type() string
	SetType(type_ string) MediaInterface

	URL() string
	SetURL(url string) MediaInterface

	UpdatedAt() string
	UpdatedAtCarbon() *carbon.Carbon
	SetUpdatedAt(updatedAt string) MediaInterface
}

func NewMedia added in v0.10.0

func NewMedia() MediaInterface

type MediaQueryInterface added in v0.10.0

type MediaQueryInterface interface {
	Validate() error

	Columns() []string
	SetColumns(columns []string) MediaQueryInterface

	HasCountOnly() bool
	IsCountOnly() bool
	SetCountOnly(countOnly bool) MediaQueryInterface

	HasEntityID() bool
	EntityID() string
	SetEntityID(entityID string) MediaQueryInterface

	HasID() bool
	ID() string
	SetID(id string) MediaQueryInterface

	HasIDIn() bool
	IDIn() []string
	SetIDIn(idIn []string) MediaQueryInterface

	HasLimit() bool
	Limit() int
	SetLimit(limit int) MediaQueryInterface

	HasOffset() bool
	Offset() int
	SetOffset(offset int) MediaQueryInterface

	HasOrderBy() bool
	OrderBy() string
	SetOrderBy(orderBy string) MediaQueryInterface

	HasSortDirection() bool
	SortDirection() string
	SetSortDirection(sortDirection string) MediaQueryInterface

	HasSoftDeletedIncluded() bool
	SoftDeletedIncluded() bool
	SetSoftDeletedIncluded(softDeletedIncluded bool) MediaQueryInterface

	HasStatus() bool
	Status() string
	SetStatus(status string) MediaQueryInterface

	HasTitleLike() bool
	TitleLike() string
	SetTitleLike(titleLike string) MediaQueryInterface

	HasType() bool
	Type() string
	SetType(mediaType string) MediaQueryInterface
	// contains filtered or unexported methods
}

func NewMediaQuery added in v0.10.0

func NewMediaQuery() MediaQueryInterface

type NewStoreOptions

type NewStoreOptions struct {
	CategoryTableName      string
	DiscountTableName      string
	MediaTableName         string
	OrderTableName         string
	OrderLineItemTableName string
	ProductTableName       string
	DB                     *sql.DB
	DbDriverName           string
	AutomigrateEnabled     bool
	DebugEnabled           bool
}

NewStoreOptions define the options for creating a new block store

type Order

type Order struct {
	dataobject.DataObject
}

func NewOrderFromExistingData

func NewOrderFromExistingData(data map[string]string) *Order

func (*Order) CreatedAt

func (order *Order) CreatedAt() string

func (*Order) CreatedAtCarbon added in v0.0.3

func (order *Order) CreatedAtCarbon() *carbon.Carbon

func (*Order) CustomerID added in v0.5.0

func (order *Order) CustomerID() string

func (*Order) ID

func (order *Order) ID() string

func (*Order) IsAwaitingFulfillment added in v0.0.2

func (order *Order) IsAwaitingFulfillment() bool

func (*Order) IsAwaitingPayment added in v0.0.2

func (order *Order) IsAwaitingPayment() bool

func (*Order) IsAwaitingPickup added in v0.0.2

func (order *Order) IsAwaitingPickup() bool

func (*Order) IsAwaitingShipment added in v0.0.2

func (order *Order) IsAwaitingShipment() bool

func (*Order) IsCancelled

func (order *Order) IsCancelled() bool

func (*Order) IsCompleted added in v0.0.2

func (order *Order) IsCompleted() bool

func (*Order) IsDeclined added in v0.0.2

func (order *Order) IsDeclined() bool

func (*Order) IsDisputed added in v0.0.2

func (order *Order) IsDisputed() bool

func (*Order) IsManualVerificationRequired added in v0.0.2

func (order *Order) IsManualVerificationRequired() bool

func (*Order) IsPending

func (order *Order) IsPending() bool

func (*Order) IsRefunded added in v0.0.2

func (order *Order) IsRefunded() bool

func (*Order) IsShipped added in v0.0.2

func (order *Order) IsShipped() bool

func (*Order) Memo

func (order *Order) Memo() string

func (*Order) Meta added in v0.0.2

func (order *Order) Meta(name string) string

func (*Order) Metas added in v0.0.2

func (order *Order) Metas() (map[string]string, error)

func (*Order) Price

func (order *Order) Price() string

func (*Order) PriceFloat

func (order *Order) PriceFloat() float64

func (*Order) Quantity

func (order *Order) Quantity() string

func (*Order) QuantityInt

func (order *Order) QuantityInt() int64

func (*Order) SetCreatedAt

func (order *Order) SetCreatedAt(createdAt string) OrderInterface

func (*Order) SetCustomerID added in v0.5.0

func (order *Order) SetCustomerID(id string) OrderInterface

func (*Order) SetID

func (order *Order) SetID(id string) OrderInterface

func (*Order) SetMemo

func (order *Order) SetMemo(memo string) OrderInterface

func (*Order) SetMeta added in v0.0.2

func (order *Order) SetMeta(name string, value string) error

func (*Order) SetMetas added in v0.0.2

func (order *Order) SetMetas(metas map[string]string) error

SetMetas stores metas as json string Warning: it overwrites any existing metas

func (*Order) SetPrice

func (order *Order) SetPrice(price string) OrderInterface

func (*Order) SetPriceFloat added in v0.3.0

func (order *Order) SetPriceFloat(price float64) OrderInterface

func (*Order) SetQuantity

func (order *Order) SetQuantity(quantity string) OrderInterface

func (*Order) SetQuantityInt added in v0.3.0

func (order *Order) SetQuantityInt(quantity int64) OrderInterface

func (*Order) SetSoftDeletedAt added in v0.13.0

func (order *Order) SetSoftDeletedAt(deletedAt string) OrderInterface

func (*Order) SetStatus

func (order *Order) SetStatus(status string) OrderInterface

func (*Order) SetUpdatedAt

func (order *Order) SetUpdatedAt(updatedAt string) OrderInterface

func (*Order) SoftDeletedAt added in v0.13.0

func (order *Order) SoftDeletedAt() string

func (*Order) SoftDeletedAtCarbon added in v0.13.0

func (order *Order) SoftDeletedAtCarbon() *carbon.Carbon

func (*Order) Status

func (order *Order) Status() string

func (*Order) UpdatedAt

func (order *Order) UpdatedAt() string

func (*Order) UpdatedAtCarbon added in v0.0.3

func (order *Order) UpdatedAtCarbon() *carbon.Carbon

func (*Order) UpsertMetas added in v0.0.2

func (order *Order) UpsertMetas(metas map[string]string) error

type OrderInterface added in v0.1.0

type OrderInterface interface {
	// Inherited from DataObject
	Data() map[string]string
	DataChanged() map[string]string
	MarkAsNotDirty()

	// Methods
	IsAwaitingFulfillment() bool
	IsAwaitingPayment() bool
	IsAwaitingPickup() bool
	IsAwaitingShipment() bool
	IsCancelled() bool
	IsCompleted() bool
	IsDeclined() bool
	IsDisputed() bool
	IsManualVerificationRequired() bool
	IsPending() bool
	IsRefunded() bool
	IsShipped() bool

	// Setters and Getters
	CreatedAt() string
	CreatedAtCarbon() *carbon.Carbon
	SetCreatedAt(createdAt string) OrderInterface

	CustomerID() string
	SetCustomerID(customerID string) OrderInterface

	ID() string
	SetID(id string) OrderInterface

	Memo() string
	SetMemo(memo string) OrderInterface

	Meta(name string) string
	SetMeta(name string, value string) error
	Metas() (map[string]string, error)
	SetMetas(metas map[string]string) error
	UpsertMetas(metas map[string]string) error

	Price() string
	SetPrice(price string) OrderInterface
	PriceFloat() float64
	SetPriceFloat(price float64) OrderInterface

	Quantity() string
	SetQuantity(quantity string) OrderInterface
	QuantityInt() int64
	SetQuantityInt(quantity int64) OrderInterface

	SoftDeletedAt() string
	SoftDeletedAtCarbon() *carbon.Carbon
	SetSoftDeletedAt(deletedAt string) OrderInterface

	Status() string
	SetStatus(status string) OrderInterface

	UpdatedAt() string
	UpdatedAtCarbon() *carbon.Carbon
	SetUpdatedAt(updatedAt string) OrderInterface
}

func NewOrder

func NewOrder() OrderInterface

type OrderLineItem added in v0.3.0

type OrderLineItem struct {
	dataobject.DataObject
}

func (*OrderLineItem) CreatedAt added in v0.3.0

func (o *OrderLineItem) CreatedAt() string

func (*OrderLineItem) CreatedAtCarbon added in v0.3.0

func (o *OrderLineItem) CreatedAtCarbon() *carbon.Carbon

func (*OrderLineItem) ID added in v0.3.0

func (o *OrderLineItem) ID() string

func (*OrderLineItem) Memo added in v0.3.0

func (o *OrderLineItem) Memo() string

func (*OrderLineItem) Meta added in v0.3.0

func (o *OrderLineItem) Meta(name string) string

func (*OrderLineItem) Metas added in v0.3.0

func (o *OrderLineItem) Metas() (map[string]string, error)

func (*OrderLineItem) OrderID added in v0.3.0

func (o *OrderLineItem) OrderID() string

func (*OrderLineItem) Price added in v0.3.0

func (o *OrderLineItem) Price() string

func (*OrderLineItem) PriceFloat added in v0.3.0

func (o *OrderLineItem) PriceFloat() float64

func (*OrderLineItem) ProductID added in v0.3.0

func (o *OrderLineItem) ProductID() string

func (*OrderLineItem) Quantity added in v0.3.0

func (o *OrderLineItem) Quantity() string

func (*OrderLineItem) QuantityInt added in v0.3.0

func (o *OrderLineItem) QuantityInt() int64

func (*OrderLineItem) SetCreatedAt added in v0.3.0

func (o *OrderLineItem) SetCreatedAt(createdAt string) OrderLineItemInterface

func (*OrderLineItem) SetID added in v0.3.0

func (*OrderLineItem) SetMemo added in v0.3.0

func (o *OrderLineItem) SetMemo(memo string) OrderLineItemInterface

func (*OrderLineItem) SetMeta added in v0.3.0

func (o *OrderLineItem) SetMeta(name string, value string) error

func (*OrderLineItem) SetMetas added in v0.3.0

func (o *OrderLineItem) SetMetas(metas map[string]string) error

SetMetas stores metas as json string Warning: it overwrites any existing metas

func (*OrderLineItem) SetOrderID added in v0.3.0

func (o *OrderLineItem) SetOrderID(orderID string) OrderLineItemInterface

func (*OrderLineItem) SetPrice added in v0.3.0

func (o *OrderLineItem) SetPrice(price string) OrderLineItemInterface

func (*OrderLineItem) SetPriceFloat added in v0.3.0

func (o *OrderLineItem) SetPriceFloat(price float64) OrderLineItemInterface

func (*OrderLineItem) SetProductID added in v0.3.0

func (o *OrderLineItem) SetProductID(productID string) OrderLineItemInterface

func (*OrderLineItem) SetQuantity added in v0.3.0

func (o *OrderLineItem) SetQuantity(quantity string) OrderLineItemInterface

func (*OrderLineItem) SetQuantityInt added in v0.3.0

func (o *OrderLineItem) SetQuantityInt(quantity int64) OrderLineItemInterface

func (*OrderLineItem) SetSoftDeletedAt added in v0.13.0

func (o *OrderLineItem) SetSoftDeletedAt(deletedAt string) OrderLineItemInterface

func (*OrderLineItem) SetStatus added in v0.3.0

func (o *OrderLineItem) SetStatus(status string) OrderLineItemInterface

func (*OrderLineItem) SetTitle added in v0.3.0

func (o *OrderLineItem) SetTitle(title string) OrderLineItemInterface

func (*OrderLineItem) SetUpdatedAt added in v0.3.0

func (o *OrderLineItem) SetUpdatedAt(updatedAt string) OrderLineItemInterface

func (*OrderLineItem) SoftDeletedAt added in v0.13.0

func (o *OrderLineItem) SoftDeletedAt() string

func (*OrderLineItem) SoftDeletedAtCarbon added in v0.13.0

func (o *OrderLineItem) SoftDeletedAtCarbon() *carbon.Carbon

func (*OrderLineItem) Status added in v0.3.0

func (o *OrderLineItem) Status() string

func (*OrderLineItem) Title added in v0.3.0

func (o *OrderLineItem) Title() string

func (*OrderLineItem) UpdatedAt added in v0.3.0

func (o *OrderLineItem) UpdatedAt() string

func (*OrderLineItem) UpdatedAtCarbon added in v0.3.0

func (o *OrderLineItem) UpdatedAtCarbon() *carbon.Carbon

func (*OrderLineItem) UpsertMetas added in v0.3.0

func (o *OrderLineItem) UpsertMetas(metas map[string]string) error

type OrderLineItemInterface added in v0.3.0

type OrderLineItemInterface interface {
	Data() map[string]string
	DataChanged() map[string]string
	MarkAsNotDirty()

	CreatedAt() string
	CreatedAtCarbon() *carbon.Carbon
	SetCreatedAt(createdAt string) OrderLineItemInterface

	ID() string
	SetID(id string) OrderLineItemInterface

	Memo() string
	SetMemo(memo string) OrderLineItemInterface

	Metas() (map[string]string, error)
	SetMetas(metas map[string]string) error
	Meta(name string) string
	SetMeta(name string, value string) error
	UpsertMetas(metas map[string]string) error

	OrderID() string
	SetOrderID(orderID string) OrderLineItemInterface

	Price() string
	SetPrice(price string) OrderLineItemInterface

	PriceFloat() float64
	SetPriceFloat(price float64) OrderLineItemInterface

	ProductID() string
	SetProductID(productID string) OrderLineItemInterface

	Quantity() string
	SetQuantity(quantity string) OrderLineItemInterface

	QuantityInt() int64
	SetQuantityInt(quantity int64) OrderLineItemInterface

	SoftDeletedAt() string
	SoftDeletedAtCarbon() *carbon.Carbon
	SetSoftDeletedAt(deletedAt string) OrderLineItemInterface

	Status() string
	SetStatus(status string) OrderLineItemInterface

	Title() string
	SetTitle(title string) OrderLineItemInterface

	UpdatedAt() string
	UpdatedAtCarbon() *carbon.Carbon
	SetUpdatedAt(updatedAt string) OrderLineItemInterface
}

func NewOrderLineItem added in v0.3.0

func NewOrderLineItem() OrderLineItemInterface

func NewOrderLineItemFromExistingData added in v0.3.0

func NewOrderLineItemFromExistingData(data map[string]string) OrderLineItemInterface

type OrderLineItemQueryInterface added in v0.11.0

type OrderLineItemQueryInterface interface {
	Validate() error

	Columns() []string
	SetColumns(columns []string) OrderLineItemQueryInterface

	HasCountOnly() bool
	IsCountOnly() bool
	SetCountOnly(countOnly bool) OrderLineItemQueryInterface

	HasCreatedAtGte() bool
	CreatedAtGte() string
	SetCreatedAtGte(createdAtGte string) OrderLineItemQueryInterface

	HasCreatedAtLte() bool
	CreatedAtLte() string
	SetCreatedAtLte(createdAtLte string) OrderLineItemQueryInterface

	HasID() bool
	ID() string
	SetID(id string) OrderLineItemQueryInterface

	HasIDIn() bool
	IDIn() []string
	SetIDIn(idIn []string) OrderLineItemQueryInterface

	HasLimit() bool
	Limit() int
	SetLimit(limit int) OrderLineItemQueryInterface

	HasOffset() bool
	Offset() int
	SetOffset(offset int) OrderLineItemQueryInterface

	HasOrderBy() bool
	OrderBy() string
	SetOrderBy(orderBy string) OrderLineItemQueryInterface

	HasOrderID() bool
	OrderID() string
	SetOrderID(orderID string) OrderLineItemQueryInterface

	HasOrderIDIn() bool
	OrderIDIn() []string
	SetOrderIDIn(orderIDIn []string) OrderLineItemQueryInterface

	HasProductID() bool
	ProductID() string
	SetProductID(productID string) OrderLineItemQueryInterface

	HasSortDirection() bool
	SortDirection() string
	SetSortDirection(sortDirection string) OrderLineItemQueryInterface

	HasSoftDeletedIncluded() bool
	SoftDeletedIncluded() bool
	SetSoftDeletedIncluded(softDeletedIncluded bool) OrderLineItemQueryInterface

	HasStatus() bool
	Status() string
	SetStatus(status string) OrderLineItemQueryInterface

	HasStatusIn() bool
	StatusIn() []string
	SetStatusIn(statusIn []string) OrderLineItemQueryInterface
	// contains filtered or unexported methods
}

func NewOrderLineItemQuery added in v0.11.0

func NewOrderLineItemQuery() OrderLineItemQueryInterface

type OrderQueryInterface added in v0.11.0

type OrderQueryInterface interface {
	Validate() error

	Columns() []string
	SetColumns(columns []string) OrderQueryInterface

	HasCountOnly() bool
	IsCountOnly() bool
	SetCountOnly(countOnly bool) OrderQueryInterface

	HasCreatedAtGte() bool
	CreatedAtGte() string
	SetCreatedAtGte(createdAtGte string) OrderQueryInterface

	HasCreatedAtLte() bool
	CreatedAtLte() string
	SetCreatedAtLte(createdAtLte string) OrderQueryInterface

	HasCustomerID() bool
	CustomerID() string
	SetCustomerID(customerID string) OrderQueryInterface

	HasID() bool
	ID() string
	SetID(id string) OrderQueryInterface

	HasIDIn() bool
	IDIn() []string
	SetIDIn(idIn []string) OrderQueryInterface

	HasLimit() bool
	Limit() int
	SetLimit(limit int) OrderQueryInterface

	HasOffset() bool
	Offset() int
	SetOffset(offset int) OrderQueryInterface

	HasOrderBy() bool
	OrderBy() string
	SetOrderBy(orderBy string) OrderQueryInterface

	HasSortDirection() bool
	SortDirection() string
	SetSortDirection(sortDirection string) OrderQueryInterface

	HasSoftDeletedIncluded() bool
	SoftDeletedIncluded() bool
	SetSoftDeletedIncluded(softDeletedIncluded bool) OrderQueryInterface

	HasStatus() bool
	Status() string
	SetStatus(status string) OrderQueryInterface

	HasStatusIn() bool
	StatusIn() []string
	SetStatusIn(statusIn []string) OrderQueryInterface
	// contains filtered or unexported methods
}

func NewOrderQuery added in v0.11.0

func NewOrderQuery() OrderQueryInterface

type Product added in v0.0.4

type Product struct {
	dataobject.DataObject
}

func (*Product) CreatedAt added in v0.0.4

func (product *Product) CreatedAt() string

func (*Product) CreatedAtCarbon added in v0.0.4

func (product *Product) CreatedAtCarbon() *carbon.Carbon

func (*Product) Description added in v0.0.4

func (product *Product) Description() string

func (*Product) ID added in v0.0.4

func (product *Product) ID() string

func (*Product) IsActive added in v0.0.4

func (product *Product) IsActive() bool

func (*Product) IsDisabled added in v0.0.4

func (product *Product) IsDisabled() bool

func (*Product) IsDraft added in v0.0.4

func (product *Product) IsDraft() bool

func (*Product) IsFree added in v0.8.1

func (product *Product) IsFree() bool

func (*Product) IsSoftDeleted added in v0.8.1

func (product *Product) IsSoftDeleted() bool

func (*Product) Memo added in v0.0.4

func (product *Product) Memo() string

func (*Product) Meta added in v0.0.4

func (product *Product) Meta(name string) string

func (*Product) Metas added in v0.0.4

func (product *Product) Metas() (map[string]string, error)

func (*Product) Price added in v0.0.4

func (product *Product) Price() string

func (*Product) PriceFloat added in v0.0.4

func (product *Product) PriceFloat() float64

func (*Product) Quantity added in v0.0.4

func (product *Product) Quantity() string

func (*Product) QuantityInt added in v0.0.4

func (product *Product) QuantityInt() int64

func (*Product) SetCreatedAt added in v0.0.4

func (product *Product) SetCreatedAt(createdAt string) ProductInterface

func (*Product) SetDescription added in v0.0.4

func (product *Product) SetDescription(description string) ProductInterface

func (*Product) SetID added in v0.0.4

func (product *Product) SetID(id string) ProductInterface

func (*Product) SetMemo added in v0.0.4

func (product *Product) SetMemo(memo string) ProductInterface

func (*Product) SetMeta added in v0.0.4

func (product *Product) SetMeta(name string, value string) error

func (*Product) SetMetas added in v0.0.4

func (product *Product) SetMetas(metas map[string]string) error

SetMetas stores metas as json string Warning: it overwrites any existing metas

func (*Product) SetPrice added in v0.0.4

func (product *Product) SetPrice(price string) ProductInterface

func (*Product) SetPriceFloat added in v0.3.0

func (product *Product) SetPriceFloat(price float64) ProductInterface

func (*Product) SetQuantity added in v0.0.4

func (product *Product) SetQuantity(quantity string) ProductInterface

func (*Product) SetQuantityInt added in v0.3.0

func (product *Product) SetQuantityInt(quantity int64) ProductInterface

func (*Product) SetShortDescription added in v0.13.0

func (product *Product) SetShortDescription(shortDescription string) ProductInterface

func (*Product) SetSoftDeletedAt added in v0.13.0

func (product *Product) SetSoftDeletedAt(deletedAt string) ProductInterface

func (*Product) SetStatus added in v0.0.4

func (product *Product) SetStatus(status string) ProductInterface

func (*Product) SetTitle added in v0.0.4

func (product *Product) SetTitle(title string) ProductInterface

func (*Product) SetUpdatedAt added in v0.0.4

func (product *Product) SetUpdatedAt(updatedAt string) ProductInterface

func (*Product) ShortDescription added in v0.13.0

func (product *Product) ShortDescription() string

func (*Product) Slug added in v0.12.0

func (product *Product) Slug() string

func (*Product) SoftDeletedAt added in v0.13.0

func (product *Product) SoftDeletedAt() string

func (*Product) SoftDeletedAtCarbon added in v0.13.0

func (product *Product) SoftDeletedAtCarbon() *carbon.Carbon

func (*Product) Status added in v0.0.4

func (product *Product) Status() string

func (*Product) Title added in v0.0.4

func (product *Product) Title() string

func (*Product) UpdatedAt added in v0.0.4

func (product *Product) UpdatedAt() string

func (*Product) UpdatedAtCarbon added in v0.0.4

func (product *Product) UpdatedAtCarbon() *carbon.Carbon

func (*Product) UpsertMetas added in v0.0.4

func (product *Product) UpsertMetas(metas map[string]string) error

type ProductInterface added in v0.3.0

type ProductInterface interface {
	Data() map[string]string
	DataChanged() map[string]string
	MarkAsNotDirty()

	IsActive() bool
	IsDisabled() bool
	IsDraft() bool
	IsSoftDeleted() bool
	IsFree() bool
	Slug() string

	CreatedAt() string
	CreatedAtCarbon() *carbon.Carbon
	SetCreatedAt(createdAt string) ProductInterface

	Description() string
	SetDescription(description string) ProductInterface

	ID() string
	SetID(id string) ProductInterface

	Memo() string
	SetMemo(memo string) ProductInterface

	Meta(name string) string
	SetMeta(name string, value string) error

	Metas() (map[string]string, error)
	SetMetas(metas map[string]string) error
	UpsertMetas(metas map[string]string) error

	Price() string
	SetPrice(price string) ProductInterface
	PriceFloat() float64
	SetPriceFloat(price float64) ProductInterface

	Quantity() string
	SetQuantity(quantity string) ProductInterface
	QuantityInt() int64
	SetQuantityInt(quantity int64) ProductInterface

	SoftDeletedAt() string
	SoftDeletedAtCarbon() *carbon.Carbon
	SetSoftDeletedAt(deletedAt string) ProductInterface

	ShortDescription() string
	SetShortDescription(shortDescription string) ProductInterface

	Status() string
	SetStatus(status string) ProductInterface

	Title() string
	SetTitle(title string) ProductInterface

	UpdatedAt() string
	UpdatedAtCarbon() *carbon.Carbon
	SetUpdatedAt(updatedAt string) ProductInterface
}

func NewProduct added in v0.0.4

func NewProduct() ProductInterface

func NewProductFromExistingData added in v0.0.4

func NewProductFromExistingData(data map[string]string) ProductInterface

type ProductQueryInterface added in v0.11.0

type ProductQueryInterface interface {
	Validate() error

	Columns() []string
	SetColumns(columns []string) ProductQueryInterface

	HasCountOnly() bool
	IsCountOnly() bool
	SetCountOnly(countOnly bool) ProductQueryInterface

	HasCreatedAtGte() bool
	CreatedAtGte() string
	SetCreatedAtGte(createdAtGte string) ProductQueryInterface

	HasCreatedAtLte() bool
	CreatedAtLte() string
	SetCreatedAtLte(createdAtLte string) ProductQueryInterface

	HasID() bool
	ID() string
	SetID(id string) ProductQueryInterface

	HasIDIn() bool
	IDIn() []string
	SetIDIn(idIn []string) ProductQueryInterface

	HasLimit() bool
	Limit() int
	SetLimit(limit int) ProductQueryInterface

	HasOffset() bool
	Offset() int
	SetOffset(offset int) ProductQueryInterface

	HasOrderBy() bool
	OrderBy() string
	SetOrderBy(orderBy string) ProductQueryInterface

	HasSortDirection() bool
	SortDirection() string
	SetSortDirection(sortDirection string) ProductQueryInterface

	HasSoftDeletedIncluded() bool
	SoftDeletedIncluded() bool
	SetSoftDeletedIncluded(softDeletedIncluded bool) ProductQueryInterface

	HasStatus() bool
	Status() string
	SetStatus(status string) ProductQueryInterface

	HasStatusIn() bool
	StatusIn() []string
	SetStatusIn(statusIn []string) ProductQueryInterface

	HasTitleLike() bool
	TitleLike() string
	SetTitleLike(titleLike string) ProductQueryInterface
	// contains filtered or unexported methods
}

func NewProductQuery added in v0.11.0

func NewProductQuery() ProductQueryInterface

type Store

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

func NewStore

func NewStore(opts NewStoreOptions) (*Store, error)

NewStore creates a new block store

func (*Store) AutoMigrate

func (store *Store) AutoMigrate() error

AutoMigrate auto migrate

func (*Store) CategoryCount added in v0.8.0

func (store *Store) CategoryCount(ctx context.Context, options CategoryQueryInterface) (int64, error)

func (*Store) CategoryCreate added in v0.8.0

func (store *Store) CategoryCreate(ctx context.Context, category CategoryInterface) error

func (*Store) CategoryDelete added in v0.8.0

func (store *Store) CategoryDelete(ctx context.Context, category CategoryInterface) error

func (*Store) CategoryDeleteByID added in v0.8.0

func (store *Store) CategoryDeleteByID(ctx context.Context, id string) error

func (*Store) CategoryFindByID added in v0.8.0

func (store *Store) CategoryFindByID(ctx context.Context, id string) (CategoryInterface, error)

func (*Store) CategoryList added in v0.8.0

func (store *Store) CategoryList(ctx context.Context, options CategoryQueryInterface) ([]CategoryInterface, error)

func (*Store) CategorySoftDelete added in v0.8.0

func (store *Store) CategorySoftDelete(ctx context.Context, category CategoryInterface) error

func (*Store) CategorySoftDeleteByID added in v0.8.0

func (store *Store) CategorySoftDeleteByID(ctx context.Context, id string) error

func (*Store) CategoryTableName added in v0.11.0

func (store *Store) CategoryTableName() string

func (*Store) CategoryUpdate added in v0.8.0

func (store *Store) CategoryUpdate(ctx context.Context, category CategoryInterface) (err error)

func (*Store) DB added in v0.9.0

func (store *Store) DB() *sql.DB

func (*Store) DiscountCount added in v0.4.0

func (store *Store) DiscountCount(ctx context.Context, options DiscountQueryInterface) (int64, error)

func (*Store) DiscountCreate

func (store *Store) DiscountCreate(ctx context.Context, discount DiscountInterface) error

func (*Store) DiscountDelete

func (store *Store) DiscountDelete(ctx context.Context, discount DiscountInterface) error

func (*Store) DiscountDeleteByID

func (store *Store) DiscountDeleteByID(ctx context.Context, id string) error

func (*Store) DiscountFindByCode

func (store *Store) DiscountFindByCode(ctx context.Context, code string) (DiscountInterface, error)

func (*Store) DiscountFindByID

func (store *Store) DiscountFindByID(ctx context.Context, id string) (DiscountInterface, error)

func (*Store) DiscountList

func (store *Store) DiscountList(ctx context.Context, options DiscountQueryInterface) ([]DiscountInterface, error)

func (*Store) DiscountSoftDelete

func (store *Store) DiscountSoftDelete(ctx context.Context, discount DiscountInterface) error

func (*Store) DiscountSoftDeleteByID

func (store *Store) DiscountSoftDeleteByID(ctx context.Context, id string) error

func (*Store) DiscountTableName added in v0.11.0

func (store *Store) DiscountTableName() string

func (*Store) DiscountUpdate

func (store *Store) DiscountUpdate(ctx context.Context, discount DiscountInterface) error

func (*Store) EnableDebug

func (store *Store) EnableDebug(debug bool, sqlLogger ...*slog.Logger)

EnableDebug - enables the debug option

func (*Store) MediaCount added in v0.10.0

func (store *Store) MediaCount(ctx context.Context, options MediaQueryInterface) (int64, error)

func (*Store) MediaCreate added in v0.10.0

func (store *Store) MediaCreate(ctx context.Context, media MediaInterface) error

func (*Store) MediaDelete added in v0.10.0

func (store *Store) MediaDelete(ctx context.Context, media MediaInterface) error

func (*Store) MediaDeleteByID added in v0.10.0

func (store *Store) MediaDeleteByID(ctx context.Context, id string) error

func (*Store) MediaFindByID added in v0.10.0

func (store *Store) MediaFindByID(ctx context.Context, id string) (MediaInterface, error)

func (*Store) MediaList added in v0.10.0

func (store *Store) MediaList(ctx context.Context, options MediaQueryInterface) ([]MediaInterface, error)

func (*Store) MediaSoftDelete added in v0.10.0

func (store *Store) MediaSoftDelete(ctx context.Context, media MediaInterface) error

func (*Store) MediaSoftDeleteByID added in v0.10.0

func (store *Store) MediaSoftDeleteByID(ctx context.Context, id string) error

func (*Store) MediaTableName added in v0.11.0

func (store *Store) MediaTableName() string

func (*Store) MediaUpdate added in v0.10.0

func (store *Store) MediaUpdate(ctx context.Context, media MediaInterface) (err error)

func (*Store) OrderCount added in v0.3.0

func (store *Store) OrderCount(ctx context.Context, options OrderQueryInterface) (int64, error)

func (*Store) OrderCreate

func (store *Store) OrderCreate(ctx context.Context, order OrderInterface) error

func (*Store) OrderDelete added in v0.3.0

func (store *Store) OrderDelete(ctx context.Context, order OrderInterface) error

func (*Store) OrderDeleteByID added in v0.3.0

func (store *Store) OrderDeleteByID(ctx context.Context, id string) error

func (*Store) OrderFindByID

func (store *Store) OrderFindByID(ctx context.Context, id string) (OrderInterface, error)

func (*Store) OrderLineItemCount added in v0.4.0

func (store *Store) OrderLineItemCount(ctx context.Context, options OrderLineItemQueryInterface) (int64, error)

func (*Store) OrderLineItemCreate added in v0.3.0

func (store *Store) OrderLineItemCreate(ctx context.Context, orderLineItem OrderLineItemInterface) error

func (*Store) OrderLineItemDelete added in v0.3.0

func (store *Store) OrderLineItemDelete(ctx context.Context, orderLineItem OrderLineItemInterface) error

func (*Store) OrderLineItemDeleteByID added in v0.3.0

func (store *Store) OrderLineItemDeleteByID(ctx context.Context, id string) error

func (*Store) OrderLineItemFindByID added in v0.3.0

func (store *Store) OrderLineItemFindByID(ctx context.Context, id string) (OrderLineItemInterface, error)

func (*Store) OrderLineItemList added in v0.3.0

func (store *Store) OrderLineItemList(ctx context.Context, options OrderLineItemQueryInterface) ([]OrderLineItemInterface, error)

func (*Store) OrderLineItemSoftDelete added in v0.3.0

func (store *Store) OrderLineItemSoftDelete(ctx context.Context, orderLineItem OrderLineItemInterface) error

func (*Store) OrderLineItemSoftDeleteByID added in v0.3.0

func (store *Store) OrderLineItemSoftDeleteByID(ctx context.Context, id string) error

func (*Store) OrderLineItemTableName added in v0.11.0

func (store *Store) OrderLineItemTableName() string

func (*Store) OrderLineItemUpdate added in v0.3.0

func (store *Store) OrderLineItemUpdate(ctx context.Context, orderLineItem OrderLineItemInterface) error

func (*Store) OrderList

func (store *Store) OrderList(ctx context.Context, options OrderQueryInterface) ([]OrderInterface, error)

func (*Store) OrderSoftDelete

func (store *Store) OrderSoftDelete(ctx context.Context, order OrderInterface) error

func (*Store) OrderSoftDeleteByID

func (store *Store) OrderSoftDeleteByID(ctx context.Context, id string) error

func (*Store) OrderTableName added in v0.11.0

func (store *Store) OrderTableName() string

func (*Store) OrderUpdate

func (store *Store) OrderUpdate(ctx context.Context, order OrderInterface) error

func (*Store) ProductCount added in v0.4.0

func (store *Store) ProductCount(ctx context.Context, options ProductQueryInterface) (int64, error)

func (*Store) ProductCreate added in v0.0.4

func (store *Store) ProductCreate(ctx context.Context, product ProductInterface) error

func (*Store) ProductDelete added in v0.3.0

func (store *Store) ProductDelete(ctx context.Context, product ProductInterface) error

func (*Store) ProductDeleteByID added in v0.3.0

func (store *Store) ProductDeleteByID(ctx context.Context, id string) error

func (*Store) ProductFindByID added in v0.0.4

func (store *Store) ProductFindByID(ctx context.Context, id string) (ProductInterface, error)

func (*Store) ProductList added in v0.0.4

func (store *Store) ProductList(ctx context.Context, options ProductQueryInterface) ([]ProductInterface, error)

func (*Store) ProductSoftDelete added in v0.0.4

func (store *Store) ProductSoftDelete(ctx context.Context, product ProductInterface) error

func (*Store) ProductSoftDeleteByID added in v0.0.4

func (store *Store) ProductSoftDeleteByID(ctx context.Context, id string) error

func (*Store) ProductTableName added in v0.11.0

func (store *Store) ProductTableName() string

func (*Store) ProductUpdate added in v0.0.4

func (store *Store) ProductUpdate(ctx context.Context, product ProductInterface) error

type StoreInterface

type StoreInterface interface {
	AutoMigrate() error
	DB() *sql.DB
	EnableDebug(debug bool, sqlLogger ...*slog.Logger)

	CategoryTableName() string
	DiscountTableName() string
	MediaTableName() string
	OrderTableName() string
	OrderLineItemTableName() string
	ProductTableName() string

	CategoryCount(ctx context.Context, options CategoryQueryInterface) (int64, error)
	CategoryCreate(context context.Context, category CategoryInterface) error
	CategoryDelete(context context.Context, category CategoryInterface) error
	CategoryDeleteByID(context context.Context, categoryID string) error
	CategoryFindByID(context context.Context, categoryID string) (CategoryInterface, error)
	CategoryList(context context.Context, options CategoryQueryInterface) ([]CategoryInterface, error)
	CategorySoftDelete(context context.Context, category CategoryInterface) error
	CategorySoftDeleteByID(context context.Context, categoryID string) error
	CategoryUpdate(contxt context.Context, category CategoryInterface) error

	DiscountCount(ctx context.Context, options DiscountQueryInterface) (int64, error)
	DiscountCreate(ctx context.Context, discount DiscountInterface) error
	DiscountDelete(ctx context.Context, discount DiscountInterface) error
	DiscountDeleteByID(ctx context.Context, discountID string) error
	DiscountFindByID(ctx context.Context, discountID string) (DiscountInterface, error)
	DiscountFindByCode(ctx context.Context, code string) (DiscountInterface, error)
	DiscountList(ctx context.Context, options DiscountQueryInterface) ([]DiscountInterface, error)
	DiscountSoftDelete(ctx context.Context, discount DiscountInterface) error
	DiscountSoftDeleteByID(ctx context.Context, discountID string) error
	DiscountUpdate(ctx context.Context, discount DiscountInterface) error

	MediaCount(ctx context.Context, options MediaQueryInterface) (int64, error)
	MediaCreate(ctx context.Context, media MediaInterface) error
	MediaDelete(ctx context.Context, media MediaInterface) error
	MediaDeleteByID(ctx context.Context, mediaID string) error
	MediaFindByID(ctx context.Context, mediaID string) (MediaInterface, error)
	MediaList(ctx context.Context, options MediaQueryInterface) ([]MediaInterface, error)
	MediaSoftDelete(ctx context.Context, media MediaInterface) error
	MediaSoftDeleteByID(ctx context.Context, mediaID string) error
	MediaUpdate(ctx context.Context, media MediaInterface) error

	OrderCount(ctx context.Context, options OrderQueryInterface) (int64, error)
	OrderCreate(ctx context.Context, order OrderInterface) error
	OrderDelete(ctx context.Context, order OrderInterface) error
	OrderDeleteByID(ctx context.Context, id string) error
	OrderFindByID(ctx context.Context, id string) (OrderInterface, error)
	OrderList(ctx context.Context, options OrderQueryInterface) ([]OrderInterface, error)
	OrderSoftDelete(ctx context.Context, order OrderInterface) error
	OrderSoftDeleteByID(ctx context.Context, id string) error
	OrderUpdate(ctx context.Context, order OrderInterface) error

	OrderLineItemCount(ctx context.Context, options OrderLineItemQueryInterface) (int64, error)
	OrderLineItemCreate(ctx context.Context, orderLineItem OrderLineItemInterface) error
	OrderLineItemDelete(ctx context.Context, orderLineItem OrderLineItemInterface) error
	OrderLineItemDeleteByID(ctx context.Context, id string) error
	OrderLineItemFindByID(ctx context.Context, id string) (OrderLineItemInterface, error)
	OrderLineItemList(ctx context.Context, options OrderLineItemQueryInterface) ([]OrderLineItemInterface, error)
	OrderLineItemSoftDelete(ctx context.Context, orderLineItem OrderLineItemInterface) error
	OrderLineItemSoftDeleteByID(ctx context.Context, id string) error
	OrderLineItemUpdate(ctx context.Context, orderLineItem OrderLineItemInterface) error

	ProductCount(ctx context.Context, options ProductQueryInterface) (int64, error)
	ProductCreate(ctx context.Context, product ProductInterface) error
	ProductDelete(ctx context.Context, product ProductInterface) error
	ProductDeleteByID(ctx context.Context, productID string) error
	ProductFindByID(ctx context.Context, productID string) (ProductInterface, error)
	ProductList(ctx context.Context, options ProductQueryInterface) ([]ProductInterface, error)
	ProductSoftDelete(ctx context.Context, product ProductInterface) error
	ProductSoftDeleteByID(ctx context.Context, productID string) error
	ProductUpdate(ctx context.Context, product ProductInterface) error
}

Jump to

Keyboard shortcuts

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