Files
medusa-store/www/apps/docs/content/references/entities/classes/entities.BatchJob.mdx
Shahed Nasser bb87db8342 docs: prep for v2 documentation (#6710)
This PR includes documentation that preps for v2 docs (but doesn't introduce new docs).

_Note: The number of file changes in the PR is due to find-and-replace within the `references` which is unavoidable. Let me know if I should move it to another PR._

## Changes

- Change Medusa version in base OAS used for v2.
- Fix to docblock generator related to not catching all path parameters.
- Added typedoc plugin that generates ER Diagrams, which will be used specifically for data model references in commerce modules.
- Changed OAS tool to output references in `www/apps/api-reference/specs-v2` directory when the `--v2` option is used.
- Added a version switcher to the API reference to switch between V1 and V2. This switcher is enabled by an environment variable, so it won't be visible/usable at the moment.
- Upgraded docusaurus to v3.0.1
- Added new Vale rules to ensure correct spelling of Medusa Admin and module names.
- Added new components to the `docs-ui` package that will be used in future documentation changes.
2024-03-18 07:47:35 +00:00

15 lines
7.1 KiB
Plaintext

---
displayed_sidebar: entitiesSidebar
slug: /references/entities/classes/BatchJob
---
import TypeList from "@site/src/components/TypeList"
# BatchJob
A Batch Job indicates an asynchronus task stored in the Medusa backend. Its status determines whether it has been executed or not.
## Properties
<TypeList types={[{"name":"id","type":"`string`","description":"The unique identifier for the batch job.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date with timezone at which the resource was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"The date with timezone at which the resource was last updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"The date with timezone at which the resource was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`string`","description":"The type of batch job.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"The unique identifier of the user that created the batch job.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by_user","type":"[User](entities.User.mdx)","description":"The details of the user that created the batch job.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The user's ID","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`Date`","description":"The date with timezone at which the resource was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`Date`","description":"The date with timezone at which the resource was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `Date`","description":"The date with timezone at which the resource was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"role","type":"[UserRoles](../enums/entities.UserRoles.mdx)","description":"The user's role. These roles don't provide any different privileges.","optional":false,"defaultValue":"member","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the User","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the User","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the User","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"password_hash","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"api_token","type":"`string`","description":"An API token associated with the user.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"An optional key-value map with additional details","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"context","type":"`Record<string, unknown>`","description":"The context of the batch job, the type of the batch job determines what the context should contain.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"result","type":"`object` & `Record<string, unknown>`","description":"The result of the batch job.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"count","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"advancement_count","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"progress","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"errors","type":"(`string` \\| [BatchJobResultError](../../medusa/types/medusa.BatchJobResultError.mdx))[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"stat_descriptors","type":"[BatchJobResultStatDescriptor](../../medusa/types/medusa.BatchJobResultStatDescriptor.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"file_key","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"file_size","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"dry_run","type":"`boolean`","description":"Specify if the job must apply the modifications or not.","optional":false,"defaultValue":"false","expandable":false,"children":[]},{"name":"status","type":"[BatchJobStatus](../../medusa/enums/medusa.BatchJobStatus.mdx)","description":"The status of the batch job.","optional":false,"defaultValue":"created","expandable":false,"children":[{"name":"CREATED","type":"`\"created\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"PRE_PROCESSED","type":"`\"pre_processed\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"CONFIRMED","type":"`\"confirmed\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"PROCESSING","type":"`\"processing\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"COMPLETED","type":"`\"completed\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"CANCELED","type":"`\"canceled\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"FAILED","type":"`\"failed\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"pre_processed_at","type":"`Date`","description":"The date from which the job has been pre-processed.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"processing_at","type":"`Date`","description":"The date the job is processing at.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"confirmed_at","type":"`Date`","description":"The date when the confirmation has been done.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"completed_at","type":"`Date`","description":"The date of the completion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`Date`","description":"The date of the concellation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"failed_at","type":"`Date`","description":"The date when the job failed.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/development/entities/repositories#retrieving-a-list-of-records" sectionTitle="BatchJob"/>