atg.commerce.pricing
Class ItemPriceSource

java.lang.Object
  extended by atg.commerce.pricing.ItemPriceSource
All Implemented Interfaces:
java.io.Serializable

public class ItemPriceSource
extends java.lang.Object
implements java.io.Serializable

This object is used to specify a pricefor a product and sku combination that will be used in place of the current day price source, such as a price list. Objects of this type can be passed to a pricing operation through the extra parameters map using the parameter name defined by the constant PricingConstants.PRICING_OVERRIDES_PARAM.

The properties of this object define the unit prices needed by each calculator to generate an item's price.

PricingTools provides an API to generate a List of these objects based on the pricing information contained in an Order. This is useful for maintaining the original prices of an Order is subsequent pricing operations or carrying prices from a submitted order to a new order.

See Also:
PricingConstants, PricingTools.generateItemPriceSources(Order, Map), Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected  java.util.Map mAttributes
           
protected  java.lang.String mCommerceItemClassType
           
protected  java.lang.String mCurrencyCode
           
protected  long mLastListTierQuantityAdjusted
           
protected  long mLastSaleTierQuantityAdjusted
           
protected  java.lang.Double mListPrice
           
protected  java.util.List mListVolumeLevels
           
protected  boolean mOnSale
           
protected  java.lang.String mParentSkuId
           
protected  RepositoryItem mPriceList
           
protected  java.lang.String mPriceListScheme
           
protected  java.lang.String mProductId
           
protected  java.lang.Double mSalePrice
           
protected  java.util.List mSaleVolumeLevels
           
protected  java.lang.String mSkuId
           
 
Constructor Summary
ItemPriceSource(java.lang.String pProductId, java.lang.String pSkuId, java.lang.String pParentSkuId, java.lang.String pCommerceItemType, java.lang.String pCurrencyCode)
          The only constructor that requires a currency code.
 
Method Summary
 void addAttribute(java.lang.Object pKey, java.io.Serializable pAttribute)
          Adds an attribute.
 java.lang.Object getAttribute(java.lang.Object pKey)
          Gets an attribute.
 java.lang.String getCommerceItemClassType()
          The class type of the commerce item to which this source should apply.
 java.lang.String getCurrencyCode()
          Returns the currency code for which this ItemPriceSource applies.
 long getLastListTierQuantityAdjusted()
          This contains the quantity of the last adjustment used to generate the last list tier.
 long getLastSaleTierQuantityAdjusted()
          This contains the quantity of the last adjustment used to generate the last sale tier.
 java.lang.Double getListPrice()
          The list price used to price the item.
 java.util.List getListVolumeLevels()
          The List of price level repository items used by the volume based list price calculator to price the item.
 java.lang.String getParentSkuId()
          The parent sku id to which the override applies.
 RepositoryItem getPriceList()
          The price list that will be set in the ItemPriceInfo.
 java.lang.String getPriceListScheme()
          The scheme name used to which this price source applies.
 java.lang.String getProductId()
          The product id to which the override applies
 java.lang.Double getSalePrice()
          The sale price used to price the item
 java.util.List getSaleVolumeLevels()
          The List of price level repository items used by the volume based sale price calculator to price the item.
 java.lang.String getSkuId()
          The sku id to which the override applies
 boolean isItemMatch(CommerceItem pCommerceItem, CommerceItem pParentCommerceItem)
          Matches the price source to the given item and parent item.
 boolean isOnSale()
          True if this source contains sale pricing information
 void removeAttribute(java.lang.Object pKey)
          Removes an attribute.
 void setCommerceItemClassType(java.lang.String pCommerceItemClassType)
           
 void setCurrencyCode(java.lang.String pCurrencyCode)
           
 void setLastListTierQuantityAdjusted(long pLastListTierQuantityAdjusted)
           
 void setLastSaleTierQuantityAdjusted(long pLastSaleTierQuantityAdjusted)
           
 void setListPrice(java.lang.Double pListPrice)
           
 void setListVolumeLevels(java.util.List pVolumeLevels)
           
 void setOnSale(boolean pOnSale)
           
 void setParentSkuId(java.lang.String pParentSkuId)
           
 void setPriceList(RepositoryItem pPriceList)
           
 void setPriceListScheme(java.lang.String pPriceListScheme)
           
 void setProductId(java.lang.String pProductId)
           
 void setSalePrice(java.lang.Double pSalePrice)
           
 void setSaleVolumeLevels(java.util.List pSaleVolumeLevels)
           
 void setSkuId(java.lang.String pSkuId)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


mCurrencyCode

protected java.lang.String mCurrencyCode

mPriceList

protected RepositoryItem mPriceList

mCommerceItemClassType

protected java.lang.String mCommerceItemClassType

mOnSale

protected boolean mOnSale

mPriceListScheme

protected java.lang.String mPriceListScheme

mProductId

protected java.lang.String mProductId

mSkuId

protected java.lang.String mSkuId

mParentSkuId

protected java.lang.String mParentSkuId

mAttributes

protected java.util.Map mAttributes

mListPrice

