consignprice

package
v0.0.0-...-9a5c20e Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: BSD-3-Clause Imports: 5 Imported by: 1

README

consignprice

import "github.com/blueprint-uservices/blueprint/examples/train_ticket/workflow/consignprice"

Package consignprice implements ts-consignprice-service from the original train ticket application

Index

type ConsignPrice

type ConsignPrice struct {
    ID            string
    Index         int64
    InitialWeight float64
    InitialPrice  float64
    WithinPrice   float64
    BeyondPrice   float64
}

type ConsignPriceService

ConsignPriceService manages the prices of consignments

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)
}

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 (c *ConsignPriceServiceImpl) GetPriceByWeightAndRegion(ctx context.Context, weight float64, isWithinRegion bool) (float64, error)

func (*ConsignPriceServiceImpl) GetPriceConfig
func (c *ConsignPriceServiceImpl) GetPriceConfig(ctx context.Context) (ConsignPrice, error)

func (*ConsignPriceServiceImpl) GetPriceInfo
func (c *ConsignPriceServiceImpl) GetPriceInfo(ctx context.Context) (string, error)

Generated by gomarkdoc

Documentation

Overview

Package consignprice implements ts-consignprice-service from the original train ticket application

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsignPrice

type ConsignPrice struct {
	ID            string
	Index         int64
	InitialWeight float64
	InitialPrice  float64
	WithinPrice   float64
	BeyondPrice   float64
}

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 (*ConsignPriceServiceImpl) CreateAndModifyPriceConfig

func (c *ConsignPriceServiceImpl) CreateAndModifyPriceConfig(ctx context.Context, priceConfig ConsignPrice) (ConsignPrice, error)

func (*ConsignPriceServiceImpl) GetPriceByWeightAndRegion

func (c *ConsignPriceServiceImpl) GetPriceByWeightAndRegion(ctx context.Context, weight float64, isWithinRegion bool) (float64, error)

func (*ConsignPriceServiceImpl) GetPriceConfig

func (c *ConsignPriceServiceImpl) GetPriceConfig(ctx context.Context) (ConsignPrice, error)

func (*ConsignPriceServiceImpl) GetPriceInfo

func (c *ConsignPriceServiceImpl) GetPriceInfo(ctx context.Context) (string, error)

Jump to

Keyboard shortcuts

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