@mercurjs/docs 2.2.1 → 2.3.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/content/home.mdx +107 -0
- package/content/learn/architecture.mdx +168 -83
- package/content/learn/introduction.mdx +161 -56
- package/content/learn/migration-to-2-0.mdx +187 -0
- package/content/learn/why-mercur.mdx +91 -0
- package/content/platform/attribute/concepts/attribute-types.mdx +59 -0
- package/content/platform/attribute/concepts/global-vs-inline.mdx +50 -0
- package/content/platform/attribute/concepts/variant-axes.mdx +61 -0
- package/content/platform/attribute/guides/attach-attributes-to-a-product.mdx +69 -0
- package/content/platform/attribute/guides/create-a-variant-axis.mdx +83 -0
- package/content/platform/attribute/guides/create-an-attribute.mdx +81 -0
- package/content/platform/attribute/overview.mdx +87 -0
- package/content/platform/attribute/reference/data-models.mdx +56 -0
- package/content/platform/attribute/reference/events.mdx +41 -0
- package/content/platform/attribute/reference/links.mdx +45 -0
- package/content/platform/attribute/reference/service.mdx +49 -0
- package/content/platform/attribute/reference/workflows.mdx +45 -0
- package/content/platform/catalog/concepts/master-products.mdx +54 -0
- package/content/platform/catalog/concepts/product-seller-allowlist.mdx +48 -0
- package/content/platform/catalog/concepts/status-lifecycle.mdx +58 -0
- package/content/platform/catalog/concepts/variants-categories-collections.mdx +49 -0
- package/content/platform/catalog/guides/allowlist-stores.mdx +59 -0
- package/content/platform/catalog/guides/create-a-master-product.mdx +70 -0
- package/content/platform/catalog/guides/publish-or-reject-a-product.mdx +79 -0
- package/content/platform/catalog/overview.mdx +90 -0
- package/content/platform/catalog/reference/data-models.mdx +66 -0
- package/content/platform/catalog/reference/events.mdx +41 -0
- package/content/platform/catalog/reference/links.mdx +44 -0
- package/content/platform/catalog/reference/service.mdx +52 -0
- package/content/platform/catalog/reference/workflows.mdx +40 -0
- package/content/platform/commission/concepts/order-commission-lines.mdx +65 -0
- package/content/platform/commission/concepts/rule-matching.mdx +86 -0
- package/content/platform/commission/concepts/rules-and-rates.mdx +84 -0
- package/content/platform/commission/guides/batch-update-rules.mdx +58 -0
- package/content/platform/commission/guides/create-a-rate.mdx +72 -0
- package/content/platform/commission/guides/refresh-order-commission-lines.mdx +55 -0
- package/content/platform/commission/overview.mdx +86 -0
- package/content/platform/commission/reference/data-models.mdx +75 -0
- package/content/platform/commission/reference/events.mdx +58 -0
- package/content/platform/commission/reference/links.mdx +45 -0
- package/content/platform/commission/reference/service.mdx +51 -0
- package/content/platform/commission/reference/workflows.mdx +40 -0
- package/content/platform/offer/concepts/pricing-and-inventory.mdx +72 -0
- package/content/platform/offer/concepts/shipping.mdx +48 -0
- package/content/platform/offer/concepts/what-is-an-offer.mdx +65 -0
- package/content/platform/offer/guides/bulk-create-offers.mdx +84 -0
- package/content/platform/offer/guides/create-an-offer.mdx +83 -0
- package/content/platform/offer/guides/manage-offer-inventory.mdx +53 -0
- package/content/platform/offer/overview.mdx +84 -0
- package/content/platform/offer/reference/data-models.mdx +56 -0
- package/content/platform/offer/reference/events.mdx +39 -0
- package/content/platform/offer/reference/links.mdx +60 -0
- package/content/platform/offer/reference/service.mdx +53 -0
- package/content/platform/offer/reference/workflows.mdx +38 -0
- package/content/platform/order-group/concepts/computed-totals.mdx +59 -0
- package/content/platform/order-group/concepts/order-splitting.mdx +61 -0
- package/content/platform/order-group/concepts/the-order-group.mdx +64 -0
- package/content/platform/order-group/guides/list-order-groups.mdx +67 -0
- package/content/platform/order-group/guides/retrieve-an-order-group.mdx +63 -0
- package/content/platform/order-group/guides/split-a-cart.mdx +58 -0
- package/content/platform/order-group/overview.mdx +83 -0
- package/content/platform/order-group/reference/data-models.mdx +40 -0
- package/content/platform/order-group/reference/events.mdx +37 -0
- package/content/platform/order-group/reference/links.mdx +45 -0
- package/content/platform/order-group/reference/service.mdx +50 -0
- package/content/platform/order-group/reference/workflows.mdx +39 -0
- package/content/platform/payout/concepts/account-lifecycle.mdx +75 -0
- package/content/platform/payout/concepts/accounts-and-onboarding.mdx +70 -0
- package/content/platform/payout/concepts/payout-pipeline.mdx +99 -0
- package/content/platform/payout/guides/create-a-payout-account.mdx +59 -0
- package/content/platform/payout/guides/process-a-provider-webhook.mdx +74 -0
- package/content/platform/payout/guides/start-provider-onboarding.mdx +50 -0
- package/content/platform/payout/overview.mdx +86 -0
- package/content/platform/payout/reference/data-models.mdx +61 -0
- package/content/platform/payout/reference/events.mdx +48 -0
- package/content/platform/payout/reference/links.mdx +36 -0
- package/content/platform/payout/reference/service.mdx +53 -0
- package/content/platform/payout/reference/workflows.mdx +32 -0
- package/content/platform/product-edit/concepts/change-actions.mdx +66 -0
- package/content/platform/product-edit/concepts/change-pipeline.mdx +69 -0
- package/content/platform/product-edit/concepts/status-and-auto-confirm.mdx +66 -0
- package/content/platform/product-edit/guides/confirm-or-decline-a-change.mdx +76 -0
- package/content/platform/product-edit/guides/edit-a-product.mdx +74 -0
- package/content/platform/product-edit/guides/request-a-revision.mdx +54 -0
- package/content/platform/product-edit/overview.mdx +85 -0
- package/content/platform/product-edit/reference/data-models.mdx +65 -0
- package/content/platform/product-edit/reference/events.mdx +47 -0
- package/content/platform/product-edit/reference/links.mdx +39 -0
- package/content/platform/product-edit/reference/service.mdx +43 -0
- package/content/platform/product-edit/reference/workflows.mdx +49 -0
- package/content/platform/review/concepts/product-vs-seller-reviews.mdx +63 -0
- package/content/platform/review/concepts/ratings-and-moderation.mdx +64 -0
- package/content/platform/review/concepts/the-review-model.mdx +56 -0
- package/content/platform/review/guides/compute-aggregate-ratings.mdx +57 -0
- package/content/platform/review/guides/create-a-review.mdx +55 -0
- package/content/platform/review/guides/moderate-a-review.mdx +58 -0
- package/content/platform/review/guides/respond-to-a-review.mdx +61 -0
- package/content/platform/review/overview.mdx +87 -0
- package/content/platform/review/reference/data-models.mdx +36 -0
- package/content/platform/review/reference/events.mdx +61 -0
- package/content/platform/review/reference/links.mdx +43 -0
- package/content/platform/review/reference/service.mdx +54 -0
- package/content/platform/review/reference/workflows.mdx +31 -0
- package/content/platform/store/concepts/lifecycle.mdx +62 -0
- package/content/platform/store/concepts/store-entity.mdx +53 -0
- package/content/platform/store/concepts/team.mdx +50 -0
- package/content/platform/store/guides/create-a-store.mdx +55 -0
- package/content/platform/store/guides/manage-the-team.mdx +55 -0
- package/content/platform/store/guides/moderate-a-store.mdx +59 -0
- package/content/platform/store/overview.mdx +86 -0
- package/content/platform/store/reference/data-models.mdx +89 -0
- package/content/platform/store/reference/events.mdx +43 -0
- package/content/platform/store/reference/links.mdx +71 -0
- package/content/platform/store/reference/service.mdx +51 -0
- package/content/platform/store/reference/workflows.mdx +35 -0
- package/content/references/api/admin/commission-rates/create-commission-rate.mdx +1 -1
- package/content/references/api/admin/commission-rates/list-commission-rates.mdx +2 -2
- package/content/references/api/admin/commission-rates/update-commission-rate.mdx +1 -1
- package/content/references/api/admin/offers/batch-create-offers.mdx +3 -3
- package/content/references/api/admin/order-groups/list-order-groups.mdx +1 -1
- package/content/references/api/admin/product-attributes/create-attribute-value.mdx +2 -2
- package/content/references/api/admin/product-attributes/create-product-attribute.mdx +1 -1
- package/content/references/api/admin/product-attributes/update-product-attribute.mdx +1 -1
- package/content/references/api/admin/product-changes/confirm-product-change.mdx +1 -1
- package/content/references/api/admin/products/batch-product-attributes.mdx +1 -1
- package/content/references/api/admin/products/create-product.mdx +1 -1
- package/content/references/api/admin/products/preview-product.mdx +1 -1
- package/content/references/api/admin.mdx +4 -5
- package/content/references/api/conventions.mdx +9 -7
- package/content/references/api/store/carts/add-line-item.mdx +1 -1
- package/content/references/api/store/offers/list-offers.mdx +1 -1
- package/content/references/api/store/order-groups/list-order-groups.mdx +1 -1
- package/content/references/api/store.mdx +4 -13
- package/content/references/api/vendor/members/accept-member-invite.mdx +1 -1
- package/content/references/api/vendor/offers/batch-create-offers.mdx +4 -0
- package/content/references/api/vendor/offers/batch-offer-inventory-items.mdx +2 -0
- package/content/references/api/vendor/offers/create-offer.mdx +13 -1
- package/content/references/api/vendor/offers/list-offers.mdx +4 -0
- package/content/references/api/vendor/offers/retrieve-offer.mdx +4 -0
- package/content/references/api/vendor/offers/update-offer.mdx +12 -0
- package/content/references/api/vendor/payout-accounts/create-onboarding.mdx +1 -1
- package/content/references/api/vendor/products/batch-product-attributes.mdx +1 -1
- package/content/references/api/vendor/products/create-product-variant.mdx +1 -1
- package/content/references/api/vendor/products/create-product.mdx +1 -1
- package/content/references/api/vendor/products/delete-product.mdx +1 -1
- package/content/references/api/vendor/products/update-product.mdx +1 -1
- package/content/references/api/vendor/sellers/create-seller.mdx +2 -2
- package/content/references/api/vendor/sellers/list-sellers.mdx +1 -1
- package/content/references/api/vendor.mdx +6 -5
- package/content/references/configuration.mdx +16 -33
- package/content/references/overview.mdx +34 -52
- package/content/references/panel-extensions/create-page.mdx +194 -0
- package/content/references/panel-extensions/custom-fields.mdx +256 -0
- package/content/references/panel-extensions/overview.mdx +102 -0
- package/content/references/panel-extensions/widgets.mdx +212 -0
- package/content/resources/ai/mcp.mdx +2 -2
- package/content/resources/ai/overview.mdx +21 -16
- package/content/resources/ai/skills.mdx +67 -0
- package/content/resources/best-practices/api-routes.mdx +55 -43
- package/content/resources/best-practices/custom-fields.mdx +116 -92
- package/content/resources/best-practices/frontend.mdx +62 -50
- package/content/resources/best-practices/module-links.mdx +48 -34
- package/content/resources/best-practices/modules.mdx +53 -27
- package/content/resources/best-practices/overview.mdx +45 -17
- package/content/resources/best-practices/subscribers-and-jobs.mdx +37 -24
- package/content/resources/best-practices/types.mdx +38 -23
- package/content/resources/best-practices/workflows.mdx +33 -21
- package/content/resources/customization/custom-fields.mdx +15 -15
- package/content/resources/customization/extend-a-workflow.mdx +7 -4
- package/content/resources/customization/extending-panels.mdx +55 -52
- package/content/resources/deployment/medusa-cloud.mdx +21 -20
- package/content/resources/deployment/self-host.mdx +123 -0
- package/content/resources/integrations/overview.mdx +38 -0
- package/content/resources/integrations/stripe-connect.mdx +39 -38
- package/content/resources/tutorials/add-a-block.mdx +25 -18
- package/content/resources/tutorials/add-a-widget.mdx +32 -23
- package/content/resources/tutorials/add-order-detail-button.mdx +33 -20
- package/content/resources/tutorials/attributes-and-variant-axes.mdx +28 -27
- package/content/resources/tutorials/build-a-block.mdx +26 -15
- package/content/resources/tutorials/custom-api-route.mdx +32 -20
- package/content/resources/tutorials/custom-panel-page.mdx +21 -12
- package/content/resources/tutorials/customize-navigation.mdx +30 -23
- package/content/resources/tutorials/extend-forms-and-tables.mdx +36 -28
- package/content/resources/tutorials/extend-onboarding.mdx +38 -35
- package/content/resources/tutorials/master-products-and-offers.mdx +28 -23
- package/content/telemetry.mdx +3 -3
- package/content/user-guide/admin/attributes/how-tos/create-an-attribute.mdx +64 -0
- package/content/user-guide/admin/attributes/how-tos/manage-possible-values.mdx +40 -0
- package/content/user-guide/admin/attributes/overview.mdx +22 -0
- package/content/user-guide/admin/commissions/how-tos/create-a-commission-rule.mdx +63 -0
- package/content/user-guide/admin/commissions/how-tos/edit-the-global-commission.mdx +48 -0
- package/content/user-guide/admin/commissions/how-tos/manage-a-commission-rule.mdx +45 -0
- package/content/user-guide/admin/commissions/overview.mdx +25 -0
- package/content/user-guide/admin/overview.mdx +20 -12
- package/content/user-guide/admin/product-requests/how-tos/review-a-new-product.mdx +58 -0
- package/content/user-guide/admin/product-requests/how-tos/review-a-product-edit.mdx +48 -0
- package/content/user-guide/admin/product-requests/overview.mdx +25 -0
- package/content/user-guide/vendor/offers/how-tos/create-an-offer.mdx +59 -0
- package/content/user-guide/vendor/offers/how-tos/update-prices-and-stock.mdx +40 -0
- package/content/user-guide/vendor/offers/overview.mdx +22 -0
- package/content/user-guide/vendor/onboarding.mdx +79 -0
- package/content/user-guide/vendor/orders/how-tos/fulfill-an-order.mdx +49 -0
- package/content/user-guide/vendor/orders/how-tos/mark-an-order-as-delivered.mdx +33 -0
- package/content/user-guide/vendor/orders/how-tos/process-a-return.mdx +42 -0
- package/content/user-guide/vendor/orders/how-tos/refund-an-order.mdx +38 -0
- package/content/user-guide/vendor/orders/how-tos/ship-an-order.mdx +40 -0
- package/content/user-guide/vendor/orders/overview.mdx +31 -0
- package/content/user-guide/vendor/overview.mdx +23 -12
- package/content/user-guide/vendor/products/how-tos/edit-a-product.mdx +44 -0
- package/content/user-guide/vendor/products/how-tos/submit-a-product.mdx +63 -0
- package/content/user-guide/vendor/products/overview.mdx +22 -0
- package/llms.txt +176 -142
- package/package.json +1 -1
- package/content/learn/concepts.mdx +0 -84
- package/content/learn/installation.mdx +0 -117
- package/content/learn/mirakl-alternative.mdx +0 -86
- package/content/migration/from-1-x-to-2-0.mdx +0 -152
- package/content/migration/from-2-0-to-2-1.mdx +0 -105
- package/content/migration/overview.mdx +0 -58
- package/content/references/api/store/search/search.mdx +0 -136
- package/content/references/modules/commission.mdx +0 -106
- package/content/references/modules/custom-fields.mdx +0 -45
- package/content/references/modules/media.mdx +0 -55
- package/content/references/modules/offer.mdx +0 -64
- package/content/references/modules/payout.mdx +0 -121
- package/content/references/modules/product-attribute.mdx +0 -111
- package/content/references/modules/product-edit.mdx +0 -80
- package/content/references/modules/search.mdx +0 -112
- package/content/references/modules/seller.mdx +0 -175
- package/content/references/panel-extension-api.mdx +0 -337
- package/content/references/workflows/cart/add-seller-shipping-method-to-cart.mdx +0 -48
- package/content/references/workflows/cart/complete-cart-with-split-orders.mdx +0 -36
- package/content/references/workflows/cart/list-seller-shipping-options-for-cart.mdx +0 -39
- package/content/references/workflows/cart/update-cart-seller-promotions.mdx +0 -42
- package/content/references/workflows/commission/batch-commission-rules.mdx +0 -49
- package/content/references/workflows/commission/create-commission-rates.mdx +0 -41
- package/content/references/workflows/commission/delete-commission-rates.mdx +0 -34
- package/content/references/workflows/commission/refresh-order-commission-lines.mdx +0 -30
- package/content/references/workflows/commission/update-commission-rates.mdx +0 -35
- package/content/references/workflows/media/set-category-images.mdx +0 -41
- package/content/references/workflows/media/set-collection-images.mdx +0 -41
- package/content/references/workflows/member/accept-member-invite.mdx +0 -33
- package/content/references/workflows/member/add-seller-member.mdx +0 -30
- package/content/references/workflows/member/create-member-invites.mdx +0 -34
- package/content/references/workflows/member/delete-member-invite.mdx +0 -24
- package/content/references/workflows/member/remove-seller-member.mdx +0 -28
- package/content/references/workflows/member/resend-member-invite.mdx +0 -28
- package/content/references/workflows/member/update-member-role.mdx +0 -28
- package/content/references/workflows/member/update-member.mdx +0 -35
- package/content/references/workflows/offer/batch-offer-inventory-items.mdx +0 -62
- package/content/references/workflows/offer/create-offers.mdx +0 -65
- package/content/references/workflows/offer/delete-offers.mdx +0 -35
- package/content/references/workflows/offer/update-offers.mdx +0 -53
- package/content/references/workflows/order/cancel-order-fulfillment.mdx +0 -34
- package/content/references/workflows/order/confirm-claim-request.mdx +0 -25
- package/content/references/workflows/order/confirm-exchange-request.mdx +0 -25
- package/content/references/workflows/order/confirm-order-edit-request.mdx +0 -25
- package/content/references/workflows/order/confirm-return-receive.mdx +0 -25
- package/content/references/workflows/order/create-order-fulfillment.mdx +0 -45
- package/content/references/workflows/order-group/get-order-group-detail.mdx +0 -29
- package/content/references/workflows/order-group/get-order-groups-list.mdx +0 -38
- package/content/references/workflows/overview.mdx +0 -72
- package/content/references/workflows/payout/create-onboarding.mdx +0 -36
- package/content/references/workflows/payout/create-payout-account.mdx +0 -33
- package/content/references/workflows/payout/create-payout.mdx +0 -30
- package/content/references/workflows/payout/process-payout-for-webhook.mdx +0 -34
- package/content/references/workflows/product/confirm-products.mdx +0 -48
- package/content/references/workflows/product/create-products.mdx +0 -63
- package/content/references/workflows/product/link-sellers-to-product-category.mdx +0 -40
- package/content/references/workflows/product/link-sellers-to-product.mdx +0 -40
- package/content/references/workflows/product/reject-product.mdx +0 -48
- package/content/references/workflows/product/request-product-change.mdx +0 -48
- package/content/references/workflows/product-attribute/add-product-attributes-to-product.mdx +0 -49
- package/content/references/workflows/product-attribute/create-and-link-product-attributes-to-product.mdx +0 -46
- package/content/references/workflows/product-attribute/create-product-attribute-values.mdx +0 -43
- package/content/references/workflows/product-attribute/create-product-attributes.mdx +0 -56
- package/content/references/workflows/product-attribute/delete-product-attribute-values.mdx +0 -30
- package/content/references/workflows/product-attribute/delete-product-attributes.mdx +0 -30
- package/content/references/workflows/product-attribute/remove-product-attributes-from-product.mdx +0 -29
- package/content/references/workflows/product-attribute/update-product-attribute-values.mdx +0 -44
- package/content/references/workflows/product-attribute/update-product-attributes-on-product.mdx +0 -41
- package/content/references/workflows/product-attribute/update-product-attributes.mdx +0 -48
- package/content/references/workflows/product-attribute/upsert-product-attribute-values.mdx +0 -43
- package/content/references/workflows/product-edit/auto-confirm-product-change.mdx +0 -39
- package/content/references/workflows/product-edit/cancel-product-change.mdx +0 -49
- package/content/references/workflows/product-edit/confirm-product-change.mdx +0 -57
- package/content/references/workflows/product-edit/create-product-change.mdx +0 -72
- package/content/references/workflows/product-edit/reject-product-change.mdx +0 -54
- package/content/references/workflows/product-edit/stage-product-change.mdx +0 -75
- package/content/references/workflows/seller/approve-seller.mdx +0 -36
- package/content/references/workflows/seller/create-seller-account.mdx +0 -59
- package/content/references/workflows/seller/create-seller-defaults.mdx +0 -22
- package/content/references/workflows/seller/create-sellers.mdx +0 -65
- package/content/references/workflows/seller/delete-seller-professional-details.mdx +0 -37
- package/content/references/workflows/seller/delete-sellers.mdx +0 -24
- package/content/references/workflows/seller/invite-seller.mdx +0 -28
- package/content/references/workflows/seller/suspend-seller.mdx +0 -37
- package/content/references/workflows/seller/terminate-seller.mdx +0 -37
- package/content/references/workflows/seller/unsuspend-seller.mdx +0 -36
- package/content/references/workflows/seller/unterminate-seller.mdx +0 -36
- package/content/references/workflows/seller/update-seller-address.mdx +0 -55
- package/content/references/workflows/seller/update-seller-payment-details.mdx +0 -52
- package/content/references/workflows/seller/update-seller-professional-details.mdx +0 -48
- package/content/references/workflows/seller/update-sellers.mdx +0 -57
- package/content/resources/ai/llms.mdx +0 -74
- package/content/resources/integrations/notifications.mdx +0 -39
- package/content/resources/integrations/search.mdx +0 -122
- package/content/resources/tutorials/configure-commissions.mdx +0 -127
- package/content/resources/tutorials/first-marketplace.mdx +0 -45
- package/content/resources/tutorials/handle-product-requests.mdx +0 -80
- package/content/resources/tutorials/import-export-products.mdx +0 -96
- package/content/resources/tutorials/seller-payouts-stripe.mdx +0 -89
- package/content/resources/tutorials/store-setup-checklist.mdx +0 -214
- package/content/tools/api-client.mdx +0 -155
- package/content/tools/cli.mdx +0 -196
- package/content/tools/dashboard-sdk.mdx +0 -35
package/content/references/workflows/product-attribute/update-product-attributes-on-product.mdx
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "updateProductAttributesOnProductWorkflow"
|
|
3
|
-
description: "Mutate a product's per-attribute value selections."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Handles the `update` portion of the attribute batch engine (`createAndLinkProductAttributesToProductWorkflow`). For shared axis attributes it adjusts the per-product value subset of the mirror option and keeps the value-link pivot in sync; for exclusive (product-scoped) axis attributes it creates or deletes values on the exclusive option; for `text`/`unit` it swaps the linked value's name (or creates one); for `toggle` it re-links the matching `true`/`false` value. A `title` on a product-scoped attribute renames it via `updateProductAttributesWorkflow`.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { updateProductAttributesOnProductWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
-
|
|
13
|
-
await updateProductAttributesOnProductWorkflow(container).run({
|
|
14
|
-
input: {
|
|
15
|
-
product_id: "prod_123",
|
|
16
|
-
update: [
|
|
17
|
-
{ id: "pattr_size", add: ["pattrval_xl"], remove: ["pattrval_s"] },
|
|
18
|
-
{ id: "pattr_material", value: "Linen" },
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
})
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Input
|
|
25
|
-
|
|
26
|
-
<ParamField body="product_id" type="string" required>The product whose attribute selections are updated.</ParamField>
|
|
27
|
-
<ParamField body="update" type="ProductAttributeBatchUpdate[]" required>
|
|
28
|
-
Per-attribute updates.
|
|
29
|
-
<Expandable title="properties">
|
|
30
|
-
<ParamField body="id" type="string" required>Id of the existing attribute to update.</ParamField>
|
|
31
|
-
<ParamField body="title" type="string">New name; only honoured for product-scoped attributes and propagated to the mirror option title.</ParamField>
|
|
32
|
-
<ParamField body="add" type="(string | { value: string })[]">Value ids to add (shared axis subset) or new value objects to create (exclusive axis).</ParamField>
|
|
33
|
-
<ParamField body="remove" type="string[]">Value ids to remove from the selection (exclusive-axis values are deleted).</ParamField>
|
|
34
|
-
<ParamField body="value" type="string | number | boolean">New scalar for `text` / `unit` / `toggle` attributes.</ParamField>
|
|
35
|
-
</Expandable>
|
|
36
|
-
</ParamField>
|
|
37
|
-
<ParamField body="additional_data" type="object">Custom data passed through.</ParamField>
|
|
38
|
-
|
|
39
|
-
## Result
|
|
40
|
-
|
|
41
|
-
<ResponseField name="result" type="void">No return value.</ResponseField>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "updateProductAttributesWorkflow"
|
|
3
|
-
description: "Update attributes matching a selector and sync mirror option titles."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Updates product attributes by selector. When `name` changes, the mirror `ProductOption` title of any affected axis attribute is updated to match. Triggered by `POST /admin/product-attributes/:id`. Emits `product-attribute.updated`.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { updateProductAttributesWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
-
|
|
13
|
-
const { result } = await updateProductAttributesWorkflow(container).run({
|
|
14
|
-
input: {
|
|
15
|
-
selector: { id: "pattr_123" },
|
|
16
|
-
update: { name: "Colour", is_filterable: true },
|
|
17
|
-
},
|
|
18
|
-
})
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Input
|
|
22
|
-
|
|
23
|
-
<ParamField body="selector" type="object" required>Filter for the attributes to update, e.g. `{ id: "pattr_123" }`.</ParamField>
|
|
24
|
-
<ParamField body="update" type="UpdateProductAttributeDTO" required>
|
|
25
|
-
Fields to set on every matched attribute.
|
|
26
|
-
<Expandable title="properties">
|
|
27
|
-
<ParamField body="name" type="string">New display name; propagated to mirror option titles.</ParamField>
|
|
28
|
-
<ParamField body="handle" type="string">New handle.</ParamField>
|
|
29
|
-
<ParamField body="description" type="string | null">New description.</ParamField>
|
|
30
|
-
<ParamField body="type" type="AttributeType">One of `single_select`, `multi_select`, `unit`, `toggle`, `text`.</ParamField>
|
|
31
|
-
<ParamField body="is_required" type="boolean">Whether products must carry this attribute.</ParamField>
|
|
32
|
-
<ParamField body="is_filterable" type="boolean">Whether the attribute is a storefront filter.</ParamField>
|
|
33
|
-
<ParamField body="is_variant_axis" type="boolean">Whether the attribute is a variant axis.</ParamField>
|
|
34
|
-
<ParamField body="rank" type="number">Sort rank.</ParamField>
|
|
35
|
-
<ParamField body="is_active" type="boolean">Whether the attribute is active.</ParamField>
|
|
36
|
-
<ParamField body="metadata" type="object | null">Custom key-value data.</ParamField>
|
|
37
|
-
</Expandable>
|
|
38
|
-
</ParamField>
|
|
39
|
-
<ParamField body="additional_data" type="object">Custom data passed through to the hooks.</ParamField>
|
|
40
|
-
|
|
41
|
-
## Result
|
|
42
|
-
|
|
43
|
-
<ResponseField name="result" type="ProductAttributeDTO[]">The updated attributes.</ResponseField>
|
|
44
|
-
|
|
45
|
-
## Hooks
|
|
46
|
-
|
|
47
|
-
- `validate` — runs before the update with `{ input }`.
|
|
48
|
-
- `productAttributesUpdated` — runs after the update with `{ attributes, additional_data }`.
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "upsertProductAttributeValuesWorkflow"
|
|
3
|
-
description: "Create or update attribute values in one call, keyed by id presence."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Splits the given values by `id`: entries without an id are created on the attribute, entries with an id are updated in place. Unlike the create/update value workflows it does not touch the mirror `ProductOption` (renaming a value in place does not re-sync the mirrored option) and it emits no events.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { upsertProductAttributeValuesWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
-
|
|
13
|
-
const { result } = await upsertProductAttributeValuesWorkflow(container).run({
|
|
14
|
-
input: {
|
|
15
|
-
attribute_id: "pattr_color",
|
|
16
|
-
values: [
|
|
17
|
-
{ name: "Teal" },
|
|
18
|
-
{ id: "pattrval_123", name: "Navy Blue" },
|
|
19
|
-
],
|
|
20
|
-
},
|
|
21
|
-
})
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Input
|
|
25
|
-
|
|
26
|
-
<ParamField body="attribute_id" type="string" required>The attribute the values belong to.</ParamField>
|
|
27
|
-
<ParamField body="values" type="UpsertProductAttributeValueDTO[]" required>
|
|
28
|
-
Values to create (no `id`) or update (with `id`).
|
|
29
|
-
<Expandable title="properties">
|
|
30
|
-
<ParamField body="id" type="string">Existing value id; omit to create a new value.</ParamField>
|
|
31
|
-
<ParamField body="name" type="string">Display name of the value.</ParamField>
|
|
32
|
-
<ParamField body="handle" type="string">URL-safe handle.</ParamField>
|
|
33
|
-
<ParamField body="rank" type="number">Sort rank.</ParamField>
|
|
34
|
-
<ParamField body="is_active" type="boolean">Whether the value is active.</ParamField>
|
|
35
|
-
<ParamField body="product_option_value_id" type="string | null">Bound mirror option value.</ParamField>
|
|
36
|
-
<ParamField body="metadata" type="object | null">Custom key-value data.</ParamField>
|
|
37
|
-
</Expandable>
|
|
38
|
-
</ParamField>
|
|
39
|
-
<ParamField body="additional_data" type="object">Custom data passed through.</ParamField>
|
|
40
|
-
|
|
41
|
-
## Result
|
|
42
|
-
|
|
43
|
-
<ResponseField name="result" type="ProductAttributeValueDTO[]">The created values followed by the updated values.</ResponseField>
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "autoConfirmProductChangeWorkflow"
|
|
3
|
-
description: "Conditionally confirm a ProductChange based on the product_request feature flag."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Decides whether a freshly staged `ProductChange` should be confirmed immediately: it runs `confirmProductChangeWorkflow` for the change when `force` is `true` or the `product_request` feature flag is disabled, and does nothing otherwise (leaving the change `pending` for operator review). Run as a step by `stageProductChangeWorkflow`. Any events (`product-change.confirmed`) come from the nested confirm workflow.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { autoConfirmProductChangeWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
-
|
|
13
|
-
await autoConfirmProductChangeWorkflow(container).run({
|
|
14
|
-
input: {
|
|
15
|
-
change_id: "prch_01H...",
|
|
16
|
-
confirmed_by: "sel_01H...",
|
|
17
|
-
},
|
|
18
|
-
})
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Input
|
|
22
|
-
|
|
23
|
-
<ParamField body="change_id" type="string" required>
|
|
24
|
-
Id of the product change to (conditionally) confirm.
|
|
25
|
-
</ParamField>
|
|
26
|
-
|
|
27
|
-
<ParamField body="confirmed_by" type="string">
|
|
28
|
-
Actor id forwarded as `confirmed_by` to the confirm workflow.
|
|
29
|
-
</ParamField>
|
|
30
|
-
|
|
31
|
-
<ParamField body="force" type="boolean">
|
|
32
|
-
Confirm regardless of the `product_request` feature flag.
|
|
33
|
-
</ParamField>
|
|
34
|
-
|
|
35
|
-
## Result
|
|
36
|
-
|
|
37
|
-
<ResponseField name="result" type="void">
|
|
38
|
-
Returns nothing; the change is either confirmed (and its actions applied) or left `pending`.
|
|
39
|
-
</ResponseField>
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "cancelProductChangeWorkflow"
|
|
3
|
-
description: "Cancel a pending ProductChange so its staged actions are never applied."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Cancels a pending `ProductChange`: validates the change exists and is still `pending`, then sets it to `canceled` with `canceled_by` and `canceled_at` — the staged actions are never applied to the master product. Triggered by `POST /admin/product-changes/:id/cancel` (operator) and `POST /vendor/products/:id/cancel` (vendor withdrawing their own edit). Emits `product-change.canceled` with `{ id }`.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { cancelProductChangeWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
-
|
|
13
|
-
await cancelProductChangeWorkflow(container).run({
|
|
14
|
-
input: {
|
|
15
|
-
id: "prch_01H...",
|
|
16
|
-
canceled_by: "sel_01H...",
|
|
17
|
-
},
|
|
18
|
-
})
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Input
|
|
22
|
-
|
|
23
|
-
<ParamField body="id" type="string" required>
|
|
24
|
-
Id of the product change to cancel. Must exist and be in `pending` status.
|
|
25
|
-
</ParamField>
|
|
26
|
-
|
|
27
|
-
<ParamField body="canceled_by" type="string">
|
|
28
|
-
Actor id recorded as the canceler on the change.
|
|
29
|
-
</ParamField>
|
|
30
|
-
|
|
31
|
-
<ParamField body="additional_data" type="object">
|
|
32
|
-
Arbitrary data forwarded to the `productChangeCanceled` hook.
|
|
33
|
-
</ParamField>
|
|
34
|
-
|
|
35
|
-
## Result
|
|
36
|
-
|
|
37
|
-
<ResponseField name="result" type="void">
|
|
38
|
-
Returns nothing; the change status is updated in place.
|
|
39
|
-
</ResponseField>
|
|
40
|
-
|
|
41
|
-
## Hooks
|
|
42
|
-
|
|
43
|
-
<ResponseField name="validate" type="hook">
|
|
44
|
-
Runs first with `{ input }` — use it to block cancellation.
|
|
45
|
-
</ResponseField>
|
|
46
|
-
|
|
47
|
-
<ResponseField name="productChangeCanceled" type="hook">
|
|
48
|
-
Runs after cancellation with `{ id, additional_data }`.
|
|
49
|
-
</ResponseField>
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "confirmProductChangeWorkflow"
|
|
3
|
-
description: "Confirm pending ProductChanges and apply their staged actions to the master product."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Confirms one or more pending `ProductChange` records: validates each change exists and is confirmable, marks them `confirmed` with `confirmed_by`, then runs the internal apply engine (`applyProductChangeActionsWorkflow`) to write the staged actions onto the master product. Triggered by `POST /admin/product-changes/:id/confirm`, and internally by `autoConfirmProductChangeWorkflow`. Emits `product-change.confirmed` with one `{ id }` per change.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { confirmProductChangeWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
-
|
|
13
|
-
await confirmProductChangeWorkflow(container).run({
|
|
14
|
-
input: {
|
|
15
|
-
ids: ["prch_01H..."],
|
|
16
|
-
confirmed_by: "user_01H...",
|
|
17
|
-
},
|
|
18
|
-
})
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
## Input
|
|
22
|
-
|
|
23
|
-
<ParamField body="ids" type="string[]" required>
|
|
24
|
-
Ids of the product changes to confirm. Each must exist and be in a confirmable (`pending`) state.
|
|
25
|
-
</ParamField>
|
|
26
|
-
|
|
27
|
-
<ParamField body="confirmed_by" type="string">
|
|
28
|
-
Actor id recorded as the confirmer on each change.
|
|
29
|
-
</ParamField>
|
|
30
|
-
|
|
31
|
-
<ParamField body="internal_note" type="string">
|
|
32
|
-
Operator-only note stored on each confirmed change.
|
|
33
|
-
</ParamField>
|
|
34
|
-
|
|
35
|
-
<ParamField body="external_note" type="string">
|
|
36
|
-
Vendor-facing note stored on each confirmed change.
|
|
37
|
-
</ParamField>
|
|
38
|
-
|
|
39
|
-
<ParamField body="additional_data" type="object">
|
|
40
|
-
Arbitrary data forwarded to the `productChangeConfirmed` hook.
|
|
41
|
-
</ParamField>
|
|
42
|
-
|
|
43
|
-
## Result
|
|
44
|
-
|
|
45
|
-
<ResponseField name="result" type="void">
|
|
46
|
-
Returns nothing; the changes are confirmed and their actions applied in place.
|
|
47
|
-
</ResponseField>
|
|
48
|
-
|
|
49
|
-
## Hooks
|
|
50
|
-
|
|
51
|
-
<ResponseField name="validate" type="hook">
|
|
52
|
-
Runs first with `{ input }` — use it to block confirmation of specific changes.
|
|
53
|
-
</ResponseField>
|
|
54
|
-
|
|
55
|
-
<ResponseField name="productChangeConfirmed" type="hook">
|
|
56
|
-
Runs after actions are applied with `{ ids, additional_data }`.
|
|
57
|
-
</ResponseField>
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "createProductChangeWorkflow"
|
|
3
|
-
description: "Create ProductChange records after validating no pending change exists per product."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Creates one or more `ProductChange` records — the staging entity for vendor edits on shared master products. Validates that none of the referenced products already has a `pending` change before inserting. Emits `product-change.created` with one `{ id }` entry per change. Actions are attached separately (see `stageProductChangeWorkflow` for the combined flow).
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { createProductChangeWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
-
|
|
13
|
-
const { result } = await createProductChangeWorkflow(container).run({
|
|
14
|
-
input: {
|
|
15
|
-
changes: [
|
|
16
|
-
{ product_id: "prod_01H...", created_by: "sel_01H..." },
|
|
17
|
-
],
|
|
18
|
-
},
|
|
19
|
-
})
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Input
|
|
23
|
-
|
|
24
|
-
<ParamField body="changes" type="CreateProductChangeDTO[]" required>
|
|
25
|
-
Changes to create.
|
|
26
|
-
<Expandable title="properties">
|
|
27
|
-
<ParamField body="product_id" type="string" required>
|
|
28
|
-
Id of the product the change targets. Must not already have a pending change.
|
|
29
|
-
</ParamField>
|
|
30
|
-
<ParamField body="status" type="ProductChangeStatus">
|
|
31
|
-
One of `pending`, `confirmed`, `declined`, `canceled`; audit-trail rows are created already `confirmed`.
|
|
32
|
-
</ParamField>
|
|
33
|
-
<ParamField body="created_by" type="string">
|
|
34
|
-
Actor id who authored the change.
|
|
35
|
-
</ParamField>
|
|
36
|
-
<ParamField body="internal_note" type="string">
|
|
37
|
-
Operator-only note.
|
|
38
|
-
</ParamField>
|
|
39
|
-
<ParamField body="external_note" type="string">
|
|
40
|
-
Vendor-facing note.
|
|
41
|
-
</ParamField>
|
|
42
|
-
<ParamField body="confirmed_by" type="string">
|
|
43
|
-
Confirming actor id, for pre-confirmed rows.
|
|
44
|
-
</ParamField>
|
|
45
|
-
<ParamField body="confirmed_at" type="Date">
|
|
46
|
-
Confirmation timestamp, for pre-confirmed rows.
|
|
47
|
-
</ParamField>
|
|
48
|
-
<ParamField body="metadata" type="object">
|
|
49
|
-
Arbitrary key-value data stored on the change.
|
|
50
|
-
</ParamField>
|
|
51
|
-
</Expandable>
|
|
52
|
-
</ParamField>
|
|
53
|
-
|
|
54
|
-
<ParamField body="additional_data" type="object">
|
|
55
|
-
Arbitrary data forwarded to the `productChangeCreated` hook.
|
|
56
|
-
</ParamField>
|
|
57
|
-
|
|
58
|
-
## Result
|
|
59
|
-
|
|
60
|
-
<ResponseField name="result" type="ProductChangeDTO[]">
|
|
61
|
-
The created change records with ids, statuses, and timestamps.
|
|
62
|
-
</ResponseField>
|
|
63
|
-
|
|
64
|
-
## Hooks
|
|
65
|
-
|
|
66
|
-
<ResponseField name="validate" type="hook">
|
|
67
|
-
Runs first with `{ input }` — use it to reject invalid payloads before creation.
|
|
68
|
-
</ResponseField>
|
|
69
|
-
|
|
70
|
-
<ResponseField name="productChangeCreated" type="hook">
|
|
71
|
-
Runs after creation with `{ changes, additional_data }`.
|
|
72
|
-
</ResponseField>
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "rejectProductChangeWorkflow"
|
|
3
|
-
description: "Decline a pending ProductChange with an optional reason for the vendor."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Declines a pending `ProductChange`: validates the change exists and is still `pending`, then sets it to `declined` with `declined_by`, `declined_at`, and `declined_reason` — the staged actions are never applied to the master product. Emits `product-change.declined` with `{ id }`.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { rejectProductChangeWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
-
|
|
13
|
-
await rejectProductChangeWorkflow(container).run({
|
|
14
|
-
input: {
|
|
15
|
-
id: "prch_01H...",
|
|
16
|
-
declined_by: "user_01H...",
|
|
17
|
-
declined_reason: "Price change exceeds allowed range",
|
|
18
|
-
},
|
|
19
|
-
})
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Input
|
|
23
|
-
|
|
24
|
-
<ParamField body="id" type="string" required>
|
|
25
|
-
Id of the product change to decline. Must exist and be in `pending` status.
|
|
26
|
-
</ParamField>
|
|
27
|
-
|
|
28
|
-
<ParamField body="declined_by" type="string">
|
|
29
|
-
Actor id recorded as the decliner on the change.
|
|
30
|
-
</ParamField>
|
|
31
|
-
|
|
32
|
-
<ParamField body="declined_reason" type="string">
|
|
33
|
-
Vendor-facing reason stored on the change.
|
|
34
|
-
</ParamField>
|
|
35
|
-
|
|
36
|
-
<ParamField body="additional_data" type="object">
|
|
37
|
-
Arbitrary data forwarded to the `productChangeRejected` hook.
|
|
38
|
-
</ParamField>
|
|
39
|
-
|
|
40
|
-
## Result
|
|
41
|
-
|
|
42
|
-
<ResponseField name="result" type="void">
|
|
43
|
-
Returns nothing; the change status is updated in place.
|
|
44
|
-
</ResponseField>
|
|
45
|
-
|
|
46
|
-
## Hooks
|
|
47
|
-
|
|
48
|
-
<ResponseField name="validate" type="hook">
|
|
49
|
-
Runs first with `{ input }` — use it to block rejection.
|
|
50
|
-
</ResponseField>
|
|
51
|
-
|
|
52
|
-
<ResponseField name="productChangeRejected" type="hook">
|
|
53
|
-
Runs after the decline with `{ id, additional_data }`.
|
|
54
|
-
</ResponseField>
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "stageProductChangeWorkflow"
|
|
3
|
-
description: "Stage a pending ProductChange with its actions and optionally auto-confirm it."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Creates a `pending` `ProductChange` for one product, attaches the given actions to it, then runs `autoConfirmProductChangeWorkflow` — so the change is applied immediately when `auto_confirm` is `true` or the `product_request` feature flag is disabled. This is the engine behind the vendor product-edit workflows (`productEditUpdateProduct`, `productEditUpdateVariants`, `productEditUpdateAttributes`, `productEditDeleteProduct`). Emits `product-change.created`.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { stageProductChangeWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
-
|
|
13
|
-
const { result } = await stageProductChangeWorkflow(container).run({
|
|
14
|
-
input: {
|
|
15
|
-
product_id: "prod_01H...",
|
|
16
|
-
created_by: "sel_01H...",
|
|
17
|
-
actions: [
|
|
18
|
-
{
|
|
19
|
-
product_id: "prod_01H...",
|
|
20
|
-
action: "UPDATE",
|
|
21
|
-
details: { title: "Linen Shirt v2" },
|
|
22
|
-
},
|
|
23
|
-
],
|
|
24
|
-
},
|
|
25
|
-
})
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Input
|
|
29
|
-
|
|
30
|
-
<ParamField body="product_id" type="string" required>
|
|
31
|
-
Id of the product the change targets.
|
|
32
|
-
</ParamField>
|
|
33
|
-
|
|
34
|
-
<ParamField body="actions" type="object[]" required>
|
|
35
|
-
Actions to stage on the change (`CreateProductChangeActionDTO` without `product_change_id`, which is stamped automatically).
|
|
36
|
-
<Expandable title="properties">
|
|
37
|
-
<ParamField body="product_id" type="string" required>
|
|
38
|
-
Id of the product the action applies to.
|
|
39
|
-
</ParamField>
|
|
40
|
-
<ParamField body="action" type="string" required>
|
|
41
|
-
Action type, e.g. `UPDATE`, `VARIANT_ADD`, `VARIANT_UPDATE`, `VARIANT_REMOVE`, `ATTRIBUTE_ADD`, `ATTRIBUTE_UPDATE`, `ATTRIBUTE_REMOVE`, `PRODUCT_DELETE`, `STATUS_CHANGE`.
|
|
42
|
-
</ParamField>
|
|
43
|
-
<ParamField body="details" type="object">
|
|
44
|
-
Operation payload applied when the change is confirmed.
|
|
45
|
-
</ParamField>
|
|
46
|
-
<ParamField body="internal_note" type="string">
|
|
47
|
-
Operator-only note on the action.
|
|
48
|
-
</ParamField>
|
|
49
|
-
<ParamField body="applied" type="boolean">
|
|
50
|
-
Whether the action is already applied; leave unset for staged edits.
|
|
51
|
-
</ParamField>
|
|
52
|
-
</Expandable>
|
|
53
|
-
</ParamField>
|
|
54
|
-
|
|
55
|
-
<ParamField body="created_by" type="string">
|
|
56
|
-
Actor id who staged the change; also used as `confirmed_by` on auto-confirm.
|
|
57
|
-
</ParamField>
|
|
58
|
-
|
|
59
|
-
<ParamField body="internal_note" type="string">
|
|
60
|
-
Operator-only note stored on the change.
|
|
61
|
-
</ParamField>
|
|
62
|
-
|
|
63
|
-
<ParamField body="external_note" type="string">
|
|
64
|
-
Vendor-facing note stored on the change.
|
|
65
|
-
</ParamField>
|
|
66
|
-
|
|
67
|
-
<ParamField body="auto_confirm" type="boolean">
|
|
68
|
-
Force immediate confirmation even when the `product_request` feature flag is enabled.
|
|
69
|
-
</ParamField>
|
|
70
|
-
|
|
71
|
-
## Result
|
|
72
|
-
|
|
73
|
-
<ResponseField name="result" type="ProductChangeDTO">
|
|
74
|
-
The created change record; still `pending` unless it was auto-confirmed.
|
|
75
|
-
</ResponseField>
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "approveSellerWorkflow"
|
|
3
|
-
description: "Approve a pending seller and open its store."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Validates the seller can be approved, sets `status` to `open`, clears `status_reason`, and stamps `approved_at` on first approval. Triggered by `POST /admin/sellers/:id/approve`. Emits `seller.approved`.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { approveSellerWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
-
|
|
13
|
-
await approveSellerWorkflow(container).run({
|
|
14
|
-
input: { seller_id: "sel_123" },
|
|
15
|
-
})
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Input
|
|
19
|
-
|
|
20
|
-
<ParamField body="seller_id" type="string" required>Id of the seller to approve.</ParamField>
|
|
21
|
-
|
|
22
|
-
<ParamField body="additional_data" type="object">Custom data passed through to the workflow hooks.</ParamField>
|
|
23
|
-
|
|
24
|
-
## Result
|
|
25
|
-
|
|
26
|
-
<ResponseField name="result" type="void">Nothing is returned.</ResponseField>
|
|
27
|
-
|
|
28
|
-
## Hooks
|
|
29
|
-
|
|
30
|
-
- `sellerApproved` — runs after approval with `{ seller_id }`.
|
|
31
|
-
|
|
32
|
-
```ts
|
|
33
|
-
approveSellerWorkflow.hooks.sellerApproved(async ({ seller_id }) => {
|
|
34
|
-
// e.g. send a welcome email
|
|
35
|
-
})
|
|
36
|
-
```
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "createSellerAccountWorkflow"
|
|
3
|
-
description: "Create a seller with its owner member during self-registration."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Creates a seller with `pending_approval` status, ensures the default seller roles exist, creates (or reuses) the owner member, and links the member's auth identity via app metadata. Optionally sets the seller address, professional details, and payment details in the same run. Triggered by `POST /vendor/sellers` during vendor registration. Emits `seller.created`.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { createSellerAccountWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
-
|
|
13
|
-
const { result } = await createSellerAccountWorkflow(container).run({
|
|
14
|
-
input: {
|
|
15
|
-
auth_identity_id: "authid_123",
|
|
16
|
-
seller: { name: "Acme", email: "hello@acme.co", currency_code: "usd" },
|
|
17
|
-
member_email: "owner@acme.co",
|
|
18
|
-
first_name: "Jane",
|
|
19
|
-
last_name: "Doe",
|
|
20
|
-
},
|
|
21
|
-
})
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## Input
|
|
25
|
-
|
|
26
|
-
<ParamField body="auth_identity_id" type="string" required>Auth identity to bind to the owner member.</ParamField>
|
|
27
|
-
<ParamField body="seller" type="CreateSellerDTO" required>
|
|
28
|
-
Seller to create; `status` is forced to `pending_approval`.
|
|
29
|
-
<Expandable title="properties">
|
|
30
|
-
<ParamField body="name" type="string" required>Display name of the seller.</ParamField>
|
|
31
|
-
<ParamField body="email" type="string" required>Contact email of the seller.</ParamField>
|
|
32
|
-
<ParamField body="currency_code" type="string" required>Default currency of the seller.</ParamField>
|
|
33
|
-
<ParamField body="handle" type="string">URL handle; auto-generated when omitted.</ParamField>
|
|
34
|
-
<ParamField body="description" type="string">Public seller description.</ParamField>
|
|
35
|
-
<ParamField body="metadata" type="object">Custom key-value data.</ParamField>
|
|
36
|
-
</Expandable>
|
|
37
|
-
</ParamField>
|
|
38
|
-
<ParamField body="member_email" type="string">Email for the new owner member; required when `member_id` is not provided.</ParamField>
|
|
39
|
-
<ParamField body="member_id" type="string">Existing member to link as owner instead of creating one.</ParamField>
|
|
40
|
-
<ParamField body="first_name" type="string">Owner member first name.</ParamField>
|
|
41
|
-
<ParamField body="last_name" type="string">Owner member last name.</ParamField>
|
|
42
|
-
<ParamField body="address" type="UpdateSellerAddressDTO">Seller address to set after creation.</ParamField>
|
|
43
|
-
<ParamField body="professional_details" type="UpdateProfessionalDetailsDTO">Professional details to set after creation.</ParamField>
|
|
44
|
-
<ParamField body="payment_details" type="UpdatePaymentDetailsDTO">Payment details to set after creation.</ParamField>
|
|
45
|
-
<ParamField body="additional_data" type="object">Custom data passed through to the workflow hooks.</ParamField>
|
|
46
|
-
|
|
47
|
-
## Result
|
|
48
|
-
|
|
49
|
-
<ResponseField name="result" type="SellerDTO">The created seller.</ResponseField>
|
|
50
|
-
|
|
51
|
-
## Hooks
|
|
52
|
-
|
|
53
|
-
- `sellerAccountCreated` — runs after the account is assembled with `{ seller, additional_data }`.
|
|
54
|
-
|
|
55
|
-
```ts
|
|
56
|
-
createSellerAccountWorkflow.hooks.sellerAccountCreated(async ({ seller }) => {
|
|
57
|
-
// provision extra resources for the new seller
|
|
58
|
-
})
|
|
59
|
-
```
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: "createSellerDefaultsWorkflow"
|
|
3
|
-
description: "Ensure the default seller roles exist."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Idempotently creates the built-in seller roles (administration, inventory management, order management, accounting, support). Run before assigning roles to members; also executed automatically by `createSellerAccountWorkflow` and `acceptMemberInviteWorkflow`.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```ts
|
|
11
|
-
import { createSellerDefaultsWorkflow } from "@mercurjs/core/workflows"
|
|
12
|
-
|
|
13
|
-
await createSellerDefaultsWorkflow(container).run({})
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Input
|
|
17
|
-
|
|
18
|
-
No input.
|
|
19
|
-
|
|
20
|
-
## Result
|
|
21
|
-
|
|
22
|
-
<ResponseField name="result" type="void">Nothing is returned.</ResponseField>
|