Fix/polish discount (#569)
* formatting and optional "is_dynamic" on updates * formatting * uppercasing discount code on update * multiple regions fail with fixed discounts * discount testing * testing * spelling * removed comment Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
This commit is contained in:
35
integration-tests/api/helpers/discount-seeder.js
Normal file
35
integration-tests/api/helpers/discount-seeder.js
Normal file
@@ -0,0 +1,35 @@
|
||||
const {
|
||||
ShippingProfile,
|
||||
Region,
|
||||
Discount,
|
||||
DiscountRule,
|
||||
} = require("@medusajs/medusa")
|
||||
module.exports = async (connection, data = {}) => {
|
||||
const manager = connection.manager
|
||||
|
||||
await manager.insert(Region, {
|
||||
id: "test-region",
|
||||
name: "Test Region",
|
||||
currency_code: "usd",
|
||||
tax_rate: 0,
|
||||
payment_providers: [
|
||||
{
|
||||
id: "test-pay",
|
||||
is_installed: true,
|
||||
},
|
||||
],
|
||||
})
|
||||
|
||||
await manager.insert(Region, {
|
||||
id: "test-region-2",
|
||||
name: "Test Region 2",
|
||||
currency_code: "eur",
|
||||
tax_rate: 0,
|
||||
payment_providers: [
|
||||
{
|
||||
id: "test-pay",
|
||||
is_installed: true,
|
||||
},
|
||||
],
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user