protected java.lang.Double mListPrice

mSalePrice

protected java.lang.Double mSalePrice

mListVolumeLevels

protected java.util.List mListVolumeLevels

mLastListTierQuantityAdjusted

protected long mLastListTierQuantityAdjusted

mSaleVolumeLevels

protected java.util.List mSaleVolumeLevels

mLastSaleTierQuantityAdjusted

protected long mLastSaleTierQuantityAdjusted
Constructor Detail

ItemPriceSource

public ItemPriceSource(java.lang.String pProductId,
                       java.lang.String pSkuId,
                       java.lang.String pParentSkuId,
                       java.lang.String pCommerceItemType,
                       java.lang.String pCurrencyCode)
The only constructor that requires a currency code.

Parameters:
pCurrencyCode - the currency code for which this source applies.
Method Detail

getCurrencyCode

public java.lang.String getCurrencyCode()
Returns the currency code for which this ItemPriceSource applies. This must match the currency code of the Order being priced when the pricing engine maps the ItemPriceSource objects to items in the Order


setCurrencyCode

public void setCurrencyCode(java.lang.String pCurrencyCode)

getPriceList

public RepositoryItem getPriceList()
The price list that will be set in the ItemPriceInfo.

Returns:

setPriceList

public void setPriceList(RepositoryItem pPriceList)

getCommerceItemClassType

public java.lang.String getCommerceItemClassType()
The class type of the commerce item to which this source should apply.


setCommerceItemClassType

public void setCommerceItemClassType(java.lang.String pCommerceItemClassType)

isOnSale

public boolean isOnSale()
True if this source contains sale pricing information


setOnSale

public void setOnSale(boolean pOnSale)

getPriceListScheme

public java.lang.String getPriceListScheme()
The scheme name used to which this price source applies. The price list based calculators use this value to execute the appropriate scheme calculator when consuming the override.


setPriceListScheme

public void setPriceListScheme(java.lang.String pPriceListScheme)

getProductId

public java.lang.String getProductId()
The product id to which the override applies


setProductId

public void setProductId(java.lang.String pProductId)

getSkuId

public java.lang.String getSkuId()
The sku id to which the override applies


setSkuId

public void setSkuId(java.lang.String pSkuId)

getParentSkuId

public java.lang.String getParentSkuId()
The parent sku id to which the override applies. This property is used when matching overrides to SubSkuItems


setParentSkuId

public void setParentSkuId(java.lang.String pParentSkuId)

addAttribute

public void addAttribute(java.lang.Object pKey,
                         java.io.Serializable pAttribute)
Adds an attribute.

Parameters:
pKey - the key to identifiying the attribute
Serializable - the attribute object

getAttribute

public java.lang.Object getAttribute(java.lang.Object pKey)
Gets an attribute.

Parameters:
pKey - the key that identifies the attribute

removeAttribute

public void removeAttribute(java.lang.Object pKey)
Removes an attribute.

Parameters:
pKey - the key that identifies the attribute

getListPrice

public java.lang.Double getListPrice()
The list price used to price the item.

Returns:

setListPrice

public void setListPrice(java.lang.Double pListPrice)

getSalePrice

public java.lang.Double getSalePrice()
The sale price used to price the item

Returns:

setSalePrice

public void setSalePrice(java.lang.Double pSalePrice)

getListVolumeLevels

public java.util.List getListVolumeLevels()
The List of price level repository items used by the volume based list price calculator to price the item.


setListVolumeLevels

public void setListVolumeLevels(java.util.List pVolumeLevels)

getLastListTierQuantityAdjusted

public long getLastListTierQuantityAdjusted()
This contains the quantity of the last adjustment used to generate the last list tier. This value is used to calculate the starting quantity for the next tier when the tiering spans multiple items in the order.


setLastListTierQuantityAdjusted

public void setLastListTierQuantityAdjusted(long pLastListTierQuantityAdjusted)

getSaleVolumeLevels

public java.util.List getSaleVolumeLevels()
The List of price level repository items used by the volume based sale price calculator to price the item.


setSaleVolumeLevels

public void setSaleVolumeLevels(java.util.List pSaleVolumeLevels)

getLastSaleTierQuantityAdjusted

public long getLastSaleTierQuantityAdjusted()
This contains the quantity of the last adjustment used to generate the last sale tier. This value is used to calculate the starting quantity for the next tier when the tiering spans multiple items in the order.


setLastSaleTierQuantityAdjusted

public void setLastSaleTierQuantityAdjusted(long pLastSaleTierQuantityAdjusted)

isItemMatch

public boolean isItemMatch(CommerceItem pCommerceItem,
                           CommerceItem pParentCommerceItem)
Matches the price source to the given item and parent item.

In this implemenation, the product id, sku id, class type, and parent sku id must match for true to be returned

This method is used by the ItemPricingEngine when mapping ItemPriceSource objects to the commerce items being priced.

Parameters:
pCommerceItem - the commerce item to which the ItemPriceSource must match
pParentCommerceItem - the parent commerce item to which the ItemPriceSource must match
Returns:
true if the match is successful

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object