* 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>
36 lines
654 B
JavaScript
36 lines
654 B
JavaScript
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,
|
|
},
|
|
],
|
|
})
|
|
}
|