Records that a promotion has been applied to a shopping cart, keeping the code the shopper entered as well as the promotion it resolved to. A cart can carry more than one of these, and they can be listed by cart or by shopper and code, which is how repeat use of a promo code is detected. The cart and the promotion must belong to the same account.
Group: Database Entities
Implements: Serializable
Properties
| Property | Returns | Description |
|---|---|---|
| adminOrg | Organisation | The Kademi account holder that owns both the cart and the promotion. Applying a promotion from a different account is rejected. |
| cart | Cart | The shopping cart the promotion was applied to. |
| id | long | The database identifier of this applied promotion. |
| orderedDate | Date | When the promotion was applied to the cart, as a timestamp. Never null. |
| promoCode | String | The code the shopper typed in to claim the promotion, kept exactly as entered and limited to 1000 characters. Searching on it together with the shopper is how previous uses of a code are found. |
| promotion | Reward | The promotion that was activated, which is held as a Reward. It must belong to the same account as the cart. |
Methods
getId() · getAdminOrg() · setAdminOrg(Organisation adminOrg) · getOrderedDate() · setOrderedDate(Date orderedDate) · getPromoCode() · setPromoCode(String promoCode) · getPromotion() · setPromotion(Reward promotion) · getCart() · setCart(Cart cart)
getId()
Returns: long
The database identifier of this applied promotion.
getAdminOrg()
Returns: Organisation
The Kademi account holder that owns both the cart and the promotion. Applying a promotion from a different account is rejected.
setAdminOrg(Organisation adminOrg)
Returns: void
Sets the Kademi account holder that owns the cart and the promotion.
| Parameter | Description |
|---|---|
adminOrg | the owning account |
getOrderedDate()
Returns: Date
When the promotion was applied to the cart, as a timestamp. Never null.
setOrderedDate(Date orderedDate)
Returns: void
Sets when the promotion was applied to the cart.
| Parameter | Description |
|---|---|
orderedDate | the date and time the promotion was applied |
getPromoCode()
Returns: String
The code the shopper typed in to claim the promotion, kept exactly as entered and limited to 1000 characters. Searching on it together with the shopper is how previous uses of a code are found.
setPromoCode(String promoCode)
Returns: void
Sets the code the shopper typed in to claim the promotion.
| Parameter | Description |
|---|---|
promoCode | the promo code as entered, at most 1000 characters |
getPromotion()
Returns: Reward
The promotion that was activated, which is held as a Reward. It must belong to the same account as the cart.
setPromotion(Reward promotion)
Returns: void
Sets the promotion that was activated.
| Parameter | Description |
|---|---|
promotion | the promotion applied to the cart |
getCart()
Returns: Cart
The shopping cart the promotion was applied to.
setCart(Cart cart)
Returns: void
Sets the shopping cart the promotion was applied to.
| Parameter | Description |
|---|---|
cart | the cart carrying this promotion |