Commit Graph

40 Commits

Author SHA1 Message Date
Philip Korsholm
c97ccd3fb5 feat(medusa): Convert FulfillmentService to TypeScript (#1962) 2022-08-22 19:19:41 +02:00
Adrien de Peretti
bd031ef7ad feat(medusa:) Convert PaymentProvider + PaymentProviderInterface to TS + (#1773)
* feat(payments): Refactor core Payment related

* fix(medusa): typings

* test(unit): fix suite

* test(unit): fix suite

* feat(medusa): Improve payment provider container typings

* fix(medusa): typings

* styles(medusa): renove comments

* feat(medusa): cleanup

* feat(medusa): Add uniq constraint on payment session and idem key on create-payment-session end point

* fix(medusa): migration

* fix(medusa): create payment session

* feat(medusa): cleanup
2022-08-10 17:26:16 +02:00
Adrien de Peretti
b8ddb31f6f feat(medusa): Move search indexing into a separate subscriber to defer the work load (#1874)
**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>
2022-07-26 12:58:28 +00:00
Oliver Windall Juhl
c76e23e84d fix(medusa): Remove deps mongoose + mongodb (#1218)
* 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>
2022-07-04 09:10:32 +02:00
Adrien de Peretti
12c06b4c9d refactor(medusa): Cleanup and fix CartService (#1306)
* 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
2022-04-13 18:35:13 +02:00
Sebastian Rindom
607a382b4e fix: ensures no duplicate tax lines when completing cart (#1262)
* fix: ensures that no duplicate tax lines are created when completing cart
2022-04-05 21:25:48 +02:00
Sebastian Rindom
62c263c360 fix: atomic phase error handler (#1104)
* fix: adds atomic phase clean up callback

* fix: call error handler in new transaction block too

* fix: error handler in no isolation case
2022-02-24 16:44:08 +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
Oliver Windall Juhl
373532ecbc feat: Typescript for API layer (#817)
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
Co-authored-by: Zakaria El Asri <33696020+zakariaelas@users.noreply.github.com>
Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>
Co-authored-by: Sebastian Rindom <seb@medusa-commerce.com>
2021-11-18 15:19:17 +01:00
Oliver Windall Juhl
1e50aee4fe feat: Allow retrieval of soft-deleted products (#723) 2021-11-10 22:23:56 +01:00
Oliver Windall Juhl
6f4e128944 hotfix: Search service interfaces should import base from folder (#766) 2021-11-10 21:57:13 +01:00
Sebastian Rindom
57a6612e84 fix: product ordering 2021-10-18 14:39:42 +02:00
zakariaelas
c3a6045dd8 fix: filter type in jsdoc 2021-09-27 12:48:43 +01:00
zakariaelas
9b6d0c7334 add: request + response interface changes 2021-09-27 12:42:10 +01:00
zakariaelas
24eecd2922 fix: use type to choose transformer before adding or replacing documents 2021-09-24 11:34:14 +01:00
zakariaelas
451e3bcdcf further adjustments based on seb's feedback 2021-09-22 15:44:52 +01:00
zakariaelas
3a10e37377 adjustments
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
2021-09-20 14:44:58 +01:00
zakariaelas
0fbde7c51f add: abstract search functionality to core + adjust meilisearch-plugin
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
2021-09-16 15:48:09 +01:00
Oliver Windall Juhl
dd0491f521 feat(medusa): Add support for filtering with gt, lt, gte and lte (#190)
- 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
2021-03-01 11:32:17 +01:00
Sebastian Rindom
7308946e56 feat: notifications (#172)
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.
2021-02-15 11:59:37 +01:00
Sebastian Rindom
f1baca3cbd Replaces MongoDB support with PostgreSQL (#151)
- 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>
2021-01-26 10:26:14 +01:00
Sebastian Rindom
fd04233238 feature: swaps (#137)
* feat: swap schema

* chore(refactor): move returns to separate service

* swap order creates return

* fix: adds returns/fulfillments/shipments and cart creation to swaps

* search products by variants

* feat: swaps ready

* fix: test passing

* chore: include customer expand fields on order

* add tests

* fix: add brightpearl plugin support

* fix: adds swap link template setting

* fix: tests

* fix(medusa-plugin-brightpearl): add swap status option

* docs: add swap description

* fix: adds GET swap in store api

* chore: unmock axios

* fix: passing klarna tests

* fix: pr
2020-11-24 14:02:49 +01:00
Oliver Windall Juhl
cc23a3b070 feat(medusa-interfaces): Adds schema options to base model 2020-10-20 17:07:47 +02:00
Sebastian Rindom
c1e821d9d4 feat: return shipping and flow (#125)
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.
2020-10-14 17:58:23 +02:00
Sebastian Rindom
893a7f69af feat: webshipper (#118)
* register fulfillment providers as singletons

* fix: adds subscribers/api endpoints and webhook handlers

* Adds readme

* Allow document attachments to orders:

* chore: gitignore utils

* chore: rm compiled files
2020-10-05 08:44:12 +02:00
Oliver Windall Juhl
9dc6999a9a feat(pagination): Adds MVP pagination to orders and products for admin routes 2020-08-27 17:51:23 +02:00
Sebastian Rindom
21bc096b2e Adds Oauth support to plugins 2020-08-04 17:13:47 +02:00
Sebastian Rindom
ec6a538877 All tests passing 2020-07-15 17:47:43 +02:00
Sebastian Rindom
cd989c56a7 Setup future usage 2020-07-13 17:35:50 +02:00
Sebastian Rindom
b45fcae6fe Klarna orders 2020-07-10 16:30:32 +02:00
olivermrbl
30c101a8be Adds create order transactiom 2020-07-10 10:23:31 +02:00
Sebastian Rindom
716415263d Adds an image connector; introduces file service 2020-07-07 14:36:48 +02:00
Sebastian Rindom
f9b232da54 Defaults 2020-07-06 11:52:16 +02:00
Sebastian Rindom
4c2aec2838 Adds publish/subscribe pattern to allow plugins and projects to hook into events (#55)
Also adds CLI to ease development.
2020-05-07 13:47:27 +02:00
Sebastian Rindom
feda00d2d1 Decorators (#42)
Adds decorator functionality to BaseService
2020-04-30 21:39:30 +02:00
Sebastian Rindom
2273cc519a Revert "[medusa-interfaces] : Adds decorator functionality to BaseService (#39)" (#41)
This reverts commit 9c76754e79.
2020-04-30 21:16:09 +02:00
Sebastian Rindom
9c76754e79 [medusa-interfaces] : Adds decorator functionality to BaseService (#39)
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()`.
2020-04-30 20:40:22 +02:00
Sebastian Rindom
ea4185eddd Creates ShippingProfileService & ShippingOptionService (#30)
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.
2020-04-07 16:35:27 +02:00
Sebastian Rindom
f8fcd5a3dd Adds a payment provider service that can easily retrieve payment providers 2020-02-18 14:58:11 +01:00
Sebastian Rindom
edce88c34b Moves Medusa interfaces defines model schemas for Customer, Cart, Order 2020-01-30 09:38:08 +01:00