com.konakartadmin.app
Class AdminPromotion

java.lang.Object
  extended by com.konakartadmin.app.AdminPromotion
All Implemented Interfaces:
AdminObjectIf

public class AdminPromotion
extends java.lang.Object
implements AdminObjectIf

This is the Promotion class - it contains information about the promotion; links it to the Order Total module that is used to calculate the promotion, and identifies to what products and customers the promotion applies.


Field Summary
private  boolean active
          Boolean that defines whether the promotion is active
private  AdminOrderProduct[] applicableProducts
          An array of OrderProducts to which the promotion can be applied
private  int categoryRule
          The rule for allowing products only from certain categories in the promotion.
private  AdminCoupon[] coupons
          A valid coupon[] for the promotion
private  boolean cumulative
          Boolean that defines whether the promotion is cumulative with other promotions.
private  java.lang.String custom1
          Custom fields
private  java.lang.String custom10
           
private  java.lang.String custom2
           
private  java.lang.String custom3
           
private  java.lang.String custom4
           
private  java.lang.String custom5
           
private  java.lang.String custom6
           
private  java.lang.String custom7
           
private  java.lang.String custom8
           
private  java.lang.String custom9
           
private  int customerGroupRule
          The rule for allowing customers belonging to customer groups to use the promotion.
private  int customerRule
          The rule for allowing customers to use the promotion.
private  java.util.Date dateAdded
          The value for the dateAdded field
private  java.lang.String description
          Description
private  java.util.Date endDate
          The date the promotion ends
private  int id
          The value for the promotionId field
private  java.util.Date lastModified
          The value for the lastModified field
private  int manufacturerRule
          The rule for allowing products only from certain manufacturers in the promotion.
private  int maxUse
          The maximum number of times that the promotion can be used by a single customer
private  java.lang.String name
          Name
private  int numCategories
          Number of categories included or excluded
private  int numCoupons
          Number of coupons included or excluded
private  int numCustomerGroups
          Number of customer groups included or excluded
private  int numCustomers
          Number of customers included or excluded
private  int numExpressions
          Number of expressions included
private  int numManufacturers
          Number of manufacturers included or excluded
private  int numProducts
          Number of products included or excluded
private  java.lang.String orderTotalCode
          The code of the Order Total module used to calculate the promotion
private  int productRule
          The rule for allowing only certain products in the promotion.
private  boolean requiresCoupon
          Promotion requires a coupon
private  java.util.Date startDate
          The date the promotion starts
 
Constructor Summary
AdminPromotion()
          Constructor
AdminPromotion(com.workingdogs.village.Record vr, org.apache.torque.util.Criteria c)
          Instantiates the attributes of the Promotion object from a Record object
 
