Commit Graph
197 Commits
Author SHA1 Message Date
PatrickandGitHub cb1ec0076b chore(oas): replace response with $ref class JSDoc (Store PRO-V) (#3044)
### Scope

Store routes directories PRO to V.

### What

Move inline OAS response schema declaration under their respective class declarations in order to expose them through  `#/components/schemas`. Replace inline OAS response schema with a `$ref` reference pointing to the newly declared schema.

### Why

Having response declared as its own "named" schema will allow OAS code generators to output typed entities/DTO that can be consumed without having to reference the route/operation.

### How

Declare a new @schema JSDoc for each "Res" class used to parse and validate request body. Move the current inline requestBody to the new @schema.

### Test

- Ran OAS validator.
- Ran docs build script.

Expect no visible changes to the documentation.
2023-01-17 14:22:10 +00:00
Carlos R. L. RodriguesandGitHub 0175388835 feat(medusa): Transaction Orchestrator (#2861)
* chore: transaction orchestrator
2023-01-16 20:16:41 -03:00
Riqwan ThamirandGitHub 7d4b8b9cc5 feat(medusa): List (service + controller) product categories #3004 (#3023)
**What:**

Introduces a store endpoint to retrieve a list of product categories

**Why:**

This is part of a greater goal of allowing products to be added to multiple categories.

**How:**

- Creates an endpoint in store routes

RESOLVES CORE-968
2023-01-16 19:20:42 +00:00
PatrickandGitHub 1ec1a78dfa Merge branch 'develop' into chore/oas-res-schema-AtoPAY 2023-01-16 11:59:19 -05:00
Patrick 542daeeadd chore: changeset 2023-01-16 11:59:05 -05:00
a0c4cfe0f7 chore(oas): replace response with $ref class JSDoc (Admin PR0-SAL) (#3030)
### Scope

Admin routes directories PRO to SAL.

### What

Move inline OAS response schema declaration under their respective class declarations in order to expose them through  `#/components/schemas`. Replace inline OAS response schema with a `$ref` reference pointing to the newly declared schema.

### Why

Having response declared as its own "named" schema will allow OAS code generators to output typed entities/DTO that can be consumed without having to reference the route/operation.

### How

Declare a new @schema JSDoc for each "Res" class used to parse and validate request body. Move the current inline requestBody to the new @schema.

### Test

- Ran OAS validator.
- Ran docs build script.

Expect no visible changes to the documentation.

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-01-16 16:00:05 +00:00
Adrien de PerettiandGitHub 8c08d00319 fix(medusa): Legacy total service to accept custom items (#3027) 2023-01-16 09:57:01 +01:00
27a29ef24e chore(oas): replace response with $ref class JSDoc (Admin SHI-V) (#3031)
### Scope

Admin routes directories SHI to V.

### What

Move inline OAS response schema declaration under their respective class declarations in order to expose them through  `#/components/schemas`. Replace inline OAS response schema with a `$ref` reference pointing to the newly declared schema.

### Why

Having response declared as its own "named" schema will allow OAS code generators to output typed entities/DTO that can be consumed without having to reference the route/operation.

### How

Declare a new @schema JSDoc for each "Res" class used to parse and validate request body. Move the current inline requestBody to the new @schema.

### Test

- Ran OAS validator.
- Ran docs build script.

Expect no visible changes to the documentation.

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-01-15 19:04:26 +00:00
Oliver Windall JuhlandGitHub 1547dd8143 fix(medusa): Add module config to transaction base service (#3033) 2023-01-15 19:37:11 +01:00
Adrien de PerettiandGitHub 93d0dc1bdc fix(medusa): test, build and watch scripts (#3025) 2023-01-15 17:10:26 +01:00
Adrien de PerettiandGitHub 142c8aa70f fix(medusa, medusa-payment-paypal): Add missing data in Payment Collection input (#3010) 2023-01-13 16:26:39 +01:00
Carlos R. L. RodriguesandGitHub 9dbccd9ca7 feat(medusa, stock-location, inventory): Allow modules to integrate with core (#2997)
* feat: module shared resources
2023-01-13 10:39:43 -03:00
Adrien de PerettiandGitHub b3e4be7208 fix(medusa): Draft order totals not working with custom items (#3008) 2023-01-13 13:52:09 +01:00
Oliver Windall JuhlandGitHub 9e3beaf531 chore(feature-flags): Remove OrderEditing feature flag (#3006) 2023-01-13 11:10:09 +00:00
Oliver Windall JuhlandGitHub d2c692aa96 fix(medusa): Add default sales channel to product in seeding (#3013) 2023-01-13 10:01:30 +01:00
Riqwan ThamirandGitHub b2839e2e4d feat(medusa): Retrieve (service + controller) a product category (#3004)
What:

Introduces a store endpoint to retrieve a product category

Why:

This is part of a greater goal of allowing products to be added to multiple categories.

How:

- Creates an endpoint in store routes

RESOLVES CORE-967
2023-01-12 16:19:06 +00:00
Oliver Windall JuhlandGitHub b80124d32d feat(medusa): Allow custom created_by on order edits (#3007) 2023-01-12 15:47:18 +01:00
Riqwan ThamirandGitHub aef8421235 feat(medusa): Emit events on product category mutations (#3003)
* chore: added events on product category mutation

* chore: remove duplicates + refactor test
2023-01-12 09:32:03 +01:00
Philip KorsholmandGitHub 1dc79590b3 fix(medusa): Rename quantity to required quantity (#2963) 2023-01-11 19:21:05 +01:00
Kasper Fabricius KristensenandGitHub 8d1275c942 feat(medusa-react): Upgrade react-query and clean up dependencies (#2969) 2023-01-11 19:19:34 +01:00
Riqwan ThamirandGitHub aab163babb feat(medusa): Nested Categories Admin Update Endpoint (#2986)
What:

Introduces an admin endpoint that allows a user to update a product category

Why:

This is part of a greater goal of allowing products to be added to multiple categories.

How:

- Creates a route on the admin scope to update category
- Creates a method in product category services to update a category

RESOLVES CORE-956
2023-01-11 16:21:53 +00:00
olivermrbl a8bde8ba74 chore(release): Publish 2023-01-11 16:27:54 +01:00
olivermrbl 9cf971c6bd chore: Add missing changeset for PayPal plugin 2023-01-11 16:24:41 +01:00
Riqwan ThamirandGitHub 8ed4eab73a feat(medusa): added admin create endpoint for nested categories (#2985)
What:

Introduces an admin endpoint that allows a user to create a product category

Why:

This is part of a greater goal of allowing products to be added to multiple categories.

How:

- Creates a route on the admin scope to create category
- Creates a method in product category services to create a category

RESOLVES CORE-958
2023-01-11 13:29:02 +00:00
olivermrbl 8e80e50638 chore: Update changesets 2023-01-10 19:26:34 +01:00
Adrien de PerettiandGitHub a2df11fc10 fix(medusa-payment-manual): Correct wrongly used input data (#2979) 2023-01-10 18:23:24 +01:00
Oliver Windall JuhlandGitHub 3308766389 chore(feature-flags): Sales Channels enabled by default (#2966) 2023-01-10 16:45:23 +00:00
Adrien de PerettiandGitHub cac81749ea feat(medusa): Update payment session management (#2937) 2023-01-10 16:33:24 +01:00
Riqwan ThamirandGitHub 71fa60892c feat(medusa): Nested Categories Admin Delete Endpoint (#2975)
**What:**

Introduces an admin endpoint that allows a user to delete a product category, given an ID.

Why:

This is part of a greater goal of allowing products to be added to multiple categories.

How:

- Creates a route on the admin scope to delete category
- Creates a method in product category services to delete a category

RESOLVES CORE-957
2023-01-10 14:28:46 +00:00
Kasper Fabricius KristensenandGitHub f6c81dab9e feat(medusa-js): Bundle package using Rollup (#2964) 2023-01-10 14:44:25 +01:00
Riqwan ThamirandGitHub f3ced106ad feat(medusa): Nested Categories Admin List Endpoint (#2973)
* chore: added get route for admin categories API

* chore: add tree method to mock repository

* chore: added changeset to the PR

* chore: rename id to productCategoryId in service

* chore: switch cli option to string

* chore: lint fixes, tests for parent category

* chore: move Nested Categories behind feature flag

* chore: use transformQuery hook in api

* chore: add feature flag in migrations

* chore: remove migration FF, fix FF name

* chore: add free text search + count repo function

* chore: added list endpoint for admin

* chore: added changeset for feature

* chore: address pr review comments

* chore: change oas comment

* chore: add nullable parent category filter + test
2023-01-10 12:52:31 +01:00
Adrien de PerettiandGitHub 4a50786fbc feat(medusa): Introduce Payment Processor API (#2737) 2023-01-10 12:15:42 +01:00
1817b810fc fix(medusa): Cancel order missing refunds relation (#2976)
**What**

The order cancelation does not include the refunds relation. It means that the check of the length of the refund is never true and therefore no errors are thrown if the order contains the refunds.

**How**

Add the refunds relation and tests

FIXES CORE-976

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-01-10 09:38:59 +00:00
Riqwan ThamirandGitHub 47d075351f feat(medusa): Get route for admin product categories API (#2961) 2023-01-10 10:08:16 +01:00
Oliver Windall JuhlandGitHub 33b3e5f16d chore(feature-flags): Publishable Keys enabled by default (#2967) 2023-01-10 08:59:57 +01:00
Philip KorsholmandGitHub 16716f5a4f feat(medusa): Create fulfillment with location (#2931)
* remove duplicate key from oas

* changeset

* initial suggestion for adding locations to fulfillments

* update migration

* re-add functionality for removing entire reservations

* fix tests

* add location when adjusting reserved inventory of a line_item

* add changest

* handle multiple reservations for a product in the same channel

* confirm inventory in stock location previous to creating the fulfillment

* fix tests after updating create-fulfillment to confirm inventory prior to creating fulfillment

* remove bugged code

* initial validation

* initial changes for review

* chekcpoint

* update validate inventory at location

* redo some unwanted changes

* typing

* update snapshots

* redo change for eslintrc

* add eslint disable

* re-order methods in interface

* assert no_notification

* iterate one time less

* add test for validation of correct inventory adjustments in case of no inventory service installation

* ensure correct adjustments for order cancellations

* remove comment

* fix tests

* fix but with coalescing

* remove location id from confirm inventory

* don't throw when adjusting reservations for a line item without reservations

* move reservation adjustments to the api

* add multiplication for updating a reservation quantity

* move inventory adjustments from the service layer to the api

* delete reservation if quantity is adjusted to 0

* rename updateReservation to updateReservationItem

* update dto fields

* reference the correct fields

* update with transaction

* add jsdocs

* force boolean cast

* context-ize cancel and create fulfillment transaction methods

* undo notification cast

* update with changes

* refactor withTransaction to variable

* use maps

* fix service mocks
2023-01-09 14:44:34 +01:00
Adrien de PerettiandGitHub 28bec599ae fix(medusa): Repository util mention of entity specifics (#2965) 2023-01-09 14:18:55 +01:00
Oliver Windall JuhlandGitHub 32b038fc3f feat(medusa): Reliable retrying of jobs (#2947) 2023-01-09 11:56:29 +01:00
Adrien de PerettiandGitHub e4af968531 fix(medusa): Custom repository take/skip when called without relations (#2962)
**What**
The actual behavior is that the skip/take is applied in a first query returning the correct number of results. When there is no relations, we are calling findByIds with the previously retrieved ids, but we also pass skip/take which means that no result are returned after the first increment of the skip.

The skip/take should not be applied in that case as it has already been applied.

FIXES CORE-970
2023-01-09 09:54:25 +00:00
Riqwan ThamirandGitHub b280e53bd3 refactor(medusa): move repository specs into its own folder (#2952)
**What:**

Introduces a new folder under which repository specs will be placed. 

Why:

We don't currently have a good place to test ORM logic or custom queries against the database. The repository folder tests are a place for just exactly that. 

How:

Creates an internal package similar to other integration tests - api and plugins. 

CORE-965
2023-01-09 08:19:01 +00:00
Adrien de PerettiandGitHub baeacd1cc5 feat(medusa): Disable subscriber when no search engine is installed (#2958) 2023-01-07 15:58:06 +01:00
Oliver Windall JuhlandGitHub 8ba0addea3 chore(integration-tests): Add test for database options (#2707)
**What**
- Add integration test suite for database options
- Expose integration tests DB to additional options
- Add test for `idle_in_transaction_session_timeout`
2023-01-06 13:41:05 +00:00
Philip KorsholmandGitHub 077e4d9606 remove duplicate key from oas (#2953)
**What**
- remove duplicate oas key

**Why**
- oas generation fails when duplicate keys are present
2023-01-06 09:46:23 +00:00
Riqwan ThamirandGitHub 3f44abe01a feat(medusa): Add ProductCategory model (#2945) 2023-01-05 19:10:46 +01:00
Adrien de PerettiandGitHub 3d200c41f9 chore: refactor payment collection setPaymentSession (#2928)
**What**

Only use `setPaymentSessionsBatch` in `setPaymentSession` to reuse the logic as it is the same behavior. One for a unique session and the other one for multiple sessions.
This refactoring reduce the risk of introducing bugs when working around payment session if it needs to be changed (which is currently happening as part of the payment refactoring) and having to change it in less places instead of more and more places
2023-01-05 15:22:12 +00:00
Carlos R. L. RodriguesandGitHub c07ffb6165 feat(medusa): Stock location module (#2907)
* feat: stock location module
2023-01-04 13:11:59 -03:00
Alex ChiuandGitHub cc10c20f35 feat(medusa): Include external_id in CreateProductInput type (#2498) 2023-01-02 10:18:10 +01:00
Philip KorsholmandGitHub b9680b641f feat(medusa): Add ProductVariantInventoryService (#2883)
* add mw feature flag

* add services

* add types

* add module interfaces

* add interface export

* add models for mw

* to be ammended

* remove featureflag

* use correct count

* update cart completion strategy

* swap service conversion

* update return service

* update order service

* update claim service

* add exception to claim item

* update cart service

* add indicies

* add changeset

* nullable changes in store

* store model update

* fix unit tests

* remove old inventory service

* format integration test

* update snapshots

* remove old inventory service tests

* update snapshots

* remove old code

* option updates

* naming

* add jsdoc to pv inventory service

* rename class variables

* pr feedback

* rename option to context

* if(variant_id) instead of if(typeof varia...)

* update tests

* add jsdoc

* go for custom

* update code for readability
2022-12-30 11:30:04 +01:00
Oliver Windall JuhlandGitHub eda26f6e81 fix(medusa): Add tax inclusive flag to return lines from line item (#2909) 2022-12-29 19:32:04 +01:00
Philip KorsholmandGitHub 645e0d0ec5 Feat(medusa): search orders by customer phone and name (#2913)
* add support for customer first- and last names and phone

* test for querying customer first_name, last_name and phone

* add customer as prop for querying orders

* polishing before pr

* changeset
2022-12-29 15:20:18 +01:00