fake

package
v3.10.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProductService

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

ProductService is just mocking stuff

func (*ProductService) FakeBundle added in v3.6.0

func (ps *ProductService) FakeBundle(marketplaceCode string, isNew bool, isExclusive bool, isOutOfStock bool, isDiscounted bool, hasFixedPrice bool) domain.BundleProduct

FakeBundle generates a bundle fake product

func (*ProductService) FakeSimple

func (ps *ProductService) FakeSimple(marketplaceCode string, isNew bool, isExclusive bool, isOutOfStock bool, isDiscounted bool, hasFixedPrice bool) domain.SimpleProduct

FakeSimple generates a simple fake product

func (*ProductService) Get

func (ps *ProductService) Get(_ context.Context, marketplaceCode string) (domain.BasicProduct, error)

Get returns a product struct

func (*ProductService) GetMarketPlaceCodes added in v3.4.0

func (ps *ProductService) GetMarketPlaceCodes() []string

GetMarketPlaceCodes returns list of available marketplace codes which are supported by this fakeservice

func (*ProductService) Inject

func (ps *ProductService) Inject(logger flamingo.Logger,
	c *struct {
		CurrencyCode            string   `inject:"config:commerce.product.fakeservice.currency,optional"`
		TestDataFolder          string   `inject:"config:commerce.product.fakeservice.jsonTestDataFolder,optional"`
		DeliveryDefaultProducts bool     `inject:"config:commerce.product.fakeservice.defaultProducts,optional"`
		DeliveryCodes           []string `inject:"config:commerce.product.fakeservice.deliveryCodes,optional"`
	},
) *ProductService

Inject dependencies

type SearchService

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

SearchService is just mocking stuff

func (*SearchService) Inject

func (s *SearchService) Inject(
	productService *ProductService,
	cfg *struct {
		LiveSearchJSON         string `inject:"config:commerce.product.fakeservice.jsonTestDataLiveSearch,optional"`
		CategoryFacetItemsJSON string `inject:"config:commerce.product.fakeservice.jsonTestDataCategoryFacetItems,optional"`
	},
) *SearchService

Inject dependencies

func (*SearchService) Search

func (s *SearchService) Search(ctx context.Context, filters ...searchDomain.Filter) (*domain.SearchResult, error)

Search returns Products based on given Filters

func (*SearchService) SearchBy

func (s *SearchService) SearchBy(ctx context.Context, attribute string, _ []string, filters ...searchDomain.Filter) (*domain.SearchResult, error)

SearchBy returns Products prefiltered by the given attribute (also based on additional given Filters)

Jump to

Keyboard shortcuts

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