projects/congacommerce/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 '@congacommerce/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)
|
||||||||||
Method converts the current cart into a quote instance. Sets the business object on the cart to 'Proposal' Example:Example :
Parameters :
Returns :
Observable<Quote>
an observable of the quote instance that was created from the cart |
convertQuoteToCart | ||||||
convertQuoteToCart(quoteId: string)
|
||||||
Method creates new cart and clones the finalized cart linked to the quote Id passed as argument to the new cart and set the new cart as active Example:Example :
Parameters :
Returns :
Observable<Cart>
an observable of the quote instance that was created from the cart |
createCart | ||||||||
createCart(quoteId: string)
|
||||||||
Method to create a new cart for quote Example:Example :
Parameters :
Returns :
Observable<string>
the id of new cart for given 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.
Parameters :
Returns :
Observable<boolean>
|
getGrandTotalByApprovalStage |
getGrandTotalByApprovalStage()
|
Method to get the aggregate of quote total by approval stage Example:Example :
Returns :
Observable<object>
Aggregate of quote total object based on the Approval Stage. |
getMyQuotes | ||||||||||||||||||||||||||||||
getMyQuotes(days?: number, limit: number, pageNumber: number, orderBy: string, orderDirection: "ASC" | "DESC")
|
||||||||||||||||||||||||||||||
Returns a list of quotes for the given user. Example:Example :
Parameters :
Returns :
Observable<Array<Quote>>
a an observable array of quote instances for the current user |
getQuoteByName | ||||||
getQuoteByName(name: string)
|
||||||
Method gets a quote by the name Example:Example :
Parameters :
Returns :
Observable<Quote>
an empty observable when the process completes |
onInit |
onInit()
|
Returns :
void
|
cartItemService |
Default value : this.injector.get(CartItemService)
|
contactService |
Default value : this.injector.get(ContactService)
|
noteService |
Default value : this.injector.get(NoteService)
|
type |
Default value : Quote
|