Commit Graph

202 Commits

Author SHA1 Message Date
Adrien de Peretti
fb7abbf407 feat(medusa): Add file size calculation for product export (#1726) 2022-06-28 15:27:36 +02:00
Sebastian Rindom
c6dc9086cf feat(medusa): Add line item totals to cart totals decoration (#1740) 2022-06-28 12:11:47 +02:00
Sebastian Rindom
2a32609b74 fix(medusa): Normalizes email before saving customer (#1719) 2022-06-27 10:56:12 +02:00
Adrien de Peretti
89cb717461 fix(medusa): Product export strategy (#1713) 2022-06-27 10:48:56 +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
Zakaria El Asri
f0be31120f refactor(medusa): Migrate ProductService to TS (#1625)
* refactor: product service

* fix: type errors in consumers

* fix: use Status enum instead of ProductStatus

* fix: remove ProductStatus

* fix: rename ProductStatus

* fix: product model nullable fields

* fix: explicit typecasting in listVariants

* fix: use atomicPhase in public methods

* fix: use transactionManager in protected methods

* fix: remove disable eslint rule comment

* fix: retrieveVariants relations

* fix: retrieveVariants

* fix: FilterableProductProps validation

* fix: nullable thumbnail

* fix: tests by making model column types more explicit

* move upsert method to repo layer

* fix: unit tests

* fix: integration tests

* fix: product tags query + integration test

* fix: rename FindWithRelationsOptions to FindWithoutRelationsOptions

* fix (productRepository): use string[] for relations

* refactor: extract price relation filtering logic into util

* fix: failing unit test

* rename DTO suffix to Input suffix

* fix: missing awaits

* fix: check for images and tags length

* fix: remove unneeded function

* extract types used in product service to types folder

* fix: use text instead of varchar

* remove: reorderOptions from ProductService

* fix: product model

* fix: add private retrieve method

* fix: conflicts

* fix: failing unit test

* fix: integration test

* fix: remove ProductSelector type

* fix: remove validateId

* fix: use spread operator

* fix: repo method typings

* fix: remove comment
2022-06-20 10:50:46 +01:00
olivermrbl
c85ef984cc Merge branch 'master' into develop 2022-06-19 12:59:08 +02:00
Oliver Windall Juhl
6b23208d63 fix(medusa): Include adjustments when authorizing payment (#1697) 2022-06-19 12:58:47 +02:00
Adrien de Peretti
453688682c feat(medusa): Support batch-job API (#1547)
* feat(medusa): Implement confirm batch job end point

* feat(medusa): Implement confirm batch-job end point

* feat(medusa): Add create batch job end point and implementation

* feat(medusa): remove cancelled related

* feat(medusa): Remove unrelated content for batch job creation

* feat(medusa): Cleanup migration

* feat(medusa): Cleanup context

* fix(medusa): Batch-job service import

* feat(medusa): Update migration

* test(medusa): Fix batch job tests

* feat(medusa): Start batch job end point

* feat(medusa): Continue end points

* feat(medusa): Continue end points

* feat(medusa): Finalize batch-job end points

* style(medusa): Lint

* feat(medusa): Cleanup

* feat(medusa): Fix list-batch-job endpoint column selection

* feat(medusa): Batch-job feedback

* feat(medusa): Update create-batch-job endpoint doc

* test(integration-tests): Fix batch-job integration reguarding the response status code

* feat(medusa): Finalize rebase from develop

* feat(medusa): Extend batch job status with ready_at and failed_at

* feat(medusa): Update migration and tests accordingly

* feat(medusa): Update status order on batchJob

* feat(medusa): Enhance batchJobService status update

* style(medusa): Cleanup

* style(medusa): Typo

* style(medusa): Remove unnecessary comment

* cleanup(medusa): Address feedback

* test(integration-tests): Update naming and snapshots

* fix(medusa): Update validator

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

* Fix(medusa): update validator

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

* test(intergration-tests): Fix creates batch job

* test(integration-tests): Fix snapshot

* feat(medusa): Re-work status

* tests(integration-tests): Fix batch job

* feat(medusa): Addresses feedback

* fix(medusa): Revert package.json script

* feat(medusa/batch-job-api): Improve status management

* feat(medusa): Improve batch job status and remove some context validation from the service

* feat(medusa): BatchJob api merge params

* feat(medusa): Apply last changes on the batch job service

* Update packages/medusa/src/services/batch-job.ts

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

* feat(medusa): BatchJobStrategy and loaders (#1434)

* add batch job strategy interface

* update plugin loaders

* remove comment

* make map async

* ensure that only one of each strategy is registered

* register strategies plural

* add identifier and batchType properties

* extend batch job strategy identification method

* initial test

* update loaders to accomodate different ways of accessing batch job strategies

* identifier batch type field

* redo merge in plugins

* update interface and load only js files

* use switches instead of elif

* remove comments

* use static properties for strategy registration

* update tests

* fix unit tests

* update test names

* update isBatchJobStrategy method

* add check for TransactionBaseService in services for plugins

* update interfaces export

* update batchjob strategy interface with a prepare script

* update loaders

* update batchjob strategy interface

* remove everything but public interface methods from batchJobStrategy

* add default implementation to prepareBathJobForProcessing

* remove unused import

* docs: Add Services reference (#1548)

* added events reference

* add upgrade guide for 1.3.0

* Update 1-3-0.md

* merge 1.3.0 with 1.3.1

* rename to 1.3.0

* added paypal documentation

* Improve storefront quickstart documents

* chore(deps): bump sqlite3 from 5.0.2 to 5.0.3 (#1453)

Bumps [sqlite3](https://github.com/TryGhost/node-sqlite3) from 5.0.2 to 5.0.3.
- [Release notes](https://github.com/TryGhost/node-sqlite3/releases)
- [Changelog](https://github.com/TryGhost/node-sqlite3/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TryGhost/node-sqlite3/compare/v5.0.2...v5.0.3)

* fix: Issue with cache in CI pipeline

Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-16 13:57:18 +02:00
Sebastian Rindom
14366f536d fix: adds tax calculation to product pricing (#1354)
* fix: adds tax calculation to product pricing

* fix: dedupe

* fix: merge inconsistencies

* fix: merge inconsistencies
2022-06-14 10:11:18 +02:00
Adrien de Peretti
9a3ff32b42 refactor(medusa): Convert DraftOrderService to TS (#1259) 2022-06-13 20:29:23 +02:00
Zakaria El Asri
247ad6dc6d fix: includes variant prices when listing products using a search query (#1607)
* fix: return prices when lsiting products with a query

* add: integration test

* fix: integration test

* fix: move WithRequiredProperty to common.ts

* fix: comment
2022-06-05 21:52:31 +01:00
Philip Korsholm
3f23edea23 fix(medusa): Allow de-selecting configurations in price lists (#1596) 2022-05-30 19:34:34 +02:00
Kasper Fabricius Kristensen
083ab09361 fix(medusa): Prevent discount type updates (#1584) 2022-05-30 09:44:53 +02:00
Adrien de Peretti
fa031fd28b feat(medusa): Support deleting prices from a price list by product or variant (#1555) 2022-05-30 09:41:57 +02:00
Kasper Fabricius Kristensen
5414148254 fix(medusa): Post /admin/discounts/:id not updating condition operator (#1573) 2022-05-24 12:28:40 +02:00
Adrien de Peretti
4489b75f5a feat(medusa): List batch jobs + Introduce composable handler pattern (#1541) 2022-05-20 10:22:42 +02:00
Oliver Windall Juhl
f0ecef6b9a fix(medisa): Deleting price list should use remove (#1540) 2022-05-19 18:56:58 +02:00
Sebastian Rindom
f17e44d88a fix(medusa): join claim items on receive return (#1539) 2022-05-19 13:04:25 +02:00
Kasper Fabricius Kristensen
46d9e6c44c fix(medusa): add q param to listAndCount product types and product tags (#1531) 2022-05-18 11:31:02 +02:00
Kasper Fabricius Kristensen
5ae5f15e98 fix(medusa): RMA on items from swaps and claims (#1182) 2022-05-17 11:19:46 +02: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
Oliver Windall Juhl
9ca45ea492 feat(medusa): Add endpoints specific to DiscountConditions (#1355) 2022-05-13 12:42:23 +02:00
Philip Korsholm
a69b52e031 Feat: Filter price lists by customer group (#1431)
* add customer groups to price list factory

* add integration test for filtering price lists by customer group

* normalize list price list query

* add customer groups to list-price-list queryparameters

* query based on customergroups if they exist for price lists

* remove verbose flag

* add another price list with a customer group

* remove console.log

* pr feedback

* add query type to repository

* add query type to repository

* set groups to undefined instead of deleting parameter

* remove wildcard destructing

* make buildQuery type specific to price lists

* steal Adriens types

* fix(medusa): support searching for price lists (#1407)

* delete instead of settting groups to undefined

* add groups to query with q

* use simple customer group factory instead of manual creation

* Update simple-customer-group-factory.ts

* remove comma that breaks integration-tests

Co-authored-by: Zakaria El Asri <33696020+zakariaelas@users.noreply.github.com>
2022-05-12 04:22:46 +02:00
Adrien de Peretti
0b2a3a0f0e Merge pull request #1475 from medusajs/fix-cartServiceCreateLostShippingAddress 2022-05-11 22:02:24 +02:00
Frane Polić
03c5617896 fix(medusa): allow price list prices update when region_id is provided (#1472) 2022-05-11 07:43:19 +02:00
Adrien de Peretti
65186036b5 Merge branch 'develop' into fix-cartServiceCreateLostShippingAddress 2022-05-10 11:16:19 +02:00
adrien2p
9b5354502f test(medusa): Fix test pipelines 2022-05-10 11:09:52 +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
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
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
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
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
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
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
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
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
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
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
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
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
Frane Polić
a514d84ccf feat: list customer groups (#1099) 2022-03-02 11:38:44 +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