From 81e5cfe8b18bf4035d899f7346d0e74f6cdca7a0 Mon Sep 17 00:00:00 2001 From: Shahed Nasser Date: Tue, 5 Jul 2022 19:50:51 +0300 Subject: [PATCH] docs: updated event reference to align with v1.3.3 (#1796) --- .../backend/subscribers/events-list.md | 126 +++++++++++++++++- 1 file changed, 122 insertions(+), 4 deletions(-) diff --git a/docs/content/advanced/backend/subscribers/events-list.md b/docs/content/advanced/backend/subscribers/events-list.md index 333e5c428a..37a954fc61 100644 --- a/docs/content/advanced/backend/subscribers/events-list.md +++ b/docs/content/advanced/backend/subscribers/events-list.md @@ -96,6 +96,115 @@ Object of the following format: + + + +`batch.pre_processed` + + + + +Triggered after the `preProcessBatchJob` of a batch job stategy is done executing. + + + +Object of the following format: + +```js +{ + id //string ID of batch job +} +``` + + + + + + + +`batch.confirmed` + + + + +Triggered after the batch job is done pre-processing and the batch job is not in dry-run mode. + + + +Object of the following format: + +```js +{ + id //string ID of batch job +} +``` + + + + + + + +`batch.processing` + + + +Triggered when a batch job starts processing after it's confirmed. + + +Object of the following format: + +```js +{ + id //string ID of batch job +} +``` + + + + + + + +`batch.completed` + + + +Triggered when a batch job is done processing and is completed. + + +Object of the following format: + +```js +{ + id //string ID of batch job +} +``` + + + + + + + +`batch.failed` + + + +Triggered when an error occurs while running a batch job and the batch job fails. + + +Object of the following format: + +```js +{ + id //string ID of batch job +} +``` + + + + @@ -167,7 +276,7 @@ Triggered when a cart and data associated with it (payment sessions, shipping me -The entire cart as an object. You can refer to the [Cart entity](https://github.com/medusajs/medusa/blob/master/packages/medusa/src/models/cart.ts) for an idea of what fields to expect. +An object with at least the ID of the cart, however, in most cases the entire cart model is available. You can refer to the [Cart entity](https://github.com/medusajs/medusa/blob/master/packages/medusa/src/models/cart.ts) for an idea of what fields to expect. @@ -915,7 +1024,7 @@ Object of the following format: ```js { id, //string ID of order - no_notification //boolean indicating whether a notification should be sent or not + no_notification //(optional) boolean indicating whether a notification should be sent or not } ``` @@ -1145,7 +1254,7 @@ Object of the following format: { id, //string ID of order return_id, //string ID of return - no_notification //boolean indicating whether a notification should be sent or not + no_notification //(optional) boolean indicating whether a notification should be sent or not } ``` @@ -1340,6 +1449,15 @@ Triggered when a product and data associated with it (options, variant orders, e The entire product passed as an object. You can refer to the [Product entity](https://github.com/medusajs/medusa/blob/master/packages/medusa/src/models/product.ts) for an idea of what fields to expect. +In one case, when the `/admin/products/{id}` endpoint is used to update the product, the payload is an object of the following format: + +```js +{ + id, //id of product + field //an array of field names that were updated +} +``` + @@ -1459,7 +1577,7 @@ Object of the following format: { id, //string ID of variant product_id, //string ID of product - metadata //object of additional data + metadata //object of the `metadata` field of the variant } ```