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
| Property | Returns | Description |
|---|---|---|
| auditOrg | Organisation | The organisation which audit records for this store are filed against, which is the store's own admin organisation. |
| createdBy | Profile | The profile which created this store. Never null. |
| createdDate | Date | When this store was created. Never null. |
| deletedBy | Profile | The profile which deleted this store, or null while it is still in use. |
| deletedDate | 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. |
| gstRate | 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. |
| id | long | Unique database identifier for this store. |
| margin | 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. |
| name | 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. |
| title | String | Free text display label for the store, shown to shoppers. Unlike the name it carries no uniqueness or path safety guarantee. Never null. |
| website | Website | The 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.
| Parameter | Description |
|---|---|
id | the 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.
| Parameter | Description |
|---|---|
name | the 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.
| Parameter | Description |
|---|---|
title | the 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.
| Parameter | Description |
|---|---|
website | the owning website |
setOrganisation(Organisation organisation)
Returns: void
Sets the admin organisation which owns this store.
| Parameter | Description |
|---|---|
organisation | the 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.
| Parameter | Description |
|---|---|
gstRate | the 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.
| Parameter | Description |
|---|---|
margin | the 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.
| Parameter | Description |
|---|---|
createdBy | the creating profile |
getCreatedDate()
Returns: Date
When this store was created. Never null.
setCreatedDate(Date createdDate)
Returns: void
Sets the creation timestamp.
| Parameter | Description |
|---|---|
createdDate | when 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.
| Parameter | Description |
|---|---|
deletedDate | when 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.
| Parameter | Description |
|---|---|
deletedBy | the 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.
| Parameter | Description |
|---|---|
p | the 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.
| Parameter | Description |
|---|---|
p | the 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.