projects/congarevenuecloud/ecommerce/src/lib/modules/order/services/quote.service.ts
The quote represents a price breakdown for a given product configuration. Quotes are generally associated with an approval process and can be converted to a cart or an order.
import { QuoteService } from '@congarevenuecloud/ecommerce';
constructor(private quoteService: QuoteService) {}
// or
export class MyService extends AObjectService {
private quoteService: QuoteService = this.injector.get(QuoteService);
}
AObjectService
Properties |
|
Methods |
acceptQuote | ||||||||
acceptQuote(quoteId: string)
|
||||||||
Method to accept the given quote. Example:Example :
Parameters :
Returns :
Observable<boolean>
|
convertCartToQuote | |||||||||||||||
convertCartToQuote(quote: Quote, fieldList?: Array
|
|||||||||||||||
Method converts the current cart into a quote instance. Example:Example :
Parameters :
Returns :
Observable<Quote>
an observable of the quote instance that was created from the cart. |
convertQuoteToCart | ||||||||
convertQuoteToCart(quote: Quote)
|
||||||||
Method creates new cart and clones the finalized cart linked to the quote, and sets the new cart as active. Example:Example :
Parameters :
Returns :
Observable<Cart>
an observable of the cart instance. |
createQuote | ||||||||
createQuote(quote: Quote)
|
||||||||
This method is use to create a quote. Example:Example :
Parameters :
Returns :
Observable<Quote>
observable instance of the created quote. |
finalizeQuote | ||||||||
finalizeQuote(quoteId: string)
|
||||||||
Method moves the quote status from Draft to Approved. Example:Example :
This method updates the status on quote from Draft to Approved. This method is a work in progress.
Parameters :
Returns :
Observable<boolean>
|
getAllQuotes | |||||||||||||||||||||||||||||||||||||||||||||
getAllQuotes(days?: number, filters?: Array<FieldFilter>, relatedRecords: string, limit: number, pageNumber: number, orderBy: string, orderDirection: "ASC" | "DESC", showErrorToaster: boolean)
|
|||||||||||||||||||||||||||||||||||||||||||||
The method fetches the list of quotes based on the parameters passed. Example:Example :
Parameters :
Returns :
Observable<QuoteResult>
An observable containing the list of quotes matching the criteria with total quote count. |
getMyQuote |
getMyQuote()
|
Returns :
Observable<Quote>
A hot observable containing the single quote instance. |
getMyQuotes | |||||||||||||||||||||||||||||||||||||||||||||
getMyQuotes(days?: number, filters?: Array<FieldFilter>, relatedRecords: string, limit: number, pageNumber: number, orderBy: string, orderDirection: "ASC" | "DESC", showErrorToaster: boolean)
|
|||||||||||||||||||||||||||||||||||||||||||||
This method is work in progress, currently returning all quotes.</ The method fetches the list of my quotes based on the parameters passed. Example:Example :
Parameters :
Returns :
Observable<QuoteResult>
An observable containing the list of quotes matching the criteria with total quote count. |
getQuote | ||||||||
getQuote(Id: string)
|
||||||||
The method gets details of the Quote based on the quote Id passed. Example:Example :
Parameters :
Returns :
Observable<Quote>
an observable instance of the quote matching the quote id. |
getQuoteAggregatesByApprovalStage | ||||||||||||||||||||||||||||||
getQuoteAggregatesByApprovalStage(account?: string | Account, aggregateFields?: Array<AggregateFields>, queryFields: Array
|
||||||||||||||||||||||||||||||
This method returns an aggregate result based on quote aggregate criteria.
Parameters :
Returns :
Observable<AggregateResultSet>
observable containing aggregate response. |
getQuoteById | |||||||||||||||
getQuoteById(quoteId: string, includeLineItems: boolean)
|
|||||||||||||||
This method returns the quote details based on given quote Id. Example:Example :
Parameters :
Returns :
Observable<Quote>
observable instance of the quote matching the quote Id. |
getQuoteByName | ||||||||
getQuoteByName(name: string)
|
||||||||
Method gets a quote by the name Example:Example :
Parameters :
Returns :
Observable<Quote>
an observable instance of the quote retrieved. |
onInit |
onInit()
|
Returns :
void
|
Public publish | ||||||||
publish(quote: Quote)
|
||||||||
The method is used to emit the state of the quote.
Parameters :
Returns :
void
|
updateQuote | ||||||||||||
updateQuote(quoteId: string, payload: Quote)
|
||||||||||||
This method updates the quote object based on the payload passed.
Parameters :
Returns :
Observable<Quote>
observable containing the updated quote. |
cartItemService |
Default value : this.injector.get(CartItemService)
|
contactService |
Default value : this.injector.get(ContactService)
|
Protected lineItemProductService |
Type : LineItemProductService
|
Default value : this.injector.get(LineItemProductService)
|
Protected ngZone |
Type : NgZone
|
Default value : this.injector.get(NgZone)
|
type |
Default value : Quote
|