feature: swaps (#137)

* feat: swap schema

* chore(refactor): move returns to separate service

* swap order creates return

* fix: adds returns/fulfillments/shipments and cart creation to swaps

* search products by variants

* feat: swaps ready

* fix: test passing

* chore: include customer expand fields on order

* add tests

* fix: add brightpearl plugin support

* fix: adds swap link template setting

* fix: tests

* fix(medusa-plugin-brightpearl): add swap status option

* docs: add swap description

* fix: adds GET swap in store api

* chore: unmock axios

* fix: passing klarna tests

* fix: pr
This commit is contained in:
Sebastian Rindom authored and GitHub committed 2020-11-24 14:02:49 +01:00
1 parent c6996dd530
commit fd04233238
56 files changed
+3266 -564

No files matched your search

@@ -27,9 +27,9 @@ class BaseService {
* @param {object} obj - the object to decorate.
* @return {object} the decorated object.
*/
runDecorators_(obj) {
runDecorators_(obj, fields = [], expandFields = []) {
return this.decorators_.reduce(async (acc, next) => {
return acc.then(res => next(res)).catch(() => acc)
return acc.then(res => next(res, fields, expandFields)).catch(() => acc)
}, Promise.resolve(obj))
}
}