chore: fixes and updates to promotion and shipping option TSDocs (#12222)
This commit is contained in:
@@ -125,6 +125,13 @@ export const createShippingOptionsPriceSetsStepId =
|
||||
"add-shipping-options-prices-step"
|
||||
/**
|
||||
* This step creates price sets for one or more shipping options.
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* Learn more about adding rules to the shipping option's prices in the Pricing Module's
|
||||
* [Price Rules](https://docs.medusajs.com/resources/commerce-modules/pricing/price-rules) documentation.
|
||||
*
|
||||
* :::note
|
||||
*/
|
||||
export const createShippingOptionsPriceSetsStep = createStep(
|
||||
createShippingOptionsPriceSetsStepId,
|
||||
|
||||
@@ -31,6 +31,13 @@ export const createShippingOptionsWorkflowId =
|
||||
* @example
|
||||
* To calculate a shipping option with flat rate prices:
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* Learn more about adding rules to the shipping option's prices in the Pricing Module's
|
||||
* [Price Rules](https://docs.medusajs.com/resources/commerce-modules/pricing/price-rules) documentation.
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* ```ts
|
||||
* const { result } = await createShippingOptionsWorkflow(container)
|
||||
* .run({
|
||||
|
||||
@@ -28,6 +28,13 @@ export const updateShippingOptionsWorkflowId =
|
||||
* You can use this workflow within your own customizations or custom workflows, allowing you to
|
||||
* update shipping options within your custom flows.
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* Learn more about adding rules to the shipping option's prices in the Pricing Module's
|
||||
* [Price Rules](https://docs.medusajs.com/resources/commerce-modules/pricing/price-rules) documentation.
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* @example
|
||||
* const { result } = await updateShippingOptionsWorkflow(container)
|
||||
* .run({
|
||||
|
||||
@@ -207,6 +207,13 @@ export const createProductVariantsWorkflowId = "create-product-variants"
|
||||
*
|
||||
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around product-variant creation.
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* Learn more about adding rules to the product variant's prices in the Pricing Module's
|
||||
* [Price Rules](https://docs.medusajs.com/resources/commerce-modules/pricing/price-rules) documentation.
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* @example
|
||||
* const { result } = await createProductVariantsWorkflow(container)
|
||||
* .run({
|
||||
|
||||
@@ -108,6 +108,13 @@ export const createProductsWorkflowId = "create-products"
|
||||
* This workflow has a hook that allows you to perform custom actions on the created products. You can see an example in [this guide](https://docs.medusajs.com/resources/commerce-modules/product/extend).
|
||||
*
|
||||
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around product creation.
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* Learn more about adding rules to the product variant's prices in the Pricing Module's
|
||||
* [Price Rules](https://docs.medusajs.com/resources/commerce-modules/pricing/price-rules) documentation.
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* @example
|
||||
* const { result } = await createProductsWorkflow(container)
|
||||
|
||||
@@ -57,6 +57,13 @@ export const updateProductVariantsWorkflowId = "update-product-variants"
|
||||
* allows you to update custom data models linked to the product variants.
|
||||
*
|
||||
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around product-variant update.
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* Learn more about adding rules to the product variant's prices in the Pricing Module's
|
||||
* [Price Rules](https://docs.medusajs.com/resources/commerce-modules/pricing/price-rules) documentation.
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* @example
|
||||
* To update product variants by their IDs:
|
||||
|
||||
@@ -343,6 +343,13 @@ export const updateProductsWorkflowId = "update-products"
|
||||
* allows you to update custom data models linked to the products.
|
||||
*
|
||||
* You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around product update.
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* Learn more about adding rules to the product variant's prices in the Pricing Module's
|
||||
* [Price Rules](https://docs.medusajs.com/resources/commerce-modules/pricing/price-rules) documentation.
|
||||
*
|
||||
* :::note
|
||||
*
|
||||
* @example
|
||||
* To update products by their IDs:
|
||||
|
||||
@@ -34,6 +34,7 @@ export const createPromotionsWorkflowId = "create-promotions"
|
||||
* {
|
||||
* code: "10OFF",
|
||||
* type: "standard",
|
||||
* status: "active",
|
||||
* application_method: {
|
||||
* type: "percentage",
|
||||
* target_type: "items",
|
||||
|
||||
@@ -123,6 +123,7 @@ export interface IPromotionModuleService extends IModuleService {
|
||||
* {
|
||||
* code: "50OFF",
|
||||
* type: "standard",
|
||||
* status: "active",
|
||||
* application_method: {
|
||||
* type: "percentage",
|
||||
* target_type: "items",
|
||||
@@ -132,6 +133,7 @@ export interface IPromotionModuleService extends IModuleService {
|
||||
* {
|
||||
* code: "FREESHIPPING",
|
||||
* type: "standard",
|
||||
* status: "active",
|
||||
* application_method: {
|
||||
* type: "percentage",
|
||||
* target_type: "shipping_methods",
|
||||
@@ -141,6 +143,7 @@ export interface IPromotionModuleService extends IModuleService {
|
||||
* {
|
||||
* code: "BUY2GET1",
|
||||
* type: "buyget",
|
||||
* status: "active",
|
||||
* application_method: {
|
||||
* type: "fixed",
|
||||
* target_type: "items",
|
||||
@@ -173,6 +176,7 @@ export interface IPromotionModuleService extends IModuleService {
|
||||
* const promotionA = await promotionModuleService.createPromotions({
|
||||
* code: "50OFF",
|
||||
* type: "standard",
|
||||
* status: "active",
|
||||
* application_method: {
|
||||
* type: "percentage",
|
||||
* target_type: "items",
|
||||
@@ -183,6 +187,7 @@ export interface IPromotionModuleService extends IModuleService {
|
||||
* const promotionB = await promotionModuleService.createPromotions({
|
||||
* code: "FREESHIPPING",
|
||||
* type: "standard",
|
||||
* status: "active",
|
||||
* application_method: {
|
||||
* type: "percentage",
|
||||
* target_type: "shipping_methods",
|
||||
@@ -193,6 +198,7 @@ export interface IPromotionModuleService extends IModuleService {
|
||||
* const promotionC = await promotionModuleService.createPromotions({
|
||||
* code: "BUY2GET1",
|
||||
* type: "buyget",
|
||||
* status: "active",
|
||||
* application_method: {
|
||||
* type: "fixed",
|
||||
* target_type: "items",
|
||||
|
||||
Reference in New Issue
Block a user