Groups the quotes offered to a customer for one piece of business, and records which of them was accepted. A proposal is usually raised from a lead, in which case the new proposal's id is written back onto the lead as the field proposalId, but it can also be raised directly against a customer. It starts in status CREATED and moves to ACCEPTED once one of its quotes is taken up.
Group: Database Entities
Implements: Serializable, Relational
Properties
| Property | Returns | Description |
|---|---|---|
| acceptedQuote | Quote | The one quote the customer accepted, if any. Null while the proposal is still being negotiated. |
| customer | BaseEntity | Who the proposal is for. This is a base entity, so it may be an individual profile or an organisation such as a dealer or reseller. Required. |
| description | String | A one line summary of the proposal, listing each quote as its title followed by an at sign and the quote total, separated by commas. Includes deleted quotes, and fails with a null pointer error if no quotes have been added yet. |
| id | long | The database identifier of this proposal. This is the value written onto the originating lead as its proposalId field. |
| lead | Lead | The lead this proposal was raised from, if any. Null for a proposal created directly against a customer rather than through a journey. |
| quotes | List<Quote> | Every quote offered under this proposal, including ones that have since been deleted or rejected. Null until the first quote is added. |
| quotesValid | boolean | True if every live quote on this proposal has at least one line item, which is the check made before a proposal can be sent. Deleted quotes are ignored, and this fails with a null pointer error if no quotes have been added yet. |
| status | ProposalStatus | Where the proposal has got to, either CREATED for one still being negotiated or ACCEPTED once a quote has been taken up. Required. |
Methods
getLead() · setLead(Lead lead) · getId() · setOrganisation(Organisation organisation) · getQuotes() · setQuotes(List<Quote> quotes) · getAcceptedQuote() · setAcceptedQuote(Quote acceptedQuote) · getStatus() · setStatus(ProposalStatus status) · getCustomer() · setCustomer(BaseEntity customer) · getDescription() · quote(long acceptedQuoteId) · isQuotesValid() · containsQuote(Quote quote)
getLead()
Returns: Lead
The lead this proposal was raised from, if any. Null for a proposal created directly against a customer rather than through a journey.
setLead(Lead lead)
Returns: void
Sets the lead this proposal was raised from.
| Parameter | Description |
|---|---|
lead | the originating lead, or null for none |
getId()
Returns: long
The database identifier of this proposal. This is the value written onto the originating lead as its proposalId field.
setOrganisation(Organisation organisation)
Returns: void
Sets the organisation that owns this proposal.
| Parameter | Description |
|---|---|
organisation | the owning organisation |
getQuotes()
Returns: List<Quote>
Every quote offered under this proposal, including ones that have since been deleted or rejected. Null until the first quote is added.
setQuotes(List<Quote> quotes)
Returns: void
Replaces the list of quotes belonging to this proposal.
| Parameter | Description |
|---|---|
quotes | the quotes belonging to this proposal |
getAcceptedQuote()
Returns: Quote
The one quote the customer accepted, if any. Null while the proposal is still being negotiated.
setAcceptedQuote(Quote acceptedQuote)
Returns: void
Sets the quote the customer accepted.
| Parameter | Description |
|---|---|
acceptedQuote | the accepted quote, or null to clear it |
getStatus()
Returns: ProposalStatus
Where the proposal has got to, either CREATED for one still being negotiated or ACCEPTED once a quote has been taken up. Required.
setStatus(ProposalStatus status)
Returns: void
Sets where the proposal has got to.
| Parameter | Description |
|---|---|
status | the new proposal status |
getCustomer()
Returns: BaseEntity
Who the proposal is for. This is a base entity, so it may be an individual profile or an organisation such as a dealer or reseller. Required.
setCustomer(BaseEntity customer)
Returns: void
Sets who the proposal is for.
| Parameter | Description |
|---|---|
customer | the customer this proposal is addressed to |
getDescription()
Returns: String
A one line summary of the proposal, listing each quote as its title followed by an at sign and the quote total, separated by commas. Includes deleted quotes, and fails with a null pointer error if no quotes have been added yet.
quote(long acceptedQuoteId)
Returns: Quote
Finds one of this proposal's quotes by its id, ignoring quotes that have been deleted. The already loaded collection is scanned rather than the database.
| Parameter | Description |
|---|---|
acceptedQuoteId | the id of the quote to find |
isQuotesValid()
Returns: boolean
True if every live quote on this proposal has at least one line item, which is the check made before a proposal can be sent. Deleted quotes are ignored, and this fails with a null pointer error if no quotes have been added yet.
containsQuote(Quote quote)
Returns: boolean
True if the given quote belongs to this proposal, compared by id. Deleted quotes still count as belonging.
| Parameter | Description |
|---|---|
quote | the quote to look for |