A single item put up for bidding on a website, with its bidding window, starting price and current leading bid. Bids are recorded as AuctionBid rows; the auction itself caches the current bid count and value, the leading bid while bidding is open and the winning bid once it has been processed. An auction can be restricted to particular groups or organisations, is optionally grouped into an AuctionSet, and can pay out either a reward or, once won, an order held as the related cart. The auctionType field selects the bidding rules, one of the HighestBidAuction, LowestUniqueBidAuction or HighestUniqueBidAuction constants.
Group: Database Entities
Implements: Serializable, Relational
Properties
| Property | Returns | Description |
|---|---|---|
| auctionDescription | String | Description of the item being auctioned, shown to bidders on the auction page. Also searched by the auction search. |
| auctionEndDate | Date | Date and time bidding closes. Bids are no longer accepted after this, but the winner is not decided until the auction is processed. |
| auctionGroups | List<AuctionGroup> | The groups the auction is restricted to, as join rows. An empty or null list means it is not restricted by group. |
| auctionOrganisations | List<AuctionOrganisation> | The organisations the auction is restricted to, as join rows. An empty or null list means it is not restricted by organisation. |
| auctionProcessedDate | Date | Date and time the auction was processed, ie when bidding was closed off and the winner decided. Null while the auction is still running or waiting to be processed. |
| auctionReserveValue | BigDecimal | The reserve, ie the minimum value bidding must reach for the item to sell. May be null, meaning there is no reserve. |
| auctionReward | Reward | The reward granted to the winner, for auctions that pay out a reward rather than an order. Null if the auction is not linked to a reward, and lazily loaded. |
| auctionSet | AuctionSet | The set this auction is part of, used to run a group of auctions together as one event. Null if the auction stands alone. |
| auctionStartDate | Date | Date and time bidding opens. An auction only counts as active once this has passed and its status is ACTIVE. |
| auctionStartValue | BigDecimal | The opening bid value, ie where bidding starts. Defaults to 1 when the auction is created. |
| auctionType | String | The bidding rules for this auction, as one of the short codes held in the HighestBidAuction (HBA), LowestUniqueBidAuction (LUB) and HighestUniqueBidAuction (HUB) constants. |
| bidFee | BigDecimal | Fee charged to the bidder each time they place a bid, for pay-to-bid auctions. Null means bidding is free. |
| branch | Branch | The content repository branch holding this auction's pages and assets. Never null, and lazily loaded. |
| createdBy | Profile | The administrator profile that created the auction. Never null, and lazily loaded. |
| createdDate | Date | Date and time the auction record was created, which is not the same as the date bidding opens. |
| currentBidCount | Integer | Running count of bids placed on this auction, kept on the auction so a listing does not have to count the bid rows. Starts at zero when the auction is created. |
| currentBidValue | BigDecimal | The value bidding has currently reached, cached on the auction so a listing does not have to read the bid rows. Null until the first bid is placed. |
| deleted | boolean | Whether the auction has been soft deleted. Deleted auctions are excluded from the standard lookups but the row and its bids are retained. |
| deletedBy | Profile | The profile that soft deleted the auction, or null if it has not been deleted. |
| deletedDate | Date | Date and time the auction was soft deleted, or null if it has not been deleted. |
| id | long | Unique database identifier for this auction. |
| images | List<AuctionImage> | Images of the item being auctioned. May be null if no images have been uploaded; getPrimaryImageId names the one to lead with. |
| incrementValue | BigDecimal | Minimum amount by which a new bid must beat the current bid. Defaults to 1 when the auction is created. |
| leadingBid | AuctionBid | The bid currently in front under this auction's bidding rules, which for a unique bid auction is not simply the highest. Null until the first bid is placed. |
| name | String | Path-safe identifier for the auction, used as the URL segment on the website and as the lookup key within an organisation or website. Use the title for display instead. |
| notes | String | Internal administrator notes about the auction, not shown to bidders. Limited to 2048 characters. |
| primaryImageId | Long | Identifier of the image to show as the auction's main picture, chosen from its images. Null if no primary image has been nominated. |
| relatedCart | Cart | The cart created when an order was placed for this auction, linking the win through to fulfilment. Null until an order is placed, and lazily loaded. |
| sku | String | Product SKU code of the item being auctioned, for tying the auction back to stock. Free text of up to 1000 characters and not validated against the product catalogue. |
| status | STATUS | Publication status of the auction: DRAFT while it is being set up, ACTIVE once it is live. Only ACTIVE auctions inside their bidding window are counted as running. |
| template | String | Name of the template used to render this auction's page to bidders. Set to an empty string when the auction is created, meaning the website's default rendering is used. |
| title | String | Free-text display title of the auction, shown as the heading on the auction page. Carries no uniqueness guarantee, unlike the name. |
| website | Website | The website the auction is published on, which scopes both its URL and who can see it. Never null, and lazily loaded. |
| winningBid | AuctionBid | The bid that won the auction. Only set once the auction has been processed, and null before then or if nobody met the reserve. |
Methods
getId() · getTitle() · setTitle(String title) · setOrganisation(Organisation organisation) · getName() · setName(String name) · getNotes() · setNotes(String notes) · getTemplate() · setTemplate(String template) · getCreatedDate() · setCreatedDate(Date createdDate) · getCreatedBy() · setCreatedBy(Profile createdBy) · isDeleted() · setDeleted(boolean deleted) · getDeletedDate() · setDeletedDate(Date deletedDate) · getDeletedBy() · setDeletedBy(Profile deletedBy) · setAuctionStartDate(Date auctionStartDate) · getAuctionStartDate() · setAuctionEndDate(Date auctionEndDate) · getAuctionEndDate() · setAuctionType(String auctionType) · getAuctionType() · setAuctionReserveValue(BigDecimal auctionReserveValue) · getAuctionReserveValue() · setAuctionStartValue(BigDecimal auctionStartValue) · getAuctionStartValue() · setBidFee(BigDecimal bidFee) · getBidFee() · setCurrentBidCount(Integer CurrentBidCount) · getCurrentBidCount() · setCurrentBidValue(BigDecimal CurrentBidValue) · getCurrentBidValue() · setIncrementValue(BigDecimal auctionIncrementValue) · getIncrementValue() · getAuctionDescription() · setAuctionDescription(String auctionDescription) · getWebsite() · setWebsite(Website website) · getAuctionGroups() · setAuctionGroups(List<AuctionGroup> auctionGroups) · addGroup(Group group) · getAuctionOrganisations() · setAuctionOrganisations(List<AuctionOrganisation> auctionOrganisations) · getAuctionProcessedDate() · setAuctionProcessedDate(Date auctionProcessedDate) · getWinningBid() · setWinningBid(AuctionBid winningBid) · getLeadingBid() · setLeadingBid(AuctionBid leadingBid) · getAuctionReward() · setAuctionReward(Reward auctionReward) · getBranch() · setBranch(Branch branch) · getRelatedCart() · setRelatedCart(Cart relatedCart) · getImages() · setImages(List<AuctionImage> images) · addImage(String fname, String hash, String orientation) · image(String childName) · getPrimaryImageId() · setPrimaryImageId(Long primaryImageId) · getStatus() · setStatus(STATUS status) · getSku() · setSku(String sku) · getAuctionSet() · setAuctionSet(AuctionSet auctionSet) · findBid(Long id) · rowId()
getId()
Returns: long
Unique database identifier for this auction.
getTitle()
Returns: String
Free-text display title of the auction, shown as the heading on the auction page. Carries no uniqueness guarantee, unlike the name.
setTitle(String title)
Returns: void
Sets the free-text display title shown on the auction page.
| Parameter | Description |
|---|---|
title | the display title to use |
setOrganisation(Organisation organisation)
Returns: void
Sets the organisation this auction falls under.
| Parameter | Description |
|---|---|
organisation | the organisation this auction falls under |
getName()
Returns: String
Path-safe identifier for the auction, used as the URL segment on the website and as the lookup key within an organisation or website. Use the title for display instead.
setName(String name)
Returns: void
Sets the path-safe name used in the auction's URL and as its lookup key.
| Parameter | Description |
|---|---|
name | the auction name to use |
getNotes()
Returns: String
Internal administrator notes about the auction, not shown to bidders. Limited to 2048 characters.
setNotes(String notes)
Returns: void
Sets the internal administrator notes held against the auction.
| Parameter | Description |
|---|---|
notes | the administrator notes to store |
getTemplate()
Returns: String
Name of the template used to render this auction's page to bidders. Set to an empty string when the auction is created, meaning the website's default rendering is used.
setTemplate(String template)
Returns: void
Sets the template used to render the auction's page.
| Parameter | Description |
|---|---|
template | the template name to use |
getCreatedDate()
Returns: Date
Date and time the auction record was created, which is not the same as the date bidding opens.
setCreatedDate(Date createdDate)
Returns: void
Sets the date and time the auction record was created.
| Parameter | Description |
|---|---|
createdDate | the creation timestamp to record |
getCreatedBy()
Returns: Profile
The administrator profile that created the auction. Never null, and lazily loaded.
setCreatedBy(Profile createdBy)
Returns: void
Sets the profile recorded as having created the auction.
| Parameter | Description |
|---|---|
createdBy | the creating profile |
isDeleted()
Returns: boolean
Whether the auction has been soft deleted. Deleted auctions are excluded from the standard lookups but the row and its bids are retained.
setDeleted(boolean deleted)
Returns: void
Marks the auction as soft deleted or restores it.
| Parameter | Description |
|---|---|
deleted | true to soft delete the auction, false to restore it |
getDeletedDate()
Returns: Date
Date and time the auction was soft deleted, or null if it has not been deleted.
setDeletedDate(Date deletedDate)
Returns: void
Sets the date and time the auction was soft deleted.
| Parameter | Description |
|---|---|
deletedDate | the deletion timestamp to record |
getDeletedBy()
Returns: Profile
The profile that soft deleted the auction, or null if it has not been deleted.
setDeletedBy(Profile deletedBy)
Returns: void
Sets the profile recorded as having soft deleted the auction.
| Parameter | Description |
|---|---|
deletedBy | the deleting profile |
setAuctionStartDate(Date auctionStartDate)
Returns: void
Sets the date and time bidding opens.
| Parameter | Description |
|---|---|
auctionStartDate | the moment bidding opens |
getAuctionStartDate()
Returns: Date
Date and time bidding opens. An auction only counts as active once this has passed and its status is ACTIVE.
setAuctionEndDate(Date auctionEndDate)
Returns: void
Sets the date and time bidding closes.
| Parameter | Description |
|---|---|
auctionEndDate | the moment bidding closes |
getAuctionEndDate()
Returns: Date
Date and time bidding closes. Bids are no longer accepted after this, but the winner is not decided until the auction is processed.
setAuctionType(String auctionType)
Returns: void
Sets the bidding rules for this auction.
| Parameter | Description |
|---|---|
auctionType | the auction type code, one of the HighestBidAuction, LowestUniqueBidAuction or HighestUniqueBidAuction constants |
getAuctionType()
Returns: String
The bidding rules for this auction, as one of the short codes held in the HighestBidAuction (HBA), LowestUniqueBidAuction (LUB) and HighestUniqueBidAuction (HUB) constants.
setAuctionReserveValue(BigDecimal auctionReserveValue)
Returns: void
Sets the reserve, the minimum bid the auction must reach to be won.
| Parameter | Description |
|---|---|
auctionReserveValue | the reserve value to set |
getAuctionReserveValue()
Returns: BigDecimal
The reserve, ie the minimum value bidding must reach for the item to sell. May be null, meaning there is no reserve.
setAuctionStartValue(BigDecimal auctionStartValue)
Returns: void
Sets the opening bid value for the auction.
| Parameter | Description |
|---|---|
auctionStartValue | the opening bid value to set |
getAuctionStartValue()
Returns: BigDecimal
The opening bid value, ie where bidding starts. Defaults to 1 when the auction is created.
setBidFee(BigDecimal bidFee)
Returns: void
Sets the fee charged to a bidder for placing a bid.
| Parameter | Description |
|---|---|
bidFee | the fee charged per bid |
getBidFee()
Returns: BigDecimal
Fee charged to the bidder each time they place a bid, for pay-to-bid auctions. Null means bidding is free.
setCurrentBidCount(Integer CurrentBidCount)
Returns: void
Sets the running count of bids placed on this auction.
| Parameter | Description |
|---|---|
CurrentBidCount | the number of bids placed so far |
getCurrentBidCount()
Returns: Integer
Running count of bids placed on this auction, kept on the auction so a listing does not have to count the bid rows. Starts at zero when the auction is created.
setCurrentBidValue(BigDecimal CurrentBidValue)
Returns: void
Sets the cached value of the current bid.
| Parameter | Description |
|---|---|
CurrentBidValue | the value of the current bid |
getCurrentBidValue()
Returns: BigDecimal
The value bidding has currently reached, cached on the auction so a listing does not have to read the bid rows. Null until the first bid is placed.
setIncrementValue(BigDecimal auctionIncrementValue)
Returns: void
Sets the minimum amount by which each new bid must beat the current one.
| Parameter | Description |
|---|---|
auctionIncrementValue | the minimum bid increment |
getIncrementValue()
Returns: BigDecimal
Minimum amount by which a new bid must beat the current bid. Defaults to 1 when the auction is created.
getAuctionDescription()
Returns: String
Description of the item being auctioned, shown to bidders on the auction page. Also searched by the auction search.
setAuctionDescription(String auctionDescription)
Returns: void
Sets the description of the item being auctioned.
| Parameter | Description |
|---|---|
auctionDescription | the description shown to bidders |
getWebsite()
Returns: Website
The website the auction is published on, which scopes both its URL and who can see it. Never null, and lazily loaded.
setWebsite(Website website)
Returns: void
Sets the website the auction is published on.
| Parameter | Description |
|---|---|
website | the website to publish the auction on |
getAuctionGroups()
Returns: List<AuctionGroup>
The groups the auction is restricted to, as join rows. An empty or null list means it is not restricted by group.
setAuctionGroups(List<AuctionGroup> auctionGroups)
Returns: void
Replaces the collection of group restrictions on the auction.
| Parameter | Description |
|---|---|
auctionGroups | the group restriction rows to hold against the auction |
addGroup(Group group)
Returns: void
Restricts the auction to an additional group, saving the join row immediately in the current session. Does nothing if the group is already linked.
| Parameter | Description |
|---|---|
group | the group to grant access to the auction |
getAuctionOrganisations()
Returns: List<AuctionOrganisation>
The organisations the auction is restricted to, as join rows. An empty or null list means it is not restricted by organisation.
setAuctionOrganisations(List<AuctionOrganisation> auctionOrganisations)
Returns: void
Replaces the collection of organisation restrictions on the auction.
| Parameter | Description |
|---|---|
auctionOrganisations | the organisation restriction rows to hold against the auction |
getAuctionProcessedDate()
Returns: Date
Date and time the auction was processed, ie when bidding was closed off and the winner decided. Null while the auction is still running or waiting to be processed.
setAuctionProcessedDate(Date auctionProcessedDate)
Returns: void
Sets the date and time the auction was processed and the winner decided.
| Parameter | Description |
|---|---|
auctionProcessedDate | the processing timestamp to record |
getWinningBid()
Returns: AuctionBid
The bid that won the auction. Only set once the auction has been processed, and null before then or if nobody met the reserve.
setWinningBid(AuctionBid winningBid)
Returns: void
Records the bid that won the auction.
| Parameter | Description |
|---|---|
winningBid | the winning bid |
getLeadingBid()
Returns: AuctionBid
The bid currently in front under this auction's bidding rules, which for a unique bid auction is not simply the highest. Null until the first bid is placed.
setLeadingBid(AuctionBid leadingBid)
Returns: void
Records which bid is currently in front.
| Parameter | Description |
|---|---|
leadingBid | the currently leading bid |
getAuctionReward()
Returns: Reward
The reward granted to the winner, for auctions that pay out a reward rather than an order. Null if the auction is not linked to a reward, and lazily loaded.
setAuctionReward(Reward auctionReward)
Returns: void
Sets the reward granted to the winner of the auction.
| Parameter | Description |
|---|---|
auctionReward | the reward to grant to the winner |
getBranch()
Returns: Branch
The content repository branch holding this auction's pages and assets. Never null, and lazily loaded.
setBranch(Branch branch)
Returns: void
Sets the content repository branch holding the auction's pages and assets.
| Parameter | Description |
|---|---|
branch | the branch the auction's content lives on |
getRelatedCart()
Returns: Cart
The cart created when an order was placed for this auction, linking the win through to fulfilment. Null until an order is placed, and lazily loaded.
setRelatedCart(Cart relatedCart)
Returns: void
Links the auction to the cart created when an order was placed for it.
| Parameter | Description |
|---|---|
relatedCart | the order raised for this auction |
getImages()
Returns: List<AuctionImage>
Images of the item being auctioned. May be null if no images have been uploaded; getPrimaryImageId names the one to lead with.
setImages(List<AuctionImage> images)
Returns: void
Replaces the collection of images held against the auction.
| Parameter | Description |
|---|---|
images | the images to hold against the auction |
addImage(String fname, String hash, String orientation)
Returns: AuctionImage
Adds an image to the auction and saves it in the current session. Blank file names and orientations are ignored rather than stored.
| Parameter | Description |
|---|---|
fname | the file name to store the image under, ignored if blank |
hash | the content hash used to fetch the image data from the blob store |
orientation | the image's orientation, ignored if blank |
image(String childName)
Returns: AuctionImage
Finds one of the auction's images by its file name.
| Parameter | Description |
|---|---|
childName | the file name of the image to find |
getPrimaryImageId()
Returns: Long
Identifier of the image to show as the auction's main picture, chosen from its images. Null if no primary image has been nominated.
setPrimaryImageId(Long primaryImageId)
Returns: void
Nominates which of the auction's images is the main picture.
| Parameter | Description |
|---|---|
primaryImageId | the id of the image to use as the main picture |
getStatus()
Returns: STATUS
Publication status of the auction: DRAFT while it is being set up, ACTIVE once it is live. Only ACTIVE auctions inside their bidding window are counted as running.
setStatus(STATUS status)
Returns: void
Sets the auction's publication status.
| Parameter | Description |
|---|---|
status | DRAFT to keep it hidden, ACTIVE to make it live |
getSku()
Returns: String
Product SKU code of the item being auctioned, for tying the auction back to stock. Free text of up to 1000 characters and not validated against the product catalogue.
setSku(String sku)
Returns: void
Sets the SKU code of the item being auctioned.
| Parameter | Description |
|---|---|
sku | the item's SKU code |
getAuctionSet()
Returns: AuctionSet
The set this auction is part of, used to run a group of auctions together as one event. Null if the auction stands alone.
setAuctionSet(AuctionSet auctionSet)
Returns: void
Puts the auction into an auction set, or removes it from one by passing null.
| Parameter | Description |
|---|---|
auctionSet | the set this auction belongs to |
findBid(Long id)
Returns: AuctionBid
Loads a bid by id and checks it actually belongs to this auction, so a bid id from elsewhere cannot be read through this auction. Reads from the database.
| Parameter | Description |
|---|---|
id | the id of the bid to load |
rowId()
Returns: Long
The row's identifier as used by the generic relational reporting layer, which is the same value as getId.