Commit Graph

82 Commits

Author SHA1 Message Date
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
zakariaelas
3d088c351b fix: more adjustments
add: composite unique constraint for shipping_option_id and cart_id
fix: fetchCartOptions to format custom shipping options like normal shipping options
fix: addShippingMethod should throw when custom shipping options is not empty and no optionId corresponds to custom shipping options
2021-10-07 14:54:05 +01: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
zakariaelas
632ad17e3f fix: merge conflicts 2021-09-30 20:29:58 +01:00
zakariaelas
79c601279e tests: integration tests 2021-09-30 14:52:43 +01:00
pKorsholm
cd4afd1576 fix(medusa): hide password hash (#429)
* auth tests

* customer auth tests

* user auth test

* store auth snapshot

* auth snapshot

* auth with deleted password hashes

* manual field input for test scripts

* fix circleci with double retrieve of user and customer

* add email validation to user

* fix: cleanup

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2021-09-30 12:19:37 +02:00
pKorsholm
9b64828ec3 Feat:discount expiration date (#403)
* discount expiration validation and testing

* integration testing

* double quotes

* add iso8601 package

* api testing

* add joi validation of start and end dates as well as valid_duration

* valid_duration column

* service testing

* discount validation in services

* integration test with invalid date interval

* include valid_duration when fetching a discount

* rename variable for clarity

* add test for dynamic discount with expiration date

* remove debug code

* adjust tests to reflect valid_duration being included in default fields

* additional discount update validation

* fixed failing test

* set ends_at on dynamic discount creation

* discount integration tests

* removed unused console.log

* removed validation of dynamic discounts by duration and added ends_at to dynamic discount creation

* integration tests for dynamic discount with and without duration

* optional valid duration for dynamic discounts

* allow nullable dynamic discount durations

* expect assertions

* fix unit test after change to dynamic discounts without duration

* change to date instead of string

* add assertions

* error handling

* addressed feedback
2021-09-30 12:13:59 +02:00
Oliver Windall Juhl
ae0ab03fac fix: Creating shipping options with requirements (#428) 2021-09-29 15:20:14 +02:00
pKorsholm
42cdfde6d9 Feat/nested return reasons (#418)
* api endpoints for nested return_reasons

* add nested return reasons to database

* add parent reason to update

* integration tests

* add children relation

* integration tests for nested returns and failing doubly nesting returns

* add delete-route and nested relations

* delete return reason route

* doubly nested return reason creation check and deletion

* nested return reasons migration

* list only parent reasons

* removed null filter

* remove empty migration

* add return reason filter to get list of categories with children

* removed console log

* corrected delete route

* return reason testing

* return reasons query

* listREasonsFromIDs

* create return testing

* listReasonsFromIds

* return reason tests

* failing if returnreason has child on return

* integration tests

* cascading deletes on return reasons

* more elegant checking for children of return reasons when creating a return

* remove console.log

* pr adjust

Co-authored-by: Philip Korsholm <phko@MacBook-Pro.localdomain>
2021-09-29 09:22:09 +02:00
Oliver Windall Juhl
85de2039cc hotfix: bug related to region update with no shipping address (#415) 2021-09-23 10:52:46 +02:00
Sebastian Mateos Nicolajsen
a70e3ed0ae feat: customer-information (#413)
* added the ability to update email as long as user has_account=false

* revamped and added fix for MC-132

Co-authored-by: olivermrbl <oliver@mrbltech.com>
2021-09-23 10:22:18 +02:00
Sebastian Mateos Nicolajsen
897ccf475a Feat/note on order (#399)
* added NoteService and related endpoints && tests

* removed snapshots

* corrected error in service

* removed snapshot

* added the ability to note down author using a string

* updated model for note

* refactored to access logged in user

* added other user id option

* removed snapshot

* updated according to feedback

* removed snapshots

* reintroduced snapshots

* updated to snake case

* removed try catch from use-db
2021-09-22 15:19:35 +02:00
Kasper Fabricius Kristensen
a82332da3e feat: add product status (#400)
* added statuses to product + unit test for updating status

* add update to product model

* added integration tests

* added integration test to validate that updating status to null results in invalid_data error

* removed comment

* update GET /store/products integration test

* fixed unit test with IdMap

* changed dbehaviour on invalid status input on admin list products

* updated migration to add status = published on all existing products + added integration test on GET /admin/products when status null is provided

* made requested changes to migration and GET /store/products

* fixed test

* made requested changes to migration
2021-09-21 11:22:17 +02:00
Zakaria El Asri
49a132976d fix: ILIKE operator not supported in sqlite (#393)
* fix: replace ILIKE operator with ILike function where possible

* remove: unused import

* fix: remove alias from test case as it is not needed

* fix: product variant query

* add: integration tests + fallback to original query for all queries searching on the display_id field

* remove: console.log
2021-09-21 11:15:33 +02:00
Oliver Windall Juhl
00ab03f3a2 feat: Allow backorder on swaps (#404) 2021-09-19 15:33:43 +02:00
Sebastian Rindom
bf43896d19 fix: customer endpoints shouldn't use customer id already provided through authentication (#402)
* Updated customers/:id to customers/me - untested

* fix: integration +unit tests

* docs: fix oas docs

Co-authored-by: ColdMeekly <20516479+ColdMeekly@users.noreply.github.com>
2021-09-17 08:27:46 +02:00
Vilfred Sikker Dreijer
d477ca9842 fix: add default relations to variants to include prices (#394) 2021-09-14 16:54:39 +02:00
Oliver Windall Juhl
27150959ff fix: Ensure uniqueness for products, variants, collections and discounts (#382) 2021-09-10 16:03:44 +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
Sebastian Mateos Nicolajsen
cf66f97758 feat: update and cancel swaps, claims, and returns (#310) 2021-09-10 13:57:34 +02:00
pKorsholm
fab155c246 Merge pull request #373 from medusajs/feat/product-variant-rank
Feat: Add product variant rank
2021-09-09 09:58:27 +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
pKorsholm
f5ee870854 product variant test adjustsments after variant was removed from the api 2021-09-08 15:04:03 +02:00
pKorsholm
ecad9db924 product-list snapshot test 2021-09-08 14:12:27 +02:00
Sebastian Mateos Nicolajsen
0076332e0e Fix/create customer in draft order (#285)
* draft order now creates customer when creating cart

* corrected to update instead of create

* corrected tests

* added creation of customer to create of cart

* removed update function from mock

* added test

* corrected update to update email properly

* corrected tests

* removed unused func

* updated core properly

* removed manual-payment service
2021-09-07 11:15:43 +02:00
pKorsholm
0c47c78c08 change variant column 'rank' to 'variant_rank' 2021-09-06 13:29:24 +02:00
olivermrbl
8fdfc87049 integration tests passing 2021-09-05 21:34:13 +02:00
pKorsholm
9e62746e43 integration tests 2021-09-03 17:15:33 +02:00
Sebastian Rindom
ae82cfc70a feat: creates support for swaps on the storefront (#355) 2021-08-30 12:14:56 +02:00
Oliver Windall Juhl
5d63b0c8d2 hotfix: Allow sale_amount product updates (#346) 2021-08-20 17:14:19 +02:00
Oliver Windall Juhl
fd14e243da fix: Account for non-discountable items in getRefundTotal (#347) 2021-08-20 17:12:37 +02:00
Kasper Fabricius Kristensen
143f06aa39 feat: Update to API references look and feel (#343)
Co-authored-by: Vadim Smirnov <smirnou.vadzim@gmail.com>
Co-authored-by: zakariasaad <zakaria.elas@gmail.com>
Co-authored-by: Vilfred Sikker <vilfredsikker@gmail.com>
Co-authored-by: olivermrbl <oliver@mrbltech.com>
2021-08-20 10:26:29 +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
821d8be733 feat: add route for retrieving a swap (#326)
* feat: swap details

* test: add get-swap and list-swaps route tests

* test: add swaps integration tests

* fix: use IdMap.getId in complete-cart unit test

commit 289d191 uses the IdMap.getId in the SwapServiceMock retrieve method, so a unit test in complete-cart needs to be adjusted accordingly

* fix: prefix default fields and totals with 'cart'
2021-07-29 16:47:33 +01:00
Zakaria El Asri
b378a4f8bc fix: enforce 1 shipping method per profile (#322)
prevents the scenario where multiple concurrent calls to insert a shipping method may lead to an inconsistent cart state with more than 1 shipping method per profile.
2021-07-23 11:26:20 +01:00
Sebastian Rindom
5a1cbc68b7 fix: allow updating billing address on customer 2021-07-13 10:41:06 +02:00
Oliver Windall Juhl
6358f8fc75 fix(medusa): Resolve issue with soft-delete and unique indexes in DB (#296) 2021-07-01 14:59:44 +02:00
Sebastian Rindom
c33c431889 chore: remove console.log 2021-06-29 16:54:24 +02:00
Sebastian Rindom
6342e68d06 fix: better store/customer support 2021-06-29 16:31:30 +02:00
Sebastian Rindom
10113d0657 test: adds integration test for shipping-option-requirements 2021-06-08 17:21:42 +02:00
olivermrbl
c0f2d629ab PR Review fixes 2021-06-07 15:23:41 +02:00
olivermrbl
e79b8f6494 add update-line-item on draft orders 2021-06-04 14:33:51 +02:00
olivermrbl
862f8282c4 fix merge conflicts 2021-06-03 11:25:18 +02:00
olivermrbl
0516bf7a5f minor test fix 2021-06-02 18:39:22 +02:00
Sebastian Rindom
586f4d884c feat: allow custom address on claims 2021-05-27 12:29:11 +02:00
olivermrbl
e3343f74a7 fix merge conflicts from develop 2021-05-25 15:44:26 +02:00