Documentation ¶
Index ¶
Constants ¶
View Source
const (
// ExternalSourceIDKey specifies the key for the ItemUpdateCommand.AdditionalData map where the external source id should be stored
ExternalSourceIDKey = "external_source_id"
)
Variables ¶
View Source
var ( // ErrInsufficientSourceQty - use to indicate that the requested qty exceeds the available qty ErrInsufficientSourceQty = errors.New("Available Source Qty insufficient") // ErrNoSourceAvailable - use to indicate that no source for item is available at all ErrNoSourceAvailable = errors.New("No Available Source Qty") )
Functions ¶
This section is empty.
Types ¶
type Source ¶
type Source struct { // LocationCode identifies the warehouse or stock location LocationCode string // Qty for the sources items Qty int // ExternalLocationCode identifies the source location in an external system ExternalLocationCode string }
Source represents the Sourcing info Deprecated: Sourcing moved to separate module
type Sources ¶
type Sources []Source
Sources is the result value object containing all sources (for the request item or product) Deprecated: Sourcing moved to separate module
func (Sources) MainLocation ¶
MainLocation returns first sourced location (or empty string)
type SourcingEngine ¶
type SourcingEngine struct { SourcingService SourcingService `inject:",optional"` Logger flamingo.Logger `inject:""` Cartservice *application.CartService `inject:""` }
SourcingEngine computes item sources Deprecated: Sourcing moved to separate module
func (*SourcingEngine) SetSourcesForCartItems ¶
func (se *SourcingEngine) SetSourcesForCartItems(ctx context.Context, session *web.Session, decoratedCart *decorator.DecoratedCart) error
SetSourcesForCartItems gets Sources and modifies the Cart Items todo move to application layer ?
type SourcingService ¶
type SourcingService interface { //GetSourceID returns one source location code where the product should be sourced //@todo will be Deprecated in future in favor of SourcingServiceDetail interface GetSourceID(ctx context.Context, session *web.Session, decoratedCart *decorator.DecoratedCart, deliveryCode string, item *decorator.DecoratedCartItem) (string, error) }
SourcingService helps in retrieving item sources Deprecated: Sourcing moved to separate module
type SourcingServiceDetail ¶
type SourcingServiceDetail interface { //GetSourcesForItem returns Sources for the given item in the cart GetSourcesForItem(ctx context.Context, session *web.Session, decoratedCart *decorator.DecoratedCart, deliveryCode string, item *decorator.DecoratedCartItem) (Sources, error) //GetAvailableSources returns Sources for the product - containing the maximum possible qty per source GetAvailableSources(ctx context.Context, session *web.Session, decoratedCart *decorator.DecoratedCart, deliveryCode string, product domain.BasicProduct) (Sources, error) }
SourcingServiceDetail additional interface to return Deprecated: Sourcing moved to separate module
Click to show internal directories.
Click to hide internal directories.