Method Summary
 AdminOrderProduct[] getApplicableProducts()
           
 int getCategoryRule()
           
 AdminCoupon[] getCoupons()
           
 java.lang.String getCustom1()
           
 java.lang.String getCustom10()
           
 java.lang.String getCustom2()
           
 java.lang.String getCustom3()
           
 java.lang.String getCustom4()
           
 java.lang.String getCustom5()
           
 java.lang.String getCustom6()
           
 java.lang.String getCustom7()
           
 java.lang.String getCustom8()
           
 java.lang.String getCustom9()
           
 int getCustomerGroupRule()
           
 int getCustomerRule()
           
 java.util.Date getDateAdded()
           
 java.lang.String getDescription()
           
 java.util.Date getEndDate()
           
 int getId()
           
 java.util.Date getLastModified()
           
 int getManufacturerRule()
           
 int getMaxUse()
           
 java.lang.String getName()
           
 int getNumCategories()
           
 int getNumCoupons()
           
 int getNumCustomerGroups()
           
 int getNumCustomers()
           
 int getNumExpressions()
           
 int getNumManufacturers()
           
 int getNumProducts()
           
 java.lang.String getOrderTotalCode()
           
 int getProductRule()
           
 java.util.Date getStartDate()
           
 boolean getStatus()
           
 boolean isActive()
           
 boolean isCumulative()
           
 boolean isRequiresCoupon()
           
 void setActive(boolean active)
           
 void setApplicableProducts(AdminOrderProduct[] applicableProducts)
           
 void setCategoryRule(int categoryRule)
           
 void setCoupons(AdminCoupon[] coupons)
           
 void setCumulative(boolean cumulative)
           
 void setCustom1(java.lang.String custom1)
           
 void setCustom10(java.lang.String custom10)
           
 void setCustom2(java.lang.String custom2)
           
 void setCustom3(java.lang.String custom3)
           
 void setCustom4(java.lang.String custom4)
           
 void setCustom5(java.lang.String custom5)
           
 void setCustom6(java.lang.String custom6)
           
 void setCustom7(java.lang.String custom7)
           
 void setCustom8(java.lang.String custom8)
           
 void setCustom9(java.lang.String custom9)
           
 void setCustomerGroupRule(int customerGroupRule)
           
 void setCustomerRule(int customerRule)
           
 void setDateAdded(java.util.Date dateAdded)
           
 void setDescription(java.lang.String description)
           
 void setEndDate(java.util.Date endDate)
           
 void setId(int id)
           
 void setLastModified(java.util.Date lastModified)
           
 void setManufacturerRule(int manufacturerRule)
           
 void setMaxUse(int maxUse)
           
 void setName(java.lang.String name)
           
 void setNumCategories(int numCategories)
           
 void setNumCoupons(int numCoupons)
           
 void setNumCustomerGroups(int numCustomerGroups)
           
 void setNumCustomers(int numCustomers)
           
 void setNumExpressions(int numExpressions)
           
 void setNumManufacturers(int numManufacturers)
           
 void setNumProducts(int numProducts)
           
 void setOrderTotalCode(java.lang.String orderTotalCode)
           
 void setProductRule(int productRule)
           
 void setRequiresCoupon(boolean requiresCoupon)
           
 void setStartDate(java.util.Date startDate)
           
 java.lang.String toString()
           
 java.lang.String toStringBrief()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

id

private int id
The value for the promotionId field


description

private java.lang.String description
Description


name

private java.lang.String name
Name


orderTotalCode

private java.lang.String orderTotalCode
The code of the Order Total module used to calculate the promotion


active

private boolean active
Boolean that defines whether the promotion is active


cumulative

private boolean cumulative
Boolean that defines whether the promotion is cumulative with other promotions. Otherwise we always use the promotion that gives the biggest discount


requiresCoupon

private boolean requiresCoupon
Promotion requires a coupon


startDate

private java.util.Date startDate
The date the promotion starts


endDate

private java.util.Date endDate
The date the promotion ends


lastModified

private java.util.Date lastModified
The value for the lastModified field


dateAdded

private java.util.Date dateAdded
The value for the dateAdded field


maxUse

private int maxUse
The maximum number of times that the promotion can be used by a single customer


customerRule

private int customerRule
The rule for allowing customers to use the promotion. The rule parameter can take the following values:

customerGroupRule

private int customerGroupRule
The rule for allowing customers belonging to customer groups to use the promotion. The rule parameter can take the following values:

categoryRule

private int categoryRule
The rule for allowing products only from certain categories in the promotion. The rule parameter can take the following values:

manufacturerRule

private int manufacturerRule
The rule for allowing products only from certain manufacturers in the promotion. The rule parameter can take the following values:

productRule

private int productRule
The rule for allowing only certain products in the promotion. The rule parameter can take the following values:

custom1

private java.lang.String custom1
Custom fields


custom2

private java.lang.String custom2

custom3

private java.lang.String custom3

custom4

private java.lang.String custom4

custom5

private java.lang.String custom5

custom6

private java.lang.String custom6

custom7

private java.lang.String custom7

custom8

private java.lang.String custom8

custom9

private java.lang.String custom9

custom10

private java.lang.String custom10

applicableProducts

private AdminOrderProduct[] applicableProducts
An array of OrderProducts to which the promotion can be applied


coupons

private AdminCoupon[] coupons
A valid coupon[] for the promotion


numCustomers

private int numCustomers
Number of customers included or excluded


numCustomerGroups

private int numCustomerGroups
Number of customer groups included or excluded


numProducts

private int numProducts
Number of products included or excluded


numManufacturers

private int numManufacturers
Number of manufacturers included or excluded


numCategories

private int numCategories
Number of categories included or excluded


numCoupons

