Broadleaf Microservices
  • v1.0.0-latest-prod

Cart Services Data Model

Overview

The Cart Service provides management of carts.

Data Diagrams

Cart

A Cart represents a customer facing shopping cart with items, pricing and fulfillment information.

To learn about quote-related domains, proceed to the Quote section on this page.

Cart Data Model

Computed Fields

Besides the persisted fields, there are a number of computer fields that aid in business logic and displaying information on a storefront. These will be represented with the name of the fields as they would appear on a JSON payload rather than using the names of their accessors.

On Cart
  • quantity: The sum of the quantities of all the CartItems.

  • anonymous: Whether the cart belongs to an anonymous user.

  • currency: The currency used by all the pricing on the cart. A Cart can only contain items using the same currency out of box.

  • Each of the following are maps where the key is the recurring period type, MONTHLY, QUARTERLY, or ANNUALLY, and the values are the monetary amounts for that period. This is make it clear to a caller which items are billed on what relative frequency. It is primarily the responsibility of the billing system to handle exact calculations and these are intended only as a display aid.

    • recurringSubtotals: The estimated recurring subtotal for the first period discounted for all items grouped by their recurring period type. Since Cart Service 2.2.0.

    • recurrignAdjustmentsTotals: The estimated recurring adjustments total for the first period discounted for all items grouped by their recurring period type. Since Cart Service 2.2.0.

    • recurringTotals: The estimated recurring total for the first period discounted for all items grouped by their recurring period type. Since Cart Service 2.2.0.

On Cart Item
  • hasConfigErrors: Whether any of the configuration error fields have contents.

  • recurringPeriodTypeWithDependentItems: If the item has a recurring price or any of its dependent items have a recurring price, this will return the type of recurring billing period that they use, e.g., MONTHLY, QUARTERLY, or ANNUALLY billed.

  • unitPriceWithDependentItems: Computes the composite unit price of the item. This includes the subtotals of the item’s dependents if their pricingStrategy is ADD_TO_PARENT. subtotal is used for the dependents (which is unit price times quantity) since a "unit" of the parent CartItem includes all its dependents—if the quantity on the parent is increased from 1 to 2 and the quantity of a dependent is 2, then there would now be 4 of those dependents in the cart with 2 per parent.

  • recurringPriceWithDependentItems: Similar to unitPriceWithDependentItems but for recurring price instead of upfront. Since Cart Service 2.2.0.

  • subtotalWithDependentItems: unitPriceWithDependentItems multiplied by the quantity of the Cart Item.

  • recurringSubtotalWithDependentItems: recurringPriceWithDependentItems multiplied by the quantity of the Cart Item. Since Cart Service 2.2.0.

  • adjustmentsTotalWithDependentItems: The sum of all non-recurring adjustments on the item plus the sum of all its dependents' non-recurring adjustments.

  • recurringAdjustmentsTotalWithDependentItems: The sum of all recurring adjustments on the item plus the sum of all its dependents' recurring adjustments. Since Cart Service 2.2.0.

  • totalWithDependentItems: Equivalent to the subtotalWithDependentItems of the item less the adjustmentsTotalWithDependentItems.

  • recurringTotalWithDependentItems: Equivalent to the recurringSubtotalWithDependentItems of the item less the recurringAdjustmentsTotalWithDependentItems. Since Cart Service 2.2.0.

  • hasFreeTrial: Whether the item has any adjustments of type FREE_TRIAL. Since Cart Service 2.2.0.

  • currency: The currency used for all prices on the item.

Item List

An ItemList is basic list of items used for things like wishlists which will not require the full information of a cart (e.g. contextual pricing information, offer/campaign support, fulfillment information, etc).

Item List Data Model

Guest Token

Guest tokens are issued for guest carts in order to provide a security layer to protect a guest’s personal information.

Guest Token Data Model

Cart Action Audit

A CartActionAudit is used to keep track of changes made to Carts of type QUOTE or B2B account carts. It is not used for regular customer carts.

Cart Action Audit Data Model

A cart of type QUOTE has special functionality. The following objects are primarily used in the quote workflow:

  • A CartNote is a message entered by buyer or seller during quote negotiation.

  • A ReviewerAssignment is used to track which sales rep is assigned to a specific quote, gaining authority to accept, modify, or reject quotes.

For more information on carts of type Quote, see this page.

Quote-related Data Model

BLC Common Features

Cart Services uses the following Common Data Features which create additional tables within the Cart Services data schema.

Application Trackable - Cart service data is Application trackable to support the service running in a multi-tenant environment.

Customer Trackable - Cart service data is Customer trackable to support associating entities to customers.