Documentation
¶
Overview ¶
Package consignprice implements ts-consignprice-service from the original train ticket application
Index ¶
- type ConsignPrice
- type ConsignPriceService
- type ConsignPriceServiceImpl
- func (c *ConsignPriceServiceImpl) CreateAndModifyPriceConfig(ctx context.Context, priceConfig ConsignPrice) (ConsignPrice, error)
- func (c *ConsignPriceServiceImpl) GetPriceByWeightAndRegion(ctx context.Context, weight float64, isWithinRegion bool) (float64, error)
- func (c *ConsignPriceServiceImpl) GetPriceConfig(ctx context.Context) (ConsignPrice, error)
- func (c *ConsignPriceServiceImpl) GetPriceInfo(ctx context.Context) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsignPrice ¶
type ConsignPriceService ¶
type ConsignPriceService interface { // Calculates the price of the consignment based on the weight and the region GetPriceByWeightAndRegion(ctx context.Context, weight float64, isWithinRegion bool) (float64, error) // Get the price configuration for calculating consignment prices as a string GetPriceInfo(ctx context.Context) (string, error) // Get the price configuration for calculating consignment prices GetPriceConfig(ctx context.Context) (ConsignPrice, error) // Creates a price config or modifies the existing price configuration CreateAndModifyPriceConfig(ctx context.Context, priceConfig ConsignPrice) (ConsignPrice, error) }
ConsignPriceService manages the prices of consignments
type ConsignPriceServiceImpl ¶
type ConsignPriceServiceImpl struct {
// contains filtered or unexported fields
}
func NewConsignPriceServiceImpl ¶
func NewConsignPriceServiceImpl(ctx context.Context, db backend.NoSQLDatabase) (*ConsignPriceServiceImpl, error)
func (*ConsignPriceServiceImpl) CreateAndModifyPriceConfig ¶
func (c *ConsignPriceServiceImpl) CreateAndModifyPriceConfig(ctx context.Context, priceConfig ConsignPrice) (ConsignPrice, error)
func (*ConsignPriceServiceImpl) GetPriceByWeightAndRegion ¶
func (*ConsignPriceServiceImpl) GetPriceConfig ¶
func (c *ConsignPriceServiceImpl) GetPriceConfig(ctx context.Context) (ConsignPrice, error)
func (*ConsignPriceServiceImpl) GetPriceInfo ¶
func (c *ConsignPriceServiceImpl) GetPriceInfo(ctx context.Context) (string, error)
Click to show internal directories.
Click to hide internal directories.