Commit Graph

757 Commits

Author SHA1 Message Date
Oli Juhl
81ea044f31 feat(medusa, core-flows): Create service zones (#6979) 2024-04-06 21:31:23 +02:00
Adrien de Peretti
bc06ad2db4 feat: Clean up shipping options management (#6977)
**What**
- cleanup existing route on some aspects but not all
- add new create shipping options end point and types
- add set of integration tests
- cleanup existing fulfillment routes
- align existing integration tests
- transform old type to zod types and validators
- fix stock location route
2024-04-06 16:52:05 +00:00
Frane Polić
58c68f6715 feat(dashboard): Admin UI regions v2 (#6943) 2024-04-06 17:41:54 +02:00
Carlos R. L. Rodrigues
df0751f122 Feat: draft order api (#6797) 2024-04-06 16:35:10 +02:00
Stevche Radevski
883a75c4f3 feat: Switch to zod for the product API and implement missing primitives (#6978) 2024-04-06 13:45:52 +00:00
Adrien de Peretti
65794f4bb5 feat: Create shipping options workflow (#6962)
**What**

- Create main workflow
- Update create pricing rule types step to be idempotent
- update remote joiner to support granular isList confguration on field aliases
- Add full workflow integration tests
2024-04-06 11:51:48 +00:00
Riqwan Thamir
5e30b8cce6 feat(dashboard): added details page for promotions + edit sliders (#6882)
* chore: added details page for promotions

* chore: add edit rules, edit details and edit campaign pages

* chore: change to type button

* chore: connection for rules

* chore: listing rule labels of multiple modules

* chore: add badge summary list

* chore: fix campaigns
2024-04-06 13:20:31 +02:00
Carlos R. L. Rodrigues
d333db0842 chore(orchestration): serialize error (#6967) 2024-04-06 11:22:48 +02:00
Oli Juhl
626aa09497 feat: Add create location fulfillment set flow + API (#6945) 2024-04-05 19:27:38 +02:00
Stevche Radevski
20e8df914e feat: Normalize known DB errors to a MedusaError when possible (#6922)
Before we would swallow the error and return a generic error to the user. This will provide more information to the caller if it is one of the known errors.
2024-04-04 19:12:59 +00:00
Adrien de Peretti
e944a627f0 feat: region payment providers management workflows/api (#6864) 2024-04-04 20:41:34 +02:00
Riqwan Thamir
483bf98a49 feat(medusa): added endpoints for rule attribute/operator/values options (#6911)
what:

adds endpoints that returns attribute options, operator options and value options for a particular rule.
2024-04-04 09:56:17 +00:00
Philip Korsholm
edafe7db47 Feat(link-module, core-flows, medusa): Add sales channel location management (#6905)
* add locations with sales channels

* init, not working location based management

* working adding sales channel stock locations

* remote sales channels from location

* remove console log

* rm allowedFields

* redo errorhandler

* make validation take an array

* add changeset

* fix build

* Update packages/core-flows/src/sales-channel/workflows/remove-locations-from-sales-channel.ts

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

* add default cases to return early

* cleanup

* add sc test and remove associations

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-04-03 08:38:53 +02:00
Adrien de Peretti
82a176e30e chore(medusa-test-utils):Handle errors gracefully (#6901)
**What**
- Better error handling and error message
- update deps management and dynamic import/require
- Pass a new flag to the modules loaders for the module loaders to be able to act depending on it. In that case, the module can determine what should be run or not. e.g in the workflow engine redis, when we are only partially loading the module, we do not want to set the Distributed transaction storage
2024-04-02 14:10:17 +00:00
Oli Juhl
7895ff3849 feat: add sales channel management (#6761)
Add V2 sales channel management to admin

`@medusajs/medusa`
- Add `POST /admin/sales-channels/:id/products/batch/remove`
- Refactor cross-module filter middleware to comply with the latest convention

`@medusajs/admin-next`
- Add all sales channel routes
- Moves the following sales channel UI to shared components in `modules/sales-channel`:
  - sales-channel-list
  - sales-channel-edit
  - sales-channel-details
    - sales-channel-general-section
  - sales-channel-create

The sales-channel-product-section is not shared because the API in V2 will change.
The sales-channel-add-products component is not shared because the API in V2 will change.

`@medusajs/core-flows`
- Add `detachProductsFromSalesChannelsStep`
- Add `removeProductsFromSalesChannelsWorkflow`
2024-04-02 13:38:33 +00:00
Stevche Radevski
b3ce13d61e fix: Fixes to product module and improving tests (#6898) 2024-04-02 07:13:46 +00:00
Stevche Radevski
585818eaf8 feat: Pricing update and refactor product API tests to not rely on internals (#6892)
This PR achieves the following
- Remove dependency on internals for seeding the tests (more work left, but major work done)
- Adds the workflow for updating variant's price

I will do a follow-up PR to further clean up the tests and remove all internal dependencies
2024-04-01 09:33:52 +00:00
Oli Juhl
1bcb13f892 feat: Remove sales channels from pub keys (#6876)
**What**
- Add workflow + step for detaching sales channels from pub API keys
- Tweak linking error message to be more helpful
- Add `removeRemoteLink` step to delete API key workflow
2024-03-29 15:01:10 +00:00
pepijn-vanvlaanderen
6113af0a66 fix(medusa): Deleted discount missing on order (#6837)
* Fix deleted discount missing on order

* Added integration test

* Added changeset
2024-03-29 11:51:27 +01:00
Carlos R. L. Rodrigues
1c6ba4468e feat(modules-sdk): remote query retrieve (#6849)
What:

Remote Joiner options to check if keys exist on entry points or relations
2024-03-29 09:26:24 +00:00
Stevche Radevski
cbb5e6bd99 feat: Refactor the product module definitions and implementation (#6866)
There are several things done in this PR, namely:

Unify the service endpoints API to always work with a model rather than allowing to pass both ID and model (eg. both type_id and type being available in the request to create).
Start using upsertWithReplace to simplify the code and fix some deassociation bugs
Apply some changes to tests to deal with the pricing breaking changes
Correctly define the model relationships (with both ID and entity fields available)
All tests for the product are passing, which should bring us back to a great baseline.
2024-03-29 09:03:41 +00:00
Philip Korsholm
18438a695a feat(medusa, stock-location-next): add list-stock-locations endpoint to api-v2 (#6788)
* initial create

* add list for stock locations

* add changeset

* redo changes for stock locatino module'

* add changeset

* naming

* prep for pr

* move integration tests

* fix pr feedback

* add changeset

* update changeset

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2024-03-28 17:33:26 +01:00
Oli Juhl
ea8d9d4d42 feat: API key sales channel link (#6851)
What
- Add link between API key and sales channels
- Add API route for batch adding sales channels to a publishable API key
- Clean up API key API routes responses
- Move API key test suite from `integration-tests/modules` to `integration-tests/api`
2024-03-28 10:15:11 +00:00
Riqwan Thamir
f176aa2b7b chore: remove noop tests (#6855) 2024-03-28 09:40:34 +01:00
Philip Korsholm
ff84f749d5 feat(medusa): add list location levels endpoint in api v2 (#6741) 2024-03-27 18:59:38 +01:00
Adrien de Peretti
d4d1f9b2f2 fix: integration tests modules expectations (#6848)
**What**
- fix tests
- cleanup deprecated jest conf
2024-03-27 15:39:20 +00:00
Adrien de Peretti
5d9aea053c fix(utils): Mikro orm prop filtering should check existence (#6842)
**What**
- Should return non decorated but visible properties.
- Should only prevent circular on non scalar fields
2024-03-27 14:31:26 +00:00
Philip Korsholm
4cf71af07d feat(core-flows, medusa): add update stock location endpoint to api-v2 (#6800)
* initial create

* add changeset

* redo changes for stock locatino module'

* initial update

* add changeset

* move integration tests

* update update method

* fix integration tests

* Update packages/stock-location-next/src/services/stock-location.ts

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

* update service

* initial fixes

* pr feedback

* update types

* expand revert clause for update

* update versioning

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-03-27 10:31:17 +01:00
Oli Juhl
0b23e7efb8 feat: Support invites in CLI for V2 (#6798)
**What**

- Add invite support to cli for 2.0
- Allow email to be passed upon accepting an invite
2024-03-26 20:02:56 +00:00
Oli Juhl
7bc7adeeb4 feat: Create user account (#6819) 2024-03-26 10:07:38 +01:00
Riqwan Thamir
509ddf9a56 feat(medusa): migrate medusa unit tests / plugins integration tests to swc jest (#6820)
what:

- migrates medusa package to swc/jest
- migrates plugins integration tests to swc/jest
- parallelises a few of the heavy test packages
- fixes typeorm circular dependencies

**Unit Tests**

Before: 1 job => ~30 mins
After: 2 jobs => ~5 mins


<img width="260" alt="Screenshot 2024-03-25 at 15 11 49" src="https://github.com/medusajs/medusa/assets/5105988/e1df6985-5bd6-48d0-b87b-336d3c77d0cf">

**Plugins**

Before: 1 job => ~10 mins
After: 1 job => ~5 mins

<img width="254" alt="Screenshot 2024-03-25 at 15 26 03" src="https://github.com/medusajs/medusa/assets/5105988/c1cec0e2-a1c3-41d1-9372-46d114d804c6">



Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-03-25 17:55:34 +00:00
Philip Korsholm
20132d7cea feat(medusa, core-flows): add retrieve stock location endpoint to api-v2 (#6791)
* initial create

* add changeset

* redo changes for stock locatino module'

* add get endpoint

* add changeset

* add exception if location is not found

* remove only

* initial delete stock location

* add changeset

* add changeset

* pr prep

* remote duplicate changeset

* propagate deletion with common step

* move integration tests

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2024-03-25 16:58:23 +01:00
Philip Korsholm
deab12e27e feat(types, medusa, core-flows): add delete-stock-location endpoint to api-v2 (#6801)
* initial create

* add changeset

* redo changes for stock locatino module'

* initial delete stock location

* add changeset

* pr prep

* propagate deletion with common step

* move integration tests

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2024-03-25 16:29:36 +01:00
Riqwan Thamir
9073d7aba3 feat(core-flows,medusa,types,utils): rename psma to prices (#6796)
What:

Renames pricesetmoneyamount to prices

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-03-25 13:15:25 +00:00
Philip Korsholm
68b9812aa1 feat(core-flows, medusa): add create stock location endpoint for api-v2 (#6787) 2024-03-25 12:53:09 +01:00
Oli Juhl
0deb2776ad feat: Add successRedirectUrl to auth options (#6792) 2024-03-25 08:55:21 +01:00
Philip Korsholm
aa154665de feat(core-flows, types, medusa): Add Update location level endpoint for api-v2 (#6743)
* initialize update-location-level

* update middlewares

* readd middleware

* pr feedback
2024-03-25 07:43:41 +01:00
Carlos R. L. Rodrigues
7e93eda1a4 feat(orchestration,workflows-sdk,core-flows): workflow cancel (#6778) 2024-03-22 15:03:06 +01:00
Oli Juhl
9e25e0c42e feat: List products middleware (#6769) 2024-03-22 14:59:21 +01:00
Riqwan Thamir
4c98545ab3 feat: shard modules and API integration tests (#6775)
what:

- runs module and api integration tests in matrix strategy
  - v28 of jest comes with sharding support, which we can utilize when we upgrade
- splits the tests by number of matrix jobs and run them in parallel
  - This introduced some flakiness in some specs, but couldn't reproduce locally. Those have been skipped for now.
- uses swc/jest for added performance
  - Locally, a chunk took 90 seconds with babel and 30 seconds with swc. 
  - This translated to 2 mins saved per shard in CI, but haven't tested this enough.
2024-03-22 11:15:01 +00:00
Riqwan Thamir
b792c4cab5 chore: merge money amounts and price set money amounts (#6768)
what: 

- merges price set money amounts and money amount
2024-03-21 16:10:13 +00:00
Riqwan Thamir
cf8b5ce85b chore: pricing models uses standardized relationships attributes (#6767)
what:

- all relationships under all models are standardized
2024-03-21 10:01:52 +00:00
Carlos R. L. Rodrigues
60070fb65f fix(link-modules): recreate dismissed link (#6764)
* fix(link-modules): recreate dismissed link

* rm type

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-03-20 19:12:48 +01:00
Riqwan Thamir
20243e22ee feat(pricing): pricing models are made soft deletable (#6732)
what:

- pricing models are made soft deletable
- adds missing timestamp attributes
- removes unwanted relationships + cascade cleanup
2024-03-20 16:03:17 +00:00
Stevche Radevski
70859397c0 feat: Align the product module HTTP API to follow our conventions (#6759) 2024-03-20 16:18:13 +01:00
Philip Korsholm
64c2731e46 feat(medusa, core-flows): add ppdate inventory item endpoint (#6735)
* init update inventory item

* prep for pr
2024-03-20 14:45:06 +01:00
Oli Juhl
8155e2cfad feat: Init. v2 implementation in admin (#6715) 2024-03-20 14:28:28 +01:00
Stevche Radevski
db9c460490 feat: Add product and pricing link on create and delete operations (#6740)
Things that remain to be done:
1. Handle product and variant updates
2. Add tests for the workflows independently
3. Align the endpoints to the new code conventions we defined
4. Finish up the update/upsert endpoints for variants

All of those can be done in a separate PR, as this is quite large already.
2024-03-19 17:14:02 +00:00
Oli Juhl
3062605bce feat: Add products to sales channel (#6725)
Depends on #6722
2024-03-19 10:24:37 +00:00
Philip Korsholm
62d5803b20 Feat(core-flows, medusa): delete inventory item (#6708)
* initial get-inventory-item

* add exception throw test

* remove console log

* add changeset

* remove inventory item

* add changeset

* fix pr feedback

* use links

* use modules instead of property names
2024-03-19 10:40:18 +01:00