Commit Graph

65 Commits

Author SHA1 Message Date
Patrick
86f9455d00 test: allow integration-tests to leverage workspaces optimizations (#2727)
### What
Leverage yarn workspaces and Turborepo for integration-tests in order to accelerate development and reduce DevX complexity.

### Why
The current solution for running integration tests requires using `medusa-dev-cli` in order to publish packages to a local npm repository. The package where the command is executed will have its package.json altered for any known medusa dependency in order to install from the local npm. The process is taxing on the host machine resources and prevents rapid iterations when working with integration tests.

For more information, see documentation: f0cc1b324c/docs/content/usage/local-development.md (run-api-integration-tests)

### How
By declaring `integeration-tests/**/*` as a workspace, Turborepo can now be leveraged to build and run integration test as if there were packages. The build process will take care of interdependency between package in order to ensure local dependency are met.

In addition, within each integration-tests "packages", we can declare local dependencies as "*" which will translate to using the one that is part of the current build, regardless of the dependency's version number. No more fiddling with version numbers.

Github actions pertaining to integration-tests have been streamlined to use the new behavior.

The integration-tests packages have been marked as `private:true` in order to avoid publishing them to the public npm registry.

### Testing
```
cd root-of-medusajs-medusa-repo/
yarn install
yarn build
yarn test:integration:api
yarn test:integration:plugins
```

After a code change, `yarn build` must be run before re-running an integration test, which is the same procedure as for unit tests.

Resolves: CORE-845
2022-12-08 14:57:16 +00:00
Adrien de Peretti
42d9c7222b feat(medusa): Performance improvements of Carts domain (#2648)
**What**

I have created a new method on the cart service which is `addLineItems`, allowing a user to add one or multiple items in an optimized way. Also updated the `generate` method from the line item service which now also accept a object data or a collection of data which. Various places have been optimized and cache support has been added to the price selection strategy.

The overall optimization allows to reach another 9000% improvement in the response time as a median (Creating a cart with 6 items):

|   | Min (ms)  | Median (ms)  | Max (ms)  | Median Improvement (%)
|---|:-:|---|---|---|
| Before optimisation  | 1200  | 9999 | 12698  |  N/A
| After optimisation | 63  | 252  | 500  | 39x
| After re optimisation | 56 | 82  | 399  | 121x
| After including addressed feedback | 65 | 202  | 495  | 49x

FIXES CORE-722
2022-12-07 14:39:12 +00:00
Philip Korsholm
70a8d3450f fix(medusa): Use correct auth middleware in GET /store/auth (#2687)
* use correct authentication middleware

* remove guard from get-session since it's guarded by middleware doing the same check

* Add integration tests

* Create lazy-swans-agree.md

Co-authored-by: olivermrbl <oliver@mrbltech.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2022-11-29 15:46:55 +01:00
Carlos R. L. Rodrigues
755ba90c05 feat(medusa): Payment Collection endpoints (#2525) 2022-11-11 18:28:45 +01:00
Kasper Fabricius Kristensen
69e579758f fix(medusa, medusa-js): Use price selection strategy for GET /admin/variants (#2270)
**What**
- Adds the use of price selection strategy to the endpoint `GET /admin/variants`
- Updates medusa-js to reflect this change (expanding the parameters).

**Testing**
- Adds a new integration test validating that returned variants are now of type PricedVariant, with the expected fields: original_price, calculated_price, etc.

**Why**
- Our current RMA flows (in our admin dashboard) relied heavily on simply using `order.tax_rate` to calculate variant prices in the different RMA menus. As taxes in Medusa, have become feature complete this approach had become very naive and has several potential issues. Moving the responsibility for calculating the correct prices guarantees that we always show the correct prices to admins.
2022-10-13 08:54:03 +00:00
Oliver Windall Juhl
ad717b9533 chore(medusa): Remove deprecated dependency @hapi/joi (#2069) 2022-09-05 16:03:06 +02:00
olivermrbl
f7a63f1782 chore(integration-tests): Fixed merge conflict 2022-08-25 16:04:49 +02:00
Carlos R. L. Rodrigues
ffd6234356 chore(integration): throw errors on catch blocks (#2091)
Why:
Suppressing errors and not failing the execution will lead to misleading errors of the following tests.

Fixes CORE-461
2022-08-25 06:36:24 +00:00
Oliver Windall Juhl
5ac7f08e4d fix(medusa): Incorrect swap difference due (#2086)
### What
Creating a swap on an order with a discount leads to an incorrect difference due. 

**Scenario**
- Create a store with minimum 2 products (Prod A, Prod B)
- Create a discount that only works for Prod A
- Create an order for Prod A with the discount applied
- Create a swap between Prod A and Prod B

**Expected outcome**
We would expect the difference_due amount to come out to the sum of:
- -1 * (price of prod a - discount applied to prod a) 
- price of prod b

**Actual outcome**
Instead the discount is applied across both products when calculating difference due. This results in a total that is instead the sum of:
- -1 * (price of prod a - discount applied to prod a)
- price of prod b - discount on prod b ignoring the condition

### How
Adds `line_item.adjustments` to relations in cart retrieval prior to setting the difference_due to car total

Fixes CORE-361
2022-08-24 14:07:44 +00:00
Sebastian Rindom
8c283ac3b0 fix(medusa): Calculated price on cart shipping options (#1878) 2022-07-20 11:04:31 +02:00
Adrien de Peretti
cdd91974f9 feat(medusa, medusa-js, medusa-react): Start implementing remove batch products on a sales channel (#1842)
What
Support sales channel remove product batch in medusa, medusa-js and medusa-react

How
By implementing a new endpoint and the associated service method as well as the repository methods.

Medusa-js new removeProductd method in the resource

Medusa-react new hook in the mutations

Tests

Endpoint test
Service test
Integration test
Hook tests

Fixes CORE-292
2022-07-13 19:40:23 +00:00
Sebastian Rindom
e539bdc620 chore: Fix CI pipeline (#1839) 2022-07-12 20:14:34 +02:00
Oliver Windall Juhl
02967f95b1 fix(medusa): Refresh adjustments when region on cart is changed (#1827)
* fix(medusa): Refresh adjustments when region on cart is changed

* fix test

* Fix unit test

* fix: integration tests

* fix: comment
2022-07-11 10:51:55 +02:00
Zakaria El Asri
9fa4238ee4 chore: improve ci pipeline (#1764)
* fix: caching deps + add true parallelization to integration tests api

* fix: github action

* chore: upgrade to yarn berry (#1762)

* init migration

* remove: yarn.lock from all pkgs

* fix: build script in pkgs

* adjust yarn config

* fix: yarn.lock and yarnrc.yml

* fix: github actions

* fix: wrong type

* fix (medusa-react): use dts-cli instead of tsdx

* fix: yarn.lock

* fix: yarn v

* fix: prepare script

* add: comment on why we need to downgrade yarn before medusa-dev

* chore: move to Turborepo (#1763)

* increase number of parallel nodes

* fix (medusa-fulfillment-webshipper): build script

* fix: use new version of medusa-dev

* fix: rename cache-bootstrap to cache-deps
2022-07-10 12:11:11 +02:00
Adrien de Peretti
7b09b8c36c feat(medusa/product-export-strategy): Implement the Product export strategy (#1688) 2022-06-22 23:42:31 +02:00
Adrien de Peretti
5172b21d09 refactor(medusa): Refactor and fix EventBusService (#1377) 2022-06-09 17:18:22 +01:00
Oliver Windall Juhl
a87e1cdf65 feat(medusa): Add endpoint for retrieving a DiscountCondition (#1525) 2022-05-17 11:17:17 +02:00
Adrien de Peretti
edeac8ac72 feat(medusa): Add /admin/products/:id/variants end point (#1471)
* feat(medusa): Add /admin/products/:id/variants end point

* test(medusa): Fix get-variants test casees

* feat(medusa): Include the config to the ProdutService#retrieveVariants as a method parameter

* feat(medusa): Improve get-variants endpoint

* feat(medusa): Improve get-variants endpoint

* test(medusa): Fix unit tests

* test(medusa): Fix unit tests

* feat(medusa): Improve typings

* feat(medusa): Update according to feedback

* feat(medusa): Update according to feedback

* test(medusa): Fix list-variants tests

* feat(medusa): Getting the variants from the product end point should use the productVariantService

* fix(medusa): list-variants expand possibly undefined

* Fix(medusa): List-variants endpoint

* fix(medusa): Tests suite for list-variant

* test(integration-tests): Fix yarn lock

* test(integration-tests): Fix yarn lock
2022-05-16 12:19:34 +02:00
Zakaria El Asri
f71b9b3a87 fix(medusa): support searching for price lists (#1407) 2022-05-08 18:45:18 +02:00
Zakaria El Asri
1cfeb5dbd8 feat: line item adjustments (#1319)
* add: crud services + model + totals

* fix: enforce unique constraint on line item adjustment model and update service (#1241)

* add: unique constraint on model + fix service

* fix: unique constraint

* fix: add cascade on delete + fix discount relation

* fix: remove optional unique prop

* add: tests for ensuring line item adjustment db constraints (#1279)

* add: tests for ensuring db constraints

* fix: use given when then

* feat: adjust cart to include line item adjustments (#1242)

* fix: cart service + cart tests

* fix: remaining tests

* fix: swap tests

* fix: add relationship + fix oas

* refactor: applyDiscount

* fix: refactor applyDiscount and fix + add unit tests

* fix: plugins tests

* feat: line item adjustments draft orders (#1243)

* fix: draft order tests

* fix: constraint

* fix: wrong variable name

* fix: unique constraint

* progress: add tests

* fix: add cascade on delete + fix discount relation

* fix: remove optional unique prop

* fix: cart removeLineItem + tests

* fix: cart unit tests

* fix: update snapshot

* remove: verbose option

* rename arg

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>

* add: create adjustments for swap additional_items

* add: create adjustments for return lines

* fix: unit test for creating adjustment for additional_items

* fix: create adjustments only for non return items + no deletion when item is a return item

* add: integration tests

* refactor: use refreshAdjustments method

* refactor test

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2022-04-12 15:49:31 +02:00
Oliver Windall Juhl
a610805917 feat: Add DiscountConditions (#1230)
* feat: Add DiscountCondition entity + Join table per relation (#1146)

* feat: Convert DiscountService to TypeScript (#1149)

* feat: Add DiscountRepository + bulk insert and remove (#1156)

* feat: Add `conditions` to payload in `POST /discounts` and `POST /discounts/:id` (#1170)

* feat: Add DiscountRuleCondition entity

* fix relation

* fix join key

* Add discount rule condition repo

* add join table per relation

* Convert DiscountService to TypeScript

* feat: Add DiscountConditionRepository

* Add migration + remove use of valid_for

* revert changes to files, not done yet

* init work on create discount endpoint

* Add conditions to create discount endpoint

* Add conditions to update discount endpoint

* Add unique constraint to discount condition

* integration tests passing

* fix imports of models

* fix tests (excluding totals calculations)

* Fix commented code

* add unique constraint on discount condition

* Add generic way of generating retrieve configs

* Requested changes + ExactlyOne validator

* Remove isLocal flag from error handler

* Use postgres error constant

* remove commented code

* feat: Add `isValidForProduct` to check if Discount is valid for a given Product (#1172)

* feat: Add `canApplyForCustomer` to check if Discount is valid for customer groups (#1212)

* feat: Add `calculateDiscountForLineItem` (#1224)

* feat: Adds discount condition test factory (#1228)

* Remove use of valid_for

* Tests passing

* Remove valid_for form relations

* Add integration tests for applying discounts to cart
2022-03-24 16:47:50 +01:00
Kasper Fabricius Kristensen
5300926db8 feat: Implement PriceList and extend MoneyAmount (#1152)
* init

* added buld id validation to repo

* admin done

* updated price reqs

* intial implementation of PriceList

* integration tests for price lists

* updated admin/product integration tests

* update updateVariantPrices method

* remove comment from error handler

* add integration test for batch deleting prices associated with price list

* make update to prices through variant service limited to default prices

* update store/products.js snapshot

* add api unit tests and update product integration tests to validate that prices from Price List are ignored

* fix product test

* requested changes

* cascade

* ensure delete variant cascades to MoneyAmount

* addresses PR feedback

* removed unused endpoint

* update mock

* fix failing store integration tests

* remove medusajs ressource

* re add env.template

* Update integration-tests/api/__tests__/admin/price-list.js

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>

* Update integration-tests/api/__tests__/admin/price-list.js

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>

* fix: update snapshots

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
2022-03-18 15:18:50 +01:00
Frane Polić
a514d84ccf feat: list customer groups (#1099) 2022-03-02 11:38:44 +01:00
Sebastian Rindom
c56660fca9 feat: new tax api (#979)
* feat: add tax calculation strategy (#885)

* feat: add tax calculation strategy

* fix: adds strategy loader

* fix: eslint ignore

* chore: cleanup

* fix: allow plugin overwrites

* fix: allow plugin overwrites

* fix: fake region

* Update packages/medusa/src/loaders/strategies.ts

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>

* feat: adds tax related db entities + tax provider (#896)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: pr comments

* fix: unit test

* feat: totals service to ts (#911)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* feat: totals service to ts

* fix: remove totals.js

* fix: add shipping methods

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: tests

* fix: tests

* fix: unit test

* fix: adds TotalsServiceProps

* feat: adds integration tests for automatic tax calculation + shipping tax rates (#945)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* feat: totals service to ts

* fix: remove totals.js

* fix: add shipping methods

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: tests

* fix: tests

* fix: unit test

* fix: integration test helpers

* fix: adds factories + tests automatic tax rates

* fix: remove verbose

* fix: adds TotalsServiceProps

* fix: add shipping tax lines

* fix: add migration for shipping taxes

* fix: integration tests for shipping taxes

* fix: integration tests for shipping taxes

* fix: jsdoc types

* Feat/manual taxes (#950)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* feat: totals service to ts

* fix: remove totals.js

* fix: add shipping methods

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: tests

* fix: tests

* fix: unit test

* fix: integration test helpers

* fix: adds factories + tests automatic tax rates

* fix: remove verbose

* fix: adds TotalsServiceProps

* fix: add shipping tax lines

* fix: add migration for shipping taxes

* fix: integration tests for shipping taxes

* fix: integration tests for shipping taxes

* fix: add integration tests for manual taxes

* fix: cart service - cleanup jsdoc

* feat: add /carts/id/taxes to manually calculate taxes

* feat: add integration tests for order tax calculations

* fix: unit tests

* fix: merge

* fix: rm verbose

* fix: unit tests

* fix: object -> cartOrOrder

* fix: rounding

* Feat/complete order w tax lines (#951)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* feat: totals service to ts

* fix: remove totals.js

* fix: add shipping methods

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: tests

* fix: tests

* fix: unit test

* fix: integration test helpers

* fix: adds factories + tests automatic tax rates

* fix: remove verbose

* fix: adds TotalsServiceProps

* fix: add shipping tax lines

* fix: add migration for shipping taxes

* fix: integration tests for shipping taxes

* fix: integration tests for shipping taxes

* fix: add integration tests for manual taxes

* fix: cart service - cleanup jsdoc

* feat: add /carts/id/taxes to manually calculate taxes

* feat: add integration tests for order tax calculations

* feat: adds cart completion strategy + create order w. tax lines

* fix: unit tests

* fix: merge

* fix: rm verbose

* fix: unit tests

* fix: unit tests

* fix: unit tests

* fix: ensure calculation for list orders

* fix: unit tests

* fix: integration tests

* fix: adds cart order type gaurds

* Docs/tax api (#954)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* feat: totals service to ts

* fix: remove totals.js

* fix: add shipping methods

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: tests

* fix: tests

* fix: unit test

* fix: integration test helpers

* fix: adds factories + tests automatic tax rates

* fix: remove verbose

* fix: adds TotalsServiceProps

* fix: add shipping tax lines

* fix: add migration for shipping taxes

* fix: integration tests for shipping taxes

* fix: integration tests for shipping taxes

* fix: add integration tests for manual taxes

* fix: cart service - cleanup jsdoc

* feat: add /carts/id/taxes to manually calculate taxes

* feat: add integration tests for order tax calculations

* feat: adds cart completion strategy + create order w. tax lines

* fix: unit tests

* fix: merge

* fix: rm verbose

* fix: unit tests

* fix: unit tests

* fix: unit tests

* fix: ensure calculation for list orders

* fix: unit tests

* fix: integration tests

* docs: documents tax related methods and types

* fix: require either item_id or shipping_method_id

* feat: product type tax rate (#969)

* feat: adds tax related db entities + tax provider

* fix: add tax provider tests

* fix: add tax service unit tests

* fix: tests + migrations

* feat: totals service to ts

* fix: remove totals.js

* fix: add shipping methods

* fix: add inherited tax lines

* chore: rm tax-line repo

* fix: test

* fix: tests

* fix: tests

* fix: unit test

* fix: integration test helpers

* fix: adds factories + tests automatic tax rates

* fix: remove verbose

* fix: adds TotalsServiceProps

* fix: add shipping tax lines

* fix: add migration for shipping taxes

* fix: integration tests for shipping taxes

* fix: integration tests for shipping taxes

* fix: add integration tests for manual taxes

* fix: cart service - cleanup jsdoc

* feat: add /carts/id/taxes to manually calculate taxes

* feat: add integration tests for order tax calculations

* feat: adds cart completion strategy + create order w. tax lines

* fix: unit tests

* fix: merge

* fix: rm verbose

* fix: unit tests

* fix: unit tests

* fix: unit tests

* fix: ensure calculation for list orders

* fix: unit tests

* fix: integration tests

* docs: documents tax related methods and types

* fix: require either item_id or shipping_method_id

* feat: adds returns tests for new tax system

* feat: adds return lines + integration tests for swaps

* feat: return integration tests

* feat: adds product type tax rates

* feat: add tax management endpoints

* fix: create single migration

* fix: adds tax rates to js client

* fix: strats

* Fix/plugin tests (#998)

* plugin testing setup

* fix: test sendgrid plugin

* fix: test sendgrid plugin

* chore: clean

* chore: clean

* fix: clean up tests

* fix: remove dirty import

* fix: sendgrid + brightpearl

* fix: plugin integration tests

* fix: klarna

* fix: shipping method tax

* fix: remove taxrates

* fix: unit tests

* fix: integration

* fix: integration

* fix: plugins tests

* fix: ignore plugins

* fix: tests

* fix: taxes (#1017)

* fix: taxes

* fix: taxes

* fix: faulty ref

* fix: create tax-lines with claim items

* fix: snapshot tax-liens

* fix: allows integration test teardown to force deleting tables

* fix: tests

* fix: merge

* fix: adds tax-rates to client

* fix: adds tax-rates to medusa-react

* fix: tests

* fix: tests

* fix: add product types

* fix: adds tax provider endpoint + cascaded deletes on tax rate relations

* fix: move errors to service layer

* fix: cleanup api

* fix: unit tests

* fix: error handler in base-service

* fix: Add order region to swap on createFulfillment (#1110)

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2022-02-24 20:14:09 +01:00
Zakaria El Asri
cb7b211c9b fix: variant price update (#1093)
* fix: variant prices update + integration tests

* add: unit tests

* fix: rename variable

* add: integration tests

* fix: integration tests

* fix: test name

* fix: move db logic to repo layer + create upsert method

* fix: linting
2022-02-22 20:23:11 +01:00
Kasper Fabricius Kristensen
66294038f0 feat: add and remove products to/from collection in bulk endpoints (#1032)
* adds bulk add/remove products to/from collection. Adds endpoint updateProducts on collections that uses these bulk operations

* fix integration tests and test description

* undo change to swap

* made requested changes

* added removeProducts endpoint

* made requested changes

* fix: set collection_id null

* updated collection_id to type string | undefined
2022-02-16 22:45:19 +01:00
Kasper Fabricius Kristensen
d2a7534615 fix: admin collections default relations (#1023)
* added default relations to retrieve collection endpoint

* push snapshot

* added created at and updated at to collection list endpoint

* updated integration tests

* added q param to list collections

* updated snapshots
2022-02-04 16:24:42 +01:00
Zakaria El Asri
2e384842d5 feat: medusa-react admin hooks (#978)
* add: medusa admin hooks + tests

* fix: remove unneeded props

* fix: deps

* fix: deps

* fix: deps

* fix: failing tests

* fix: failing tests

* fix: query key

* add: yarn workspaces

* fix: linting medusa-react

* fix: add prepare script

* fix: buildOptions

* fix: useAdminShippingOptions query

* fix: use qs instead for query params (#1019)

* fix: formatting

* debug: ci pipeline

* debug: log node_modules structure

* debug: use lerna bootstrap

* debug: update node version

* debug: print pkgs in workspace

* debug: print pkgs in workspace

* debug: print pkgs in workspace

* debug: print pkgs in workspace

* debug: add explicit build step

* fix: jsdoc

* debug: run build step

* debug: fix build errors

* debug: add build step to integration tests

* fix: failing test

* cleanup

Co-authored-by: Sebastian Rindom <seb@medusajs.com>
Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2022-02-02 17:10:56 +01:00
Zakaria El Asri
69620e572e chore: parallelize integration tests and use template dbs (#907) 2021-12-14 21:45:57 +01:00
Oliver Windall Juhl
6579c13111 feat: Admin shipping options routes to Typescript (#891) 2021-12-07 17:07:23 +01:00
Zakaria El Asri
74bc9c618f fix: create cart with items (#851)
* fix: create cart with items

* remove: verbose mode

* fix: unit test
2021-12-01 10:53:01 +01:00
Oliver Windall Juhl
373532ecbc feat: Typescript for API layer (#817)
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Zakaria El Asri <33696020+zakariaelas@users.noreply.github.com>
Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>
Co-authored-by: Sebastian Rindom <seb@medusa-commerce.com>
2021-11-18 15:19:17 +01:00
Sebastian Rindom
45b344fbe1 fix: add product count to storefront (#719) 2021-11-04 15:32:48 +01:00
Zakaria El Asri
0a65eca3de fix: delete region causes cascade error (#672)
Co-authored-by: olivermrbl <oliver@mrbltech.com>
2021-11-03 15:19:46 +01:00
Sebastian Rindom
2297a84cb9 fix: merge develop 2021-10-15 18:44:19 +02:00
Sebastian Mateos Nicolajsen
fbd08e0feb feat:swap/claim on claim and claim on swap (#424) 2021-10-14 18:21:38 +02:00
zakariaelas
7cdd628997 merge develop and resolve conflicts 2021-10-14 15:44:58 +01:00
zakariaelas
dba1d5bb69 fix: adjustments based on seb's feedback
- remove eager from shipping_option relationship in `models/custom-shipping-options.ts`
- remove custom_shipping_options relation from cart model
2021-10-14 14:44:36 +01:00
Kasper Fabricius Kristensen
fc50aacde2 fix: options relations on GET variant (#532) 2021-10-13 19:46:44 +02:00
zakariaelas
52be911e50 fix: adjustments based on feedback
rename RMAShippingOption to CustomShippingOption
update models and relations
update unit and integration tests
update services
2021-10-06 14:17:36 +01:00
zakariaelas
db83448d18 fix: tests 2021-10-01 16:41:27 +01:00
Oliver Windall Juhl
00ab03f3a2 feat: Allow backorder on swaps (#404) 2021-09-19 15:33:43 +02:00
Vilfred Sikker Dreijer
682741041a Feat: add product default relations support for variant prices (#359)
Co-authored-by: olivermrbl <oliver@mrbltech.com>
2021-09-10 14:53:12 +02:00
Kasper Fabricius Kristensen
16b0fa377a fix: make shipping_option_id on requirements optional (#340)
* changed validator so that reqiurement shipping_option_id is now optional + added integration test that confirms that when an update contains a requirement without an ID it is created

* fix: formatting

* fix: un-bump babel-preset-medusa-package

* chore: update yarn.lock

* fix: implemented suggested changes, need to validate behaviour on clean branch so NOT ready for merging just yet

* fix: implemented suggested changes, need to validate behaviour on clean branch so NOT ready for merging just yet

* afix: made it impossible to set a min. subtotal requirement that is greater than max. subtotal

* fix: added explanation to error

* fix: Error when removing requirement on update

Co-authored-by: olivermrbl <oliver@mrbltech.com>
2021-09-09 09:03:00 +02:00
Sebastian Rindom
ae82cfc70a feat: creates support for swaps on the storefront (#355) 2021-08-30 12:14:56 +02:00
Sebastian Rindom
1039d040e9 Add SQLite support for easy setup (#336)
* Modifies schema to allow SQLite as a DB driver. SQLite is preinstalled in most OSes allowing for minimal prerequisites in the installation process.

* Removes Redis dependency and replaces "real" redis instance with ioredis-mock this is not feature complete and errors are expected.

* Updates medusa new command to only ask for Postgres credentials if the starter template has database_type === "postgres" in medusa-config.js

* Small improvements to bin resolution

* Improvements to endpoint stability
2021-08-16 15:45:26 +02:00
Sebastian Rindom
9a701ff229 fix: improves integration tests (#332)
* fix: improves integration tests

* fix: giftcard order with total 0

* fix: remove breaking eager
2021-08-11 09:26:25 +02:00
Kasper Fabricius Kristensen
f07cc0fa40 feat: In band inventory updates (#311)
Co-authored-by: olivermrbl <oliver@mrbltech.com>
2021-08-05 12:21:15 +02:00
Oliver Windall Juhl
6053c4a8dd feat: Add discountable flag to product (#329) 2021-08-05 10:40:12 +02:00
Zakaria El Asri
06fd882a67 fix: parameterize integration tests' db credentials (#319)
* add: read db credentials from .env

* remove: console.log

* fix: default to default pg user and password
2021-07-23 11:27:05 +01:00