Documentation ¶
Index ¶
- func CalculateFinalPrice(item priceCalculatorItem, action admodels.Action) billing.Money
- func CalculateInternalAuctionBid(item priceCalculatorItem) billing.Money
- func CalculateNewBidPrice(price billing.Money, item priceCalculatorItem) billing.Money
- func CalculatePotentialPrice(item priceCalculatorItem, action admodels.Action) billing.Money
- func CalculatePurchasePrice(item priceCalculatorItem, action admodels.Action) billing.Money
- type PriceScope
- type PriceScopeView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateFinalPrice ¶
CalculateFinalPrice returns final price for the item which is including all possible commissions with all corrections
Formula:
FinalPrice = Price - SourceCorrectionFactor[%] - TargetCorrectionFactor[%]
func CalculateInternalAuctionBid ¶
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 ¶
CalculateNewBidPrice returns new bid price for the target with system comission and with source corrections
func CalculatePotentialPrice ¶
CalculatePotentialPrice returns the base price without any corrections or commissions
Formula:
PotentialPrice = Price
func CalculatePurchasePrice ¶
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.