Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
@@ -18,7 +18,7 @@ You can get a Medusa engine up and running in your local development environment
|
||||
yarn add @medusajs/medusa
|
||||
|
||||
# CLI
|
||||
npm install -g @medusa/medusa-cli
|
||||
npm install -g @medusajs/medusa-cli
|
||||
yarn add global @medusajs/medusa-cli
|
||||
|
||||
# babel preset
|
||||
|
||||
@@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.1.8](https://github.com/medusajs/medusa/compare/medusa-payment-klarna@1.1.7...medusa-payment-klarna@1.1.8) (2021-03-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* klarna doesn't treat negative discounts well ([e275184](https://github.com/medusajs/medusa/commit/e27518435ea1fafe556168c36475916a4243eabe))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.7](https://github.com/medusajs/medusa/compare/medusa-payment-klarna@1.1.6...medusa-payment-klarna@1.1.7) (2021-03-17)
|
||||
|
||||
**Note:** Version bump only for package medusa-payment-klarna
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "medusa-payment-klarna",
|
||||
"version": "1.1.7",
|
||||
"version": "1.1.8",
|
||||
"description": "Klarna Payment provider for Medusa Commerce",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -102,7 +102,7 @@ class KlarnaProviderService extends PaymentService {
|
||||
|
||||
order.order_lines = await this.lineItemsToOrderLines_(cart, region.tax_rate)
|
||||
|
||||
if (discount_total) {
|
||||
if (discount_total > 0) {
|
||||
order.order_lines.push({
|
||||
name: `Discount`,
|
||||
quantity: 1,
|
||||
@@ -113,6 +113,16 @@ class KlarnaProviderService extends PaymentService {
|
||||
total_amount: -discount_total * (1 + taxRate),
|
||||
total_tax_amount: -discount_total * taxRate,
|
||||
})
|
||||
} else if (discount_total < 0) {
|
||||
order.order_lines.push({
|
||||
name: `Discount Payback`,
|
||||
quantity: 1,
|
||||
type: "surcharge",
|
||||
unit_price: -discount_total * (1 + taxRate),
|
||||
tax_rate: taxRate * 10000,
|
||||
total_amount: -discount_total * (1 + taxRate),
|
||||
total_tax_amount: -discount_total * taxRate,
|
||||
})
|
||||
}
|
||||
|
||||
if (gift_card_total) {
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.1.9](https://github.com/medusajs/medusa/compare/medusa-plugin-brightpearl@1.1.8...medusa-plugin-brightpearl@1.1.9) (2021-03-25)
|
||||
|
||||
**Note:** Version bump only for package medusa-plugin-brightpearl
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.8](https://github.com/medusajs/medusa/compare/medusa-plugin-brightpearl@1.1.7...medusa-plugin-brightpearl@1.1.8) (2021-03-17)
|
||||
|
||||
**Note:** Version bump only for package medusa-plugin-brightpearl
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "medusa-plugin-brightpearl",
|
||||
"version": "1.1.8",
|
||||
"version": "1.1.9",
|
||||
"description": "Brightpearl plugin for Medusa Commerce",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -182,7 +182,16 @@ class BrightpearlService extends BaseService {
|
||||
|
||||
if (availability) {
|
||||
const brightpearlProduct = await client.products.retrieve(productId)
|
||||
const onHand = availability[productId].total.onHand
|
||||
|
||||
const prodAvail = availability[productId]
|
||||
|
||||
let onHand = 0
|
||||
if (
|
||||
prodAvail.warehouses &&
|
||||
prodAvail.warehouses[`${this.options.warehouse}`]
|
||||
) {
|
||||
onHand = prodAvail.warehouses[`${this.options.warehouse}`].onHand
|
||||
}
|
||||
|
||||
const sku = brightpearlProduct.identity.sku
|
||||
if (!sku) return
|
||||
|
||||
@@ -3,6 +3,17 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.1.8](https://github.com/medusajs/medusa/compare/medusa-plugin-contentful@1.1.7...medusa-plugin-contentful@1.1.8) (2021-03-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* update all contentful ([806918a](https://github.com/medusajs/medusa/commit/806918a10e42fde60240dcc785d8e175dc8507b5))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.7](https://github.com/medusajs/medusa/compare/medusa-plugin-contentful@1.1.6...medusa-plugin-contentful@1.1.7) (2021-03-17)
|
||||
|
||||
**Note:** Version bump only for package medusa-plugin-contentful
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "medusa-plugin-contentful",
|
||||
"version": "1.1.7",
|
||||
"version": "1.1.8",
|
||||
"description": "Contentful plugin for Medusa Commerce",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -449,9 +449,14 @@ class ContentfulService extends BaseService {
|
||||
"options",
|
||||
]
|
||||
|
||||
const found = variant.fields.find((f) => updateFields.includes(f))
|
||||
if (!found) {
|
||||
return
|
||||
// Update came directly from product variant service so only act on a couple
|
||||
// of fields. When the update comes from the product we want to ensure
|
||||
// references are set up correctly so we run through everything.
|
||||
if (variant.fields) {
|
||||
const found = variant.fields.find((f) => updateFields.includes(f))
|
||||
if (!found) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
@@ -3,6 +3,22 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
||||
|
||||
## [1.1.16](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.15...@medusajs/medusa@1.1.16) (2021-03-26)
|
||||
|
||||
**Note:** Version bump only for package @medusajs/medusa
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.15](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.14...@medusajs/medusa@1.1.15) (2021-03-18)
|
||||
|
||||
**Note:** Version bump only for package @medusajs/medusa
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
## [1.1.14](https://github.com/medusajs/medusa/compare/@medusajs/medusa@1.1.13...@medusajs/medusa@1.1.14) (2021-03-17)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@medusajs/medusa",
|
||||
"version": "1.1.14",
|
||||
"version": "1.1.16",
|
||||
"description": "E-commerce for JAMstack",
|
||||
"main": "dist/index.js",
|
||||
"repository": {
|
||||
|
||||
@@ -35,6 +35,7 @@ describe("POST /admin/discounts/:discount_id/regions/:region_id", () => {
|
||||
"id",
|
||||
"code",
|
||||
"is_dynamic",
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"starts_at",
|
||||
|
||||
@@ -35,6 +35,7 @@ describe("POST /admin/discounts/:discount_id/variants/:variant_id", () => {
|
||||
"id",
|
||||
"code",
|
||||
"is_dynamic",
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"starts_at",
|
||||
|
||||
@@ -6,6 +6,7 @@ const defaultFields = [
|
||||
"id",
|
||||
"code",
|
||||
"is_dynamic",
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"starts_at",
|
||||
|
||||
@@ -6,6 +6,7 @@ const defaultFields = [
|
||||
"id",
|
||||
"code",
|
||||
"is_dynamic",
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"starts_at",
|
||||
|
||||
@@ -6,6 +6,7 @@ const defaultFields = [
|
||||
"id",
|
||||
"code",
|
||||
"is_dynamic",
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"starts_at",
|
||||
|
||||
@@ -59,6 +59,7 @@ export const defaultFields = [
|
||||
"id",
|
||||
"code",
|
||||
"is_dynamic",
|
||||
"is_disabled",
|
||||
"rule_id",
|
||||
"parent_discount_id",
|
||||
"starts_at",
|
||||
|
||||
@@ -83,27 +83,35 @@ class ClaimItemService extends BaseService {
|
||||
)
|
||||
}
|
||||
|
||||
const claimTagRepo = manager.getCustomRepository(this.claimTagRepository_)
|
||||
const tagsToAdd = await Promise.all(
|
||||
tags.map(async t => {
|
||||
const normalized = t.trim().toLowerCase()
|
||||
const existing = await claimTagRepo.findOne({
|
||||
where: { value: normalized },
|
||||
let tagsToAdd = []
|
||||
if (tags && tags.length) {
|
||||
const claimTagRepo = manager.getCustomRepository(
|
||||
this.claimTagRepository_
|
||||
)
|
||||
tagsToAdd = await Promise.all(
|
||||
tags.map(async t => {
|
||||
const normalized = t.trim().toLowerCase()
|
||||
const existing = await claimTagRepo.findOne({
|
||||
where: { value: normalized },
|
||||
})
|
||||
if (existing) {
|
||||
return existing
|
||||
}
|
||||
|
||||
return claimTagRepo.create({ value: normalized })
|
||||
})
|
||||
if (existing) {
|
||||
return existing
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
return claimTagRepo.create({ value: normalized })
|
||||
let imagesToAdd = []
|
||||
if (images && images.length) {
|
||||
const claimImgRepo = manager.getCustomRepository(
|
||||
this.claimImageRepository_
|
||||
)
|
||||
imagesToAdd = images.map(url => {
|
||||
return claimImgRepo.create({ url })
|
||||
})
|
||||
)
|
||||
|
||||
const claimImgRepo = manager.getCustomRepository(
|
||||
this.claimImageRepository_
|
||||
)
|
||||
const imagesToAdd = images.map(url => {
|
||||
return claimImgRepo.create({ url })
|
||||
})
|
||||
}
|
||||
|
||||
const created = ciRepo.create({
|
||||
...rest,
|
||||
|
||||
Reference in New Issue
Block a user