Browse Source

docs(core): Add docs to OrderItemPriceCalculationStrategy on relations

Relates to #1683
Michael Bromley 3 years ago
parent
commit
fba7a73df3

+ 5 - 2
packages/core/src/config/order/order-item-price-calculation-strategy.ts

@@ -5,9 +5,9 @@ import { ProductVariant } from '../../entity/product-variant/product-variant.ent
 
 /**
  * @description
- * The OrderItemPriceCalculationStrategy defines the price of an OrderItem. By default the 
+ * The OrderItemPriceCalculationStrategy defines the price of an OrderItem. By default the
  * {@link DefaultOrderItemPriceCalculationStrategy} is used.
- * 
+ *
  * ### When is the strategy invoked ?
  * * addItemToOrder (only on the new order line)
  * * adjustOrderLine  (only on the adjusted order line)
@@ -48,6 +48,9 @@ export interface OrderItemPriceCalculationStrategy extends InjectableStrategy {
      * @description
      * Receives the ProductVariant to be added to the Order as well as any OrderLine custom fields and returns
      * the price for a single unit.
+     *
+     * Note: if you have any `relation` type custom fields defined on the OrderLine entity, they will only be
+     * passed in to this method if they are set to `eager: true`.
      */
     calculateUnitPrice(
         ctx: RequestContext,