Commit Graph

1724 Commits

Author SHA1 Message Date
Philip Korsholm
b164977a19 Feat: Medusa react price list (#1258)
* export everything from price lists in core

* medusa-js price list

* feat: add product list for price lists

* feat: add product list for price lists

* add price list to admin module

* add price list hooks initial

* refactor: product list controller

* fix: add integration test for price list products

* update types

* add tests for price lists

* update medusa react tests

* update update request for price lists

* Apply suggestions from code review

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

* rename methods

* pr feedback

* list products from price list

* fix errors after merge

* update medusa react with medusa-js method name changes

* redo changes

* update hook names

* fix: routes in msw handler

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
Co-authored-by: Zakaria El Asri <zakaria.elas@gmail.com>
2022-04-03 20:48:49 +02:00
Sebastian Rindom
fb33dbaca3 feat: price list products (#1239)
* feat: add product list for price lists

* feat: add product list for price lists

* refactor: product list controller

* fix: add integration test for price list products

* fix: use getListConfig
2022-03-30 13:29:14 +02:00
Philip Korsholm
3083aaee81 Fix: Add Customer id in generate line item for customer specific pricing (#1245)
* initial

* add logged in item to cart gets correct price

* customer id or cart_id customer id

* move customer_id to a config

* update unit test

* run pipelines
2022-03-28 09:57:33 +02:00
Sebastian Rindom
e9f6b4761a Merge remote-tracking branch 'origin/master' into develop 2022-03-25 22:26:48 +01:00
Sebastian Rindom
e4af6b8f9c chore: fix integration tests (#1240)
* chore: fix integration tests

* chore: fix integration tests

* fix: store tests

* fix: store tests

* fix: cleanup
2022-03-25 15:08:54 +01:00
Shahed Nasser
585bdf357a Merge pull request #1246 from medusajs/docs/fix-contentful-link
Docs: fix link in contentful tutorial
2022-03-25 14:51:37 +02:00
Shahed Nasser
a18ae35ec2 fix link 2022-03-25 14:49:20 +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
Shahed Nasser
ee0db7b4c3 Docs: update api reference (#1213)
* Updated API reference

* fixed error for requests with no response
2022-03-23 20:12:37 +01:00
0xflotus
9f03c51fbb fix: grammar (#1209) 2022-03-23 20:11:05 +01:00
Frane Polić
b7f699654b feat: customer group customers client endpoints (#1221)
* feat: add `listCustomers` (by group) to `medusa-js`

* feat: add `useAdminCustomerGroupCustomers` hook

* fix: remove log

* fix: import/export

* fix: change query keys

* wip: sublist query keys

* fix: revert query factory changes

* fix: add query as a param when building the "detail" key

* fix: revert keys logic, use special case

* fix: query path, change batch keys

* change admin customer groups cache key generation

* spread query params

Co-authored-by: fPolic <frane@medusajs.com>
2022-03-23 20:07:13 +01:00
Frane Polić
932f4b29a8 fix: list customers query error (#1226)
* fix: list customers generated query

* fix: consistency

Co-authored-by: fPolic <frane@medusajs.com>
2022-03-23 20:05:58 +01:00
Philip Korsholm
e2423020c0 Feat: use price selection strategy (#1165)
* init

* add query params

* added buld id validation to repo

* admin done

* updated price reqs

* initial price selection strategy

* update customer seeder

* format models

* price selection strategy

* price selection testing

* update price selection tests

* update price selection strategy

* remove console.warn

* update price seleciton strategy

* use price selection strategy in "get-product"

* price selection strategy integration testing

* update integration tests

* update price selection strat

* remove console.log

* fix unit tests

* update product snapshot integration tests

* fix failing unit tests

* update variant test snapshots

* update variant test snapshots

* fix failing unit tests

* update product snapshot integration tests

* intial implementation of PriceList

* add price selection strategy test to list-products

* add price selection to list products

* add price selection strategy to getRegionPrice

* add price selection strategy to get variant

* update product snapshot test

* store testing of price selection

* variant services

* update cart service

* update product tests

* update test

* unit testing with price selection strategy

* integration tests for price lists

* update sort prices for consistent results

* update snapshot

* update product snapshot with product ids

* this time pipelines work

* swap tests

* redo ordering

* updated admin/product integration tests

* update updateVariantPrices method

* remove comment from error handler

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

* named ids

* run with verbose

* add console.log

* sort products in integration test

* remove verbose flag

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

* update store/products.js snapshot

* update comment

* add todo

* lift existing price calculations to variant level

* remove unused import

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

* fix product test

* update integration tests

* pre merge commit

* requested changes

* cascade

* ensure delete variant cascades to MoneyAmount

* fetch variants correctly

* use find options

* add pricelist to relevant seeders

* update integration tests

* update price selection with "includeDiscountPrices"

* use transaction with price selection strategy

* add await to prevent store test errors

* remove verbose

* addresses PR feedback

* removed unused endpoint

* remove unused repository from constructor

* remove from constructor argument

* update mock

* update unit tests

* fix failing store integration tests

* remove medusajs ressource

* re add env.template

* price selection strategy methods

* fix integration tests

* update unit tests

* remove commented out code

* update jsdoc

* update price selection strategy parameter

* update snapshots

* integration tests cleanup

* pr feedback

* update integration tests

* pr feedback

* price selection unit tests

* add calculated price type to results

* cleanup include discount prices and price selection configs

* refactor price selection params to a separate file

* update tests and refactor price selection seeder

* remove prices from variant update

* rename result

* pr feedback

* remove unused import

* create getRegionPriceContext

* remove from params in search

* remove unused import

Co-authored-by: Kasper <kasper@medusajs.com>
Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
2022-03-23 17:17:19 +01:00
Sebastian Rindom
491b6eba2d fix: add tax service registration (#1225)
* fix: add tax service registration

* fix: cleanup
2022-03-23 11:10:41 +01:00
Oliver Windall Juhl
6603d3850a chore: Replace old Medusa domain with new (#1222) 2022-03-22 15:46:51 +01:00
Sebastian Rindom
fbe3b98761 fix: ensure customer identify calls before order track (#1227) 2022-03-22 15:43:15 +01:00
Philip Korsholm
dfa3502e41 Feat: Price selection implementation (#1158)
* init

* added buld id validation to repo

* admin done

* updated price reqs

* initial price selection strategy

* update customer seeder

* format models

* price selection strategy

* price selection testing

* update price selection tests

* update price selection strategy

* remove console.warn

* update price selection strat

* remove console.log

* fix unit tests

* update product snapshot integration tests

* fix failing unit tests

* update variant test snapshots

* 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

* price selection strategy methods

* fix integration tests

* update unit tests

* update jsdoc

* update price selection strategy parameter

* fix unit tests

* pr feedback

Co-authored-by: Kasper <kasper@medusajs.com>
Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
2022-03-21 19:03:42 +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
Sebastian Rindom
23f8399c16 fix(gatsby-source-medusa): adds support for incremental sourcing of medusa data (#1217) 2022-03-18 15:00:36 +01:00
Shahed Nasser
52e9cf6519 Merge pull request #1211 from medusajs/docs/reference-logo
Docs: Change logo in API reference
2022-03-18 12:33:31 +02:00
Sebastian Rindom
3cd4108915 fix: adds date filters on store collection + region list api (#1216) 2022-03-18 11:02:40 +01:00
Sebastian Rindom
36bfdfe6e1 fix(medusa-plugin-contentful): add type and collection entity synchronisation (#1191)
* fix: adds optional type and collection entries on products

* fix: type upsert in product

* fix: type upsert in product

* Update packages/medusa-plugin-contentful/src/services/contentful.js

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

* Update packages/medusa-plugin-contentful/src/services/contentful.js

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

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2022-03-17 23:29:26 +01:00
Sebastian Rindom
e3655b53f7 fix: storefront product filtering (#1189)
* fix: allow multiple ids in list + expand, fields param

* fix: add filtering by title

* fix: adds integration test

* fix: adds integration test of product variant filtering

* fix: integration tests

* fix: unit tests

* fix: refactor query param parsing
2022-03-17 23:28:15 +01:00
Shahed Nasser
cad9cc7d0d Change logo 2022-03-17 10:45:44 +02:00
Kasper Fabricius Kristensen
4be991c156 fix: source-shopify tests (#1192) 2022-03-15 20:12:52 +01:00
Shahed Nasser
a18263cf61 Merge pull request #1100 from medusajs/docs/advanced-backend-endpoint-admin
docs: Add Endpoint for Admin
2022-03-15 13:02:28 +02:00
Shahed Nasser
9ff18d0c4d resolve conflict 2022-03-15 12:02:09 +02:00
Kasper Fabricius Kristensen
eb8e247e7d fix: source shopify handle duplicate unique values and more efficient updates (#1154)
* fix: added functionality to handle duplicate sku, ean, upc, and barcodes on product variants

* handle unique variant values

* save

* clear ignored keys in redis

* fixed plugin to handle duplicates and use last build time to make queries more effective

* v1.1.1-canary.0

* removed console log

* v1.1.1-canary.1

* reduce amounts of calls to shopify api

* v1.1.1-canary.2

* added README and support for SmartCollections

* v1.1.1-canary.4

* v1.1.1-canary.5

* v1.1.1-canary.5

* fix dropped products in smart collections

* cleanup

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2022-03-10 13:10:57 +01:00
Frane Polić
218b20b26d fix: CustomerGroups missing features in the clients (#1159)
* feat: support for query params in customer groups retrieve method

* feat: add `useAdminDeleteCustomerGroup`hook

* fix: formatting

* fix: pass `query` object in `useAdminCustomerGroup` hook

Co-authored-by: fPolic <frane@medusajs.com>
2022-03-10 13:10:18 +01:00
Nicklas Gellner
d9f68c891e chore: Update to product roadmap status and removal of link to old product roadmap (#1162) 2022-03-10 13:08:54 +01:00
Philip Korsholm
dacc9c6c4b Feat: Add groups to list customer (#1113)
* add controllers directory and loaders

* update integration tests

* start groups

* move controllers to pure functions

* group filtering for customers

* print errors

* remove verbose flag

* controller refactor

* update imports

* Feat/list customers by customer group (#1114)

* move controllers to pure functions

* add customer group test

* add api for list customer group customers

* remove unused imports

* controller refactor

* update imports

* Update packages/medusa/src/api/routes/admin/customer-groups/get-customer-group-customers.ts

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

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

* fix: dedupe

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2022-03-10 13:05:46 +01:00
Zakaria El Asri
8e7de6dd36 fix: make sure @medusajs/medusa is loaded correctly regardless of integration test suite being run (#1166) 2022-03-09 17:20:18 +01:00
Kasper Fabricius Kristensen
4e7435e4d7 fix: default POST request payloads to an empty object (#1141)
* defaulted carts.create payload to an empty object

* fix linting

* requested changes
2022-03-09 17:19:38 +01:00
Philip Korsholm
5f5a2af30b Feat: Add customer search controller (#1111)
* add controllers directory and loaders

* move controllers to pure functions

* controller refactor

* update imports
2022-03-09 10:55:05 +01:00
Frane Polić
daf49bcaf3 feat: customer groups react hooks (#1153)
* fix: msw handlers for medusa-react storybook

* feat: add customer groups query hooks

* feat: add create/update customer groups hooks

* feat: add customer group batch  hooks

* feat: add test files, fix import

* add customer groups fixture

* add customer gorup mock endpoints

* add test cases

* add hook comments

* fix: typos

* fix: comments refactor

* fix: comment

Co-authored-by: fPolic <frane@medusajs.com>
2022-03-07 12:52:48 +01:00
Kasper Fabricius Kristensen
a6f352d9f1 fixed type of value and valid_for in AdminPostDiscountsDiscountReq (#1128)
* fixed type of value in update/rule

* update type of valid_for
2022-03-06 20:44:11 +01:00
Nicklas Gellner
715ed445a3 chore: typo in CONTRIBUTING (#1155) 2022-03-06 20:35:34 +01:00
Shahed Nasser
4229c39a7f docs: added create service documentation (#1103) 2022-03-06 16:00:08 +01:00
Shahed Nasser
d12c8b919b Docs: added architecture overview (#1109) 2022-03-06 15:58:07 +01:00
Shahed Nasser
dbb85c1043 Replaced Video Links with Video Player (#1145) 2022-03-06 15:57:10 +01:00
olivermrbl
6b34a9adab Merge branch 'master' into develop 2022-03-04 16:56:58 +01:00
Frane Polić
93426bfc02 feat: customer groups client endpoints (#1147)
* feat: WIP add customer group endpoints, fix generated type exports from api

* fix: export api types, add `list`method

* fix: export customer groups types from the `medusa-js` package

* fix: cleanup type exports from customer groups api

* feat: add customer group batch methods

* fix: refactor comments

* fix: address PR comments

Co-authored-by: fPolic <frane@medusajs.com>
2022-03-03 03:52:40 +01:00
Frane Polić
a514d84ccf feat: list customer groups (#1099) 2022-03-02 11:38:44 +01:00
Shahed Nasser
adc9280f59 changes to yarn.lock 2022-03-02 12:09:20 +02:00
Michał
e844f4a5b7 fix: exists flag on /store/auth/:email endpoint (#1122) 2022-03-02 10:18:11 +01:00
olivermrbl
6c010c019f chore(release): Publish
- @medusajs/medusa-cli@1.2.1
 - medusa-fulfillment-webshipper@1.2.1
 - medusa-interfaces@1.2.1
 - @medusajs/medusa-js@1.1.1
 - medusa-payment-klarna@1.2.1
 - medusa-payment-paypal@1.1.1
 - medusa-plugin-algolia@0.1.1
 - medusa-plugin-brightpearl@1.2.1
 - medusa-plugin-meilisearch@0.1.1
 - medusa-plugin-segment@1.2.1
 - medusa-plugin-sendgrid@1.2.1
 - medusa-plugin-slack-notification@1.2.1
 - medusa-react@0.2.1
 - medusa-source-shopify@1.1.1
 - @medusajs/medusa@1.2.1
2022-02-28 16:57:42 +01:00
Oliver Windall Juhl
549ad3b907 fix: Add tax repo to withTransaction in region service (#1126) 2022-02-28 11:21:49 +01:00
Philip Korsholm
4b4463f0e2 Feat: Bulk add customers to customer group (#1095)
* fix babel transform-runtime regenerator required for migrations

* add customer group model

* add migration for customer group

* add customer group model export

* add customer group repository

* add customer group service

* add CustomerGroupRepository to "withTransaction" in CustomerGroupService

* remove unnecessary argument to runtime plugin

* service export ordering

* add create customer group endpoint

* add customergroup to route index in admin

* add customer group service

* add customer groups test

* cleanup

* add customers batch initial

* batch creation of customer groups

* integration testing batch creation

* integration tests

* chaining existing customers creation in repo

* remove commented test

* update unit tests to reflect change in idempotent behavior

* ensure that exceptions are expected

* update idempotency behavior

* update formatting

* update format

* Update packages/medusa/src/repositories/customer-group.ts

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

* pr feedback

* add In import

* add seperate model dto

* add integration test

* error handling in repository

* remove unused import

* jsdoc

* Update packages/medusa/src/api/routes/admin/customer-groups/add-customers-batch.ts

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

* Update packages/medusa/src/api/routes/admin/customer-groups/add-customers-batch.ts

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

* pr review comments

* rename variable

* fix: adds atomic phase clean up callback

* fix: call error handler in new transaction block too

* restore

* error handling

* fix: error handler in no isolation case

* add integration test for missing group on update

* final adjustments to test

* fix pr feedback

* cleanup core for pr

* remove console.log

* remove customergroupservice test from customers

* Apply suggestions from code review

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

* add end bracket to customer tests

* remove comments

* change model decorator

* fix integration test merge

* onDelete cascade instead of cascade:true

* remove verbose flag

* fix: dedupe type

* add save to customer groups

* customer model delete cascade

* add await to asyncronous save operations

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2022-02-28 10:03:26 +01:00
olivermrbl
562a1b427a fix: merge conflicts 2022-02-25 18:55:44 +01:00
olivermrbl
806c42650c chore(release): Publish
- @medusajs/medusa-cli@1.2.0
 - medusa-fulfillment-webshipper@1.2.0
 - medusa-interfaces@1.2.0
 - @medusajs/medusa-js@1.1.0
 - medusa-payment-klarna@1.2.0
 - medusa-payment-paypal@1.1.0
 - medusa-plugin-algolia@0.1.0
 - medusa-plugin-brightpearl@1.2.0
 - medusa-plugin-meilisearch@0.1.0
 - medusa-plugin-segment@1.2.0
 - medusa-plugin-sendgrid@1.2.0
 - medusa-plugin-slack-notification@1.2.0
 - medusa-react@0.2.0
 - medusa-source-shopify@1.1.0
 - @medusajs/medusa@1.2.0
2022-02-25 18:53:50 +01:00