services

package
v0.0.0-...-993f9dd Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_VALID_DURATION = time.Hour * 24 * 7

Variables

This section is empty.

Functions

This section is empty.

Types

type AllocationMapOptions

type AllocationMapOptions struct {
	ExcludeGiftCards bool
	ExcludeDiscounts bool
}

type AnalyticsConfigService

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

func NewAnalyticsConfigService

func NewAnalyticsConfigService(
	r Registry,
) *AnalyticsConfigService

func (*AnalyticsConfigService) Create

func (*AnalyticsConfigService) Delete

func (*AnalyticsConfigService) Retrive

func (*AnalyticsConfigService) SetContext

func (*AnalyticsConfigService) Update

type AuthService

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

func NewAuthService

func NewAuthService(
	r Registry,
) *AuthService

func (*AuthService) Authenticate

func (s *AuthService) Authenticate(email string, password string) types.AuthenticateResult

func (*AuthService) AuthenticateAPIToken

func (s *AuthService) AuthenticateAPIToken(token string) types.AuthenticateResult

func (*AuthService) AuthenticateCustomer

func (s *AuthService) AuthenticateCustomer(email string, password string) types.AuthenticateResult

func (*AuthService) ComparePassword

func (s *AuthService) ComparePassword(password string, hash string) bool

func (*AuthService) SetContext

func (s *AuthService) SetContext(context context.Context) *AuthService

type AvailabilityContext

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

type BatchJobService

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

func NewBatchJobService

func NewBatchJobService(container di.Container, r Registry) *BatchJobService

func (*BatchJobService) Cancel

func (s *BatchJobService) Cancel(batchJobId uuid.UUID, model *models.BatchJob) (*models.BatchJob, *utils.ApplictaionError)

func (*BatchJobService) Complete

func (s *BatchJobService) Complete(batchJobId uuid.UUID, model *models.BatchJob) (*models.BatchJob, *utils.ApplictaionError)

func (*BatchJobService) Confirm

func (s *BatchJobService) Confirm(batchJobId uuid.UUID, model *models.BatchJob) (*models.BatchJob, *utils.ApplictaionError)

func (*BatchJobService) Create

func (*BatchJobService) ListAndCount

func (s *BatchJobService) ListAndCount(selector *types.FilterableBatchJob, config *sql.Options) ([]models.BatchJob, *int64, *utils.ApplictaionError)

func (*BatchJobService) PrepareBatchJobForProcessing

func (s *BatchJobService) PrepareBatchJobForProcessing(data *types.CreateBatchJobInput) (*types.CreateBatchJobInput, *utils.ApplictaionError)

func (*BatchJobService) ResolveBatchJobByType

func (s *BatchJobService) ResolveBatchJobByType(batchtype string) interfaces.IBatchJobStrategy

func (*BatchJobService) Retrive

func (s *BatchJobService) Retrive(batchJobId uuid.UUID) (*models.BatchJob, *utils.ApplictaionError)

func (*BatchJobService) SetContext

func (s *BatchJobService) SetContext(context context.Context) *BatchJobService

func (*BatchJobService) SetFailed

func (s *BatchJobService) SetFailed(batchJobId uuid.UUID, model *models.BatchJob, errorMessage types.BatchJobResultError) (*models.BatchJob, *utils.ApplictaionError)

func (*BatchJobService) SetPreProcessingDone

func (s *BatchJobService) SetPreProcessingDone(batchJobId uuid.UUID, model *models.BatchJob) (*models.BatchJob, *utils.ApplictaionError)

func (*BatchJobService) SetProcessing

func (s *BatchJobService) SetProcessing(batchJobId uuid.UUID, model *models.BatchJob) (*models.BatchJob, *utils.ApplictaionError)

func (*BatchJobService) Update

func (*BatchJobService) UpdateStatus

func (s *BatchJobService) UpdateStatus(batchJobId uuid.UUID, model *models.BatchJob, status models.BatchJobStatus) (*models.BatchJob, *utils.ApplictaionError)

type Bus

type Bus interface {
	BusController
	BusSubscriber
	BusPublisher
}

Bus englobes global (subscribe, publish, control) bus behavior

func New

func New() Bus

New returns new EventBus with empty handlers.

type BusController

type BusController interface {
	HasCallback(topic string) bool
	WaitAsync()
}

