A shop front within a website, holding the products offered for sale and the pricing defaults applied to them. A website can have several stores, each identified by a name which is unique within the website. The store carries the default GST rate and internal margin used to price its products, and either may be overridden on an individual product. Membership of a store is held by ProductInEComStore rather than on the product itself. Stores are deleted softly, by setting the deleted date and the profile which deleted them, so the finders ignore any store which has been deleted rather than removing the row.

Group: Database Entities

Implements: Serializable, Relational, Auditable


Properties

PropertyReturnsDescription
auditOrgOrganisationThe organisation which audit records for this store are filed against, which is the store's own admin organisation.
createdByProfileThe profile which created this store. Never null.
createdDateDateWhen this store was created. Never null.
deletedByProfileThe profile which deleted this store, or null while it is still in use.
deletedDateDateWhen this store was deleted, or null while it is still in use. Stores are deleted softly, so the finders skip any store which has a deleted date.
gstRateBigDecimalDefault rate of GST for products in this store, as a decimal fraction, so 15 percent is 0.15. An individual product can override it. Can be null, meaning no store level default has been set.
idlongUnique database identifier for this store.
marginBigDecimalDefault internal margin for products in this store, as a decimal fraction, so a 5 percent margin is 0.05 and prices the product at 1.05 times its base cost. An individual product can override it. Can be null.
nameStringShort, path safe identifier for the store, unique within its website and used to look the store up. Use the title for anything shown to a shopper. Never null.
titleStringFree text display label for the store, shown to shoppers. Unlike the name it carries no uniqueness or path safety guarantee. Never null.
websiteWebsiteThe website this store belongs to and is browsed through. Never null, and store names are unique within it.

Methods

getId() · setId(long id) · getName() · setName(String name) · getTitle() · setTitle(String title) · getWebsite() · setWebsite(Website website) · setOrganisation(Organisation organisation) · getGstRate() · setGstRate(BigDecimal gstRate) · getMargin() · setMargin(BigDecimal margin) · getCreatedBy() · setCreatedBy(Profile createdBy) · getCreatedDate() · setCreatedDate(Date createdDate) · getDeletedDate() · setDeletedDate(Date deletedDate) · getDeletedBy() · setDeletedBy(Profile deletedBy) · findProduct(Product p) · contains(Product p) · getAuditOrg()

getId()

Returns: long

Unique database identifier for this store.

setId(long id)

Returns: void

Sets the database identifier. The database assigns this when the store is first saved, so it is not normally set by hand.

ParameterDescription
idthe primary key to use

getName()

Returns: String

Short, path safe identifier for the store, unique within its website and used to look the store up. Use the title for anything shown to a shopper. Never null.

setName(String name)

Returns: void

Sets the store's name. Keep it path safe and unique within the website, because it is the lookup key.

ParameterDescription
namethe new name

getTitle()

Returns: String

Free text display label for the store, shown to shoppers. Unlike the name it carries no uniqueness or path safety guarantee. Never null.

setTitle(String title)

Returns: void

Sets the display title shown to shoppers.

ParameterDescription
titlethe new display title

getWebsite()

Returns: Website

The website this store belongs to and is browsed through. Never null, and store names are unique within it.

setWebsite(Website website)

Returns: void

Sets the website this store belongs to.

ParameterDescription
websitethe owning website

setOrganisation(Organisation organisation)

Returns: void

Sets the admin organisation which owns this store.

ParameterDescription
organisationthe owning admin organisation

getGstRate()

Returns: BigDecimal

Default rate of GST for products in this store, as a decimal fraction, so 15 percent is 0.15. An individual product can override it. Can be null, meaning no store level default has been set.

setGstRate(BigDecimal gstRate)

Returns: void

Sets the default GST rate for products in this store.

ParameterDescription
gstRatethe GST rate as a decimal fraction, for example 0.15 for 15 percent

getMargin()

Returns: BigDecimal

Default internal margin for products in this store, as a decimal fraction, so a 5 percent margin is 0.05 and prices the product at 1.05 times its base cost. An individual product can override it. Can be null.

setMargin(BigDecimal margin)

Returns: void

Sets the default internal margin for products in this store.

ParameterDescription
marginthe margin as a decimal fraction, for example 0.05 for 5 percent

getCreatedBy()

Returns: Profile

The profile which created this store. Never null.

setCreatedBy(Profile createdBy)

Returns: void

Sets the profile recorded as having created this store.

ParameterDescription
createdBythe creating profile

getCreatedDate()

Returns: Date

When this store was created. Never null.

setCreatedDate(Date createdDate)

Returns: void

Sets the creation timestamp.

ParameterDescription
createdDatewhen the store was created

getDeletedDate()

Returns: Date

When this store was deleted, or null while it is still in use. Stores are deleted softly, so the finders skip any store which has a deleted date.

setDeletedDate(Date deletedDate)

Returns: void

Sets the deletion timestamp, which marks the store as deleted.

ParameterDescription
deletedDatewhen the store was deleted, or null to undo the deletion

getDeletedBy()

Returns: Profile

The profile which deleted this store, or null while it is still in use.

setDeletedBy(Profile deletedBy)

Returns: void

Sets the profile recorded as having deleted this store.

ParameterDescription
deletedBythe deleting profile, or null to undo the deletion

findProduct(Product p)

Returns: ProductInEComStore

Finds the membership record which places the given product in this store, carrying that product's price and availability here. Queries the database, so it is more expensive than a plain property read.

ParameterDescription
pthe product to look for in this store

contains(Product p)

Returns: boolean

Whether the given product is offered in this store. Runs the same database lookup as findProduct, so prefer findProduct if the membership record itself is wanted.

ParameterDescription
pthe product to test

getAuditOrg()

Returns: Organisation

The organisation which audit records for this store are filed against, which is the store's own admin organisation.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.