Commit Graph

120 Commits

Author SHA1 Message Date
Stevche Radevski
e8d6025374 Add support for tax inclusivity to region and store (#7808)
This also includes rework of the currency model for the Store module.

This change is breaking as existing stores won't have any supported currencies set, so users would need to go to the store settings again and choose the supported currencies there.
2024-06-24 15:25:44 +00:00
Adrien de Peretti
ae6dbc06be chore: Update module test runner to support DmlEntities when needed (#7799)
* chore: Update module test runner to support DmlEntities when needed

* update es version for core test utils

* fix test

* update swc config
2024-06-24 09:44:01 +02:00
Riqwan Thamir
8ac74c1357 feat(core-flows,types,pricing,medusa): Products API can create prices with rules (#7796)
* chore: Products API can create prices with rules

* chore: fix tests

* chore: cleanup

* chore: address comments
2024-06-21 15:30:36 +02:00
Adrien de Peretti
90e6ca0e9e chore: Internal medusa service proper typings with DML (#7792) 2024-06-21 12:36:54 +02:00
Stevche Radevski
944051a951 fix: Allow filtering products by variant options in store (#7784) 2024-06-21 10:42:09 +02:00
Stevche Radevski
ee35379e21 chore: Rename all event keys to uppercase (#7787)
* chore: Rename all event keys to uppercase

* fix: Remove main entity from event builder
2024-06-21 10:41:35 +02:00
Adrien de Peretti
937a632eb6 chore: make module loaders DML aware and auto generate joiner config (#7781)
* chore: make module loaders DML aware and auto generate joiner config

* fixes and cleanup

* improve dml entity check

* add unit tests on load resources

* cleanup deps

* cleanup deps

* cleanup Modules

* finalise

* fix modules-sdk jest

* fix modules-sdk jest

* fix import

* fix import
2024-06-20 18:18:07 +02:00
Riqwan Thamir
03924a4ff6 chore: move to swc/jest (#7739)
* chore: move to swc

* chore: fix tax rate tests

* chore: undo failed test

* chore: fix unit tests script

* chore: use node 20

* Update scripts/run-workspace-unit-tests-in-chunks.sh
2024-06-20 12:59:33 +02:00
Riqwan Thamir
f61557712c chore: make apis nullable (#7763)
what:

- makes top level attributes of each object an optional field in the http layer where possible

RESOLVES CORE-2229
2024-06-20 10:10:59 +00:00
Riqwan Thamir
33c4cd34cc chore: export DML builders + fix default undefined values in SQL (#7776)
* chore: export dml builders through utils

* chore: fix undefined sql error

* chore: upgrade to ts 5

* chore: use isDefined
2024-06-20 10:45:49 +02:00
Adrien de Peretti
48963f55ef Chore/rm main entity concept (#7709)
**What**
Update the `MedusaService` class, factory and types to remove the concept of main modules. The idea being that all method will be explicitly named and suffixes to represent the object you are trying to manipulate.
This pr also includes various fixes in different modules

Co-authored-by: Stevche Radevski <4820812+sradevski@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-06-19 13:02:16 +00:00
Riqwan Thamir
0d04c548f5 feat(dashboard,types,promotion,medusa): hide fields on promotions depending on templates (#7746)
**what:**

- hides different fields depending on the chosen template
- remove operator values API
- fixes to edit promotion rules
- make currency optional for promotion

RESOLVES CORE-2297
2024-06-18 16:47:42 +00:00
Carlos R. L. Rodrigues
cfa983001b feat(order): create claim and exchange (#7734) 2024-06-18 08:08:16 -03:00
Adrien de Peretti
e0b14519f1 fix: Medusa service base method transaction (#7758)
**What**
Remove transaction decorator from the base medusa service method, the transaction will always be coming from the shared context. It fixes the issue that when you consume a base method directly it will return a proper tuple from the DB instead of the one from the entity map cc @VariableVic 

**NOTE**
This pr also fix some categories issues in the product module which was preventing the tests from working. if @sradevski you could have a look later, in the mean time we can still merge it

FIXES CORE-2342
2024-06-18 10:58:54 +00:00
Riqwan Thamir
4c962b97b1 chore: extend timeout on flaky spec (#7760) 2024-06-18 12:01:12 +02:00
Carlos R. L. Rodrigues
12a57836a7 fix(pricing): Only get prices from active price list (#7753) 2024-06-17 20:18:08 +02:00
Carlos R. L. Rodrigues
70a72ce2df chore(payment-stripe): smallest unit (#7748) 2024-06-17 13:37:38 -03:00
Frane Polić
3ecbec9685 feat(dashboard): inventory details variants section (#7705) 2024-06-14 11:18:23 +02:00
Riqwan Thamir
3d33f06e77 chore: upgrade jest everywhere (#7703) 2024-06-14 07:35:30 +02:00
Stevche Radevski
dd1a8e6016 fix: Sort product categories based on rank (#7702) 2024-06-13 14:35:50 +00:00
Adrien de Peretti
d2a5201eeb chore: Refactor and improve abstract module service factory (#7688)
* chore: Refactor and improve abstract module service factory

* align naming

* clean up some template args and tests

* partially migrate modules

* partially migrate modules

* migrate more modules

* migrate last modules

* fix typings

* rename interface

* rename interface

* fixes

* fixes

* rm local plain tests
2024-06-13 13:12:37 +02:00
Stevche Radevski
d862d03de0 feat: Revamp of product categories (#7695)
* feat: Normalize the categories interface to match standards

* feat: Revamp the product category implementation

* fix: Adjustments to code and tests around product categories
2024-06-13 09:10:12 +02:00
Carlos R. L. Rodrigues
75811cd4b3 feat(order): Claim and Exchange entities (#7681) 2024-06-12 14:49:15 -03:00
Adrien de Peretti
afae395fea chore: ensure the event group id is kept for async workflow (#7668)
* chore: ensure the event group id is kept for async workflow

* revert test

* fix tests

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2024-06-11 13:20:17 +02:00
Stevche Radevski
3d72002c28 fix: Remove scheduled workflows if they no longer exist when executed (#7673) 2024-06-11 12:57:25 +02:00
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
Stevche Radevski
69410162f6 feat: Add support for scheduled workflows (#7651)
We still need to:
But wanted to open the PR for early feedback on the approach
2024-06-10 14:49:52 +00:00
Oli Juhl
3f661c917b feat: Fix subscribers loading + add order <> cart link (#7617) 2024-06-09 12:31:28 +02:00
Riqwan Thamir
fbb00f3863 chore: group & release events for local eventbus (#7649)
* chore: stage & release events for local eventbus

* chore: address review

* chore: mock emitter correctly
2024-06-07 15:31:16 +02:00
Adrien de Peretti
2e77a076b8 feat: Add emitEvent step + cleanup (#7643)
* feat: Add emitEvent step + cleanup

* fix typo

* fix typo
2024-06-07 11:52:19 +02:00
Adrien de Peretti
9576de2be4 feat: emit product tags events (#7636)
**What**
emit product tags events

**note**
Stil does not take into consideration non overriden method, delete and soft delete emits event under the hood and we will have to migrate that at the end
2024-06-06 15:14:40 +00: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
Adrien de Peretti
3fbb8aa671 feat: Product module events (#7598)
WIP, not ready to review

**what**
- add events
- integration tests of emitted events
- remove integration tests on auto generated services in favor of module method integration tests
2024-06-06 11:47:38 +00:00
Kasper Fabricius Kristensen
50ce223e4b feat(types,js-sdk,medusa,fulfillment): Types and SDK methods related to Stock Locations (#7625) 2024-06-06 11:04:42 +02:00
Adrien de Peretti
da3837f2bc chore: return meta information on created/updated/deleted object from upsertWithReplace (#7616)
**What**
- Return the updated/deleted/created entities from the upsert with replace according to the configuration

This will help to emit the events from the product module as it rely on this abstraction in many places
2024-06-05 20:04:45 +00:00
Stevche Radevski
37b794b89d chore: Move upload tests to HTTP layer (#7610) 2024-06-05 12:24:33 +00:00
Harminder Virk
2b62686ec6 implement events to the pricing module (#7584) 2024-06-05 17:33:49 +05:30
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
Harminder Virk
8d9d78029b Remove redundant methods from pricing module (#7597) 2024-06-04 16:33:06 +05:30
Stevche Radevski
0929c4f457 Feat: Add product tag endpoints, move tests to HTTP folder (#7591)
* chore: Move product type tests to HTTP folder

* feat: Add product tags endpoints and move tests to HTTP folder
2024-06-04 10:56:22 +02: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
Oli Juhl
0c0c510a37 chore: Move admin region tests (#7582) 2024-06-03 14:25:43 +02:00
Oli Juhl
65d3222973 chore: Move customer + customer group integration tests and fixes issues (#7577)
* chore: Move customer + customer group and fixes issues

* remove /customer sendpoint
2024-06-03 10:52:32 +02:00
Adrien de Peretti
9608bf06ef feat: Event emitting part 1/N (Fulfillment) (#7391)
**What**
Add support for event emitting in the fulfillment module

**NOTE**
It does not include the review of the events for the abstract module factory if the method is not implemented in the module itself and rely on the default implementation
2024-06-03 08:29:35 +00:00
Carlos R. L. Rodrigues
af0140d317 feat(order): cancel fulfillment (#7573) 2024-06-02 09:33:24 -03:00
Stevche Radevski
3ede9d7863 fix: Use integer for variant and category ranks (#7572) 2024-06-01 16:25:04 +02:00