* feat(medusa): Cleanup swap creation flow
* revert test and package
* fix unit tests
* fix swap seeder that does not include the tax lines on the return line item
---------
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
**What**
Move to transformQuery which adds a default ordering and also allows to order the product list from the store API
**How**
Among other things, fix the product repo to allow ordering by either a key from the product or a key from a relation
FIXES CORE-911
FIXES CORE-901
**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.
* init: copy PI files
* feat: add subscribers, refactor strategies folder
* wip: strategies integration tests package
* fix: rename
* wip: use redis
* wip: use redis deps, redis setup in local tests
* fix: naming collision, medusa config
* fix: typing, update apply changes for new event ordering and reimplement interface
* feat: make redis container run in integration tests
* fix: missing yarn lock
* feat: redis setup v2
* fix: setup server imports
* fix: a lot of integration issues
* fix: a lot of integration issues v2, transform tags, fix `ops` object parsing
* wip: parsing product options
* feat: ✨creating product and variants works, processing product/variant options, update schema
* fix: query keys, logic for finding existing variant
* fix: types
* feat: update product variant's options
* feat: parse MA records
* feat: creating/updating MA records, region detection, error handling
* feat: throw an error when creating an MA for nonexistent region
* refactor: remove unused methods
* refactor: use provided ids to track records, extract a couple of methods
* refactor: remove unused method
* refactor/wip: add initial comment for main methods
* refactor: replace usage of RedisJSON functionality with basic k/v api
* feat: async progress report
* types: define more precise types, cleanup
* feat: error handling
* feat: unit testing preprocessing
* feat: integration testing for CI, fix legacy bug where user is unable to create a variant if regional price is also sent as payload, add csv for integration tests
* fix: error throw for logs
* feat: add product endpoint snap
* refactor: remove log
* feat: add snaps, rebase
* refactor: add comments
* feat: snap update
* refactor: typo
* refactor: change error handler
* feat: Redis cleanup after the job is done
* testing :fix product unit test, remove integration snap, add inline object matcher
* testing: fix obsolete snaps
* refactor: update comments
* fix: rebase issue
* fix: rebase issue v2, remove log form an integration test
* fix: try reverting setup server
* fix: insert variants test
* refactor: don't pass tx manager, refactor methods
* refactor: don't use regionRepo, add `retrieveByName` to region repo
* refactor: don't use productRepo
* refactor: don't use `productVariantRepo`
* refactor: remove repo mocks from unit tests
* fix: product import unit tests
* feat: file cleanup on finalize, kill test logs
* wip: use files to persist ops instead of redis, move strategy class into `batch-job` folder
* fix: minio delete method, add file cleanup method to import, fix promise coordination
* fix: replace redis methods
* feat: store import ops as a file instead of Redis
* feat: test cleanup
* fix: change unit tests after Redis logic removal
* feat: use `results` for progress reporting, add `stat_descriptors` info after preprocessing, remove redis mentions
* feat: extract to other files, use directory from property, fix strategy loader to allow other files in `strategies` directory
* feat: fix instance progress counter
* fix: mock services types
* fix: update snaps
* fix: error handling stream, fix test file service name generation
* fix: remove dir with tmp files after testing
* fix: new yarn.lock after rebase
* fix: remove log, change object shape
* fix: add DI types
* refactor: remove container as a csv parser dep
* fix: remove seeder, change typings
* refactor: reimplement `retrieveByName` in the region service
* fix: unit tests typings
* fix: remove ts-ignore, complete typings for csv parser validators
* fix: don't keep track of progress since it is redundant and only keep track of `advancement_count`
* fix: return of the batch job seeder
* fix: update find region by name method
* fix: update types for service typings
* fix: update redis type usage
* fix: update unit tests file
* fix: unit tests
* fix: remove redis from integration test
* feat: refactor region retrieval by name
* feat: refactor product option update
* fix: remove repo import
* fix: return redis in test
* fix: handle stream error
* fix: tmp data cleanup
Co-authored-by: fPolic <frane@medusajs.com>
* 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
* 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>
* update customer service prep
* expand on the update customer groups test case
* add the test case for customer group update
* docs for `groups` prop on update customer endpoint
* refactor, update comments
* expend on integration tests, add customer mock with a group
* refactor to use `customerGroupService.list` method
* update units
* remove `updateCustomerGroups`
* fix rebase conflict
* fix customer seed data, add JoinTable on groups
* group retrieval using the expand param
* fix: use `buildQuery_`
* fix: validation for `groups`, enable `expand`param on update customer endpoint
* fix: remove fileds form the `FilterableCustomerGroupProps`
* fix: spearate body/query validation
Co-authored-by: fPolic <frane@medusajs.com>
* 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
* duplicate error handling
* ducplicate name integration test
* add jsdoc
* customergroup not customer
* pr feedback
* pipeline test
* fix weird merge
Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
* api routes for user management
* add invites and roles to db
* services
* invite repo
* include user in accepting invitation
* include user role in create user
* api password reset
* delete invite
* include email in reset password token
* added metadata as dbawarecolumn
* added events for invite handling and delete functionality
* added invite model to exports
* add default value member and allow null roles
* conditional inclusion of invites in "list-users"
* integration tests for users
* helpers for user testing
* add unauthenticated routes to users
* simplifying create invite
* create users with first and last name, and dev role
* reset password endpoint
* removed token from response
* update user with firstname, lastname and role
* create invite refactor
* test password reset without email in body
* removed redundant router variable
* cleanup
* unit tests
* adjustments
* service tests
* adjustments according to api changes
* fix cart test
* cloned now works
* change name to verified token for the verified token
* add a space
* db aware columns
* fix: timestampz dbaware
* more testing
* add list-invites endpoint
* reset-password error handling
* pr issues adjusted
* fixed test
* add optional to link templates
* move invites to a new endpoint
* migrate invites to own testsuite
* adjust snapshots
* email constraint for invite
* fix integration tests
* addressing pr feedback
* unit tests for extended user api
* linting
* fix integration tests
* fix unit tests
* fix: Addresses breaking change from class-transformer
* fix orders testing
* merge "create-claim" js and ts files
* add out commented tests
* update typescript endpoints to reflect changes made for user management
* converted invites to typescript
* add exports from api endpoints
* remove old js files used for reference
* integration test
* import reflect metadata
* invite service conversion to ts
* removed unused import
* update invite service to match styleguide
* add "expires_at" and "token" to invite table
* update invite service to save tokens and validate expires_at
* fix failing tests
* fix tests after adding token and expires_at to invite
* add expiration to create
Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
Co-authored-by: olivermrbl <oliver@mrbltech.com>