Commit Graph

5251 Commits

Author SHA1 Message Date
adrien2p
9b5354502f test(medusa): Fix test pipelines 2022-05-10 11:09:52 +02:00
Adrien de Peretti
eae37d8449 Merge pull request #1344 from adrien2p/feat-improveNewBaseService
feat(medusa): Move BaseService to the core and refactor it as part of the new TransactionBaseService
2022-05-09 17:05:18 +02:00
Adrien de Peretti
90870292c6 fix(medusa): Remove line-item.js file (#1414) 2022-05-09 09:52:15 +02:00
Adrien de Peretti
c67d6bee30 fix(medusa): PluginLoaders when loading services should only look for js files (#1473) 2022-05-09 09:42:47 +02:00
Adrien de Peretti
525910f72a fix(medusa-file-spaces): Allow duplicate filenames (#1474) 2022-05-09 09:41:18 +02:00
Zakaria El Asri
f71b9b3a87 fix(medusa): support searching for price lists (#1407) 2022-05-08 18:45:18 +02:00
Kasper Fabricius Kristensen
e7cb76ab6e fix: Cascade remove prices + option values on variant and product delete (#1465) 2022-05-08 16:12:31 +02:00
Philip Korsholm
e2d08316dd fix: Use correct product price when fetching product for pricelist (#1416) 2022-05-08 13:03:29 +02:00
Shahed Nasser
98f5c4ec8b fix(medusa-js): Updated URLs for JS Client (#1435) 2022-05-06 14:54:04 +02:00
adrien2p
f5edaf51ea fix(medusa): Proper fix of the cart service 2022-05-06 10:31:02 +02:00
adrien2p
32a65d27fc test(medusa): Add a test to check that the shipping_address is not erase when an id is have been given 2022-05-05 15:28:33 +02:00
adrien2p
c442be47d4 fix(medusa): CartService lost shipping address when using the id 2022-05-05 15:07:00 +02:00
Adrien de Peretti
3c75a65792 fix(medusa): MoneyAmountRepository#findManyForVariantInRegion sql statement for constraint related to price_list (#1462) 2022-05-05 07:56:34 +02:00
adrien2p
3ad91741b2 feat(medusa): Move some typings into the common types 2022-05-04 16:01:04 +02:00
Philip Korsholm
2260c2d09e fix(medusa-cli): allow spaces in develop command (#1430) 2022-05-04 08:44:37 +02:00
adrien2p
f7ef3aac36 feat(medusa): Rename base-service.spec to transaction-base-service.spec 2022-05-03 09:22:00 +02:00
adrien2p
978ee98dc3 refactor(medusa): Improve proposal in cartService use arguments to pass to the super 2022-05-02 18:08:03 +02:00
adrien2p
ff9ff21487 feat(medusa): Update TransactionBaseService methods visibility 2022-05-02 13:38:15 +02:00
olivermrbl
ae5801c518 chore(release): Publish
- gatsby-source-medusa@0.1.0
 - @medusajs/medusa-cli@1.3.0
 - medusa-file-s3@1.1.0
 - medusa-file-spaces@1.2.0
 - medusa-fulfillment-webshipper@1.3.0
 - medusa-interfaces@1.3.0
 - @medusajs/medusa-js@1.2.0
 - medusa-payment-klarna@1.3.0
 - medusa-payment-paypal@1.2.0
 - medusa-plugin-add-ons@1.2.0
 - medusa-plugin-algolia@0.2.0
 - medusa-plugin-brightpearl@1.3.0
 - medusa-plugin-contentful@1.2.0
 - medusa-plugin-ip-lookup@1.2.0
 - medusa-plugin-meilisearch@0.2.0
 - medusa-plugin-segment@1.3.0
 - medusa-plugin-sendgrid@1.3.0
 - medusa-plugin-slack-notification@1.3.0
 - medusa-plugin-twilio-sms@1.2.0
 - medusa-react@0.3.0
 - medusa-source-shopify@1.2.0
 - @medusajs/medusa@1.3.0
2022-05-01 15:16:35 +02:00
olivermrbl
d0675dc8b5 fix: merge conflicts 2022-05-01 14:58:28 +02:00
Shahed Nasser
56e79d334e fix(medusa-plugin-twilio-sms): fix name in README (#1457) 2022-05-01 11:56:41 +02:00
Greg Hannan
ab4a141f73 Replace cancelled typo with canceled in docs as implementing the docs was causing notifications to not send emails. 2022-04-27 13:41:16 +01:00
Philip Korsholm
00fd096d25 Feat: Discount migration (#1214)
* 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

* initial

* add migration scripts

* make getMigrationsFolder generic

* add datamodel migration command

* add datamodel run to migraitons cli

* remove data migration code from migrations

* add inner join

* add migration script for discount migration

* redo all script changes after adding script file

* address pr feedback

* cherrypick files from develop

* remove unused import

* suggestions

* Update packages/medusa/src/scripts/discount-rule-migration.ts

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

* fix: revert rule id to dr_id

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: olivermrbl <oliver@mrbltech.com>
2022-04-27 10:25:04 +02:00
Philip Korsholm
40b63d092a fix: Invoke canCalculate with an entire shipping option (#1397) 2022-04-26 22:11:48 +02:00
Zakaria El Asri
b8f1ae9ff5 feat: line item adjustment migration script (#1255) 2022-04-26 16:05:33 +02:00
Philip Korsholm
f7386bf4b3 fix: Update is_giftcard type when filtering products (#1427)
* transform is_giftcard parameter and default to false

* add test for non gift_cards

* make default optional
2022-04-25 14:55:33 +02:00
Kasper Fabricius Kristensen
7a1e394b9d Feat/expand on list discounts (#1304) 2022-04-21 15:22:07 +02:00
adrien2p
b90291b18d feat(medusa): Improve buildQuery as well as refactor the cart service as an example 2022-04-21 13:48:16 +02:00
adrien2p
e7e715ac17 feat(medusa): Split base service to its related TransactionBaseService and utilities methods when required 2022-04-21 13:48:16 +02:00
adrien2p
99146b7403 feat(medusa): Export transaction related methods to the transactionBaseService 2022-04-21 13:48:16 +02:00
adrien2p
1499bc52e3 feat(medusa): Add writable type 2022-04-21 13:48:16 +02:00
adrien2p
bfb81b8b32 feat(medusa): Improve base-service 2022-04-21 13:48:16 +02:00
Adrien de Peretti
313cb0658b feat(medusa): Improve config loading (#1290) 2022-04-21 12:49:56 +02:00
Adrien de Peretti
89a6de4660 fix(medusa): Remove updatePaymentMethod store cart route (#1382) 2022-04-21 12:43:22 +02:00
Oliver Windall Juhl
9acee2799e fix(medusa): Remove unsupported Discount endpoints (#1367) 2022-04-19 13:39:49 +02:00
Zakaria El Asri
95ea8fa385 fix: query key (#1350) 2022-04-17 16:54:56 +02:00
Adrien de Peretti
530bbd4cac refactor: LineItemService migration to TS + refactoring + fix (#1254)
* refactor(medusa): LineItemService migration to TS + refactoring

* feat(medusa): Cleanup line-item service

* feat(medusa): Rebase develop

* test(medusa): Fix integration cart tests

* fix(medusa): Cart service updateUnitPrices
2022-04-14 20:53:35 +02:00
Adrien de Peretti
6830a12b46 feat(medusa): Improve exported medusa API (#1335)
* feat(medusa): Improve exported medusa API
Avoid to always have to import from @medusajs/medusa/dist/*

* feat(medusa): The Model loaders should ignore the index file

* fix(medusa): swap model typo
2022-04-14 16:01:10 +02:00
Scuro Guardiano
d3104bf6ac Added compiling typescript files to develop command (#1307)
Issue1281
2022-04-14 10:09:40 +02:00
Adrien de Peretti
12c06b4c9d refactor(medusa): Cleanup and fix CartService (#1306)
* refactor(medusa): Cleanup + fix

* styles(medusa): Lint

* refactor(medusa): Finalize cleanup

* feat(medusa): Prefer the usage of bulk operations instead of sequential/conccurent operations

* feat(medusa): Improve cart service

* refactor(medusa): Explicitly specifying protected methods when needed as well as enfore the usage of the local transactionManager_ in those methods

* tests(medusa): Fix tests according to the new changes

* feat(medusa): Cleanup after rebase

* test(medusa): Fix cart service tests
2022-04-13 18:35:13 +02:00
Adrien de Peretti
3f19a3c4d5 refactor(medusa-interfaces): Migrate baseService to TS + improve the service it self (#1314)
* refactor(medusa-interfaces): Migrate baseService to TS + improve the service it self

* feat(medusa,medusa-interfaces): Cleanup and move base-service to medusa core

* medusa(medusa, medusa-interfaces): Improve typings

* medusa(medusa, medusa-interfaces): buildQuery make properties optionals

* feat(medusa-interfaces): Revert temporarly the medusa-interfaces while moving the base-service to the medusa core

* feat(medusa): Improve base-service typings

* feat(medusa): Remove template that is not necessary
2022-04-13 17:42:09 +02:00
Oliver Windall Juhl
edc6d9d29c fix: Remove region_id from countries on region deletes (#1330)
* Remove region id from countries on delete

* Update snapshots
2022-04-13 10:52:25 +02:00
Kasper Fabricius Kristensen
2a1b34c20f fixed typing of AdminPostPriceListsPriceListPriceListReq (#1332) 2022-04-13 10:50:05 +02:00
Kasper Fabricius Kristensen
8c420f4285 feat: Add BatchJob entity (#1324)
* added entity

* better typing

* make requested changes

* add migration
2022-04-13 08:16:38 +02:00
Oliver Windall Juhl
ecc5bdd362 Only use country if part of a region (#1183) 2022-04-12 16:42:53 +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
Sebastian Rindom
607a382b4e fix: ensures no duplicate tax lines when completing cart (#1262)
* fix: ensures that no duplicate tax lines are created when completing cart
2022-04-05 21:25:48 +02:00
Philip Korsholm
497e9b3f7d add discount exports (#1298) 2022-04-05 09:25:24 +02:00
Adrien de Peretti
5f9197a656 refactor(medusa): Loaders to TS (#1288)
* refactor(medusa): Loaders

* refactor(medusa): Improve MedusaContainer typings

* refactor(medusa): Improve MedusaContainer typings
2022-04-03 21:16:17 +02:00
Adrien de Peretti
ab2d81f786 fix(medusa): Lint and missing transaction usage (#1297) 2022-04-03 21:01:43 +02:00