Commit Graph
81 Commits
Author SHA1 Message Date
Stevche Radevski 0f60d1fe96 feat: Add order endpoints for store (#7266) 2024-05-07 19:34:44 +02:00
Stevche Radevski 4e12168dbd feat: Consolidate payment functions and handle sessions for storefront (#7231) 2024-05-06 13:14:40 +00:00
Stevche Radevski 6487931f54 fix: Add shipping options for cart fix (#7205) 2024-05-02 10:33:58 +00:00
Stevche Radevski 8387d03370 fix: Correctly fetch cart when updating a line item (#7196) 2024-05-01 14:55:20 +00:00
Stevche Radevski d930d88369 fix: Ensure passed Id filters get applied on top of maybe link filter (#7182) 2024-05-01 11:25:24 +02:00
Stevche Radevski ec37576dd0 feat: Add collection and category endpoints to store (#7155)
* feat: Add collection endpoints to store

* feat: Add category store endpoints
2024-05-01 09:54:51 +02:00
Stevche Radevski 32c2a9d76b feat: Add missing endpoints and normalize customer and currency endpoints for storefront (#7160) 2024-04-29 16:15:05 +02:00
Stevche Radevski aef222278b fix: Corrections to the store region endpoint for v2 (#7152) 2024-04-26 08:36:37 +00:00
Stevche Radevski f03a822253 feat: Add support for search to all endpoints (#7149)
* feat: Add search capability to api keys

* feat: Add support for searching to currency and customer endpoints

* fix: Clean up product search filters

* feat: Add search support to regions

* feat: Add search support to sales channels

* feat: Add search support to store module

* feat: Add search support to user module

* fix: Clean up inventory search

* feat: Add search support for payments

* fix: Add searchable attributes to stock location models

* feat: Add search support to tax

* feat: Add search support to promotions

* feat: Add search support for pricing, filtering cleanup

* fix: Further cleanups around search
2024-04-25 17:36:59 +02:00
Stevche Radevski f341265f42 feat: Add s3-compatible plugin for the file module (#7143) 2024-04-25 09:06:47 +02:00
Stevche Radevski 614d659a59 feat: Add local file provider and wire everything up in the file module (#7134) 2024-04-24 10:59:58 +02:00
Stevche Radevski 9e3556686b fix: Standardize remaining batch methods and update FE calls (#7122) 2024-04-23 09:12:38 +00:00
Stevche Radevski 0df523594f feat: Convert several batch methods to the standardized format (#7116) 2024-04-22 16:35:10 +02:00
Stevche Radevski 89143e1032 feat: Add batch method to collection and clean up some batch implementations (#7102) 2024-04-22 08:36:22 +00:00
Stevche Radevski 9bd2d30595 Chore/finish migration zod (#7098)
* chore: Finish migrating all http endpoints to zod

* chore: Final changes to fully migrate to zod in the HTTP layer
2024-04-19 09:36:44 +02:00
Stevche Radevski be00a2eb51 chore: Move most of the remaining endpoints to zod (#7096) 2024-04-18 14:12:13 +02:00
Stevche Radevski ccb50bb3da fix: Switch to zod for customer endpoints, fix inconsistencies (#7094) 2024-04-18 10:30:45 +02:00
Stevche Radevski 44829f296a chore: Move several more endpoints to use zod for validation, unify APIs (#7086) 2024-04-18 06:51:43 +00:00
Stevche Radevski 08dc861dc1 fix: Support bigNumber in upsertWithReplace (#7084) 2024-04-17 17:07:20 +02:00
Stevche Radevski a7df6235f9 chore: Move several modules to use zod for validation and cleanup routes (#7079) 2024-04-16 18:06:56 +02:00
Stevche Radevski 92b633d1cb fix: Switch some modules to using zod for validation, and fix some bugs (#7074) 2024-04-16 07:44:53 +00:00
Stevche Radevski fd83e75e4b feat: Add support for batch method for products and product variants (#7038)
* feat(products): Add batch methods for product and variants

* chore: Rename batch validator and minor changes based on PR review
2024-04-15 16:48:29 +02:00
Stevche Radevski 47a175ce94 feat: Add support for price setting and updates for products (#7037)
We still need to add a `batch` method for variants, but I'll do that in a separate PR
2024-04-11 17:21:58 +00:00
Stevche Radevski fbc2959b37 feat: Add support for loading file providers to file module (#7016) 2024-04-09 10:03:56 +02:00
Stevche Radevski db2f0ef53f feat: Make tags unique, clean up searchability of product entities (#7014) 2024-04-08 17:55:40 +02:00
Stevche Radevski fa5c9bbe8f feat: Improve how options are defined and handled for product (#7007)
* feat: Improve how options are defined and handled for product

* fix: Updating option values supports passing without id
2024-04-08 15:29:41 +02:00
Stevche Radevski 2a0e010f73 feat: Add variant creation and editing in the products UI (#6997) 2024-04-08 09:32:12 +02:00
Stevche Radevski f65fbff535 feat: Improvements to the products details page in the admin (#6994) 2024-04-07 17:52:47 +02:00
Stevche Radevski 7302d078a9 feat: Add decimal digits and rounding info to currencies (#6991) 2024-04-07 16:34:22 +02:00
Stevche Radevski 4d6306f57b feat: Revamp product details page and several product fixes and cleanups (#6988) 2024-04-07 15:29:37 +02:00
Stevche Radevski 44bcde92c8 feat: Add support for setting sales channel when creating a product (#6986) 2024-04-07 13:45:47 +02:00
Stevche Radevski e8587e9f95 feat: Add support for defining options when creating product (#6981) 2024-04-06 18:58:53 +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
Stevche Radevski 07fb058d96 feat: Add product routes and components to v2 in admin-next (#6958) 2024-04-06 11:59:52 +02:00
Stevche Radevski a0005faa14 fix: upsertWithReplace should delete non-persist relationship fields … (#6960)
…before upsert
2024-04-05 13:26:14 +00:00
Stevche Radevski 9ccd88d025 feat: Add boilerplate for the file module (#6956) 2024-04-05 14:46:02 +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
Stevche Radevski 06b2f0a8dc feat: Add some of the missing pieces in the create product form (#6918)
The changes are still partial, there is more work to be done to have everything function properly.
Also, refactored the file upload from the product media form to a separate component
2024-04-04 10:27:33 +00:00
Stevche Radevski 3dee91426e feat: Correctly define all product module models and SQL migration script (#6906)
The only thing remaining is modifying `upsertWithReplace` to handle many-to-many constraints correctly and not cascade updates to them. This is something that we should do separately though.
2024-04-02 12:27:12 +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
Stevche Radevski 1a48fe0282 feat: Add v2 product types endpoints (#6880)
Also adjusts the product type module APIs to follow the conventions
2024-03-29 19:27:10 +00:00
Stevche Radevski 86f499de2f feat: Implemented price set update with prices and aligned pricing API (#6872) 2024-03-29 10:23: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
Stevche Radevski a6562d2a41 feat: Modify the abstract repository upsert to handle subresources as per convention (#6813)
* feat: Modify the abstract repository upsert method to handle subresources correctly

* fix: Preserve the upsertWithResponse order in the response, and return all the data

* fix: Create integration tests folder for mikro orm utils that run against the DB

* fix: Remove many-to-one creation and additional changes based on PR review
2024-03-28 15:28:57 +01:00
Stevche Radevski 70859397c0 feat: Align the product module HTTP API to follow our conventions (#6759) 2024-03-20 16:18:13 +01:00
Stevche Radevski 05e857d256 feat: Update the signatures for variants and options to follow convention (#6748) 2024-03-20 11:31:54 +00: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
Stevche Radevski 1956dce80a feat: Update the product options model and refactor the product module (#6685)
The changes in this PR are:
1. Change how product options are created and stored. The relationship changed from
`options --> option values <-- variants`
to
`options --> option values --> variant options <-- variants`

Now we can enforce non-duplicate option values, easier creation and updates of options, and more.

2. Refactors the product module. The product module did a lot of things in a non-ideal approach, and this is a step towards a more consistent usage of the base repository and methods exposed by a module. There is still work left to improve the module, but a large chunk of the changes are included in this PR


Things to do as a follow-up:
1. Remove many-to-many relationships  if an empty list is passed in the base repository.
2. Improve the typings of the module
3. Further cleanup and improvements (there are few questions that I need answered before I can improve the API)
2024-03-15 12:35:46 +00:00
Stevche Radevski 68d869607f chore: Use module test runner in all modules (#6706)
I replaced the custom test setup with the test runner. This should make migrating to mikroorm 6 a lot easier once we do it.

There are few more modules to be done, but I thought the PR is super big already so we can tackle them separately.

Note that there are no or very little test changes, it is mostly the setup around the tests.
2024-03-14 21:01:50 +00:00
Stevche Radevski ff4bd62f71 feat: Implement missing methods in product module and make more tests pass (#6650)
The 2 bigger remaining tasks are:
1. handling prices for variants
2. Handling options (breaking change)

After that all tests should pass on both v1 and v2
2024-03-11 11:03:24 +00:00
Stevche Radevski a92cdeb01d chore: Adjusting the v2 product module to follow the v1 specs (#6618)
In this PR:
1. I added upsert support for the product
2. I updated the create and update signatures to match the latest interface standards
3. Small changes to make the v1 and v2 APIs compatible (WIP)
2024-03-08 14:03:59 +00:00
Stevche Radevski 056e3e9599 feat: Set withDeleted as true if filtering on deleted_at in modules (#6626)
Similar convention already existed in v1, so we are just applying this for the abstract module factory
2024-03-08 11:40:00 +00:00
Stevche Radevski 7dee1a3fd3 chore: Start using medusa test runner on product API tests (#6609)
I want to get this merged where we only switch to the runner, so actual test changes are more obvious when reviewing.
2024-03-07 10:29:00 +00:00
Stevche RadevskiandAdrien de Peretti 12b035cb18 chore(tests): Try to use the api integration tests for v2 (#6588)
Few things to keep in mind:
1. You need to set MEDUSA_FF_MEDUSA_V2 to true before running the tests to run with the v2 API
2. You can use the `breaking` function to differentiate between v1 and v2 differences. This can help us identify what was breaking pretty quickly afterwards
3. You will need to run specific tests for now instead of all if you want to target v2. I think that's fine though, as we don't really need these to run on every PR until we have feature parity (and by then, all tests would be both v1 and v2 compatible)


**note: Adrien** 
- add a new way to load modules only to run their loaders comparable to the way to run the migrations only
- improve tests runner to cleanup the data properly as well as re running all loaders and core defaults

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-03-07 08:05:43 +00:00
Stevche Radevski a6736c7ee0 fix: Add some tests and test cleanup for product module (#6586) 2024-03-05 17:18:46 +01:00
Stevche Radevski f9ef37a2f2 feat: add product admin v2 endpoints (#6579)
This implementation obviously lacks a lot of things, and there are a lot of TODOs. However, there are already a lot of questions I'd rather get answered soon, so I figured it's much easier to do the implementation in steps.

I wrote down all breaking changes, suggested changes, and new additions with comments (TODO and Note).

In a follow-up PR I will:

Add the remaining/missing models
Make the workflows handle all interactions between the different models/modules
Add integration tests
2024-03-05 10:24:33 +00:00
Stevche Radevski 71ed21de4a feat: Add supported currencies to store model (#6562)
I ultimately went with having a flat list of settings for the store. It wouldn't be very difficult to change it if we wish to do so, but for now this keeps the codebase simpler
2024-03-01 15:43:47 +00:00
Stevche Radevski 347aba719c fix: Move default country loading for region to the loader, fix a bug with cascade (#6559) 2024-03-01 14:58:55 +01:00
Stevche Radevski 196e821ff2 feat: Modify api key and sales channel link to use modules and add test (#6546) 2024-03-01 09:24:50 +00:00
Stevche Radevski 4d38eb3bf8 chore: Use default countries and currencies from utils (#6543) 2024-02-29 17:01:18 +01:00
Stevche Radevski dc025302a1 feat: Add currency module and remove currency models from region and pricing modules (#6536)
What:
- Creates a new currency module
- Removes currency model from the pricing module
- Removes currency model from region module
2024-02-29 15:09:59 +00:00
Stevche Radevski d60f3adc03 feat: Add basic endpoints and workflows for Store module (#6515) 2024-02-28 10:08:11 +00:00
Stevche Radevski 753bd93ba1 feat(api-key): Add api-key authentication to middleware (#6521)
Also did a bit of a cleanup on the auth middleware. There should be no behavioral changes, just moved code around.
2024-02-27 13:44:37 +00:00
Stevche Radevski 690e8c2e09 feat(api-key): Allow revoking in the future, and enforce the secret key (#6484)
Since there is quite a bit of code here already, I'll do the middleware changes in a separate PR
2024-02-27 10:37:32 +00:00
Stevche Radevski b13c669528 feat: Add basic CRUD functionality to store module (#6510)
Adds the core model and basic CRUD around it.

Note: The store model is not complete, but I prefer doing smaller PRs so it's easier to do a proper review. Adding currencies will be a follow-up PR.
2024-02-26 14:23:48 +00:00
Stevche Radevski 63be07031b feat: Add skeleton for Store module (#6506) 2024-02-26 12:00:48 +00:00
Stevche Radevski 5b85c3103e feat: Update signature of region module to match latest spec (#6487) 2024-02-23 15:56:16 +00:00
Stevche Radevski 78b6d46584 Merge pull request #6471 from medusajs/feat/add-api-endpoints-api-key
feat(api-key): Add the endpoints and workflows for api key module
2024-02-23 11:35:31 +01:00
Stevche Radevski 0582545065 feat(api-key): Add the endpoints and workflows for api key module 2024-02-23 11:01:08 +01:00
Stevche Radevski add861d205 chore(utils): Move generic utils from region module to utils (#6466)
Moves some generic utilities from the region module to the top-level utils package
2024-02-22 08:06:46 +00:00
Stevche Radevski 5a15e039ec Merge pull request #6463 from medusajs/feat/implement-crud-api-key-module
feat(api-key): Add CRUD functionalities to the api key module
2024-02-21 16:36:31 +01:00
Stevche Radevski ec6351b363 chore: Updates based on PR feedback 2024-02-21 16:05:51 +01:00
Stevche Radevski c99ca5cc22 feat(api-key): Add CRUD functionalities to the api key module 2024-02-21 15:45:40 +01:00
Stevche Radevski 30dbb86ef4 chore: Update CONTRIBUTING.md to include information on changesets (#6454) 2024-02-21 07:48:04 +01:00
Stevche Radevski 269be1b64a feat: Add skeleton for api key module (#6451)
Adds a module skeleton for the API Key module.
Implementation of functionalities will follow in separate PRs
2024-02-20 12:28:57 +00:00
Stevche Radevski cfefd59249 feat(regions): Add support for updating countries in a region (#6432)
**What**
Add missing support for updating countries on the POST /admin/regions/:id route.
Furthermore, the PR refactors how the normalization and validation was handled in both create and update scenarios.
Finally, the PR adds a unique index on the country entity, which ensures at the DB level that we cannot have a duplicate country in the DB for a single region.
2024-02-20 11:46:42 +00:00
Stevche Radevski 35a4db29b7 Merge pull request #6416 from medusajs/chore/add-sradevski-teams
Add sradevski to teams.yml
2024-02-16 13:14:35 +01:00
Stevche Radevski a4d43f05f0 Add sradevski to teams.yml 2024-02-16 13:00:15 +01:00
Stevche Radevski 076c1cd752 Merge pull request #6409 from medusajs/docs/fix-description-payment-processor
docs(payments): Fix incorrect reference in payment processor tsdoc
2024-02-16 09:36:19 +01:00
Stevche Radevski b5369a4ff1 docs(payments): Fix incorrect reference in payment processor tsdoc 2024-02-16 08:41:05 +01:00