price

package
v0.0.0-...-a08dd98 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateFinalPrice

func CalculateFinalPrice(item priceCalculatorItem, action admodels.Action) billing.Money

CalculateFinalPrice returns final price for the item which is including all possible commissions with all corrections

Formula:

FinalPrice = Price - SourceCorrectionFactor[%] - TargetCorrectionFactor[%]

func CalculateInternalAuctionBid

func CalculateInternalAuctionBid(item priceCalculatorItem) billing.Money

CalculateInternalAuctionBid returns price for the internal auction. Normaly it's the ECPM value, with correction (in case of external source) and without any system comission

func CalculateNewBidPrice

func CalculateNewBidPrice(price billing.Money, item priceCalculatorItem) billing.Money

CalculateNewBidPrice returns new bid price for the target with system comission and with source corrections

func CalculatePotentialPrice

func CalculatePotentialPrice(item priceCalculatorItem, action admodels.Action) billing.Money

CalculatePotentialPrice returns the base price without any corrections or commissions

Formula:

PotentialPrice = Price

func CalculatePurchasePrice

func CalculatePurchasePrice(item priceCalculatorItem, action admodels.Action) billing.Money

CalculatePurchasePrice returns purchase price for the target whithout system comission and with any corrections

Formula:

PurchasePrice = Price - SourceCorrectionFactor[%] - TargetCorrectionFactor[%] - CommissionShareFactor[%]

Types

type PriceScope

type PriceScope struct {
	// TestMode represents the flag for the test budget usage for the view price.
	TestMode bool `json:"test_mode,omitempty"`

	// MaxBidPrice represents the maximum price for the bid on the auction.
	MaxBidPrice billing.Money `json:"max_bid_price,omitempty"`

	// BidPrice represents the price for the bid on the auction. But charged will be by ViewPrice
	BidPrice billing.Money `json:"bid_price,omitempty"`

	// ViewPrice represents the price for the view action.
	ViewPrice billing.Money `json:"view_price,omitempty"`

	// ClickPrice represents the price for the click action.
	ClickPrice billing.Money `json:"click_price,omitempty"`

	// LeadPrice represents the price for the lead action.
	LeadPrice billing.Money `json:"lead_price,omitempty"`

	// ECPM represents the price for the 1000 views.
	ECPM billing.Money `json:"ecpm,omitempty"`
}

func (*PriceScope) PricePerAction

func (ps *PriceScope) PricePerAction(actionType admodels.Action) billing.Money

PricePerAction returns the price for the action type.

func (*PriceScope) SetBidPrice

func (ps *PriceScope) SetBidPrice(price billing.Money, maxIfZero bool) bool

SetBidPrice sets the price for the bid on the auction.

func (*PriceScope) SetViewPrice

func (ps *PriceScope) SetViewPrice(price billing.Money, maxIfZero bool) bool

SetViewPrice sets the price for the view action.

type PriceScopeView

type PriceScopeView struct {
	// MaxBidPrice represents the maximum price for the bid on the auction.
	MaxBidPrice billing.Money `json:"max_bid_price,omitempty"`

	// BidPrice represents the price for the bid on the auction. But charged will be by ViewPrice
	BidPrice billing.Money `json:"bid_price,omitempty"`

	// ViewPrice represents the price for the view action.
	ViewPrice billing.Money `json:"view_price,omitempty"`

	// ECPM represents the price for the 1000 views.
	ECPM billing.Money `json:"ecpm,omitempty"`
}

func (*PriceScopeView) PricePerAction

func (ps *PriceScopeView) PricePerAction(actionType admodels.Action) billing.Money

PricePerAction returns the price for the action type.

func (*PriceScopeView) SetBidPrice

func (ps *PriceScopeView) SetBidPrice(price billing.Money, maxIfZero bool) bool

SetBidPrice sets the price for the bid on the auction.

func (*PriceScopeView) SetViewPrice

func (ps *PriceScopeView) SetViewPrice(price billing.Money, maxIfZero bool) bool

SetViewPrice sets the price for the view action.

Jump to

Keyboard shortcuts

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