BusController defines bus control behavior (checking handler's presence, synchronization)

type BusPublisher

type BusPublisher interface {
	Publish(topic string, args ...interface{})
}

BusPublisher defines publishing-related bus behavior

type BusSubscriber

type BusSubscriber interface {
	Subscribe(topic string, fn interface{}) error
	SubscribeAsync(topic string, fn interface{}, transactional bool) error
	SubscribeOnce(topic string, fn interface{}) error
	SubscribeOnceAsync(topic string, fn interface{}) error
	Unsubscribe(topic string, handler interface{}) error
}

BusSubscriber defines subscription-related bus behavior

type CalculationContextOptions

type CalculationContextOptions struct {
	IsReturn         bool
	ExcludeShipping  bool
	ExcludeGiftCards bool
	ExcludeDiscounts bool
}

type CartService

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

func NewCartService

func NewCartService(
	r Registry,
) *CartService

func (*CartService) AddLineItem

func (s *CartService) AddLineItem(
	cartId uuid.UUID,
	lineItem models.LineItem,
	validateSalesChannels bool,
) *utils.ApplictaionError

func (*CartService) AddOrUpdateLineItems

func (s *CartService) AddOrUpdateLineItems(
	cartId uuid.UUID,
	lineItems []models.LineItem,
	validateSalesChannels bool,
) *utils.ApplictaionError

func (*CartService) AddShippingMethod

func (s *CartService) AddShippingMethod(id uuid.UUID, cart *models.Cart, optionId uuid.UUID, data map[string]interface{}) (*models.Cart, *utils.ApplictaionError)

func (*CartService) ApplyDiscount

func (s *CartService) ApplyDiscount(cart *models.Cart, discountCode string) *utils.ApplictaionError

func (*CartService) ApplyDiscounts

func (s *CartService) ApplyDiscounts(cart *models.Cart, discountCodes []string) *utils.ApplictaionError

func (*CartService) AuthorizePayment

func (s *CartService) AuthorizePayment(id uuid.UUID, cart *models.Cart, context map[string]interface{}) (*models.Cart, *utils.ApplictaionError)

func (*CartService) Create

func (*CartService) CreateTaxLines

func (s *CartService) CreateTaxLines(id uuid.UUID, cart *models.Cart) *utils.ApplictaionError

func (*CartService) DecorateTotals

func (s *CartService) DecorateTotals(cart *models.Cart, totalsConfig TotalsConfig) (*models.Cart, *utils.ApplictaionError)

func (*CartService) Delete

func (s *CartService) Delete(id uuid.UUID) (*models.Cart, *utils.ApplictaionError)

func (*CartService) DeletePaymentSession

func (s *CartService) DeletePaymentSession(id uuid.UUID, providerId uuid.UUID) *utils.ApplictaionError

func (*CartService) DeleteTaxLines

func (s *CartService) DeleteTaxLines(id uuid.UUID) *utils.ApplictaionError

func (*CartService) List

func (*CartService) RefreshPaymentSession

func (s *CartService) RefreshPaymentSession(id uuid.UUID, providerId uuid.UUID) *utils.ApplictaionError

func (*CartService) RemoveDiscount

func (s *CartService) RemoveDiscount(cartId uuid.UUID, discountCode string) (*models.Cart, *utils.ApplictaionError)

func (*CartService) RemoveLineItem

func (s *CartService) RemoveLineItem(id uuid.UUID, lineItemIds uuid.UUIDs) *utils.ApplictaionError

func (*CartService) Retrieve

func (s *CartService) Retrieve(id uuid.UUID, config *sql.Options, totalsConfig TotalsConfig) (*models.Cart, *utils.ApplictaionError)

func (*CartService) RetrieveLegacy

func (s *CartService) RetrieveLegacy(id uuid.UUID, config *sql.Options, totalsConfig TotalsConfig) (*models.Cart, *utils.ApplictaionError)

func (*CartService) RetrieveWithTotals

func (s *CartService) RetrieveWithTotals(id uuid.UUID, config *sql.Options, totalsConfig TotalsConfig) (*models.Cart, *utils.ApplictaionError)

func (*CartService) SetContext

func (s *CartService) SetContext(context context.Context) *CartService

func (*CartService) SetMetadata

func (s *CartService) SetMetadata(id uuid.UUID, key string, value string) (*models.Cart, *utils.ApplictaionError)

func (*CartService) SetPaymentSession

func (s *CartService) SetPaymentSession(id uuid.UUID, providerId uuid.UUID) *utils.ApplictaionError

func (*CartService) SetPaymentSessions

func (s *CartService) SetPaymentSessions(id uuid.UUID, cart *models.Cart) *utils.ApplictaionError

func (*CartService) Update

func (*CartService) UpdateLineItem

func (s *CartService) UpdateLineItem(
	cartId uuid.UUID,
	lineItemId uuid.UUID,
	update *types.LineItemUpdate,
) (*models.Cart, *utils.ApplictaionError)

func (*CartService) UpdatePaymentSession

func (s *CartService) UpdatePaymentSession(cartId uuid.UUID, update map[string]interface{}) (*models.Cart, *utils.ApplictaionError)

func (*CartService) ValidateLineItem

func (s *CartService) ValidateLineItem(
	salesChannelId uuid.UUID,
	lineItem types.LineItemValidateData,
) (bool, *utils.ApplictaionError)

type ClaimItemService

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

func NewClaimItemService

func NewClaimItemService(
	r Registry,
) *ClaimItemService

func (*ClaimItemService) Create

func (*ClaimItemService) List

func (*ClaimItemService) Retrieve

func (s *ClaimItemService) Retrieve(claimItemId uuid.UUID, config *sql.Options) (*models.ClaimItem, *utils.ApplictaionError)

func (*ClaimItemService) SetContext

func (s *ClaimItemService) SetContext(context context.Context) *ClaimItemService

func (*ClaimItemService) Update

type ClaimService

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

func NewClaimService

func NewClaimService(
	r Registry,
) *ClaimService

func (*ClaimService) Cancel

func (*ClaimService) CancelFulfillment

func (s *ClaimService) CancelFulfillment(fulfillmentId uuid.UUID) (*models.ClaimOrder, *utils.ApplictaionError)

func (*ClaimService) Create

func (*ClaimService) CreateFulfillment

func (s *ClaimService) CreateFulfillment(id uuid.UUID, noNotification bool, locationId uuid.UUID, metadata map[string]interface{}) (*models.ClaimOrder, *utils.ApplictaionError)

func (*ClaimService) CreateShipment

func (s *ClaimService) CreateShipment(id uuid.UUID, fulfillmentId uuid.UUID, trackingLinks []models.TrackingLink, noNotification bool, metadata map[string]interface{}) (*models.ClaimOrder, *utils.ApplictaionError)

func (*ClaimService) GetRefundTotalForClaimLinesOnOrder

func (s *ClaimService) GetRefundTotalForClaimLinesOnOrder(order *models.Order, claimItems []types.CreateClaimItemInput) (*float64, *utils.ApplictaionError)

func (*ClaimService) List

func (s *ClaimService) List(selector *models.ClaimOrder, config *sql.Options) ([]models.ClaimOrder, *utils.ApplictaionError)

func (*ClaimService) ProcessRefund

func (s *ClaimService) ProcessRefund(id uuid.UUID) (*models.ClaimOrder, *utils.ApplictaionError)

func (*ClaimService) Retrieve

func (s *ClaimService) Retrieve(id uuid.UUID, config *sql.Options) (*models.ClaimOrder, *utils.ApplictaionError)

func (*ClaimService) SetContext

func (s *ClaimService) SetContext(context context.Context) *ClaimService

func (*ClaimService) Update

func (*ClaimService) ValidateCreateClaimInput

func (s *ClaimService) ValidateCreateClaimInput(data *types.CreateClaimInput) *utils.ApplictaionError

type CsvColumn

type CsvColumn struct {
	Name      string
	Required  bool
	Match     *regexp.Regexp
	MapTo     string
	Reducer   func(data interface{}, key string, value string) (interface{}, error)
	Transform func(value string) interface{}
	Validator interfaces.ICsvValidator
}

type CsvParserService

type CsvParserService struct {
	Schema    CsvSchema
	Delimiter string
}

func NewCsvParserService

func NewCsvParserService(schema CsvSchema, delimiter string) *CsvParserService

func (*CsvParserService) Parse

func (p *CsvParserService) Parse(readableStream io.Reader) ([]interface{}, error)

func (*CsvParserService) ParserFunc

func (p *CsvParserService) ParserFunc(line []string) (interface{}, error)

type CsvReader

type CsvReader struct {
	Reader    io.Reader
	Delimiter string
}

func NewCsvReader

func NewCsvReader(reader io.Reader, delimiter string) *CsvReader

func (*CsvReader) Read

func (r *CsvReader) Read() ([]string, error)

type CsvSchema

type CsvSchema struct {
	Columns []CsvColumn
}

type CurrencyService

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

func NewCurrencyService

func NewCurrencyService(
	r Registry,
) *CurrencyService

func (*CurrencyService) ListAndCount

func (s *CurrencyService) ListAndCount(selector *types.FilterableCurrencyProps, config *sql.Options) ([]models.Currency, *int64, *utils.ApplictaionError)

func (*CurrencyService) RetrieveByCode

func (s *CurrencyService) RetrieveByCode(code string) (*models.Currency, *utils.ApplictaionError)

func (*CurrencyService) SetContext

func (s *CurrencyService) SetContext(context context.Context) *CurrencyService

func (*CurrencyService) Update

type CustomShippingOptionService

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

func NewCustomShippingOptionService

func NewCustomShippingOptionService(
	r Registry,
) *CustomShippingOptionService

func (*CustomShippingOptionService) List

func (*CustomShippingOptionService) Retrieve

func (*CustomShippingOptionService) SetContext

type CustomerGroupService

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

func NewCustomerGroupService

func NewCustomerGroupService(
	r Registry,
) *CustomerGroupService

func (*CustomerGroupService) AddCustomers

func (s *CustomerGroupService) AddCustomers(id uuid.UUID, customerIds uuid.UUIDs) (*models.CustomerGroup, *utils.ApplictaionError)

func (*CustomerGroupService) Create

func (*CustomerGroupService) Delete

func (s *CustomerGroupService) Delete(groupId uuid.UUID) *utils.ApplictaionError

func (*CustomerGroupService) List

func (*CustomerGroupService) ListAndCount

func (*CustomerGroupService) RemoveCustomer

func (s *CustomerGroupService) RemoveCustomer(id uuid.UUID, customerIds uuid.UUIDs) (*models.CustomerGroup, *utils.ApplictaionError)

func (*CustomerGroupService) Retrieve

func (s *CustomerGroupService) Retrieve(customerGroupId uuid.UUID, config *sql.Options) (*models.CustomerGroup, *utils.ApplictaionError)

func (*CustomerGroupService) SetContext

func (s *CustomerGroupService) SetContext(context context.Context) *CustomerGroupService

func (*CustomerGroupService) Update

type CustomerService

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

func NewCustomerService

func NewCustomerService(
	r Registry,
) *CustomerService

func (*CustomerService) AddAddress

func (s *CustomerService) AddAddress(customerId uuid.UUID, address *models.Address) (*models.Customer, *models.Address, *utils.ApplictaionError)

func (*CustomerService) Count

func (s *CustomerService) Count() (*int64, *utils.ApplictaionError)

func (*CustomerService) Create

func (*CustomerService) Delete

func (s *CustomerService) Delete(customerId uuid.UUID) *utils.ApplictaionError

func (*CustomerService) GenerateResetPasswordToken

func (s *CustomerService) GenerateResetPasswordToken(customerId uuid.UUID) (*string, *utils.ApplictaionError)

func (*CustomerService) HashPassword

func (s *CustomerService) HashPassword(password string) (string, error)

func (*CustomerService) List

func (*CustomerService) ListAndCount

func (s *CustomerService) ListAndCount(selector *types.FilterableCustomer, config *sql.Options) ([]models.Customer, *int64, *utils.ApplictaionError)

func (*CustomerService) ListByEmail

func (s *CustomerService) ListByEmail(email string, config *sql.Options) ([]models.Customer, *utils.ApplictaionError)

func (*CustomerService) RemoveAddress

func (s *CustomerService) RemoveAddress(customerId uuid.UUID, addressId uuid.UUID) (err *utils.ApplictaionError)

func (*CustomerService) Retrieve

func (s *CustomerService) Retrieve(selector models.Customer, config *sql.Options) (*models.Customer, *utils.ApplictaionError)

func (*CustomerService) RetrieveByEmail

func (s *CustomerService) RetrieveByEmail(email string, config *sql.Options) (*models.Customer, *utils.ApplictaionError)

func (*CustomerService) RetrieveById

func (s *CustomerService) RetrieveById(id uuid.UUID, config *sql.Options) (*models.Customer, *utils.ApplictaionError)

func (*CustomerService) RetrieveByPhone

func (s *CustomerService) RetrieveByPhone(phone string, config *sql.Options) (*models.Customer, *utils.ApplictaionError)

func (*CustomerService) RetrieveRegisteredByEmail

func (s *CustomerService) RetrieveRegisteredByEmail(email string, config *sql.Options) (*models.Customer, *utils.ApplictaionError)

func (*CustomerService) RetrieveUnregisteredByEmail

func (s *CustomerService) RetrieveUnregisteredByEmail(email string, config *sql.Options) (*models.Customer, *utils.ApplictaionError)

func (*CustomerService) SetContext

func (s *CustomerService) SetContext(context context.Context) *CustomerService

func (*CustomerService) Update

func (*CustomerService) UpdateAddress

func (s *CustomerService) UpdateAddress(customerId uuid.UUID, addressId uuid.UUID, model *models.Address) (*models.Address, *utils.ApplictaionError)

func (*CustomerService) UpdateBillingAddress

func (s *CustomerService) UpdateBillingAddress(model *models.Customer, id uuid.UUID, address *models.Address) *utils.ApplictaionError

type DefaultFileService

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

func NewDefaultFileService

func NewDefaultFileService() *DefaultFileService

func (*DefaultFileService) Delete

func (s *DefaultFileService) Delete(fileData map[string]interface{}) error

func (*DefaultFileService) GetDownloadStream

func (s *DefaultFileService) GetDownloadStream(fileData interfaces.GetUploadedFileType) (io.Reader, error)

func (*DefaultFileService) GetPresignedDownloadUrl

func (s *DefaultFileService) GetPresignedDownloadUrl(fileData interfaces.GetUploadedFileType) (string, error)

func (*DefaultFileService) GetUploadStreamDescriptor

func (*DefaultFileService) SetContext

func (s *DefaultFileService) SetContext(context context.Context) *DefaultFileService

func (*DefaultFileService) Upload

func (*DefaultFileService) UploadProtected

func (s *DefaultFileService) UploadProtected(fileData io.Reader) (*interfaces.FileServiceUploadResult, error)

type DefaultSearchService

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

func NewDefaultSearchService

func NewDefaultSearchService(
	r Registry,
) *DefaultSearchService

func (*DefaultSearchService) AddDocuments

func (s *DefaultSearchService) AddDocuments(indexName string, documents interface{}, types string)

func (*DefaultSearchService) CreateIndex

func (s *DefaultSearchService) CreateIndex(indexName string, options interface{})

func (*DefaultSearchService) DeleteAllDocuments

func (s *DefaultSearchService) DeleteAllDocuments(indexName string)

func (*DefaultSearchService) DeleteDocument

func (s *DefaultSearchService) DeleteDocument(indexName string, document_id interface{})

func (*DefaultSearchService) GetIndex

func (s *DefaultSearchService) GetIndex(indexName string)

func (*DefaultSearchService) ReplaceDocuments

func (s *DefaultSearchService) ReplaceDocuments(indexName string, documents interface{}, types string)

func (*DefaultSearchService) Search

func (s *DefaultSearchService) Search(indexName string, query interface{}, options map[string]interface{}) map[string]interface{}

func (*DefaultSearchService) SetContext

func (s *DefaultSearchService) SetContext(context context.Context) *DefaultSearchService

func (*DefaultSearchService) UpdateSettings

func (s *DefaultSearchService) UpdateSettings(indexName string, settings interface{})

type DiscountConditionService

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

func NewDiscountConditionService

func NewDiscountConditionService(
	r Registry,
) *DiscountConditionService

func (*DiscountConditionService) Delete

func (s *DiscountConditionService) Delete(conditionId uuid.UUID) *utils.ApplictaionError

func (*DiscountConditionService) RemoveResources

func (*DiscountConditionService) ResolveConditionType

func (*DiscountConditionService) Retrieve

func (*DiscountConditionService) SetContext

func (*DiscountConditionService) UpsertCondition

func (s *DiscountConditionService) UpsertCondition(data *types.DiscountConditionInput, overrideExisting bool) ([]models.DiscountCondition, *utils.ApplictaionError)

type DiscountService

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

func NewDiscountService

func NewDiscountService(
	r Registry,
) *DiscountService

func (*DiscountService) AddRegion

func (s *DiscountService) AddRegion(discountId uuid.UUID, regionId uuid.UUID) (*models.Discount, *utils.ApplictaionError)

func (*DiscountService) CalculateDiscountForLineItem

func (s *DiscountService) CalculateDiscountForLineItem(discountId uuid.UUID, lineItem *models.LineItem, calculationContextData types.CalculationContextData) (float64, *utils.ApplictaionError)

func (*DiscountService) Create

func (*DiscountService) CreateDynamicCode

func (s *DiscountService) CreateDynamicCode(discountId uuid.UUID, data *types.CreateDynamicDiscountInput) (*models.Discount, *utils.ApplictaionError)

func (*DiscountService) Delete

func (s *DiscountService) Delete(discountId uuid.UUID) *utils.ApplictaionError

func (*DiscountService) DeleteDynamicCode

func (s *DiscountService) DeleteDynamicCode(discountId uuid.UUID, code string) *utils.ApplictaionError

func (*DiscountService) List

func (*DiscountService) ListAndCount

func (s *DiscountService) ListAndCount(selector *types.FilterableDiscount, config *sql.Options) ([]models.Discount, *int64, *utils.ApplictaionError)

func (*DiscountService) ListByCodes

func (s *DiscountService) ListByCodes(discountCodes []string, config sql.Query) ([]models.Discount, *utils.ApplictaionError)

func (*DiscountService) RemoveRegion

func (s *DiscountService) RemoveRegion(discountId uuid.UUID, regionId uuid.UUID) (*models.Discount, *utils.ApplictaionError)

func (*DiscountService) Retrieve

func (s *DiscountService) Retrieve(discountId uuid.UUID, config *sql.Options) (*models.Discount, *utils.ApplictaionError)

func (*DiscountService) RetrieveByCode

func (s *DiscountService) RetrieveByCode(discountCode string, config *sql.Options) (*models.Discount, *utils.ApplictaionError)

func (*DiscountService) SetContext

func (s *DiscountService) SetContext(context context.Context) *DiscountService

func (*DiscountService) Update

func (*DiscountService) ValidateDiscountForProduct

func (s *DiscountService) ValidateDiscountForProduct(discountRuleId uuid.UUID, productId uuid.UUID) (bool, *utils.ApplictaionError)

func (*DiscountService) ValidateDiscountRule

type DraftOrderService

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

func NewDraftOrderService

func NewDraftOrderService(
	r Registry,
) *DraftOrderService

func (*DraftOrderService) Create

func (*DraftOrderService) Delete

func (s *DraftOrderService) Delete(draftOrderId uuid.UUID) *utils.ApplictaionError

func (*DraftOrderService) List

func (*DraftOrderService) ListAndCount

func (*DraftOrderService) RegisterCartCompletion

func (s *DraftOrderService) RegisterCartCompletion(id uuid.UUID, orderId uuid.UUID) (*models.DraftOrder, *utils.ApplictaionError)

func (*DraftOrderService) Retrieve

func (s *DraftOrderService) Retrieve(draftOrderId uuid.UUID, config *sql.Options) (*models.DraftOrder, *utils.ApplictaionError)

func (*DraftOrderService) RetrieveByCartId

func (s *DraftOrderService) RetrieveByCartId(cartId uuid.UUID, config *sql.Options) (*models.DraftOrder, *utils.ApplictaionError)

func (*DraftOrderService) SetContext

func (s *DraftOrderService) SetContext(context context.Context) *DraftOrderService

func (*DraftOrderService) Update

type EventBus

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

EventBus - box for handlers and callbacks.

func (*EventBus) HasCallback

func (bus *EventBus) HasCallback(topic string) bool

HasCallback returns true if exists any callback subscribed to the topic.

func (*EventBus) Publish

func (bus *EventBus) Publish(topic string, args ...interface{})

Publish executes callback defined for a topic. Any additional argument will be transferred to the callback.

func (*EventBus) Subscribe

func (bus *EventBus) Subscribe(topic string, fn interface{}) error

Subscribe subscribes to a topic. Returns error if `fn` is not a function.

func (*EventBus) SubscribeAsync

func (bus *EventBus) SubscribeAsync(topic string, fn interface{}, transactional bool) error

SubscribeAsync subscribes to a topic with an asynchronous callback Transactional determines whether subsequent callbacks for a topic are run serially (true) or concurrently (false) Returns error if `fn` is not a function.

func (*EventBus) SubscribeOnce

func (bus *EventBus) SubscribeOnce(topic string, fn interface{}) error

SubscribeOnce subscribes to a topic once. Handler will be removed after executing. Returns error if `fn` is not a function.

func (*EventBus) SubscribeOnceAsync

func (bus *EventBus) SubscribeOnceAsync(topic string, fn interface{}) error

SubscribeOnceAsync subscribes to a topic once with an asynchronous callback Handler will be removed after executing. Returns error if `fn` is not a function.

func (*EventBus) Unsubscribe

func (bus *EventBus) Unsubscribe(topic string, handler interface{}) error

Unsubscribe removes callback defined for a topic. Returns error if there are no callbacks subscribed to the topic.

func (*EventBus) WaitAsync

func (bus *EventBus) WaitAsync()

WaitAsync waits for all async callbacks to complete

type FlagRouter

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

func NewFlagRouter

func NewFlagRouter(r Registry) *FlagRouter

func (*FlagRouter) IsFeatureEnabled

func (m *FlagRouter) IsFeatureEnabled(flag []string) bool

func (*FlagRouter) SetFlag

func (m *FlagRouter) SetFlag(flag string, value bool)

type FulfillmentProviderService

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

func NewFulfillmentProviderService

func NewFulfillmentProviderService(
	container di.Container,
	r Registry,
) *FulfillmentProviderService

func (*FulfillmentProviderService) CalculatePrice

func (s *FulfillmentProviderService) CalculatePrice(option *models.ShippingOption, data map[string]interface{}, cart *models.Cart) (float64, *utils.ApplictaionError)

func (*FulfillmentProviderService) CanCalculate

func (*FulfillmentProviderService) CancelFulfillment

func (s *FulfillmentProviderService) CancelFulfillment(fulfillment *models.Fulfillment) (*models.Fulfillment, *utils.ApplictaionError)

func (*FulfillmentProviderService) CreateFulfillment

func (*FulfillmentProviderService) CreateReturn

func (s *FulfillmentProviderService) CreateReturn(returnOrder *models.Return) (core.JSONB, *utils.ApplictaionError)

func (*FulfillmentProviderService) List

func (*FulfillmentProviderService) ListFulfillmentOptions

func (s *FulfillmentProviderService) ListFulfillmentOptions(providerIDs uuid.UUIDs) ([]types.FulfillmentOptions, *utils.ApplictaionError)

func (*FulfillmentProviderService) RegisterInstalledProviders

func (s *FulfillmentProviderService) RegisterInstalledProviders(providers uuid.UUIDs) *utils.ApplictaionError

func (*FulfillmentProviderService) RetrieveDocuments

func (s *FulfillmentProviderService) RetrieveDocuments(providerId uuid.UUID, fulfillmentData map[string]interface{}, documentType string) (map[string]interface{}, *utils.ApplictaionError)

func (*FulfillmentProviderService) RetrieveProvider

func (s *FulfillmentProviderService) RetrieveProvider(providerID uuid.UUID) interfaces.IFulfillmentService

func (*FulfillmentProviderService) SetContext

func (*FulfillmentProviderService) ValidateFulfillmentData

func (s *FulfillmentProviderService) ValidateFulfillmentData(option *models.ShippingOption, data map[string]interface{}, cart *models.Cart) (map[string]interface{}, *utils.ApplictaionError)

func (*FulfillmentProviderService) ValidateOption

type FulfillmentService

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

func NewFulfillmentService

func NewFulfillmentService(
	r Registry,
) *FulfillmentService

func (*FulfillmentService) CancelFulfillment

func (s *FulfillmentService) CancelFulfillment(fulfillmentId uuid.UUID, fulfillment *models.Fulfillment) (*models.Fulfillment, *utils.ApplictaionError)

func (*FulfillmentService) CreateFulfillment

func (*FulfillmentService) CreateShipment

func (s *FulfillmentService) CreateShipment(fulfillmentId uuid.UUID, trackingLinks []models.TrackingLink, config *types.CreateShipmentConfig) (*models.Fulfillment, *utils.ApplictaionError)

func (*FulfillmentService) GetFulfillmentItems

func (*FulfillmentService) PartitionItems

func (s *FulfillmentService) PartitionItems(shippingMethods []models.ShippingMethod, items []models.LineItem) []types.FulfillmentItemPartition

func (*FulfillmentService) Retrieve

func (s *FulfillmentService) Retrieve(fulfillmentId uuid.UUID, config *sql.Options) (*models.Fulfillment, *utils.ApplictaionError)

func (*FulfillmentService) SetContext

func (s *FulfillmentService) SetContext(context context.Context) *FulfillmentService

func (*FulfillmentService) ValidateFulfillmentLineItem

func (s *FulfillmentService) ValidateFulfillmentLineItem(item *models.LineItem, quantity int) (*models.LineItem, *utils.ApplictaionError)

type GenerateLineItemContext

type GenerateLineItemContext struct {
	types.GenerateLineItemContext
	VariantPricing *types.ProductVariantPricing
}

type GetLineItemTotalOptions

type GetLineItemTotalOptions struct {
	IncludeTax       bool
	ExcludeDiscounts bool
}

type GetShippingMethodTotalsOptions

type GetShippingMethodTotalsOptions struct {
	IncludeTax         bool
	UseTaxLines        bool
	CalculationContext interfaces.TaxCalculationContext
}

type GetTotalsOptions

type GetTotalsOptions struct {
	ExcludeGiftCards bool
	ForceTaxes       bool
}

type GiftCardService

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

func NewGiftCardService

func NewGiftCardService(
	r Registry,
) *GiftCardService

func (*GiftCardService) Create

func (*GiftCardService) CreateTransaction

func (*GiftCardService) Delete

func (*GiftCardService) GenerateCode

func (s *GiftCardService) GenerateCode() string

func (*GiftCardService) List

func (*GiftCardService) ListAndCount

func (s *GiftCardService) ListAndCount(selector *types.FilterableGiftCard, config *sql.Options) ([]models.GiftCard, *int64, *utils.ApplictaionError)

func (*GiftCardService) ResolveTaxRate

func (s *GiftCardService) ResolveTaxRate(giftCardTaxRate float64, region *models.Region) float64

func (*GiftCardService) Retrieve

func (s *GiftCardService) Retrieve(selector *models.GiftCard, config *sql.Options) (*models.GiftCard, *utils.ApplictaionError)

func (*GiftCardService) RetrieveByCode

func (s *GiftCardService) RetrieveByCode(code string, config *sql.Options) (*models.GiftCard, *utils.ApplictaionError)

func (*GiftCardService) RetrieveById

func (s *GiftCardService) RetrieveById(id uuid.UUID, config *sql.Options) (*models.GiftCard, *utils.ApplictaionError)

func (*GiftCardService) SetContext

func (s *GiftCardService) SetContext(context context.Context) *GiftCardService

func (*GiftCardService) Update

type IdempotencyKeyService

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

func NewIdempotencyKeyService

func NewIdempotencyKeyService(
	r Registry,
) *IdempotencyKeyService

func (*IdempotencyKeyService) Create

func (*IdempotencyKeyService) InitializeRequest

func (s *IdempotencyKeyService) InitializeRequest(headerKey string, reqMethod string, reqParams core.JSONB, reqPath string) (*models.IdempotencyKey, *utils.ApplictaionError)

func (*IdempotencyKeyService) Lock

func (*IdempotencyKeyService) Retrieve

func (s *IdempotencyKeyService) Retrieve(idempotencyKey string) (*models.IdempotencyKey, *utils.ApplictaionError)

func (*IdempotencyKeyService) SetContext

func (*IdempotencyKeyService) Update

func (*IdempotencyKeyService) WorkStage

type InviteService

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

func NewInviteService

func NewInviteService(
	r Registry,
) *InviteService

func (*InviteService) Accept

func (*InviteService) Create

func (s *InviteService) Create(data *types.CreateInviteInput, validDuration time.Duration) *utils.ApplictaionError

func (*InviteService) Delete

func (s *InviteService) Delete(inviteId uuid.UUID) *utils.ApplictaionError

func (*InviteService) List

func (*InviteService) Resend

func (s *InviteService) Resend(id uuid.UUID) *utils.ApplictaionError

func (*InviteService) SetContext

func (s *InviteService) SetContext(context context.Context) *InviteService

type LineItemAdjustmentService

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

func NewLineItemAdjustmentService

func NewLineItemAdjustmentService(
	r Registry,
) *LineItemAdjustmentService

func (*LineItemAdjustmentService) Create

func (*LineItemAdjustmentService) CreateAdjustmentForLineItem

func (s *LineItemAdjustmentService) CreateAdjustmentForLineItem(cart *models.Cart, lineItem *models.LineItem) ([]models.LineItemAdjustment, *utils.ApplictaionError)

func (*LineItemAdjustmentService) CreateAdjustments

func (*LineItemAdjustmentService) Delete

func (*LineItemAdjustmentService) DeleteSlice

func (*LineItemAdjustmentService) GenerateAdjustments

func (s *LineItemAdjustmentService) GenerateAdjustments(calculationContextData types.CalculationContextData, generatedLineItem *models.LineItem, context *models.ProductVariant) ([]models.LineItemAdjustment, *utils.ApplictaionError)

func (*LineItemAdjustmentService) List

func (*LineItemAdjustmentService) Retrieve

func (*LineItemAdjustmentService) SetContext

func (*LineItemAdjustmentService) Update

type LineItemService

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

func NewLineItemService

func NewLineItemService(
	r Registry,
) *LineItemService

func (*LineItemService) CloneTo

func (s *LineItemService) CloneTo(ids uuid.UUIDs, data *models.LineItem, options map[string]interface{}) ([]models.LineItem, *utils.ApplictaionError)

func (*LineItemService) Create

func (*LineItemService) CreateReturnLines

func (s *LineItemService) CreateReturnLines(returnId uuid.UUID, cartId uuid.UUID) (*models.LineItem, *utils.ApplictaionError)

func (*LineItemService) CreateTaxLine

func (*LineItemService) Delete

func (*LineItemService) DeleteWithTaxLines

func (s *LineItemService) DeleteWithTaxLines(id uuid.UUID) *utils.ApplictaionError

func (*LineItemService) Generate

func (s *LineItemService) Generate(
	variantId uuid.UUID,
	variant []types.GenerateInputData,
	regionId uuid.UUID,
	quantity int,
	context types.GenerateLineItemContext,
) ([]models.LineItem, *utils.ApplictaionError)

func (*LineItemService) List

func (s *LineItemService) List(selector models.LineItem, config *sql.Options) ([]models.LineItem, *utils.ApplictaionError)

func (*LineItemService) Retrieve

func (s *LineItemService) Retrieve(lineItemId uuid.UUID, config *sql.Options) (*models.LineItem, *utils.ApplictaionError)

func (*LineItemService) SetContext

func (s *LineItemService) SetContext(context context.Context) *LineItemService

func (*LineItemService) Update

func (s *LineItemService) Update(id uuid.UUID, selector *models.LineItem, Update *models.LineItem, config *sql.Options) (*models.LineItem, *utils.ApplictaionError)

type LineItemTotalsOptions

type LineItemTotalsOptions struct {
	IncludeTax         bool
	UseTaxLines        bool
	ExcludeGiftCards   bool
	CalculationContext *interfaces.TaxCalculationContext
}

type NewTotalsService

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

func NewNewTotalsServices

func NewNewTotalsServices(
	r Registry,
) *NewTotalsService

func (*NewTotalsService) GetGiftCardTotals

func (s *NewTotalsService) GetGiftCardTotals(giftCardableAmount float64, giftCardTransactions []models.GiftCardTransaction, region *models.Region, giftCards []models.GiftCard) (*Total, *utils.ApplictaionError)

func (*NewTotalsService) GetGiftCardTransactionsTotals

func (s *NewTotalsService) GetGiftCardTransactionsTotals(giftCardTransactions []models.GiftCardTransaction, region *models.Region) *Total

func (*NewTotalsService) GetGiftCardableAmount

func (s *NewTotalsService) GetGiftCardableAmount(giftCardsTaxable bool, subtotal, shippingTotal, discountTotal, taxTotal float64) float64

func (*NewTotalsService) GetLineItemRefund

func (s *NewTotalsService) GetLineItemRefund(lineItem models.LineItem, calculationContext *interfaces.TaxCalculationContext, taxRate *float64) (float64, *utils.ApplictaionError)

func (*NewTotalsService) GetLineItemTotals

func (s *NewTotalsService) GetLineItemTotals(items []models.LineItem, includeTax bool, calculationContext *interfaces.TaxCalculationContext, taxRate *float64) (map[uuid.UUID]models.LineItem, *utils.ApplictaionError)

func (*NewTotalsService) GetShippingMethodTotals

func (s *NewTotalsService) GetShippingMethodTotals(shippingMethods []models.ShippingMethod, includeTax bool, discounts []models.Discount, taxRate *float64, calculationContext *interfaces.TaxCalculationContext) (map[uuid.UUID]models.ShippingMethod, *utils.ApplictaionError)

func (*NewTotalsService) SetContext

func (s *NewTotalsService) SetContext(context context.Context) *NewTotalsService

type NoteService

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

func NewNoteService

func NewNoteService(
	r Registry,
) *NoteService

func (*NoteService) Create

func (s *NoteService) Create(data *types.CreateNoteInput, config map[string]interface{}) (*models.Note, *utils.ApplictaionError)

func (*NoteService) Delete

func (s *NoteService) Delete(id uuid.UUID) *utils.ApplictaionError

func (*NoteService) List

func (s *NoteService) List(selector *types.FilterableNote, config *sql.Options) ([]models.Note, *utils.ApplictaionError)

func (*NoteService) ListAndCount

func (s *NoteService) ListAndCount(selector *types.FilterableNote, config *sql.Options) ([]models.Note, *int64, *utils.ApplictaionError)

func (*NoteService) Retrieve

func (s *NoteService) Retrieve(id uuid.UUID, config *sql.Options) (*models.Note, *utils.ApplictaionError)

func (*NoteService) SetContext

func (s *NoteService) SetContext(context context.Context) *NoteService

func (*NoteService) Update

type NotificationService

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

func NewNotificationService

func NewNotificationService(
	container di.Container,
	subscribers map[string]uuid.UUIDs,
	attachmentGenerator interface{},
	r Registry,
) *NotificationService

func (*NotificationService) HandleEvent

func (s *NotificationService) HandleEvent(eventName string, data map[string]interface{}) *utils.ApplictaionError

func (*NotificationService) List

func (*NotificationService) ListAndCount

func (*NotificationService) RegisterAttachmentGenerator

func (s *NotificationService) RegisterAttachmentGenerator(service interface{})

func (*NotificationService) RegisterInstalledProviders

func (s *NotificationService) RegisterInstalledProviders(providers uuid.UUIDs) *utils.ApplictaionError

func (*NotificationService) Resend

func (*NotificationService) Retrieve

func (*NotificationService) RetrieveProvider

func (*NotificationService) Send

func (s *NotificationService) Send(event string, eventData map[string]interface{}, providerId uuid.UUID) (*models.Notification, *utils.ApplictaionError)

func (*NotificationService) SetContext

func (s *NotificationService) SetContext(context context.Context) *NotificationService

func (*NotificationService) Subscribe

func (s *NotificationService) Subscribe(eventName string, providerId uuid.UUID) *utils.ApplictaionError

type OAuthService

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

func NewOAuthService

func NewOAuthService(
	container di.Container,
	r Registry,
) *OAuthService

func (*OAuthService) Create

func (*OAuthService) GenerateToken

func (s *OAuthService) GenerateToken(appName string, code string, state string) (*models.OAuth, *utils.ApplictaionError)

func (*OAuthService) List

func (s *OAuthService) List(selector *models.OAuth, config *sql.Options) ([]models.OAuth, *utils.ApplictaionError)

func (*OAuthService) RefreshToken

func (s *OAuthService) RefreshToken(appName string) (*models.OAuth, *utils.ApplictaionError)

func (*OAuthService) RegisterOauthApp

func (s *OAuthService) RegisterOauthApp(appDetails *types.CreateOauthInput) (*models.OAuth, *utils.ApplictaionError)

func (*OAuthService) Retrieve

func (s *OAuthService) Retrieve(id uuid.UUID, config *sql.Options) (*models.OAuth, *utils.ApplictaionError)

func (*OAuthService) RetrieveByName

func (s *OAuthService) RetrieveByName(appName string, config *sql.Options) (*models.OAuth, *utils.ApplictaionError)

func (*OAuthService) SetContext

func (s *OAuthService) SetContext(context context.Context) *OAuthService

func (*OAuthService) Update

type OrderEditService

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

func NewOrderEditService

func NewOrderEditService(
	r Registry,
) *OrderEditService

func (*OrderEditService) AddLineItem

func (*OrderEditService) Cancel

func (s *OrderEditService) Cancel(id uuid.UUID, canceledBy uuid.UUID) (*models.OrderEdit, *utils.ApplictaionError)

func (*OrderEditService) Confirm

func (s *OrderEditService) Confirm(id uuid.UUID, confirmedBy uuid.UUID) (*models.OrderEdit, *utils.ApplictaionError)

func (*OrderEditService) Create

func (*OrderEditService) Decline

func (s *OrderEditService) Decline(id uuid.UUID, declinedBy uuid.UUID, declinedReason string) (*models.OrderEdit, *utils.ApplictaionError)

func (*OrderEditService) DecorateTotals

func (s *OrderEditService) DecorateTotals(orderEdit *models.OrderEdit) (*models.OrderEdit, *utils.ApplictaionError)

func (*OrderEditService) Delete

func (*OrderEditService) DeleteClonedItems

func (s *OrderEditService) DeleteClonedItems(id uuid.UUID) *utils.ApplictaionError

func (*OrderEditService) DeleteItemChange

func (s *OrderEditService) DeleteItemChange(id uuid.UUID, itemChangeId uuid.UUID) *utils.ApplictaionError

func (*OrderEditService) List

func (*OrderEditService) ListAndCount

func (s *OrderEditService) ListAndCount(selector *types.FilterableOrderEdit, config *sql.Options) ([]models.OrderEdit, *int64, *utils.ApplictaionError)

func (*OrderEditService) RefreshAdjustments

func (s *OrderEditService) RefreshAdjustments(id uuid.UUID, preserveCustomAdjustments bool) *utils.ApplictaionError

func (*OrderEditService) RemoveLineItem

func (s *OrderEditService) RemoveLineItem(id uuid.UUID, lineItemId uuid.UUID) *utils.ApplictaionError

func (*OrderEditService) RequestConfirmation

func (s *OrderEditService) RequestConfirmation(id uuid.UUID, requestedBy uuid.UUID) (*models.OrderEdit, *utils.ApplictaionError)

func (*OrderEditService) Retrieve

func (s *OrderEditService) Retrieve(id uuid.UUID, config *sql.Options) (*models.OrderEdit, *utils.ApplictaionError)

func (*OrderEditService) RetrieveActive

func (s *OrderEditService) RetrieveActive(orderId uuid.UUID, config *sql.Options) (*models.OrderEdit, *utils.ApplictaionError)

func (*OrderEditService) SetContext

func (s *OrderEditService) SetContext(context context.Context) *OrderEditService

func (*OrderEditService) Update

func (*OrderEditService) UpdateLineItem

func (s *OrderEditService) UpdateLineItem(id uuid.UUID, itemId uuid.UUID, quantity int) *utils.ApplictaionError

type OrderItemChangeService

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

func NewOrderItemChangeService

func NewOrderItemChangeService(
	r Registry,
) *OrderItemChangeService

func (*OrderItemChangeService) Delete

func (s *OrderItemChangeService) Delete(itemChangeIds uuid.UUIDs) *utils.ApplictaionError

func (*OrderItemChangeService) List

func (*OrderItemChangeService) Retrieve

func (*OrderItemChangeService) SetContext

type OrderService

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

func NewOrderService

func NewOrderService(
	r Registry,
) *OrderService

func (*OrderService) AddShippingMethod

func (s *OrderService) AddShippingMethod(
	orderId uuid.UUID,
	optionId uuid.UUID,
	data map[string]interface{},
	config *types.CreateShippingMethodDto,
) (*models.Order, *utils.ApplictaionError)

func (*OrderService) Archive

func (s *OrderService) Archive(id uuid.UUID) (*models.Order, *utils.ApplictaionError)

func (*OrderService) Cancel

func (s *OrderService) Cancel(orderId uuid.UUID) (*models.Order, *utils.ApplictaionError)

func (*OrderService) CancelFulfillment

func (s *OrderService) CancelFulfillment(fulfillmentId uuid.UUID) (*models.Order, *utils.ApplictaionError)

func (*OrderService) CapturePayment

func (s *OrderService) CapturePayment(orderId uuid.UUID) (*models.Order, *utils.ApplictaionError)

func (*OrderService) CompleteOrder

func (s *OrderService) CompleteOrder(id uuid.UUID) (*models.Order, *utils.ApplictaionError)

func (*OrderService) CreateFromCart

func (s *OrderService) CreateFromCart(id uuid.UUID, data *models.Cart) (*models.Order, *utils.ApplictaionError)

func (*OrderService) CreateFulfillment

func (s *OrderService) CreateFulfillment(id uuid.UUID, itemsToFulfill []types.FulFillmentItemType, config map[string]interface{}) (*models.Order, *utils.ApplictaionError)

func (*OrderService) CreateRefund

func (s *OrderService) CreateRefund(id uuid.UUID, refundAmount float64, reason models.RefundReason, note *string, noNotification *bool) (*models.Order, *utils.ApplictaionError)

func (*OrderService) CreateShipment

func (s *OrderService) CreateShipment(
	orderId uuid.UUID,
	fulfillmentId uuid.UUID,
	trackingLinks []models.TrackingLink,
	config struct {
		NoNotification bool
		Metadata       map[string]interface{}
	},
) (*models.Order, *utils.ApplictaionError)

func (*OrderService) GetFulfillmentItems

func (s *OrderService) GetFulfillmentItems(order models.Order, items []types.FulFillmentItemType, transformer func(item models.LineItem, quantity int) interface{}) ([]models.LineItem, *utils.ApplictaionError)

func (*OrderService) GetTotalsRelations

func (s *OrderService) GetTotalsRelations(config *sql.Options) []string

func (*OrderService) List

func (s *OrderService) List(selector *types.FilterableOrder, config *sql.Options) ([]models.Order, *utils.ApplictaionError)

func (*OrderService) ListAndCount

func (s *OrderService) ListAndCount(selector *types.FilterableOrder, config *sql.Options) ([]models.Order, *int64, *utils.ApplictaionError)

func (*OrderService) RegisterReturnReceived

func (s *OrderService) RegisterReturnReceived(id uuid.UUID, receivedReturn *models.Return, customRefundAmount *float64) (*models.Order, *utils.ApplictaionError)

func (*OrderService) Retrieve

func (s *OrderService) Retrieve(selector models.Order, config *sql.Options) (*models.Order, *utils.ApplictaionError)

func (*OrderService) RetrieveByCartId

func (s *OrderService) RetrieveByCartId(cartId uuid.UUID, config *sql.Options) (*models.Order, *utils.ApplictaionError)

func (*OrderService) RetrieveByCartIdWithTotals

func (s *OrderService) RetrieveByCartIdWithTotals(cartId uuid.UUID, config *sql.Options) (*models.Order, *utils.ApplictaionError)

func (*OrderService) RetrieveByExternalId

func (s *OrderService) RetrieveByExternalId(externalId uuid.UUID, config *sql.Options) (*models.Order, *utils.ApplictaionError)

func (*OrderService) RetrieveById

func (s *OrderService) RetrieveById(id uuid.UUID, config *sql.Options) (*models.Order, *utils.ApplictaionError)

func (*OrderService) RetrieveByIdWithTotals

func (s *OrderService) RetrieveByIdWithTotals(id uuid.UUID, config *sql.Options, context types.TotalsContext) (*models.Order, *utils.ApplictaionError)

func (*OrderService) RetrieveLegacy

func (s *OrderService) RetrieveLegacy(id uuid.UUID, selector models.Order, config *sql.Options) (*models.Order, *utils.ApplictaionError)

func (*OrderService) RetrieveWithTotals

func (s *OrderService) RetrieveWithTotals(selector models.Order, config *sql.Options, context types.TotalsContext) (*models.Order, *utils.ApplictaionError)

func (*OrderService) SetContext

func (s *OrderService) SetContext(context context.Context) *OrderService

func (*OrderService) Update

func (s *OrderService) Update(orderId uuid.UUID, update *types.UpdateOrderInput) (*models.Order, *utils.ApplictaionError)

func (*OrderService) UpdateBillingAddress

func (s *OrderService) UpdateBillingAddress(
	order *models.Order,
	address *models.Address,
) *utils.ApplictaionError

func (*OrderService) UpdateShippingAddress

func (s *OrderService) UpdateShippingAddress(
	order *models.Order,
	address *models.Address,
) *utils.ApplictaionError

func (*OrderService) ValidateFulfillmentLineItem

func (s *OrderService) ValidateFulfillmentLineItem(
	item *models.LineItem,
	quantity int,
) *models.LineItem

type PaymentCollectionService

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

func NewPaymentCollectionService

func NewPaymentCollectionService(
	r Registry,
) *PaymentCollectionService

func (*PaymentCollectionService) AuthorizePaymentSessions

func (s *PaymentCollectionService) AuthorizePaymentSessions(id uuid.UUID, sessionIds uuid.UUIDs, context map[string]interface{}) (*models.PaymentCollection, *utils.ApplictaionError)

func (*PaymentCollectionService) Delete

func (*PaymentCollectionService) IsValidTotalAmount

func (s *PaymentCollectionService) IsValidTotalAmount(total float64, sessionsInput []types.PaymentCollectionsSessionsBatchInput) bool

func (*PaymentCollectionService) MarkAsAuthorized

func (*PaymentCollectionService) RefreshPaymentSession

func (s *PaymentCollectionService) RefreshPaymentSession(id uuid.UUID, sessionId uuid.UUID, customerId uuid.UUID) (*models.PaymentSession, *utils.ApplictaionError)

func (*PaymentCollectionService) Retrieve

func (*PaymentCollectionService) SetContext

func (*PaymentCollectionService) SetPaymentSession

func (s *PaymentCollectionService) SetPaymentSession(id uuid.UUID, sessionInput *types.SessionsInput, customerId uuid.UUID) (*models.PaymentCollection, *utils.ApplictaionError)

func (*PaymentCollectionService) SetPaymentSessionsBatch

func (s *PaymentCollectionService) SetPaymentSessionsBatch(id uuid.UUID, paymentCollection *models.PaymentCollection, sessionsInput []types.PaymentCollectionsSessionsBatchInput, customerId uuid.UUID) (*models.PaymentCollection, *utils.ApplictaionError)

func (*PaymentCollectionService) Update

type PaymentProviderService

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

func NewPaymentProviderService

func NewPaymentProviderService(
	container di.Container,
	r Registry,
) *PaymentProviderService

func (*PaymentProviderService) AuthorizePayment

func (s *PaymentProviderService) AuthorizePayment(paymentSession *models.PaymentSession, context map[string]interface{}) (*models.PaymentSession, *utils.ApplictaionError)

func (*PaymentProviderService) CancelPayment

func (*PaymentProviderService) CapturePayment

func (*PaymentProviderService) CreatePayment

func (*PaymentProviderService) CreateSession

func (*PaymentProviderService) DeleteSession

func (s *PaymentProviderService) DeleteSession(paymentSession *models.PaymentSession) *utils.ApplictaionError

func (*PaymentProviderService) GetStatus

func (*PaymentProviderService) List

func (*PaymentProviderService) ListPayments

func (s *PaymentProviderService) ListPayments(selector models.Payment, config *sql.Options) ([]models.Payment, *utils.ApplictaionError)

func (*PaymentProviderService) RefreshSession

func (s *PaymentProviderService) RefreshSession(paymentSession *models.PaymentSession, sessionInput *types.PaymentSessionInput) (*models.PaymentSession, *utils.ApplictaionError)

func (*PaymentProviderService) RefundFromPayment

func (s *PaymentProviderService) RefundFromPayment(payment *models.Payment, amount float64, reason models.RefundReason, note *string) (*models.Refund, *utils.ApplictaionError)

func (*PaymentProviderService) RefundPayments

func (s *PaymentProviderService) RefundPayments(data []models.Payment, amount float64, reason models.RefundReason, note *string) (*models.Refund, *utils.ApplictaionError)

func (*PaymentProviderService) RegisterInstalledProviders

func (s *PaymentProviderService) RegisterInstalledProviders(providers uuid.UUIDs) *utils.ApplictaionError

func (*PaymentProviderService) RetrievePayment

func (s *PaymentProviderService) RetrievePayment(id uuid.UUID, relations []string) (*models.Payment, *utils.ApplictaionError)

func (*PaymentProviderService) RetrieveProvider

func (*PaymentProviderService) RetrieveRefund

func (s *PaymentProviderService) RetrieveRefund(id uuid.UUID, config *sql.Options) (*models.Refund, *utils.ApplictaionError)

func (*PaymentProviderService) RetrieveSession

func (s *PaymentProviderService) RetrieveSession(id uuid.UUID, relations []string) (*models.PaymentSession, *utils.ApplictaionError)

func (*PaymentProviderService) SaveSession

func (*PaymentProviderService) SetContext

func (*PaymentProviderService) UpdatePayment

func (*PaymentProviderService) UpdateSession

func (*PaymentProviderService) UpdateSessionData

func (s *PaymentProviderService) UpdateSessionData(paymentSession *models.PaymentSession, data map[string]interface{}) (*models.PaymentSession, *utils.ApplictaionError)

type PaymentService

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

func NewPaymentService

func NewPaymentService(
	r Registry,
) *PaymentService

func (*PaymentService) Capture

func (s *PaymentService) Capture(id uuid.UUID, payment *models.Payment) (*models.Payment, *utils.ApplictaionError)

func (*PaymentService) Create

func (*PaymentService) List

func (s *PaymentService) List(selector models.Payment, config *sql.Options) ([]models.Payment, *utils.ApplictaionError)

func (*PaymentService) Refund

func (s *PaymentService) Refund(id uuid.UUID, payment *models.Payment, amount float64, reason models.RefundReason, note *string) (*models.Refund, *utils.ApplictaionError)

func (*PaymentService) Retrieve

func (s *PaymentService) Retrieve(id uuid.UUID, config *sql.Options) (*models.Payment, *utils.ApplictaionError)

func (*PaymentService) SetContext

func (s *PaymentService) SetContext(context context.Context) *PaymentService

func (*PaymentService) Update

type PriceListService

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

func NewPriceListService

func NewPriceListService(
	r Registry,
) *PriceListService

func (*PriceListService) AddCurrencyFromRegion

func (s *PriceListService) AddCurrencyFromRegion(prices []types.PriceListPriceCreateInput) ([]models.MoneyAmount, *utils.ApplictaionError)

func (*PriceListService) AddPrices

func (*PriceListService) ClearPrices

func (s *PriceListService) ClearPrices(id uuid.UUID) *utils.ApplictaionError

func (*PriceListService) Create

func (*PriceListService) Delete

func (*PriceListService) DeletePrices

func (s *PriceListService) DeletePrices(id uuid.UUID, priceIds uuid.UUIDs) *utils.ApplictaionError

func (*PriceListService) DeleteProductPrices

func (s *PriceListService) DeleteProductPrices(id uuid.UUID, productIds uuid.UUIDs) (uuid.UUIDs, *int, *utils.ApplictaionError)

func (*PriceListService) DeleteVariantPrices

func (s *PriceListService) DeleteVariantPrices(id uuid.UUID, variantIds uuid.UUIDs) (uuid.UUIDs, *int, *utils.ApplictaionError)

func (*PriceListService) List

func (*PriceListService) ListAndCount

func (s *PriceListService) ListAndCount(selector *types.FilterablePriceList, config *sql.Options) ([]models.PriceList, *int64, *utils.ApplictaionError)

func (*PriceListService) ListPriceListsVariantIdsMap

func (s *PriceListService) ListPriceListsVariantIdsMap(priceListIds uuid.UUIDs) (map[string][]string, *utils.ApplictaionError)

func (*PriceListService) ListProducts

func (s *PriceListService) ListProducts(id uuid.UUID, selector *types.FilterableProduct, config *sql.Options, requiresPriceList bool) ([]models.Product, *int64, *utils.ApplictaionError)

func (*PriceListService) ListVariants

func (s *PriceListService) ListVariants(id uuid.UUID, selector *types.FilterableProductVariant, config *sql.Options, requiresPriceList bool) ([]models.ProductVariant, *int64, *utils.ApplictaionError)

func (*PriceListService) Retrieve

func (s *PriceListService) Retrieve(id uuid.UUID, config *sql.Options) (*models.PriceList, *utils.ApplictaionError)

func (*PriceListService) SetContext

func (s *PriceListService) SetContext(context context.Context) *PriceListService

func (*PriceListService) Update

func (*PriceListService) UpsertCustomerGroups

func (s *PriceListService) UpsertCustomerGroups(id uuid.UUID, customerGroups []types.CustomerGroups) *utils.ApplictaionError

type PricingService

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

func NewPricingService

func NewPricingService(
	r Registry,
) *PricingService

func (*PricingService) GetProductPricing

func (*PricingService) GetProductPricingById

func (s *PricingService) GetProductPricingById(productId uuid.UUID, context *interfaces.PricingContext) (map[uuid.UUID]types.ProductVariantPricing, *utils.ApplictaionError)

func (*PricingService) GetProductVariantPricingById

func (s *PricingService) GetProductVariantPricingById(variantId uuid.UUID, context *interfaces.PricingContext) (*types.ProductVariantPricing, *utils.ApplictaionError)

func (*PricingService) GetProductVariantsPricing

func (s *PricingService) GetProductVariantsPricing(data []interfaces.Pricing, context *interfaces.PricingContext) (map[uuid.UUID]types.ProductVariantPricing, *utils.ApplictaionError)

func (*PricingService) GetShippingOptionPricing

func (s *PricingService) GetShippingOptionPricing(shippingOption *models.ShippingOption, context *interfaces.PricingContext) (*types.PricedShippingOption, *utils.ApplictaionError)

func (*PricingService) SetAdminProductPricing

func (s *PricingService) SetAdminProductPricing(products []models.Product) ([]models.Product, *utils.ApplictaionError)

func (*PricingService) SetAdminVariantPricing

func (s *PricingService) SetAdminVariantPricing(variants []models.ProductVariant, context *interfaces.PricingContext) ([]models.ProductVariant, *utils.ApplictaionError)

func (*PricingService) SetContext

func (s *PricingService) SetContext(context context.Context) *PricingService

func (*PricingService) SetProductPrices

func (s *PricingService) SetProductPrices(products []models.Product, context *interfaces.PricingContext) ([]models.Product, *utils.ApplictaionError)

func (*PricingService) SetShippingOptionPrices

func (s *PricingService) SetShippingOptionPrices(shippingOptions []models.ShippingOption, context *interfaces.PricingContext) ([]types.PricedShippingOption, *utils.ApplictaionError)

func (*PricingService) SetVariantPrices

type ProductCategoryService

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

func NewProductCategoryService

func NewProductCategoryService(
	r Registry,
) *ProductCategoryService

func (*ProductCategoryService) AddProducts

func (s *ProductCategoryService) AddProducts(productCategoryId uuid.UUID, productIDs uuid.UUIDs) *utils.ApplictaionError

func (*ProductCategoryService) Create

func (*ProductCategoryService) Delete

func (s *ProductCategoryService) Delete(productCategoryId uuid.UUID) *utils.ApplictaionError

func (*ProductCategoryService) List

func (*ProductCategoryService) ListAndCount

func (*ProductCategoryService) RemoveProducts

func (s *ProductCategoryService) RemoveProducts(productCategoryId uuid.UUID, productIDs uuid.UUIDs) *utils.ApplictaionError

func (*ProductCategoryService) Retrieve

func (*ProductCategoryService) RetrieveByHandle

func (s *ProductCategoryService) RetrieveByHandle(handle string, config *sql.Options) (*models.ProductCategory, *utils.ApplictaionError)

func (*ProductCategoryService) RetrieveById

func (*ProductCategoryService) SetContext

func (*ProductCategoryService) Update

type ProductCollectionService

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

func NewProductCollectionService

func NewProductCollectionService(
	r Registry,
) *ProductCollectionService

func (*ProductCollectionService) AddProducts

func (s *ProductCollectionService) AddProducts(collectionId uuid.UUID, productIds uuid.UUIDs) (*models.ProductCollection, *utils.ApplictaionError)

func (*ProductCollectionService) Create

func (*ProductCollectionService) Delete

func (s *ProductCollectionService) Delete(collectionId uuid.UUID) *utils.ApplictaionError

func (*ProductCollectionService) List

func (*ProductCollectionService) ListAndCount

func (*ProductCollectionService) RemoveProducts

func (s *ProductCollectionService) RemoveProducts(collectionId uuid.UUID, productIds uuid.UUIDs) *utils.ApplictaionError

func (*ProductCollectionService) Retrieve

func (*ProductCollectionService) RetrieveByHandle

func (s *ProductCollectionService) RetrieveByHandle(collectionHandle string, config *sql.Options) (*models.ProductCollection, *utils.ApplictaionError)

func (*ProductCollectionService) SetContext

func (*ProductCollectionService) Update

type ProductService

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

func NewProductService

func NewProductService(
	r Registry,
) *ProductService

func (*ProductService) AddOption

func (s *ProductService) AddOption(id uuid.UUID, optionTitle string) (*models.Product, *utils.ApplictaionError)

func (*ProductService) Count

func (s *ProductService) Count(selector models.Product) (*int64, *utils.ApplictaionError)

func (*ProductService) Create

func (*ProductService) DecorateProductsWithSalesChannels

func (s *ProductService) DecorateProductsWithSalesChannels(products []models.Product) ([]models.Product, *utils.ApplictaionError)

func (*ProductService) Delete

func (*ProductService) DeleteOption

func (s *ProductService) DeleteOption(id uuid.UUID, optionId uuid.UUID) (*models.Product, *utils.ApplictaionError)

func (*ProductService) FilterProductsBySalesChannel

func (s *ProductService) FilterProductsBySalesChannel(productIds uuid.UUIDs, salesChannelId uuid.UUID, config *sql.Options) ([]models.Product, *utils.ApplictaionError)

func (*ProductService) IsProductInSalesChannels

func (s *ProductService) IsProductInSalesChannels(id uuid.UUID, salesChannelIds uuid.UUIDs) (bool, *utils.ApplictaionError)

func (*ProductService) List

func (*ProductService) ListAndCount

func (s *ProductService) ListAndCount(selector *types.FilterableProduct, config *sql.Options) ([]models.Product, *int64, *utils.ApplictaionError)

func (*ProductService) ListTagsByUsage

func (s *ProductService) ListTagsByUsage(take int) ([]models.ProductTag, *utils.ApplictaionError)

func (*ProductService) ListTypes

func (*ProductService) ReorderVariants

func (s *ProductService) ReorderVariants(id uuid.UUID, variantOrder uuid.UUIDs) (*models.Product, *utils.ApplictaionError)

func (*ProductService) Retrieve

func (s *ProductService) Retrieve(selector models.Product, config *sql.Options) (*models.Product, *utils.ApplictaionError)

func (*ProductService) RetrieveByExternalId

func (s *ProductService) RetrieveByExternalId(externalId string, config *sql.Options) (*models.Product, *utils.ApplictaionError)

func (*ProductService) RetrieveByHandle

func (s *ProductService) RetrieveByHandle(productHandle string, config *sql.Options) (*models.Product, *utils.ApplictaionError)

func (*ProductService) RetrieveById

func (s *ProductService) RetrieveById(id uuid.UUID, config *sql.Options) (*models.Product, *utils.ApplictaionError)

func (*ProductService) RetrieveOptionByTitle

func (s *ProductService) RetrieveOptionByTitle(title string, id uuid.UUID) (*models.ProductOption, *utils.ApplictaionError)

func (*ProductService) RetrieveVariants

func (s *ProductService) RetrieveVariants(id uuid.UUID, config *sql.Options) ([]models.ProductVariant, *utils.ApplictaionError)

func (*ProductService) SetContext

func (s *ProductService) SetContext(context context.Context) *ProductService

func (*ProductService) Update

func (*ProductService) UpdateOption

func (s *ProductService) UpdateOption(id uuid.UUID, optionId uuid.UUID, data *types.ProductOptionInput) (*models.Product, *utils.ApplictaionError)

func (*ProductService) UpdateShippingProfile

func (s *ProductService) UpdateShippingProfile(productIds uuid.UUIDs, profileId uuid.UUID) ([]models.Product, *utils.ApplictaionError)

type ProductTagService

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

func NewProductTagService

func NewProductTagService(
	r Registry,
) *ProductTagService

func (*ProductTagService) Create

func (*ProductTagService) List

func (*ProductTagService) ListAndCount

func (*ProductTagService) Retrieve

func (*ProductTagService) SetContext

func (s *ProductTagService) SetContext(context context.Context) *ProductTagService

type ProductTaxRateService

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

func NewProductTaxRateService

func NewProductTaxRateService(
	r Registry,
) *ProductTaxRateService

func (*ProductTaxRateService) List

func (*ProductTaxRateService) SetContext

type ProductTypeService

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

func NewProductTypeService

func NewProductTypeService(
	r Registry,
) *ProductTypeService

func (*ProductTypeService) List

func (*ProductTypeService) ListAndCount

func (*ProductTypeService) Retrieve

func (*ProductTypeService) SetContext

func (s *ProductTypeService) SetContext(context context.Context) *ProductTypeService

type ProductVariantInventoryService

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

func NewProductVariantInventoryService

func NewProductVariantInventoryService(
	r Registry,
) *ProductVariantInventoryService

func (*ProductVariantInventoryService) AdjustInventory

func (s *ProductVariantInventoryService) AdjustInventory(variantId uuid.UUID, locationId uuid.UUID, quantity int) *utils.ApplictaionError

func (*ProductVariantInventoryService) AdjustReservationsQuantityByLineItem

func (s *ProductVariantInventoryService) AdjustReservationsQuantityByLineItem(lineItemId uuid.UUID, variantId uuid.UUID, locationId uuid.UUID, quantity int) *utils.ApplictaionError

func (*ProductVariantInventoryService) AttachInventoryItem

func (*ProductVariantInventoryService) ConfirmInventory

func (s *ProductVariantInventoryService) ConfirmInventory(variantId uuid.UUID, quantity int, context map[string]interface{}) (bool, *utils.ApplictaionError)

func (*ProductVariantInventoryService) DeleteReservationsByLineItem

func (s *ProductVariantInventoryService) DeleteReservationsByLineItem(lineItemId uuid.UUID, variantId uuid.UUID, quantity int) *utils.ApplictaionError

func (*ProductVariantInventoryService) DetachInventoryItem

func (s *ProductVariantInventoryService) DetachInventoryItem(inventoryItemId uuid.UUID, variantId uuid.UUID) *utils.ApplictaionError

func (*ProductVariantInventoryService) GetAvailabilityContext

func (s *ProductVariantInventoryService) GetAvailabilityContext(variants []models.ProductVariant, salesChannelId uuid.UUIDs, existingContext *AvailabilityContext) (*AvailabilityContext, *utils.ApplictaionError)

func (*ProductVariantInventoryService) GetVariantQuantityFromVariantInventoryItems

func (s *ProductVariantInventoryService) GetVariantQuantityFromVariantInventoryItems(variantInventoryItems []models.ProductVariantInventoryItem, channelId uuid.UUID) (*int, *utils.ApplictaionError)

func (*ProductVariantInventoryService) ListByItem

func (*ProductVariantInventoryService) ListByVariant

func (*ProductVariantInventoryService) ListInventoryItemsByVariant

func (s *ProductVariantInventoryService) ListInventoryItemsByVariant(variantId uuid.UUID) ([]interfaces.InventoryItemDTO, *utils.ApplictaionError)

func (*ProductVariantInventoryService) ListVariantsByItem

func (*ProductVariantInventoryService) ReserveQuantity

func (*ProductVariantInventoryService) Retrieve

func (*ProductVariantInventoryService) SetContext

func (*ProductVariantInventoryService) SetProductAvailability

func (s *ProductVariantInventoryService) SetProductAvailability(products []models.Product, salesChannelId uuid.UUIDs) ([]models.Product, *utils.ApplictaionError)

func (*ProductVariantInventoryService) SetVariantAvailability

func (s *ProductVariantInventoryService) SetVariantAvailability(variants []models.ProductVariant, salesChannelId uuid.UUIDs, availabilityContext *AvailabilityContext) ([]models.ProductVariant, *utils.ApplictaionError)

func (*ProductVariantInventoryService) ValidateInventoryAtLocation

func (s *ProductVariantInventoryService) ValidateInventoryAtLocation(items []models.LineItem, locationId uuid.UUID) *utils.ApplictaionError

type ProductVariantService

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

func NewProductVariantService

func NewProductVariantService(
	r Registry,
) *ProductVariantService

func (*ProductVariantService) AddOptionValue

func (s *ProductVariantService) AddOptionValue(id uuid.UUID, optionId uuid.UUID, optionValue string) (*models.ProductOptionValue, *utils.ApplictaionError)

addOptionValue adds option value to a variant

func (*ProductVariantService) Create

func (*ProductVariantService) Delete

func (s *ProductVariantService) Delete(variantIds uuid.UUIDs) *utils.ApplictaionError

Delete deletes the variant

func (*ProductVariantService) DeleteOptionValue

func (s *ProductVariantService) DeleteOptionValue(id uuid.UUID, optionId uuid.UUID) *utils.ApplictaionError

deleteOptionValue deletes option value from given variant

func (*ProductVariantService) GetRegionPrice

getRegionPrice gets the price specific to a region

func (*ProductVariantService) IsVariantInSalesChannels

func (s *ProductVariantService) IsVariantInSalesChannels(id uuid.UUID, salesChannelIds uuid.UUIDs) (bool, *utils.ApplictaionError)

IsVariantInSalesChannels checks if the variant is assigned to at least one of the provided sales channels

func (*ProductVariantService) List

list lists the variants

func (*ProductVariantService) ListAndCount

ListAndCount lists and counts the variants

func (*ProductVariantService) Retrieve

func (*ProductVariantService) RetrieveBySKU

func (s *ProductVariantService) RetrieveBySKU(sku string, config *sql.Options) (*models.ProductVariant, *utils.ApplictaionError)

func (*ProductVariantService) SetContext

func (*ProductVariantService) SetCurrencyPrice

setCurrencyPrice sets the default price for the given currency

func (*ProductVariantService) SetRegionPrice

setRegionPrice sets the default price of a specific region

func (*ProductVariantService) Update

func (*ProductVariantService) UpdateBatch

func (*ProductVariantService) UpdateOptionValue

func (s *ProductVariantService) UpdateOptionValue(id uuid.UUID, optionId uuid.UUID, optionValue string) (*models.ProductOptionValue, *utils.ApplictaionError)

updateOptionValue updates variant's option value

func (*ProductVariantService) UpdateVariantPrices

func (*ProductVariantService) UpsertCurrencyPrices

func (*ProductVariantService) UpsertRegionPrices

func (*ProductVariantService) ValidateVariantsToCreate

func (s *ProductVariantService) ValidateVariantsToCreate(product *models.Product, variants []types.CreateProductVariantInput) *utils.ApplictaionError

ValidateVariantsToCreate validates the variants to Create

type PublishableApiKeyService

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

func NewPublishableApiKeyService

func NewPublishableApiKeyService(
	r Registry,
) *PublishableApiKeyService

func (*PublishableApiKeyService) AddSalesChannels

func (s *PublishableApiKeyService) AddSalesChannels(id uuid.UUID, salesChannelIds uuid.UUIDs) *utils.ApplictaionError

func (*PublishableApiKeyService) Create

func (*PublishableApiKeyService) Delete

func (*PublishableApiKeyService) GetResourceScopes

func (*PublishableApiKeyService) IsValid

func (*PublishableApiKeyService) ListAndCount

func (*PublishableApiKeyService) ListSalesChannels

func (*PublishableApiKeyService) RemoveSalesChannels

func (s *PublishableApiKeyService) RemoveSalesChannels(id uuid.UUID, salesChannelIds uuid.UUIDs) *utils.ApplictaionError

func (*PublishableApiKeyService) Retrieve

func (*PublishableApiKeyService) RetrieveById

func (*PublishableApiKeyService) Revoke

func (s *PublishableApiKeyService) Revoke(id uuid.UUID, loggedInUserId uuid.UUID) *utils.ApplictaionError

func (*PublishableApiKeyService) SetContext

func (*PublishableApiKeyService) Update

type RegionService

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

func NewRegionService

func NewRegionService(
	r Registry,
) *RegionService

func (*RegionService) AddCountry

func (s *RegionService) AddCountry(regionId uuid.UUID, code string) (*models.Region, *utils.ApplictaionError)

func (*RegionService) AddFulfillmentProvider

func (s *RegionService) AddFulfillmentProvider(regionId uuid.UUID, providerId uuid.UUID) (*models.Region, *utils.ApplictaionError)

func (*RegionService) AddPaymentProvider

func (s *RegionService) AddPaymentProvider(regionId uuid.UUID, providerId uuid.UUID) (*models.Region, *utils.ApplictaionError)

func (*RegionService) Create

func (*RegionService) Delete

func (s *RegionService) Delete(regionId uuid.UUID) *utils.ApplictaionError

func (*RegionService) List

func (*RegionService) ListAndCount

func (s *RegionService) ListAndCount(selector *types.FilterableRegion, config *sql.Options) ([]models.Region, *int64, *utils.ApplictaionError)

func (*RegionService) RemoveCountry

func (s *RegionService) RemoveCountry(regionId uuid.UUID, code string) (*models.Region, *utils.ApplictaionError)

func (*RegionService) RemoveFulfillmentProvider

func (s *RegionService) RemoveFulfillmentProvider(regionId uuid.UUID, providerId uuid.UUID) (*models.Region, *utils.ApplictaionError)

func (*RegionService) RemovePaymentProvider

func (s *RegionService) RemovePaymentProvider(regionId uuid.UUID, providerId uuid.UUID) (*models.Region, *utils.ApplictaionError)

func (*RegionService) Retrieve

func (s *RegionService) Retrieve(regionId uuid.UUID, config *sql.Options) (*models.Region, *utils.ApplictaionError)

func (*RegionService) RetrieveByCountryCode

func (s *RegionService) RetrieveByCountryCode(code string, config *sql.Options) (*models.Region, *utils.ApplictaionError)

func (*RegionService) RetrieveByName

func (s *RegionService) RetrieveByName(name string) (*models.Region, *utils.ApplictaionError)

func (*RegionService) SetContext

func (s *RegionService) SetContext(context context.Context) *RegionService

func (*RegionService) Update

func (s *RegionService) Update(regionId uuid.UUID, Update *types.UpdateRegionInput) (*models.Region, *utils.ApplictaionError)

type Registry

type Registry interface {
	Context() *gorm.DB
	Manager(ctx context.Context) *gorm.DB
	Config() *config.Config

	//Repository
	AddressRepository() *repository.AddressRepo
	AnalyticsConfigRepository() *repository.AnalyticsConfigRepo
	BatchJobRepository() *repository.BatchJobRepo
	CartRepository() *repository.CartRepo
	ClaimImageRepository() *repository.ClaimImageRepo
	ClaimItemRepository() *repository.ClaimItemRepo
	ClaimTagRepository() *repository.ClaimTagRepo
	ClaimRepository() *repository.ClaimRepo
	CountryRepository() *repository.CountryRepo
	CurrencyRepository() *repository.CurrencyRepo
	CustomShippingOptionRepository() *repository.CustomShippingOptionRepo
	CustomerGroupRepository() *repository.CustomerGroupRepo
	CustomerRepository() *repository.CustomerRepo
	DiscountConditionRepository() *repository.DiscountConditionRepo
	DiscountRuleRepository() *repository.DiscountRuleRepo
	DiscountRepository() *repository.DiscountRepo
	DraftOrderRepository() *repository.DraftOrderRepo
	FulfillmentProviderRepository() *repository.FulfillmentProviderRepo
	FulfillmentRepository() *repository.FulfillmentRepo
	GiftCardTransactionRepository() *repository.GiftCardTransactionRepo
	GiftCardRepository() *repository.GiftCardRepo
	IdempotencyKeyRepository() *repository.IdempotencyKeyRepo
	ImageRepository() *repository.ImageRepo
	InviteRepository() *repository.InviteRepo
	LineItemAdjustmentRepository() *repository.LineItemAdjustmentRepo
	LineItemTaxLineRepository() *repository.LineItemTaxLineRepo
	LineItemRepository() *repository.LineItemRepo
	MoneyAmountRepository() *repository.MoneyAmountRepo
	NoteRepository() *repository.NoteRepo
	NotificationProviderRepository() *repository.NotificationProviderRepo
	NotificationRepository() *repository.NotificationRepo
	OAuthRepository() *repository.OAuthRepo
	OrderEditRepository() *repository.OrderEditRepo
	OrderItemChangeRepository() *repository.OrderItemChangeRepo
	OrderRepository() *repository.OrderRepo
	PaymentCollectionRepository() *repository.PaymentCollectionRepo
	PaymentProviderRepository() *repository.PaymentProviderRepo
	PaymentSessionRepository() *repository.PaymentSessionRepo
	PaymentRepository() *repository.PaymentRepo
	PriceListRepository() *repository.PriceListRepo
	ProductCategoryRepository() *repository.ProductCategoryRepo
	ProductCollectionRepository() *repository.ProductCollectionRepo
	ProductOptionValueRepository() *repository.ProductOptionValueRepo
	ProductOptionRepository() *repository.ProductOptionRepo
	ProductTagRepository() *repository.ProductTagRepo
	ProductTaxRateRepository() *repository.ProductTaxRateRepo
	ProductTypeRepository() *repository.ProductTypeRepo
	ProductVariantInventoryItemRepository() *repository.ProductVariantInventoryItem
	ProductVariantRepository() *repository.ProductVariantRepo
	ProductRepository() *repository.ProductRepo
	PublishableApiKeySalesChannelRepository() *repository.PublishableApiKeySalesChannelRepo
	PublishableApiKeyRepository() *repository.PublishableApiKeyRepo
	RefundRepository() *repository.RefundRepo
	RegionRepository() *repository.RegionRepo
	ReturnItemRepository() *repository.ReturnItemRepo
	ReturnReasonRepository() *repository.ReturnReasonRepo
	ReturnRepository() *repository.ReturnRepo
	SalesChannelLocationRepository() *repository.SalesChannelLocationRepo
	SalesChannelRepository() *repository.SalesChannelRepo
	ShippingMethodTaxLineRepository() *repository.ShippingMethodTaxLineRepo
	ShippingMethodRepository() *repository.ShippingMethodRepo
	ShippingOptionRequirementRepository() *repository.ShippingOptionRequirementRepo
	ShippingOptionRepository() *repository.ShippingOptionRepo
	ShippingProfileRepository() *repository.ShippingProfileRepo
	ShippingTaxRateRepository() *repository.ShippingTaxRateRepo
	StagedJobRepository() *repository.StagedJobRepo
	StoreRepository() *repository.StoreRepo
	SwapRepository() *repository.SwapRepo
	TaxProviderRepository() *repository.TaxProviderRepo
	TaxRateRepository() *repository.TaxRateRepo
	TrackingLinkRepository() *repository.TrackingLinkRepo
	UserRepository() *repository.UserRepo

	//Services
	AnalyticsConfigService() *AnalyticsConfigService
	AuthService() *AuthService
	BatchJobService() *BatchJobService
	CartService() *CartService
	ClaimItemService() *ClaimItemService
	ClaimService() *ClaimService
	CsvParserService() *CsvParserService
	CurrencyService() *CurrencyService
	CustomShippingOptionService() *CustomShippingOptionService
	CustomerGroupService() *CustomerGroupService
	CustomerService() *CustomerService
	DiscountConditionService() *DiscountConditionService
	DiscountService() *DiscountService
	DraftOrderService() *DraftOrderService
	EventBus() *Bus
	DefaultFileService() *DefaultFileService
	FulfillmentProviderService() *FulfillmentProviderService
	FulfillmentService() *FulfillmentService
	GiftCardService() *GiftCardService
	IdempotencyKeyService() *IdempotencyKeyService
	InviteService() *InviteService
	LineItemAdjustmentService() *LineItemAdjustmentService
	LineItemService() *LineItemService
	NewTotalsService() *NewTotalsService
	NoteService() *NoteService
	NotificationService() *NotificationService
	OAuthService() *OAuthService
	OrderItemChangeService() *OrderItemChangeService
	OrderEditService() *OrderEditService
	OrderService() *OrderService
	PaymentCollectionService() *PaymentCollectionService
	PaymentProviderService() *PaymentProviderService
	PaymentService() *PaymentService
	PriceListService() *PriceListService
	PricingService() *PricingService
	ProductCategoryService() *ProductCategoryService
	ProductCollectionService() *ProductCollectionService
	ProductTagService() *ProductTagService
	ProductTaxRateService() *ProductTaxRateService
	ProductTypeService() *ProductTypeService
	ProductVariantInventoryService() *ProductVariantInventoryService
	ProductVariantService() *ProductVariantService
	ProductService() *ProductService
	PublishableApiKeyService() *PublishableApiKeyService
	RegionService() *RegionService
	ReturnReasonService() *ReturnReasonService
	ReturnService() *ReturnService
	SalesChannelInventoryService() *SalesChannelInventoryService
	SalesChannelLocationService() *SalesChannelLocationService
	SalesChannelService() *SalesChannelService
	DefaultSearchService() *DefaultSearchService
	ShippingOptionService() *ShippingOptionService
	ShippingProfileService() *ShippingProfileService
	ShippingTaxRateService() *ShippingTaxRateService
	StagedJobService() *StagedJobService
	StoreService() *StoreService
	StrategyResolverService() *StrategyResolverService
	SwapService() *SwapService
	SystemProviderService() *SystemProviderService
	SystemTaxService() *SystemTaxService
	TaxProviderService() *TaxProviderService
	TaxRateService() *TaxRateService
	TockenService() *TockenService
	TotalsService() *TotalsService
	UserService() *UserService

	//Interfaces
	PriceSelectionStrategy() interfaces.IPriceSelectionStrategy
	TaxCalculationStrategy() interfaces.ITaxCalculationStrategy
	InventoryService() interfaces.IInventoryService
	StockLocationService() interfaces.IStockLocationService
	CacheService() interfaces.ICacheService
	PricingModuleService() interfaces.IPricingModuleService
	BatchJobStrategy() interfaces.IBatchJobStrategy
}

type ReserveQuantityContext

type ReserveQuantityContext struct {
	LocationId     uuid.UUID
	LineItemId     uuid.UUID
	SalesChannelId uuid.UUID
}

type ReturnReasonService

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

func NewReturnReasonService

func NewReturnReasonService(
	r Registry,
) *ReturnReasonService

func (*ReturnReasonService) Create

func (*ReturnReasonService) Delete

func (s *ReturnReasonService) Delete(returnReasonId uuid.UUID) *utils.ApplictaionError

func (*ReturnReasonService) List

func (*ReturnReasonService) Retrieve

func (s *ReturnReasonService) Retrieve(returnReasonId uuid.UUID, config *sql.Options) (*models.ReturnReason, *utils.ApplictaionError)

func (*ReturnReasonService) SetContext

func (s *ReturnReasonService) SetContext(context context.Context) *ReturnReasonService

func (*ReturnReasonService) Update

type ReturnService

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

func NewReturnService

func NewReturnService(
	r Registry,
) *ReturnService

func (*ReturnService) Cancel

func (s *ReturnService) Cancel(returnId uuid.UUID) (*models.Return, *utils.ApplictaionError)

func (*ReturnService) Create

func (*ReturnService) Fulfill

func (s *ReturnService) Fulfill(returnId uuid.UUID) (*models.Return, *utils.ApplictaionError)

func (*ReturnService) GetFulfillmentItems

func (s *ReturnService) GetFulfillmentItems(order *models.Order, items []types.OrderReturnItem, transformer Transformer) ([]models.ReturnItem, *utils.ApplictaionError)

func (*ReturnService) List

func (*ReturnService) ListAndCount

func (s *ReturnService) ListAndCount(selector *types.FilterableReturn, config *sql.Options) ([]models.Return, *int64, *utils.ApplictaionError)

func (*ReturnService) Receive

func (s *ReturnService) Receive(returnId uuid.UUID, receivedItems []types.OrderReturnItem, refundAmount *float64, allowMismatch bool, context map[string]interface{}) (*models.Return, *utils.ApplictaionError)

func (*ReturnService) Retrieve

func (s *ReturnService) Retrieve(returnId uuid.UUID, config *sql.Options) (*models.Return, *utils.ApplictaionError)

func (*ReturnService) RetrieveBySwap

func (s *ReturnService) RetrieveBySwap(swapId uuid.UUID, relations []string) (*models.Return, *utils.ApplictaionError)

func (*ReturnService) SetContext

func (s *ReturnService) SetContext(context context.Context) *ReturnService

func (*ReturnService) Update

func (*ReturnService) ValidateReturnLineItem

func (s *ReturnService) ValidateReturnLineItem(item *models.LineItem, quantity int, additional *types.OrderReturnItem) (*models.ReturnItem, *utils.ApplictaionError)

func (*ReturnService) ValidateReturnStatuses

func (s *ReturnService) ValidateReturnStatuses(order *models.Order) *utils.ApplictaionError

type SalesChannelInventoryService

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

func NewSalesChannelInventoryService

func NewSalesChannelInventoryService(
	r Registry,
) *SalesChannelInventoryService

func (*SalesChannelInventoryService) RetrieveAvailableItemQuantity

func (s *SalesChannelInventoryService) RetrieveAvailableItemQuantity(salesChannelId uuid.UUID, inventoryItemId uuid.UUID) (int, *utils.ApplictaionError)

func (*SalesChannelInventoryService) SetContext

type SalesChannelLocationService

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

func NewSalesChannelLocationService

func NewSalesChannelLocationService(
	r Registry,
) *SalesChannelLocationService

func (*SalesChannelLocationService) AssociateLocation

func (s *SalesChannelLocationService) AssociateLocation(salesChannelId uuid.UUID, locationId uuid.UUID) *utils.ApplictaionError

func (*SalesChannelLocationService) ListLocationIds

func (s *SalesChannelLocationService) ListLocationIds(salesChannelId uuid.UUIDs) (uuid.UUIDs, *utils.ApplictaionError)

func (*SalesChannelLocationService) ListSalesChannelIds

func (s *SalesChannelLocationService) ListSalesChannelIds(locationId uuid.UUID) (uuid.UUIDs, *utils.ApplictaionError)

func (*SalesChannelLocationService) RemoveLocation

func (s *SalesChannelLocationService) RemoveLocation(salesChannelId uuid.UUID, locationId uuid.UUID) *utils.ApplictaionError

func (*SalesChannelLocationService) SetContext

type SalesChannelService

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

func NewSalesChannelService

func NewSalesChannelService(
	r Registry,
) *SalesChannelService

func (*SalesChannelService) AddProducts

func (s *SalesChannelService) AddProducts(salesChannelId uuid.UUID, productIds uuid.UUIDs) (*models.SalesChannel, *utils.ApplictaionError)

func (*SalesChannelService) Create

func (*SalesChannelService) CreateDefault

func (*SalesChannelService) Delete

func (s *SalesChannelService) Delete(salesChannelId uuid.UUID) *utils.ApplictaionError

func (*SalesChannelService) List

func (*SalesChannelService) ListAndCount

func (*SalesChannelService) ListProductIdsBySalesChannelIds

func (s *SalesChannelService) ListProductIdsBySalesChannelIds(salesChannelIds uuid.UUIDs) (map[string][]string, *utils.ApplictaionError)

func (*SalesChannelService) RemoveProducts

func (s *SalesChannelService) RemoveProducts(salesChannelId uuid.UUID, productIds uuid.UUIDs) (*models.SalesChannel, *utils.ApplictaionError)

func (*SalesChannelService) Retrieve

func (*SalesChannelService) RetrieveById

func (s *SalesChannelService) RetrieveById(salesChannelId uuid.UUID, config *sql.Options) (*models.SalesChannel, *utils.ApplictaionError)

func (*SalesChannelService) RetrieveByName

func (s *SalesChannelService) RetrieveByName(name string, config *sql.Options) (*models.SalesChannel, *utils.ApplictaionError)

func (*SalesChannelService) RetrieveDefault

func (s *SalesChannelService) RetrieveDefault() (*models.SalesChannel, *utils.ApplictaionError)

func (*SalesChannelService) SetContext

func (s *SalesChannelService) SetContext(context context.Context) *SalesChannelService

func (*SalesChannelService) Update

type ShippingMethodTotals

type ShippingMethodTotals struct {
	Price            float64
	TaxTotal         float64
	Total            float64
	Subtotal         float64
	OriginalTotal    float64
	OriginalTaxTotal float64
	TaxLines         []models.ShippingMethodTaxLine
}

type ShippingOptionService

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

func NewShippingOptionService

func NewShippingOptionService(
	r Registry,
) *ShippingOptionService

func (*ShippingOptionService) AddRequirement

func (*ShippingOptionService) Create

func (*ShippingOptionService) CreateShippingMethod

func (s *ShippingOptionService) CreateShippingMethod(optionId uuid.UUID, data map[string]interface{}, config *types.CreateShippingMethodDto) (*models.ShippingMethod, *utils.ApplictaionError)

func (*ShippingOptionService) Delete

func (s *ShippingOptionService) Delete(optionId uuid.UUID) *utils.ApplictaionError

func (*ShippingOptionService) DeleteShippingMethods

func (s *ShippingOptionService) DeleteShippingMethods(shippingMethods []models.ShippingMethod) *utils.ApplictaionError

func (*ShippingOptionService) GetPrice

func (*ShippingOptionService) List

func (*ShippingOptionService) ListAndCount

func (*ShippingOptionService) RemoveRequirement

func (s *ShippingOptionService) RemoveRequirement(requirementId uuid.UUID) (*models.ShippingOptionRequirement, *utils.ApplictaionError)

func (*ShippingOptionService) Retrieve

func (*ShippingOptionService) SetContext

func (*ShippingOptionService) Update

func (*ShippingOptionService) UpdateShippingMethod

func (*ShippingOptionService) UpdateShippingProfile

func (s *ShippingOptionService) UpdateShippingProfile(optionIds uuid.UUIDs, profileId uuid.UUID) ([]models.ShippingOption, *utils.ApplictaionError)

func (*ShippingOptionService) ValidateCartOption

func (*ShippingOptionService) ValidateRequirement

type ShippingProfileService

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

func NewShippingProfileService

func NewShippingProfileService(
	r Registry,
) *ShippingProfileService

func (*ShippingProfileService) AddProduct

func (s *ShippingProfileService) AddProduct(profileId uuid.UUID, productId uuid.UUID) (*models.ShippingProfile, *utils.ApplictaionError)

func (*ShippingProfileService) AddProducts

func (s *ShippingProfileService) AddProducts(profileId uuid.UUID, productIds uuid.UUIDs) (*models.ShippingProfile, *utils.ApplictaionError)

func (*ShippingProfileService) AddShippingOption

func (s *ShippingProfileService) AddShippingOption(profileId uuid.UUID, optionId uuid.UUID) (*models.ShippingProfile, *utils.ApplictaionError)

func (*ShippingProfileService) AddShippingOptions

func (s *ShippingProfileService) AddShippingOptions(profileId uuid.UUID, optionIds uuid.UUIDs) (*models.ShippingProfile, *utils.ApplictaionError)

func (*ShippingProfileService) Create

func (*ShippingProfileService) CreateDefault

func (*ShippingProfileService) CreateGiftCardDefault

func (s *ShippingProfileService) CreateGiftCardDefault() (*models.ShippingProfile, *utils.ApplictaionError)

func (*ShippingProfileService) Delete

func (s *ShippingProfileService) Delete(profileId uuid.UUID) *utils.ApplictaionError

func (*ShippingProfileService) FetchCartOptions

func (*ShippingProfileService) GetMapProfileIdsByProductIds

func (s *ShippingProfileService) GetMapProfileIdsByProductIds(productIds uuid.UUIDs) (*map[uuid.UUID]uuid.UUID, *utils.ApplictaionError)

func (*ShippingProfileService) GetProfilesInCart

func (s *ShippingProfileService) GetProfilesInCart(cart *models.Cart) (uuid.UUIDs, *utils.ApplictaionError)

func (*ShippingProfileService) List

func (*ShippingProfileService) RemoveProducts

func (s *ShippingProfileService) RemoveProducts(profileId uuid.UUID, productIds uuid.UUIDs) (*models.ShippingProfile, *utils.ApplictaionError)

func (*ShippingProfileService) Retrieve

func (*ShippingProfileService) RetrieveDefault

func (*ShippingProfileService) RetrieveForProducts

func (s *ShippingProfileService) RetrieveForProducts(productIds uuid.UUIDs) (map[string]models.ShippingProfile, *utils.ApplictaionError)

func (*ShippingProfileService) RetrieveGiftCardDefault

func (s *ShippingProfileService) RetrieveGiftCardDefault() (*models.ShippingProfile, *utils.ApplictaionError)

func (*ShippingProfileService) SetContext

func (*ShippingProfileService) Update

type ShippingTaxRateService

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

func NewShippingTaxRateService

func NewShippingTaxRateService(
	r Registry,
) *ShippingTaxRateService

func (*ShippingTaxRateService) List

func (*ShippingTaxRateService) SetContext

type StagedJobService

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

func NewStagedJobService

func NewStagedJobService(r Registry) *StagedJobService

func (*StagedJobService) Create

func (*StagedJobService) Delete

func (s *StagedJobService) Delete(stagedJobIds uuid.UUIDs) *utils.ApplictaionError

func (*StagedJobService) List

func (*StagedJobService) SetContext

func (s *StagedJobService) SetContext(context context.Context) *StagedJobService

type StoreService

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

func NewStoreService

func NewStoreService(
	r Registry,
) *StoreService

func (*StoreService) AddCurrency

func (s *StoreService) AddCurrency(code string) (*models.Store, *utils.ApplictaionError)

func (*StoreService) Create

func (s *StoreService) Create() (*models.Store, *utils.ApplictaionError)

func (*StoreService) GetDefaultCurrency

func (s *StoreService) GetDefaultCurrency(code string) *models.Currency

func (*StoreService) RemoveCurrency

func (s *StoreService) RemoveCurrency(code string) (*models.Store, *utils.ApplictaionError)

func (*StoreService) Retrieve

func (s *StoreService) Retrieve(config *sql.Options) (*models.Store, *utils.ApplictaionError)

func (*StoreService) SetContext

func (s *StoreService) SetContext(context context.Context) *StoreService

func (*StoreService) Update

type StrategyResolverService

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

func NewStrategyResolverService

func NewStrategyResolverService() *StrategyResolverService

func (*StrategyResolverService) SetContext

type SwapService

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

func NewSwapService

func NewSwapService(
	r Registry,
) *SwapService

func (*SwapService) AreReturnItemsValid

func (s *SwapService) AreReturnItemsValid(returnItems []types.OrderReturnItem) (bool, *utils.ApplictaionError)

func (*SwapService) Cancel

func (s *SwapService) Cancel(swapId uuid.UUID) (*models.Swap, *utils.ApplictaionError)

func (*SwapService) CancelFulfillment

func (s *SwapService) CancelFulfillment(fulfillmentId uuid.UUID) (*models.Swap, *utils.ApplictaionError)

func (*SwapService) Create

func (s *SwapService) Create(order *models.Order, returnItems []types.OrderReturnItem, additionalItems []types.CreateClaimItemAdditionalItemInput, returnShipping *types.CreateClaimReturnShippingInput, custom map[string]interface{}) (*models.Swap, *utils.ApplictaionError)

func (*SwapService) CreateCart

func (s *SwapService) CreateCart(swapId uuid.UUID, customShippingOptions []types.CreateCustomShippingOptionInput, context map[string]interface{}) (*models.Swap, *utils.ApplictaionError)

func (*SwapService) CreateFulfillment

func (s *SwapService) CreateFulfillment(swapId uuid.UUID, config *types.CreateShipmentConfig) (*models.Swap, *utils.ApplictaionError)

func (*SwapService) CreateShipment

func (s *SwapService) CreateShipment(swapId uuid.UUID, fulfillmentId uuid.UUID, trackingLinks []models.TrackingLink, config *types.CreateShipmentConfig) (*models.Swap, *utils.ApplictaionError)

func (*SwapService) DeleteMetadata

func (s *SwapService) DeleteMetadata(swapId string, key string) (*models.Swap, *utils.ApplictaionError)

func (*SwapService) List

func (s *SwapService) List(selector *types.FilterableSwap, config *sql.Options) ([]models.Swap, *utils.ApplictaionError)

func (*SwapService) ListAndCount

func (s *SwapService) ListAndCount(selector *types.FilterableSwap, config *sql.Options) ([]models.Swap, *int64, *utils.ApplictaionError)

func (*SwapService) ProcessDifference

func (s *SwapService) ProcessDifference(swapId uuid.UUID) (*models.Swap, *utils.ApplictaionError)

func (*SwapService) RegisterCartCompletion

func (s *SwapService) RegisterCartCompletion(swapId uuid.UUID) (*models.Swap, *utils.ApplictaionError)

func (*SwapService) RegisterReceived

func (s *SwapService) RegisterReceived(id uuid.UUID) (*models.Swap, *utils.ApplictaionError)

func (*SwapService) Retrieve

func (s *SwapService) Retrieve(swapId uuid.UUID, config *sql.Options) (*models.Swap, *utils.ApplictaionError)

func (*SwapService) RetrieveByCartId

func (s *SwapService) RetrieveByCartId(cartId uuid.UUID, relations []string) (*models.Swap, *utils.ApplictaionError)

func (*SwapService) SetContext

func (s *SwapService) SetContext(context context.Context) *SwapService

func (*SwapService) Update

func (s *SwapService) Update(swapId uuid.UUID, Update *models.Swap) (*models.Swap, *utils.ApplictaionError)

type SystemProviderService

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

func NewSystemProviderService

func NewSystemProviderService() *SystemProviderService

func (*SystemProviderService) AuthorizePayment

func (s *SystemProviderService) AuthorizePayment() map[string]interface{}

func (*SystemProviderService) CancelPayment

func (s *SystemProviderService) CancelPayment() map[string]interface{}

func (*SystemProviderService) CapturePayment

func (s *SystemProviderService) CapturePayment() map[string]interface{}

func (*SystemProviderService) CreatePayment

func (s *SystemProviderService) CreatePayment() map[string]interface{}

func (*SystemProviderService) DeletePayment

func (s *SystemProviderService) DeletePayment() map[string]interface{}

func (*SystemProviderService) GetPaymentData

func (s *SystemProviderService) GetPaymentData() map[string]interface{}

func (*SystemProviderService) GetStatus

func (s *SystemProviderService) GetStatus() string

func (*SystemProviderService) RefundPayment

func (s *SystemProviderService) RefundPayment() map[string]interface{}

func (*SystemProviderService) SetContext

func (*SystemProviderService) UpdatePayment

func (s *SystemProviderService) UpdatePayment() map[string]interface{}

func (*SystemProviderService) UpdatePaymentData

func (s *SystemProviderService) UpdatePaymentData() map[string]interface{}

type SystemTaxService

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

func NewSystemTaxService

func NewSystemTaxService(r Registry) *SystemTaxService

func (*SystemTaxService) SetContext

func (s *SystemTaxService) SetContext(context context.Context) *SystemTaxService

type TaxProviderService

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

func NewTaxProviderService

func NewTaxProviderService(
	container di.Container,
	r Registry,
) *TaxProviderService

func (*TaxProviderService) ClearLineItemsTaxLines

func (s *TaxProviderService) ClearLineItemsTaxLines(itemIds uuid.UUIDs) *utils.ApplictaionError

func (*TaxProviderService) ClearTaxLines

func (s *TaxProviderService) ClearTaxLines(cartId uuid.UUID) *utils.ApplictaionError

func (*TaxProviderService) CreateShippingTaxLines

func (s *TaxProviderService) CreateShippingTaxLines(shippingMethod *models.ShippingMethod, calculationContext *interfaces.TaxCalculationContext) ([]models.ShippingMethodTaxLine, *utils.ApplictaionError)

func (*TaxProviderService) CreateTaxLines

func (*TaxProviderService) GetCacheKey

func (s *TaxProviderService) GetCacheKey(id uuid.UUID, regionId uuid.UUID) string

func (*TaxProviderService) GetRegionRatesForProduct

func (s *TaxProviderService) GetRegionRatesForProduct(productIds uuid.UUIDs, region *models.Region) (map[uuid.UUID][]types.TaxServiceRate, *utils.ApplictaionError)

func (*TaxProviderService) GetRegionRatesForShipping

func (s *TaxProviderService) GetRegionRatesForShipping(optionId uuid.UUID, region *models.Region) ([]types.TaxServiceRate, *utils.ApplictaionError)

func (*TaxProviderService) GetShippingTaxLines

func (s *TaxProviderService) GetShippingTaxLines(shippingMethod *models.ShippingMethod, calculationContext *interfaces.TaxCalculationContext) ([]models.ShippingMethodTaxLine, *utils.ApplictaionError)

func (*TaxProviderService) GetTaxLines

func (*TaxProviderService) GetTaxLinesMap

func (s *TaxProviderService) GetTaxLinesMap(items []models.LineItem, calculationContext *interfaces.TaxCalculationContext) (types.TaxLinesMaps, *utils.ApplictaionError)

func (*TaxProviderService) List

func (*TaxProviderService) ListAndCount

func (s *TaxProviderService) ListAndCount(selector *models.TaxProvider, config *sql.Options) ([]models.TaxProvider, *int64, *utils.ApplictaionError)

func (*TaxProviderService) RegisterInstalledProviders

func (s *TaxProviderService) RegisterInstalledProviders(providers uuid.UUIDs) *utils.ApplictaionError

func (*TaxProviderService) RetrieveProvider

func (s *TaxProviderService) RetrieveProvider(region models.Region) interfaces.ITaxService

func (*TaxProviderService) SetContext

func (s *TaxProviderService) SetContext(context context.Context) *TaxProviderService

type TaxRateService

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

func NewTaxRateService

func NewTaxRateService(
	r Registry,
) *TaxRateService

func (*TaxRateService) AddToProduct

func (s *TaxRateService) AddToProduct(id uuid.UUID, productIds uuid.UUIDs, replace bool) ([]models.ProductTaxRate, *utils.ApplictaionError)

func (*TaxRateService) AddToProductType

func (s *TaxRateService) AddToProductType(id uuid.UUID, productTypeIds uuid.UUIDs, replace bool) ([]models.ProductTypeTaxRate, *utils.ApplictaionError)

func (*TaxRateService) AddToShippingOption

func (s *TaxRateService) AddToShippingOption(id uuid.UUID, optionIds uuid.UUIDs, replace bool) ([]models.ShippingTaxRate, *utils.ApplictaionError)

func (*TaxRateService) Create

func (*TaxRateService) Delete

func (*TaxRateService) List

func (*TaxRateService) ListAndCount

func (s *TaxRateService) ListAndCount(selector *types.FilterableTaxRate, config *sql.Options) ([]models.TaxRate, int64, *utils.ApplictaionError)

func (*TaxRateService) ListByProduct

func (s *TaxRateService) ListByProduct(productId uuid.UUID, config types.TaxRateListByConfig) ([]models.TaxRate, *utils.ApplictaionError)

func (*TaxRateService) ListByShippingOption

func (s *TaxRateService) ListByShippingOption(shippingOptionId uuid.UUID) ([]models.TaxRate, *utils.ApplictaionError)

func (*TaxRateService) RemoveFromProduct

func (s *TaxRateService) RemoveFromProduct(id uuid.UUID, productIds uuid.UUIDs) *utils.ApplictaionError

func (*TaxRateService) RemoveFromProductType

func (s *TaxRateService) RemoveFromProductType(id uuid.UUID, typeIds uuid.UUIDs) *utils.ApplictaionError

func (*TaxRateService) RemoveFromShippingOption

func (s *TaxRateService) RemoveFromShippingOption(id uuid.UUID, optionIds uuid.UUIDs) *utils.ApplictaionError

func (*TaxRateService) Retrieve

func (s *TaxRateService) Retrieve(taxRateId uuid.UUID, config *sql.Options) (*models.TaxRate, *utils.ApplictaionError)

func (*TaxRateService) SetContext

func (s *TaxRateService) SetContext(context context.Context) *TaxRateService

func (*TaxRateService) Update

type TockenService

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

func NewTockenService

func NewTockenService(secretKey []byte) *TockenService

func (*TockenService) SetContext

func (s *TockenService) SetContext(context context.Context) *TockenService

func (*TockenService) SignToken

func (s *TockenService) SignToken(data map[string]interface{}) (*string, error)

func (*TockenService) SignTokenWithSecret

func (s *TockenService) SignTokenWithSecret(data map[string]interface{}, secret []byte) (*string, error)

func (*TockenService) VerifyToken

func (s *TockenService) VerifyToken(tocken string) (*jwt.Token, jwt.MapClaims, error)

func (*TockenService) VerifyTokenWithSecret

func (s *TockenService) VerifyTokenWithSecret(tocken string, secret []byte) (*jwt.Token, jwt.MapClaims, error)

type Total

type Total struct {
	Total    float64
	TaxTotal float64
}

type TotalsConfig

type TotalsConfig struct {
	ForceTaxes bool
}

type TotalsService

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

func NewTotalService

func NewTotalService(
	r Registry,
) *TotalsService

func (*TotalsService) CalculateDiscount

func (s *TotalsService) CalculateDiscount(lineItem models.LineItem, variant uuid.UUID, variantPrice float64, value float64, discountType models.DiscountRuleType) types.LineDiscount

func (*TotalsService) GetAllocationItemDiscounts

func (s *TotalsService) GetAllocationItemDiscounts(discount models.Discount, cart models.Cart) []types.LineDiscount

func (*TotalsService) GetAllocationMap

func (s *TotalsService) GetAllocationMap(calculationContextData types.CalculationContextData, options AllocationMapOptions) (types.LineAllocationsMap, *utils.ApplictaionError)

func (*TotalsService) GetCalculationContext

func (s *TotalsService) GetCalculationContext(calculationContextData types.CalculationContextData, options CalculationContextOptions) (*interfaces.TaxCalculationContext, *utils.ApplictaionError)

func (*TotalsService) GetDiscountTotal

func (s *TotalsService) GetDiscountTotal(cart *models.Cart, order *models.Order) (float64, *utils.ApplictaionError)

func (*TotalsService) GetGiftCardTotal

func (s *TotalsService) GetGiftCardTotal(cart *models.Cart, order *models.Order, opts map[string]interface{}) (*Total, *utils.ApplictaionError)

func (*TotalsService) GetGiftCardableAmount

func (s *TotalsService) GetGiftCardableAmount(cart *models.Cart, order *models.Order) (float64, *utils.ApplictaionError)

func (*TotalsService) GetLineDiscounts

func (s *TotalsService) GetLineDiscounts(calculationContextData types.CalculationContextData, discount models.Discount) []types.LineDiscountAmount

func (*TotalsService) GetLineItemAdjustmentsTotal

func (s *TotalsService) GetLineItemAdjustmentsTotal(cart *models.Cart, order *models.Order) float64

func (*TotalsService) GetLineItemDiscountAdjustment

func (s *TotalsService) GetLineItemDiscountAdjustment(lineItem models.LineItem, discount models.Discount) float64

func (*TotalsService) GetLineItemRefund

func (s *TotalsService) GetLineItemRefund(order *models.Order, lineItem models.LineItem) (float64, *utils.ApplictaionError)

func (*TotalsService) GetLineItemTotal

func (s *TotalsService) GetLineItemTotal(lineItem models.LineItem, cart *models.Cart, order *models.Order, options GetLineItemTotalOptions) (float64, *utils.ApplictaionError)

func (*TotalsService) GetLineItemTotals

func (s *TotalsService) GetLineItemTotals(lineItem models.LineItem, cart *models.Cart, order *models.Order, options *LineItemTotalsOptions) (*models.LineItem, *utils.ApplictaionError)

func (*TotalsService) GetPaidTotal

func (s *TotalsService) GetPaidTotal(order *models.Order) float64

func (*TotalsService) GetRefundTotal

func (s *TotalsService) GetRefundTotal(order *models.Order, lineItems []models.LineItem) (float64, *utils.ApplictaionError)

func (*TotalsService) GetRefundedTotal

func (s *TotalsService) GetRefundedTotal(order *models.Order) float64

func (*TotalsService) GetShippingMethodTotals

func (s *TotalsService) GetShippingMethodTotals(shippingMethod models.ShippingMethod, cart *models.Cart, order *models.Order, opts GetShippingMethodTotalsOptions) (*ShippingMethodTotals, *utils.ApplictaionError)

func (*TotalsService) GetShippingTotal

func (s *TotalsService) GetShippingTotal(cart *models.Cart, order *models.Order) (float64, *utils.ApplictaionError)

func (*TotalsService) GetSubtotal

func (s *TotalsService) GetSubtotal(cart *models.Cart, order *models.Order, opts types.SubtotalOptions) (float64, *utils.ApplictaionError)

func (*TotalsService) GetSwapTotal

func (s *TotalsService) GetSwapTotal(order *models.Order) float64

func (*TotalsService) GetTaxTotal

func (s *TotalsService) GetTaxTotal(cart *models.Cart, order *models.Order, forceTaxes bool) (float64, *utils.ApplictaionError)

func (*TotalsService) GetTotal

func (s *TotalsService) GetTotal(cart *models.Cart, order *models.Order, options GetTotalsOptions) (float64, *utils.ApplictaionError)

func (*TotalsService) Rounded

func (s *TotalsService) Rounded(value float64) float64

func (*TotalsService) SetContext

func (s *TotalsService) SetContext(context context.Context) *TotalsService

type TotalsServiceProps

type TotalsServiceProps struct {
	TaxProviderService     TaxProviderService
	NewTotalsService       NewTotalsService
	TaxCalculationStrategy interfaces.ITaxCalculationStrategy
}

type Transformer

type Transformer func(item *models.LineItem, quantity int, additional *types.OrderReturnItem) (*models.ReturnItem, *utils.ApplictaionError)

TODO:OrdersReturnItem

type UserService

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

func NewUserService

func NewUserService(
	r Registry,
) *UserService

func (*UserService) Create

func (*UserService) Delete

func (s *UserService) Delete(userId uuid.UUID) *utils.ApplictaionError

func (*UserService) GenerateResetPasswordToken

func (s *UserService) GenerateResetPasswordToken(userId uuid.UUID) (*string, *utils.ApplictaionError)

func (*UserService) HashPassword

func (s *UserService) HashPassword(password string) (string, error)

func (*UserService) List

func (s *UserService) List(selector *types.FilterableUser, config *sql.Options) ([]models.User, *utils.ApplictaionError)

func (*UserService) ListAndCount

func (s *UserService) ListAndCount(selector *types.FilterableUser, config *sql.Options) ([]models.User, *int64, *utils.ApplictaionError)

func (*UserService) Retrieve

func (s *UserService) Retrieve(userId uuid.UUID, config *sql.Options) (*models.User, *utils.ApplictaionError)

func (*UserService) RetrieveByApiToken

func (s *UserService) RetrieveByApiToken(apiToken string, relations []string) (*models.User, *utils.ApplictaionError)

func (*UserService) RetrieveByEmail

func (s *UserService) RetrieveByEmail(email string, config *sql.Options) (*models.User, *utils.ApplictaionError)

func (*UserService) SetContext

func (s *UserService) SetContext(context context.Context) *UserService

func (*UserService) SetPassword

func (s *UserService) SetPassword(userId uuid.UUID, password string) (*models.User, *utils.ApplictaionError)

func (*UserService) Update

func (s *UserService) Update(userId uuid.UUID, data *types.UpdateUserInput) (*models.User, *utils.ApplictaionError)

Jump to

Keyboard shortcuts

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