chore: Merge master to develop (#3653)

This commit is contained in:
Oliver Windall Juhl authored and GitHub committed 2023-03-31 13:09:57 +02:00
1 parent b2e2eddcea
commit 809ab2e0eb
120 files changed
+2240 -585

No files matched your search

@@ -0,0 +1,41 @@
# Discount Generator
Generate dynamic discount codes in your Medusa backend.
[Medusa Website](https://medusajs.com/) | [Medusa Repository](https://github.com/medusajs/medusa)
## Features
- Provides a service that can be used to generate a dynamic discount with a random code.
- Provides an endpoint that can be used to generate a dynamic discount with a random code.
---
## Prerequisites
- [Medusa backend](https://docs.medusajs.com/development/backend/install)
---
## How to Install
1\. Run the following command in the directory of the Medusa backend:
```bash
npm install medusa-plugin-discount-generator
```
2\. In `medusa-config.js` add the following at the end of the `plugins` array:
```js
const plugins = [
// ...
`medusa-plugin-discount-generator`
]
```
---
## Test the Plugin
Try using the `DiscountGeneratorService` in your code, or using the `/discount-code` endpoint to generate a random discount code.