Commit Graph

174 Commits

Author SHA1 Message Date
Carlos R. L. Rodrigues
37426939da Feat(order): post purchase support (#7666) 2024-06-10 18:44:51 -03:00
Riqwan Thamir
39ddba2491 chore: ability to group events on redis event bus (#7655)
* chore: ability to group events on redis event bus

* chore: fix tests

* Update packages/modules/event-bus-redis/src/services/event-bus-redis.ts

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>

* chore: change shape of input and body data

* chore: fix builds

* chore: address comments

* chore: fix unit test

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2024-06-10 22:15:43 +02:00
Riqwan Thamir
0507dbe027 chore(core-flows,inventory,types,medusa): add fixes to inventory module + location levels api (#7629)
what:

- santizes inputs to prevent reserved_quantity from being updated directly
- inventory items create api can create location levels
- add validation to update quantity of reservation items
- general cleanup

RESOLVES CORE-2254
2024-06-06 12:58:17 +00:00
Stevche Radevski
d2e1e9f8c7 fix: Apply strict schema for all body and query parameters (#7624) 2024-06-05 15:40:54 +00:00
Stevche Radevski
1e3c8747e5 chore: Move inventory tests to HTTP layer (#7613) 2024-06-05 09:36:58 +00:00
Stevche Radevski
fafc92b875 Revamp auth module to support multiple providers linked to a single auth identity (#7521) 2024-06-05 07:47:16 +00:00
Oli Juhl
dc087bf310 feat: Move shipping option + profile test and more (#7609) 2024-06-05 08:36:41 +02:00
Stevche Radevski
e44fe78b96 fix: Several fixes to store product endpoints, moved several test suites to HTTP (#7601)
* chore: Move publishable api key tests to HTTP

* chore: Move store tests to HTTP folder

* fix: Add tests for store products, fix several bugs around publishable keys
2024-06-04 21:00:07 +02:00
Riqwan Thamir
e7005a0aac feat(core-flows,medusa): adds inventory kit creation to variants endpoint (#7599)
what:

When creating a variant, we can now create inventory as a part of the product and variants create endpoint.

This applies only to variants where `manage_inventory=true`. 2 cases present itself:

1. When inventory_items are present
  - Link an inventory item with required_quantity to the variant
  - the inventory item already needs to be present
2. When inventory_items are not present
  - A default inventory item will be created
  - links the created item to the variant with a default required_quantity
  
  
RESOLVES CORE-2220
2024-06-04 13:49:31 +00:00
Carlos R. L. Rodrigues
68fb04b849 fix(order): ignore reservation when manage_inventory is false (#7594) 2024-06-04 07:08:54 -03:00
Riqwan Thamir
ecfbfcc707 feat(core-flows,modules-sdk,types,medusa,link-modules): adds variant <> inventory item link endpoints (#7576)
what:

- adds variant inventory link management endpoints:
```
Link inventory item to variant
POST /products/:id/variants/:vid/inventory-items

Update variant's inventory item link
POST /products/:id/variants/:vid/inventory-items/:iid

Unlink variant's inventory item
DELETE /products/:id/variants/:vid/inventory-items/:iid
```

- a batch endpoint that does the above 3 across variants
```
POST /products/:id/variants/inventory-items
```
2024-06-03 18:23:29 +00:00
Carlos R. L. Rodrigues
122186a78d chore(order): cancel order (#7586) 2024-06-03 12:31:33 -03:00
Carlos R. L. Rodrigues
af0140d317 feat(order): cancel fulfillment (#7573) 2024-06-02 09:33:24 -03:00
Stevche Radevski
4117beed58 chore: Refactor batch product workflows and add tests (#7540) 2024-05-30 15:53:03 +02:00
Riqwan Thamir
15e9787465 feat(types,medusa): add inventory quantity to products endpoint (#7541)
what:

- when inventory_quantity is requested through the API, we calculate the inventory based on sales channels + stock locations and return the total available inventory.

A variant can have multiple inventory items. As an example:

Table: (variant)
  - 4 (required_quantity via link) x legs (inventory item)
  - 2 x table top

Only if all individual inventory items of a variant are available, do we mark the variant as available as a single unit. 

RESOLVES CORE-2187
2024-05-30 13:20:06 +00:00
Stevche Radevski
eeb8225b5e chore: Remove redundant product tests, add missing to http layer (#7543) 2024-05-30 11:26:50 +00:00
Stevche Radevski
5ad6864b82 feat: Improve zod error messages (#7535) 2024-05-30 09:52:47 +02:00
Riqwan Thamir
f0b9d5534e chore: query inventory items by location id (#7524)
what:

- allows querying inventory items by the correct location_id
2024-05-29 14:14:10 +00:00
Carlos R. L. Rodrigues
f1ced57d5f chore: payment auto capture + remove enum from utils (#7513)
What:

- handles payments session that are auto captured
- removes all the enums from `@medusajs/types`
- move all `@medusajs/types` to devDependencies
2024-05-29 11:12:59 +00:00
Carlos R. L. Rodrigues
bbca54efa7 chore(order): aggregate statuses (#7497) 2024-05-29 07:05:42 -03:00
Harminder Virk
82be054a1a chore: Rename config properties to camelCase (#7498)
* refactor: rename config types to camelCase

* refactor: update config references to use renamed options

* refactor: update more references

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-05-28 14:49:29 +02:00
Oli Juhl
c9de1d28a4 feat: Assign store default sales channel in cart creation (#7495) 2024-05-28 12:12:01 +02:00
Oli Juhl
ad21bd30b1 fix: errors thrown in transformer (#7480)
* chore: wup

* throw on error

* add back test

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
2024-05-28 08:44:33 +02:00
Riqwan Thamir
7baedf73d5 feat(core-flows,types,utils,medusa): Update existing line items when adding the same variant to cart (#7470)
* feat(core-flows,types,utils,medusa): Update existing line items when adding the same variant to cart

* chore: split steps into 2 for add-to-cart

* chore: split steps into 2 for add-to-cart

* chore: iterate safely

* chore: parallelize upsert
2024-05-27 17:54:11 +02:00
Stevche Radevski
10ef32c5a3 feat: Apply authentication middleware globally (#7396)
* feat: Apply auth middleware globally

* feat: Remove local auth middleware where it makes sense
2024-05-27 15:24:53 +02:00
Carlos R. L. Rodrigues
62ef82f497 feat(order): fulfillment workflow (#7385)
FIXES: CORE-2162 CORE-2167 CORE-2041
2024-05-27 12:49:33 +00:00
Adrien de Peretti
e275e01d85 chore: Cleanup medusa test utils (#7464)
* chore: Cleanup medusa test utils

* update yarn

* cleanup

* fix key

* cleanup

* fixes

* fixes

* fixes

* fixes

* fix runners

* fix bootstrap

* naming

* Improve runners options

* Improve runners options

* Improve runners options

* cleanup

* fix tests
2024-05-27 14:14:32 +02:00
Stevche Radevski
28a3f9a3df feat: Add list cart option typings, make region optional on update cart (#7455) 2024-05-27 09:37:10 +02:00
Adrien de Peretti
f585b13c96 chore: remove babel usage (#7452) 2024-05-24 20:51:12 +02:00
Stevche Radevski
135772b27b feat: Revert to using app_metadata for authentication (#7433) 2024-05-23 22:01:41 +02:00
Stevche Radevski
8a070d5d85 Revamp the authentication setup (#7419)
* feat: Add email pass authentication provider package

* feat: Revamp auth module and remove concept of scope

* feat: Revamp the auth module to be more standardized in how providers are loaded

* feat: Switch from scope to actor type for authentication

* feat: Add support for per-actor auth methods

* feat: Add emailpass auth provider by default

* fix: Add back app_metadata in auth module
2024-05-23 20:56:40 +02:00
Riqwan Thamir
d1d23f1e8d feat(dashboard,medusa): Promotion Campaign fixes (#7337)
* chore(medusa): strict zod versions in workspace

* feat(dashboard): add campaign create to promotion UI

* wip

* fix(medusa): Missing middlewares export (#7289)

* fix(docblock-generator): fix how type names created from Zod objects are inferred (#7292)

* feat(api-ref): show schema of a tag (#7297)

* feat: Add support for sendgrid and logger notification providers (#7290)

* feat: Add support for sendgrid and logger notification providers

* fix: changes based on PR review

* chore: add action to automatically label docs (#7284)

* chore: add action to automatically label docs

* removes the paths param

* docs: preparations for preview (#7267)

* configured base paths + added development banner

* fix typelist site url

* added navbar and sidebar badges

* configure algolia filters

* remove AI assistant

* remove unused imports

* change navbar text and badge

* lint fixes

* fix build error

* add to api reference rewrites

* fix build error

* fix build errors in user-guide

* fix feedback component

* add parent title to pagination

* added breadcrumbs component

* remove user-guide links

* resolve todos

* fix details about authentication

* change documentation title

* lint content

* chore: fix bug with form reset

* chore: address reviews

* chore: fix specs

* chore: loads of FE fixes + BE adds

* chore: add more polishes + reorg files

* chore: fixes to promotions modal

* chore: cleanup

* chore: cleanup

* chore: fix build

* chore: fkix cart spec

* chore: fix module tests

* chore: fix moar tests

* wip

* chore: templates + fixes + migrate currency

* chore: fix build, add validation for max_quantity

* chore: allow removing campaigns

* chore: fix specs

* chore: scope campaigns based on currency

* remove console logs

* chore: add translations + update keys

* chore: move over filesfrom v2 to routes

* chore(dashboard): Delete old translation files (#7423)

* feat(dashboard,admin-sdk,admin-shared,admin-vite-plugin): Add support for UI extensions (#7383)

* intial work

* update lock

* add routes and fix HMR of configs

* cleanup

* rm imports

* rm debug from plugin

* address feedback

* address feedback

* temp skip specs

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
Co-authored-by: Stevche Radevski <sradevski@live.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Kasper Fabricius Kristensen <45367945+kasperkristensen@users.noreply.github.com>
2024-05-23 15:28:00 +02:00
Stevche Radevski
5ede560f70 feat(auth): Revamp authentication setup (#7387)
* chore: Clean up authentication middlewares

* chore: Rename AuthUser to AuthIdentity

* feat: Define link between user, customer, and auth identity

* feat: Use links for auth, update auth context content

* fix: Adjust user create command with new auth setup

* fix: Make auth login more dynamic, review fixes

* fix: Change test assertions for created by
2024-05-22 10:27:32 +02:00
Adrien de Peretti
c4fde7ea5c feat(core-flows, fulfillment): Add create return specific method and add more tests (#7357)
* feat(core-flows, fulfillment): Add create return specific method and add more tests

* fix defautl providers in tests fixtures

* more tests

* wip fixes

* fix flow and tests

* cleanup
2024-05-21 13:48:59 +02:00
Riqwan Thamir
43613f3f58 chore: pick the default store region (#7369)
* chore: pick the default store region

* chore: fix test

* chore: remove from defaults workflow and move to seeds

* chore: undo payment provider change

* chore: rearrange conditionals
2024-05-21 12:05:01 +02:00
Frane Polić
521b4e7926 feat(dashboard): order fulfillment UI (#7262)
* feat: initial impl. of Unfulfilled section and create flow

* feat: create fulfillment

* feat: order <> fulfillment link, fulfillment section

* feat: accept order_id when creating fulfillment

* feat: finish create and cancel

* fix: integration test

* refactor: real Order<>Fulfillment link instead readonly, add link step to the workflow

* fix: revert `order_id` definitions

* chore: add changeset

* fix: build

* fix: address comments

* fix: fetch inventory and location levels for fulfilled variant

* fix: loading inventory details

* add isList to order fulfillment link

* fix: duplicate declaration

* fix: type

* refactor: link orders step, fix client

* fix: move translations to the new file

* fix: pass order id in test

---------

Co-authored-by: olivermrbl <oliver@mrbltech.com>
2024-05-20 13:41:09 +02:00
Oli Juhl
bf4724b8e6 feat: Destroy session + introduce http config (#7336) 2024-05-19 12:40:28 +02:00
Adrien de Peretti
a775d57255 feat(core-flows, types): Create return order (#7319)
**what**
- Create return workflow partial implementation
- Update some order domain types
- create order fulfillment link

**NOTE**
this PR is partially done but can still be merged as is, it will require some discussions around the flow and some unknowns or uncertainty in regards to some data and some behaviour
2024-05-16 14:10:54 +00:00
Stevche Radevski
07e5c17f86 chore: Remove medusa interfaces package (#7347) 2024-05-16 15:06:21 +02:00
Stevche Radevski
ee924b1b28 feat: Add a simple configurable notifications subscriber (#7331)
* feat: Add a simple configurable notifications subscriber that is configurable

* Proposal on awaiting all subscribers to run

* fix: Clean up wait subscribers util and notifications test

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
2024-05-16 13:36:09 +02:00
Riqwan Thamir
b78703b8c6 chore: fix variant pricing validation for carts (#7344) 2024-05-16 09:03:37 +02:00
Kasper Fabricius Kristensen
490586f566 feat(medusa,dashboard,admin-sdk): Run admin dashboard from Medusa instance (#7330) 2024-05-15 19:52:09 +02:00
Carlos R. L. Rodrigues
7c4f4d7388 feat(payment): update payment collection status (#7335) 2024-05-15 15:11:40 +00:00
Carlos R. L. Rodrigues
70fd355e46 chore(order): link order and payment collection (#7334) 2024-05-14 20:37:27 +00:00
Stevche Radevski
d680c7ee4c Remove v1-related code from medusa app (#7326)
* chore: Remove unused validations and utilities

* chore: Remove all resources that are not being loaded

* chore: Remove unused dependencies, typeorm related code and fix tests

* chore: Use createAdminUser in all module tests
2024-05-14 13:21:30 +02:00
Oli Juhl
5b26f5f2cf feat: Add publishable key scopes middleware (#7301)
**What**

Add pub key + sales channel middlewares to the store carts API
- Assign sales channel associated with pub key, if sales channel is not passed in request
  - Throw if pub key has multiple associated sales channels
- Throw if sales channel ID in payload is not associated with publishable API key in header
2024-05-13 16:17:52 +00:00
Adrien de Peretti
63623422fe chore(): Autoload module resources (#7291)
**What**
- automatically build and consume connection and container loader if not exported by the module
- therefore load the services and repositories automatically, including baseRepository
- automatically build run and revert migrations if not provided
- cleaup modules to remove extra unnecessary bits and pieces
- remove the `initializeFactory` in favor of using `medusaApp`

Should drastically improve the module building DX by removing a lot of boilerplate to handle by the user, that plus the base entity should simplify quite a lot the flow cc @shahednasser 

**Note**
I had to choose a way to identify connection and container loader from the exported loader from the module. I decided to go with named function `connectionLoader` and `containerLoader`, also, now the factories will return named function so if the user use the factories we are providing to build those loaders, the function will also be named and identified
2024-05-13 12:12:36 +00:00
Stevche Radevski
79758c46b6 feat: Add support for sendgrid and logger notification providers (#7290)
* feat: Add support for sendgrid and logger notification providers

* fix: changes based on PR review
2024-05-11 17:40:03 +02:00
Riqwan Thamir
9a14aeebcf feat(core-flows,types,medusa): API to add promotions to campaign (#7277)
what:

- adds an API to add promotions to campaign
- reworks module to perform atomic actions
2024-05-10 07:53:56 +00:00
Adrien de Peretti
71f4f46cb9 chore(medusa): cleanup medusa package (#7206) 2024-05-07 12:48:49 +02:00