private int numCoupons
Number of coupons included or excluded


numExpressions

private int numExpressions
Number of expressions included

Constructor Detail

AdminPromotion

public AdminPromotion()
Constructor


AdminPromotion

public AdminPromotion(com.workingdogs.village.Record vr,
                      org.apache.torque.util.Criteria c)
               throws com.workingdogs.village.DataSetException
Instantiates the attributes of the Promotion object from a Record object

Parameters:
vr - Record containing data
c - Criteria containing column names
Throws:
com.workingdogs.village.DataSetException
Method Detail

toString

public java.lang.String toString()
Specified by:
toString in interface AdminObjectIf
Overrides:
toString in class java.lang.Object
Returns:
Returns a string containing the attributes of the Promotion object.

toStringBrief

public java.lang.String toStringBrief()
Returns:
Returns a string containing the attributes of the Promotion object.

isActive

public boolean isActive()
Returns:
Returns the active boolean

getStatus

public boolean getStatus()
Returns:
Returns the status of the object. The start and end dates are also used to determine whether the promotion is active.

setActive

public void setActive(boolean active)
Parameters:
active - The active to set.

isCumulative

public boolean isCumulative()
Returns:
Returns the cumulative.

setCumulative

public void setCumulative(boolean cumulative)
Parameters:
cumulative - The cumulative to set.

getCustom1

public java.lang.String getCustom1()
Returns:
Returns the custom1.

setCustom1

public void setCustom1(java.lang.String custom1)
Parameters:
custom1 - The custom1 to set.

getCustom2

public java.lang.String getCustom2()
Returns:
Returns the custom2.

setCustom2

public void setCustom2(java.lang.String custom2)
Parameters:
custom2 - The custom2 to set.

getCustom3

public java.lang.String getCustom3()
Returns:
Returns the custom3.

setCustom3

public void setCustom3(java.lang.String custom3)
Parameters:
custom3 - The custom3 to set.

getCustom4

public java.lang.String getCustom4()
Returns:
Returns the custom4.

setCustom4

public void setCustom4(java.lang.String custom4)
Parameters:
custom4 - The custom4 to set.

getCustom5

public java.lang.String getCustom5()
Returns:
Returns the custom5.

setCustom5

public void setCustom5(java.lang.String custom5)
Parameters:
custom5 - The custom5 to set.

getCustom6

public java.lang.String getCustom6()
Returns:
Returns the custom6.

setCustom6

public void setCustom6(java.lang.String custom6)
Parameters:
custom6 - The custom6 to set.

getCustom7

public java.lang.String getCustom7()
Returns:
Returns the custom7.

setCustom7

public void setCustom7(java.lang.String custom7)
Parameters:
custom7 - The custom7 to set.

getCustom8

public java.lang.String getCustom8()
Returns:
Returns the custom8.

setCustom8

public void setCustom8(java.lang.String custom8)
Parameters:
custom8 - The custom8 to set.

getCustom9

public java.lang.String getCustom9()
Returns:
Returns the custom9.

setCustom9

public void setCustom9(java.lang.String custom9)
Parameters:
custom9 - The custom9 to set.

getCustom10

public java.lang.String getCustom10()
Returns:
Returns the custom10.

setCustom10

public void setCustom10(java.lang.String custom10)
Parameters:
custom10 - The custom10 to set.

getId

public int getId()
Specified by:
getId in interface AdminObjectIf
Returns:
Returns the id.

setId

public void setId(int id)
Specified by:
setId in interface AdminObjectIf
Parameters:
id - The id to set.

getOrderTotalCode

public java.lang.String getOrderTotalCode()
Returns:
Returns the orderTotalCode.

setOrderTotalCode

public void setOrderTotalCode(java.lang.String orderTotalCode)
Parameters:
orderTotalCode - The orderTotalCode to set.

getName

public java.lang.String getName()
Returns:
Returns the name.

setName

public void setName(java.lang.String name)
Parameters:
name - The name to set.

getDescription

public java.lang.String getDescription()
Returns:
Returns the description.

setDescription

public void setDescription(java.lang.String description)
Parameters:
description - The description to set.

isRequiresCoupon

public boolean isRequiresCoupon()
Returns:
Returns the requiresCoupon.

setRequiresCoupon

