Commit Graph
64 Commits
Author SHA1 Message Date
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
Philip KorsholmandSebastian Rindom 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
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
Philip KorsholmandSebastian Rindom 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
Philip KorsholmandSebastian Rindom 4d1c8e1ec5 Feat: bulk delete customers from customer group (#1097)
* integration testing

* customer seeder

* initial bulk removal

* integraiton testing of deletes

* delete fix

* not found test

* remove unused code

* Apply suggestions from code review

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

* update integration tests

* pr review fixes

* update migration

* formatting

* integration tests for deletion

* pr feedback

* fix failing integration tests

* remove integration tests before merging

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2022-02-25 18:53:49 +01:00
Philip Korsholm 44fb9531d2 Feat: Delete customer group (#1102) 2022-02-25 18:53:49 +01:00
Philip KorsholmandSebastian Rindom 3b878bc5dd Feat: Create customer group (#1074)
* 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>
2022-02-25 18:53:49 +01:00
Philip Korsholm cd842138ba add pagination and date filtering to regions (#976) 2022-02-25 18:53:49 +01:00
Philip KorsholmandSebastian Rindom 0394be36ef Feat: bulk delete customers from customer group (#1097)
* integration testing

* customer seeder

* initial bulk removal

* integraiton testing of deletes

* delete fix

* not found test

* remove unused code

* Apply suggestions from code review

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

* update integration tests

* pr review fixes

* update migration

* formatting

* integration tests for deletion

* pr feedback

* fix failing integration tests

* remove integration tests before merging

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2022-02-25 15:29:13 +01:00
Philip Korsholm e35a4fb2ea Feat: Delete customer group (#1102) 2022-02-24 14:20:58 +01:00
Philip KorsholmandSebastian Rindom b16976a6f4 Feat: Create customer group (#1074)
* 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>
2022-02-18 09:58:54 +01:00
Philip Korsholm 8141e12a3d add pagination and date filtering to regions (#976) 2022-02-10 09:15:07 +01:00
Philip Korsholm 24175025d1 Fix: admin list products expand integration test (#974) 2022-02-02 08:35:16 +01:00
Philip Korsholm 7fcdac51ea Feat: object notation in queryparams (#1002)
* add object notation for queryparams

* test rule.type query params in list-discount

* pr feedback
2022-02-01 17:31:12 +01:00
Philip Korsholm f4f9653efc Feat: admin collections filtering (#977)
* collections filtering

* filtering collection tests

* oas for list collections
2022-02-01 17:24:47 +01:00
Philip Korsholm f61eaeec12 feat: expand store product filtering (#973) 2022-01-11 16:06:16 +01:00
Philip Korsholm 5754534beb Feat: Client admin uploads (#952)
* convert uploads to ts

* add custom headers to request

* uploads resource

* uploads routes updates

* index export

* add oas

* remove delete uploads endpoint

* add new package for form-data

* remove exports for delete upload endpoint

* remove dev package from medusa-js

* automatic package upgrade of medusa
2022-01-04 16:18:17 +01:00
Philip Korsholm f405e9c874 notifications client (#949) 2021-12-20 14:09:12 +01:00
Philip KorsholmandOliver Windall Juhl e0be2da15e Feat: Client admin products (#930)
* add exports in product

* add product resource

* fix failling tests

* import reflect metadata

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2021-12-17 12:30:04 +01:00
Philip KorsholmandSebastian Rindom 59e268b919 Feat: Add users endpoint to medusajs (#925)
* add users endpoint to medusajs

* add exports to medusa

* use native omit

Co-authored-by: Sebastian Rindom <seb@medusajs.com>
2021-12-16 16:22:40 +01:00
Philip KorsholmandSebastian Rindom 01b915585b Feat/client admin orders (#932)
* add export to medusa index

* add orders to medusa-client

* correct update entity

* add orders to admin resource

Co-authored-by: Sebastian Rindom <seb@medusajs.com>
2021-12-16 14:43:16 +01:00
Philip Korsholm 3da46723a0 Feat: add variants to medusa client (#927) 2021-12-16 14:28:54 +01:00
Philip Korsholm f5d3e4de10 swaps in admin resources (#928) 2021-12-15 16:57:39 +01:00
Philip Korsholm b70df6be94 Feat: client admin shipping profiles (#929)
* shipping profiles resource

* spelling
2021-12-15 14:21:43 +01:00
Philip Korsholmandolivermrbl 40f6e88875 Feat/medusa js admin collections (#916)
* feat: Add Auth Admin routes to JS client

* include api key verification for admin

* add admin/collections to medusa-js

* undo file changes

* jsdoc

Co-authored-by: olivermrbl <oliver@mrbltech.com>
2021-12-14 17:33:55 +01:00
Philip Korsholmandolivermrbl fee4e46ea7 Feat/client authentication api key (#915)
* feat: Add Auth Admin routes to JS client

* include api key verification for admin

* undo changes

* undo file changes

* improve api key auth

* auth documentation in readme

* pr feedback

* typo

Co-authored-by: olivermrbl <oliver@mrbltech.com>
2021-12-14 16:55:20 +01:00
d1b8f4b50b Feat: Extend user api (#460)
* 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>
2021-12-08 10:15:22 +01:00
Philip Korsholm 80089d04d8 Fix: get fulfillment options (#852) 2021-12-03 13:19:25 +01:00
Philip Korsholm f162b4a2a1 Feat/api reference curl examples (#720)
* curl reference initial

* add tooltips to curl command

* refactor copy component

* move copy to copy component

* formatting

* always include required fields

* add example values

* format svg

* fix property extraction

* explainer comment
2021-11-19 10:18:16 +01:00
Philip Korsholm 0bffa673b0 babel preset with typescript (#771) 2021-11-11 13:26:19 +01:00
Philip Korsholm 649d8d34aa Feat:cancel previous actions on push (#707) 2021-11-03 13:16:12 +01:00
Philip Korsholm 075864f24c fix mocks (#713) 2021-11-03 13:14:47 +01:00
Philip KorsholmandSebastian Rindom 68c2a4fe3a Fix/polish discount (#569)
* formatting and optional "is_dynamic" on updates

* formatting

* uppercasing discount code on update

* multiple regions fail with fixed discounts

* discount testing

* testing

* spelling

* removed comment

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2021-10-26 13:20:38 +02:00
Philip Korsholm 6b83653bf6 Fix/cascading product variant deletion (#570)
* testing for deletes of variants when a product is deleted

* remove variants with products

* test using direct db query

* formatting

* removed unused imports
2021-10-22 09:20:59 +02:00
Philip Korsholm 9d175ca332 Update assert-changed-files.sh 2021-10-21 21:13:32 +02:00
Philip Korsholm 20e5533bcd Update product.js 2021-10-21 21:12:48 +02:00
Philip Korsholm fbf94b8824 Update action.yml 2021-10-21 21:04:17 +02:00
Philip Korsholm cf6d63c41a Update action.yml 2021-10-21 20:58:39 +02:00
Philip Korsholm ac55bcd9fd Update product.js 2021-10-21 20:49:18 +02:00
Philip Korsholm b657ff9bfa Update product.js 2021-10-21 20:36:24 +02:00
Philip Korsholm 85612006eb Update product.js 2021-10-21 20:25:52 +02:00
Philip Korsholm d27649752b Update action.yml 2021-10-21 20:17:14 +02:00
Philip Korsholm da20f4907f Update product.js 2021-10-21 18:10:14 +02:00
Philip Korsholm ac5b747490 Update product.js 2021-10-21 18:01:59 +02:00
Philip Korsholm 1bd13a6dd7 update cache number 2021-10-21 17:43:17 +02:00
Philip Korsholm ac6d9c6ec2 Update assert-changed-files-actions.sh 2021-10-21 17:39:20 +02:00
Philip Korsholm eb797677e9 Update action.yml 2021-10-21 17:31:43 +02:00
1b0dd60a33 Feat/new actions (#586)
* test

* test

* create integration testing workflow

* Create unit-testing.yml

* Rename integration-testing to integration-testing.yml

* initial testing

* Update assert-changed-files.sh

* Update integration-testing.yml

* Update unit-testing.yml

* Update assert-changed-files.sh

* Delete integration-testing.yml

* Update assert-changed-files.sh

* Update assert-changed-files.sh

* Update assert-changed-files.sh

* Update order.js

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Create cache-bootstrap.yml

* Update cache-bootstrap.yml

* Update cache-bootstrap.yml

* Update cache-bootstrap.yml

* Update unit-testing.yml

* extracted action

* corrected ext. name for int. tests

* checked out actions

* added fetching of actions

* updated

* updated

* moved package

* updated

* Update action.yml

* Update action.yml

* ended if statement

* updated

* updated

* removed error

* updated cache version

* update

* updated to more strict cache policy

* update

* updated

* updated

* update

* update

* update

* update

* update

* update

* update

* update

* updated to also include on PR

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* removed current branch from diff

* updated comment

* Update action.yml

* Update action.yml

* Update action.yml

* save before merge

* Update action.yml

* Update product.js

* Update product.js

* Update action.yml

* Update action.yml

* Update action.yml

* Update action.yml

* Update assert-changed-files-actions.sh

* Update assert-changed-files-actions.sh

* Update product-variant.js

* Update product.js

* Update product.js

* cleanup

Co-authored-by: Sebastian Mateos Nicolajsen <80953876+sebastiannicolajsen@users.noreply.github.com>
Co-authored-by: Sebastian M. Nicolajsen <sebastian.m.nicolajsen@gmail.com>
2021-10-21 17:15:29 +02:00
Philip Korsholm 6a02090287 Update action.yml 2021-10-21 14:53:21 +02:00
Philip Korsholm 0a11cf51d3 Update action.yml 2021-10-21 14:50:15 +02:00
Philip Korsholm 816b45baf7 Update action.yml 2021-10-21 14:24:04 +02:00
Philip Korsholm 5fa3892e4f Update action.yml 2021-10-21 14:19:31 +02:00
Philip Korsholm 2126a5e5d2 Update action.yml 2021-10-21 14:16:25 +02:00
Philip Korsholm ac21142ba7 Update action.yml 2021-10-21 14:12:24 +02:00
Philip Korsholm 40d7cb2109 Update action.yml 2021-10-21 14:11:54 +02:00
Philip Korsholm e8f9884abe Update action.yml 2021-10-21 09:20:15 +02:00
Philip Korsholm 117d90193a Update action.yml 2021-10-21 09:20:04 +02:00
Philip KorsholmandSebastian Rindom ba2de6906a Feat:contentful plugin archive on delete
* extend plugin with methods for archival in contentful

* add events to services

* rename entities

* eventbusservice to delete

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

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

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

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

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

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

* testing

* adjust options

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

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

* adjust options

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

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

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

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

Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
2021-10-14 17:00:27 +02:00
pKorsholm 5ef2a3fbcb feat: Product filtering (#439) 2021-10-13 16:01:59 +02:00
pKorsholmandSebastian Rindom 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
pKorsholmandPhilip Korsholm 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
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
pKorsholm 3992fc15a0 Merge pull request #367 from medusajs/docs/remove-spelling-errors
Docs: fix spelling errors in "2-adding custom functionality"
2021-09-06 13:31:50 +02:00