Fluent builder for constructing and submitting a new RewardEntry, recording that a profile has entered or been awarded a promotion. Configure the desired fields with the setter methods (both the fluent with-style methods and the plain getX/setX pairs are provided for the same fields), then call build to persist the entry. Obtained from PromotionsManager.newRewardEntryBuilder.
Group: Builders
Properties
| Property | Returns | Description |
|---|---|---|
| attachmentHash | String | The content hash of the file attached to this entry, if set. |
| awardedDate | Date | The date the entry is awarded on, if set. |
| awardedFor | ModuleStatus | The module status this entry was awarded for, if the entry was triggered by completing a module. |
| awardedTo | Profile | The profile this entry is being awarded to, as given when the builder was created. |
| firstName | String | The first name recorded for this entry, if set. |
| reason | String | The reason recorded for this entry, if set. |
| relatedCart | Cart | The cart related to this entry, if set. |
| relatedOrg | Organisation | The organisation related to this entry, if one has been set. |
| relatedProductSku | ProductSku | The product sku related to this entry, if one has been set. |
| reward | Reward | The promotion this entry is being submitted for, as given when the builder was created. |
| status | RewardEntryStatus | The approval status this entry will be created with, if explicitly set. |
| surName | String | The surname recorded for this entry, if set. |
Methods
getReward() · relatedProductSku(ProductSku s) · reason(String s) · awardedDate(Date s) · attachmentHash(String s) · firstName(String s) · surName(String s) · relatedCart(Cart s) · status(RewardEntryStatus status) · getAwardedFor() · setAwardedFor(ModuleStatus awardedFor) · getRelatedOrg() · setRelatedOrg(Organisation relatedOrg) · getRelatedProductSku() · setRelatedProductSku(ProductSku relatedProductSku) · getAwardedTo() · getAwardedDate() · setAwardedDate(Date awardedDate) · getReason() · setReason(String reason) · getAttachmentHash() · setAttachmentHash(String attachmentHash) · getRelatedCart() · setRelatedCart(Cart relatedCart) · getFirstName() · setFirstName(String firstName) · getSurName() · setSurName(String surName) · getStatus() · setStatus(RewardEntryStatus status) · addAnswer(String name, String value) · addAnswerFile(String name, FileItem fileItem) · extraField1(String extraField) · extraField2(String extraField) · extraField3(String extraField) · build()
getReward()
Returns: Reward
The promotion this entry is being submitted for, as given when the builder was created.
relatedProductSku(ProductSku s)
Returns: RewardEntryBuilder
Sets the product sku related to this entry.
| Parameter | Description |
|---|---|
s | the related product sku |
reason(String s)
Returns: RewardEntryBuilder
Sets the reason recorded for this entry.
| Parameter | Description |
|---|---|
s | the reason text |
awardedDate(Date s)
Returns: RewardEntryBuilder
Sets the date the entry is awarded on. If not set, submitEntry uses the current date.
| Parameter | Description |
|---|---|
s | the awarded date |
attachmentHash(String s)
Returns: RewardEntryBuilder
Sets the content hash of a file attached to this entry.
| Parameter | Description |
|---|---|
s | the attachment hash |
firstName(String s)
Returns: RewardEntryBuilder
Sets the first name recorded for this entry. If not set, build uses the awarded profile's first name.
| Parameter | Description |
|---|---|
s | the first name |
surName(String s)
Returns: RewardEntryBuilder
Sets the surname recorded for this entry. If not set, build uses the awarded profile's surname.
| Parameter | Description |
|---|---|
s | the surname |
relatedCart(Cart s)
Returns: RewardEntryBuilder
Sets the cart related to this entry, when the entry is awarded as part of a checkout.
| Parameter | Description |
|---|---|
s | the related cart |
status(RewardEntryStatus status)
Returns: RewardEntryBuilder
Sets the approval status the entry will be created with. If not set, build defaults it based on whether the promotion requires approval.
| Parameter | Description |
|---|---|
status | the approval status |
getAwardedFor()
Returns: ModuleStatus
The module status this entry was awarded for, if the entry was triggered by completing a module.
setAwardedFor(ModuleStatus awardedFor)
Returns: void
Sets the module status this entry is awarded for.
| Parameter | Description |
|---|---|
awardedFor | the related module status |
getRelatedOrg()
Returns: Organisation
The organisation related to this entry, if one has been set.
setRelatedOrg(Organisation relatedOrg)
Returns: void
Sets the organisation related to this entry.
| Parameter | Description |
|---|---|
relatedOrg | the related organisation |
getRelatedProductSku()
Returns: ProductSku
The product sku related to this entry, if one has been set.
setRelatedProductSku(ProductSku relatedProductSku)
Returns: void
Sets the product sku related to this entry.
| Parameter | Description |
|---|---|
relatedProductSku | the related product sku |
getAwardedTo()
Returns: Profile
The profile this entry is being awarded to, as given when the builder was created.
getAwardedDate()
Returns: Date
The date the entry is awarded on, if set.
setAwardedDate(Date awardedDate)
Returns: void
Sets the date the entry is awarded on.
| Parameter | Description |
|---|---|
awardedDate | the awarded date |
getReason()
Returns: String
The reason recorded for this entry, if set.
setReason(String reason)
Returns: void
Sets the reason recorded for this entry.
| Parameter | Description |
|---|---|
reason | the reason text |
getAttachmentHash()
Returns: String
The content hash of the file attached to this entry, if set.
setAttachmentHash(String attachmentHash)
Returns: void
Sets the content hash of a file attached to this entry.
| Parameter | Description |
|---|---|
attachmentHash | the attachment hash |
getRelatedCart()
Returns: Cart
The cart related to this entry, if set.
setRelatedCart(Cart relatedCart)
Returns: void
Sets the cart related to this entry.
| Parameter | Description |
|---|---|
relatedCart | the related cart |
getFirstName()
Returns: String
The first name recorded for this entry, if set.
setFirstName(String firstName)
Returns: void
Sets the first name recorded for this entry.
| Parameter | Description |
|---|---|
firstName | the first name |
getSurName()
Returns: String
The surname recorded for this entry, if set.
setSurName(String surName)
Returns: void
Sets the surname recorded for this entry.
| Parameter | Description |
|---|---|
surName | the surname |
getStatus()
Returns: RewardEntryStatus
The approval status this entry will be created with, if explicitly set.
setStatus(RewardEntryStatus status)
Returns: void
Sets the approval status this entry will be created with.
| Parameter | Description |
|---|---|
status | the approval status |
addAnswer(String name, String value)
Returns: RewardEntryBuilder
Records a text answer to a quiz question for this entry.
| Parameter | Description |
|---|---|
name | the answer key |
value | the given answer text |
addAnswerFile(String name, FileItem fileItem)
Returns: RewardEntryBuilder
Records a file answer to a quiz question for this entry. The file is uploaded and stored when the entry is built.
| Parameter | Description |
|---|---|
name | the answer key |
fileItem | the uploaded file |
extraField1(String extraField)
Returns: RewardEntryBuilder
Set extra field 1 for this reward entry.
| Parameter | Description |
|---|---|
extraField | as {@code String} |
extraField2(String extraField)
Returns: RewardEntryBuilder
Set extra field 2 for this reward entry.
| Parameter | Description |
|---|---|
extraField | as {@code String} |
extraField3(String extraField)
Returns: RewardEntryBuilder
Set extra field 3 for this reward entry.
| Parameter | Description |
|---|---|
extraField | as {@code String} |
build()
Returns: RewardEntry
Validates and submits this builder, creating and persisting the RewardEntry (and any quiz submission records) via PromotionsManager.submitEntry.