Documentation ¶
Index ¶
- type PackSplitter
- type ProductService
- func (s *ProductService) CreatePackSizes(ctx context.Context, createPackSizes *payloads.ChangePackSizesPayload) ([]*models.PackSize, error)
- func (s *ProductService) CreateProductOrder(ctx context.Context, createProduct *payloads.CreateProductOrderPayload) ([]*payloads.CreatedPackOrderPayload, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PackSplitter ¶
type PackSplitter struct {
// contains filtered or unexported fields
}
PackSplitter represents an instance of the package splitting algorithm
func NewPackSplitter ¶
func NewPackSplitter(packSizes []int, order int) *PackSplitter
NewPackSplitter creates a new PackSplitter instance
func (*PackSplitter) SplitOrderIntoPacks ¶
func (p *PackSplitter) SplitOrderIntoPacks() map[int]int
SplitOrderIntoPacks splits the order amount into packs using PackSplitter.packSizes
type ProductService ¶
type ProductService struct {
// contains filtered or unexported fields
}
ProductService is a struct that contains references to the dependencies
func GetProductServiceDefaultInstance ¶
func GetProductServiceDefaultInstance() *ProductService
GetProductServiceDefaultInstance returns the default instance of ProductService
func (*ProductService) CreatePackSizes ¶
func (s *ProductService) CreatePackSizes(ctx context.Context, createPackSizes *payloads.ChangePackSizesPayload) ([]*models.PackSize, error)
CreatePackSizes creates a product order using the provided payload
func (*ProductService) CreateProductOrder ¶
func (s *ProductService) CreateProductOrder(ctx context.Context, createProduct *payloads.CreateProductOrderPayload) ([]*payloads.CreatedPackOrderPayload, error)
CreateProductOrder creates a product order using the provided payload
Click to show internal directories.
Click to hide internal directories.