**What**
Move the preliminary indexing action at boot time to a separate subscriber in order to defer the work load in the background and therefore to avoid increasing the load time when the number of products increase with time.
**Tests**
Add 10k products (since it is our limit, tried with 50k before getting the error limit) using
```sal
do $$
declare
counter integer := 0;
begin
while counter < 10000 loop
INSERT INTO product (id, title, description, handle, profile_id)
(SELECT * FROM ((SELECT random(), random(), random(), random(), 'sp_01FNB9K7FXB0SZMKXD013RJYSP')) as T);
counter := counter + 1;
end loop;
end$$;
```
then start the server and while the server is starting, hit the search end point repeatedly
FIXES CORE-258
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
* fix(medusa): Remove deps mongoose, mongodb and transaction service + base model
* chore: delete permissions+add-ons legacy plugins
Co-authored-by: Sebastian Rindom <skrindom@gmail.com>
* refactor(medusa): Cleanup + fix
* styles(medusa): Lint
* refactor(medusa): Finalize cleanup
* feat(medusa): Prefer the usage of bulk operations instead of sequential/conccurent operations
* feat(medusa): Improve cart service
* refactor(medusa): Explicitly specifying protected methods when needed as well as enfore the usage of the local transactionManager_ in those methods
* tests(medusa): Fix tests according to the new changes
* feat(medusa): Cleanup after rebase
* test(medusa): Fix cart service tests
rename search subscriber
fix: comments in medusa-interfaces/search-service.js
add: use cursor pagination when indexing all products to search engine
fix: emit product_id on product-variant creation
fix: move search API route under products/search
fix: use meilisearchService instead of searchService in plugin loader
add SearchService interface to medusa-interfaces
add DefaultSearchService skeleton implementation to core
add search-index.js loader to core for indexing db documents
add SearchSubscriber to core
add loadToSearchEngine method in ProductService
switch order of loaders in core to load subscriptions AFTER plugins
adjust service and loader for medusa-plugin-meilisearch
- Add support for filtering with lt, gt, lte, gte in the following format: created_at[gt]=01-26-1997
- Add middleware for cleaning request queries
- Add order query validation
- Temp. disables tags in claim integration tests
The Notifications API allows plugins to register Notification Providers which have `sendNotification` and `resendNotification`.
Each plugin can listen to any events transmittet over the event bus and the result of the notification send will be persisted in the database to allow for clear communications timeline + ability to resend notifications.
- All schemas have been rewritten to a relational model
- All services have been rewritten to accommodate the new data model
- Adds idempotency keys to core endpoints allowing you to retry requests with no additional side effects
- Adds staged jobs to avoid putting jobs in the queue when transactions abort
- Adds atomic transactions to all methods with access to the data layer
Co-authored-by: Oliver Windall Juhl <oliver@mrbltech.com>
Adds support for return shipping methods and changes returns to have a request/receive flow. Store operators should now first request a return, noting the line items that will be returned. When the inventory is received the return will be registered triggering the refund. Return shipping methods can now be created for all regions.
Plugins and projects can add decorators in services. E.g. if a plugin needs to load some additional information on carts the plugin can register a decorator via: `cartService.addDecorator(someFunc)` which will be available later through `cartService.runDecorators()`.
Adds ShippingProfiles:
With Shipping Profiles store operators can group products together and select which shipping options can fulfill the products. The shipping profiles are region agnostic, but for products to be shippable to a given region the shipping profile must have a shipping option associated that ships to this region.
Adds Shipping Options:
Shipping Options represents a way that the customer can have their order shipped. The shipping option has a fulfillment provider associated to determine who fulfills orders with the given shipping method. If a fulfillment provider has multiple ways that they can ship a shipping option for each of the fulfillment provider's shipping options can be created.