public void setRequiresCoupon(boolean requiresCoupon)
Parameters:
requiresCoupon - The requiresCoupon to set.

getCategoryRule

public int getCategoryRule()
Returns:
Returns the categoryRule.

setCategoryRule

public void setCategoryRule(int categoryRule)
Parameters:
categoryRule - The categoryRule to set.

getCustomerRule

public int getCustomerRule()
Returns:
Returns the customerRule.

setCustomerRule

public void setCustomerRule(int customerRule)
Parameters:
customerRule - The customerRule to set.

getManufacturerRule

public int getManufacturerRule()
Returns:
Returns the manufacturerRule.

setManufacturerRule

public void setManufacturerRule(int manufacturerRule)
Parameters:
manufacturerRule - The manufacturerRule to set.

getProductRule

public int getProductRule()
Returns:
Returns the productRule.

setProductRule

public void setProductRule(int productRule)
Parameters:
productRule - The productRule to set.

getApplicableProducts

public AdminOrderProduct[] getApplicableProducts()
Returns:
Returns the applicableProducts.

setApplicableProducts

public void setApplicableProducts(AdminOrderProduct[] applicableProducts)
Parameters:
applicableProducts - The applicableProducts to set.

getDateAdded

public java.util.Date getDateAdded()
Returns:
Returns the dateAdded.

setDateAdded

public void setDateAdded(java.util.Date dateAdded)
Parameters:
dateAdded - The dateAdded to set.

getEndDate

public java.util.Date getEndDate()
Returns:
Returns the endDate.

setEndDate

public void setEndDate(java.util.Date endDate)
Parameters:
endDate - The endDate to set.

getLastModified

public java.util.Date getLastModified()
Returns:
Returns the lastModified.

setLastModified

public void setLastModified(java.util.Date lastModified)
Parameters:
lastModified - The lastModified to set.

getStartDate

public java.util.Date getStartDate()
Returns:
Returns the startDate.

setStartDate

public void setStartDate(java.util.Date startDate)
Parameters:
startDate - The startDate to set.

getCoupons

public AdminCoupon[] getCoupons()
Returns:
Returns the coupons.

setCoupons

public void setCoupons(AdminCoupon[] coupons)
Parameters:
coupons - The coupons to set.

getNumCategories

public int getNumCategories()
Returns:
Returns the numCategories.

setNumCategories

public void setNumCategories(int numCategories)
Parameters:
numCategories - The numCategories to set.

getNumCustomers

public int getNumCustomers()
Returns:
Returns the numCustomers.

setNumCustomers

public void setNumCustomers(int numCustomers)
Parameters:
numCustomers - The numCustomers to set.

getNumManufacturers

public int getNumManufacturers()
Returns:
Returns the numManufacturers.

setNumManufacturers

public void setNumManufacturers(int numManufacturers)
Parameters:
numManufacturers - The numManufacturers to set.

getNumProducts

public int getNumProducts()
Returns:
Returns the numProducts.

setNumProducts

public void setNumProducts(int numProducts)
Parameters:
numProducts - The numProducts to set.

getNumCoupons

public int getNumCoupons()
Returns:
Returns the numCoupons.

setNumCoupons

public void setNumCoupons(int numCoupons)
Parameters:
numCoupons - The numCoupons to set.

getCustomerGroupRule

public int getCustomerGroupRule()
Returns:
Returns the customerGroupRule.

setCustomerGroupRule

public void setCustomerGroupRule(int customerGroupRule)
Parameters:
customerGroupRule - The customerGroupRule to set.

getNumCustomerGroups

public int getNumCustomerGroups()
Returns:
Returns the numCustomerGroups.

setNumCustomerGroups

public void setNumCustomerGroups(int numCustomerGroups)
Parameters:
numCustomerGroups - The numCustomerGroups to set.

getNumExpressions

public int getNumExpressions()
Returns:
the numExpressions

setNumExpressions

public void setNumExpressions(int numExpressions)
Parameters:
numExpressions - the numExpressions to set

getMaxUse

public int getMaxUse()
Returns:
the maxUse

setMaxUse

public void setMaxUse(int maxUse)
Parameters:
maxUse - the maxUse to set


Copyright © 2011 DS Data Systems UK Ltd.