Harminder Virk
48e00169d2
breaking: move shared HTTP utils to the framework ( #9402 )
...
Fixes: FRMW-2728, FRMW-2729
After this PR gets merged the following middleware will be exported from the `@medusajs/framework/http` import path.
- applyParamsAsFilters
- clearFiltersByKey
- applyDefaultFilters
- setContext
- getQueryConfig
- httpCompression
- maybeApplyLinkFilter
- refetchEntities
- unlessPath
- validateBody
- validateQuery
Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com >
2024-10-03 09:42:00 +00:00
Harminder Virk
2d1cf12dac
feature: Add MikroORM CLI wrapper to bypass hardcoded module system ( #9426 )
...
FIXES: FRMW-2727
MikroORM (with version 5.9) has [hardcoded the TypeScript module](https://github.com/mikro-orm/mikro-orm/blob/5.x/packages/core/src/utils/ConfigurationLoader.ts#L138-L139 ) system to `commonjs`, which makes it incompatible with the module system we are using, ie `Node16`.
So, in order to continue using the Mikro ORM CLI within our modules, we will have to monkey-patch the block of code responsible for configuring `ts-node`. However, the monkey-patching must be done before their CLI gets booted.
As a result of this, we have to create a wrapper CLI on top of Mikro ORM CLI that performs the following steps.
- Monkey-patch the relevant code
- Register Mikro ORM CLI as the second step.
Due do this, we will have to use this new wrapper CLI within the modules, which is exposed as `medusa-db`. Maybe, `medusa-db` is not a great name, so please send your suggestions.
2024-10-03 04:51:20 +00:00
Frane Polić
c726ed54f5
fix(pricing): price set update deletes price list prices ( #9308 )
...
**Why**
- price set update uses `upsertWithReplace` so price list prices are removed since we "ignore" them in regular price set operations and use price list methods to manage them
**What**
- preserve price list prices when updating price sets
---
FIXES CC-516
2024-10-01 08:37:56 +00:00
Harminder Virk
48bea267dc
chore: perform dependencies scan and fix all dependencies ( #9296 )
2024-09-26 14:14:38 +05:30
Adrien de Peretti
e096feb7d5
chore: Update modules deps ( #9286 )
2024-09-26 11:14:35 +05:30
Adrien de Peretti
90d530565b
chore(): Remove default limit from the build query ( #9257 )
...
* chore(): Remove default limit from the build query
* rm take: null
* fix tests
* fix tests
* fix db usage
* fix typo
* rm unsused template arg
* fixes
* fixes
* fixes
* fixes
* fixes
* fixes
* fixes
2024-09-24 16:06:45 +02:00
Harminder Virk
9e711720dd
chore: upgrade moduleResolution to Node16 ( #9269 )
2024-09-24 17:19:20 +05:30
Frane Polić
d721282600
fix(pricing): calculate pricing repository query ( #9265 )
...
**What**
- fix wrong parentheses nesting when generating calculate pricing query
- filter out deleted price lists
- use built in DB values for time comparison
---


---
TODO:
- [x] check after price list start/end_date is modified, PL prices are not retrieved properly anymore
---
FIXES CC-518
2024-09-24 10:47:40 +00:00
Adrien de Peretti
a734184538
chore(): Handle medusa service base methods events ( #9179 )
...
* chore(): Handle medusa service base methods events
* cleanup
* cleanup
* fix import
* fix decorator order
* fixes
* apply default event emition
* fix binding
* fix binding
* align tests with new event emition
2024-09-18 17:57:00 +02:00
Adrien de Peretti
81d3ae01c7
chore: Cleanup manager decorator usage ( #9181 )
2024-09-18 14:16:20 +02:00
Adrien de Peretti
c6795dfc47
feat(modules-sdk): Parse filters based on loaded modules graph ( #9158 )
2024-09-17 14:20:04 -03:00
Carlos R. L. Rodrigues
950cf9af79
chore: remove container registration name ( #9137 )
2024-09-16 06:22:24 -03:00
Carlos R. L. Rodrigues
fdd0543011
chore: joiner config entity property ( #9084 )
2024-09-11 06:25:25 -03:00
Adrien de Peretti
2c5e72d141
feat: Application types generation from project GQL schema's ( #8995 )
2024-09-06 15:15:32 +05:30
Oli Juhl
2bacf86d3c
chore: Remove prepublishOnly script ( #8699 )
...
* wip
* wip
* verbose logging
* remove prepublish scripts
* chore: add back prepublish scripts
* wip
* remove prepublishOnly script
* chore: Clean up rest of build scripts
* add back build script
* feedback
---------
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com >
2024-08-27 10:31:38 +02:00
Carlos R. L. Rodrigues
3b4eea08ef
chore: peer dependency version ( #8771 )
...
* fix peer dependency version
* dotenv
* commands
* dotenv cli
2024-08-26 21:55:57 +02:00
Carlos R. L. Rodrigues
058378970a
chore: dependecies reorg ( #8535 )
2024-08-23 07:16:04 -03:00
Oli Juhl
2f62b47bff
fix(pricing): Calculate price sets with amount 0 ( #8622 )
2024-08-16 12:49:11 +02:00
Adrien de Peretti
4af7309170
fix: install modules-sdk for test-utils to work ( #8142 )
2024-07-16 12:00:24 +02:00
Stevche Radevski
874d511e13
feat: Add tax inclusivity management to currenices ( #8112 )
2024-07-14 18:03:44 +02:00
Carlos R. L. Rodrigues
3d7d629e75
chore(pricing): big number support ( #8113 )
2024-07-12 19:27:28 +00:00
Carlos R. L. Rodrigues
de36e2b36e
chore: rename return flow ( #8050 )
2024-07-10 08:09:10 -03:00
Stevche Radevski
1c3ef13371
feat: Add necessary middlewares for tax inclusive pricing ( #7827 )
...
We are adding tax inclusive pricing calculation when listing products.
Two things to keep in mind:
- `region_id` will be required if you request calculated prices.
- We won't accept `currency_code` anymore, as that will come from the region info (since ultimately a cart and its currency are tied to a region)
REF CORE-2376
DEPENDS ON #8003
2024-07-09 09:37:13 +00:00
Adrien de Peretti
9750047af1
chore: Rename entity to model ( #7977 )
...
**What**
Start renaming `entity` to `model`
2024-07-08 07:43:49 +00:00
Adrien de Peretti
b368251ca3
chore: Migrate modules to use the Module util ( #7964 )
...
**What**
Apply the `Module` util to each module to handle the export and provide the linkable configuration object.
- Most joiner config that does not have any special config are removed/cleaned up in favor of the autogenerated one or simpler one
- linkable are now available in all modules
- cleaned up the dependencies of the modules
FIXES CORE-2410
2024-07-05 13:00:40 +00:00
Adrien de Peretti
f4dd390ab1
chore: Apply defineMikroOrmCliConfig ( #7975 )
...
**What**
Ensure all module rely on the same config for the dev db
FIXES CORE-2493
2024-07-05 11:10:03 +00:00
Stevche Radevski
3e86cb6ac3
feat: Add HTTP endpoints and workflows for price preference management ( #7960 )
...
REF CORE-2376
Remaining pieces are adding UI to manage the flag, showing the flag in price editor, plugging it in cart calculations, and https://github.com/medusajs/medusa/pull/7827
2024-07-05 08:47:01 +00:00
Stevche Radevski
5544303b91
feat: Add support for managing tax inclusivity ( #7943 )
...
UI / HTTP / Workflows will come in separate PRs
REF CORE-2376
2024-07-04 14:50:09 +00:00
Adrien de Peretti
617a5972bf
feat: refactor module joiner config and links generation ( #7859 )
...
* feat: refactor module joiner config and links generation
* improve typings
* WIP
* WIP
* WIP
* rename type file
* create link config
* finish typings and add utils
* improve links
* WIP typings
* finalize ExportModule utils
* finalize ExportModule utils
* fix: dml tests
* improve and fixes
* simplify typings with id changes
* add toJSON
* multiple fixes and entity builder fixes
* fix currency searchable
* fix tests
* medusa service refactoring
* cleanup
* cleanup and fixes
* make module name optional
* renaming
---------
Co-authored-by: Harminder Virk <virk.officials@gmail.com >
2024-07-03 13:12:49 +02:00
Stevche Radevski
b4aa7fb9a7
fix: Disallow creating duplicate prices ( #7866 )
...
* fix: Disallow creating duplicate prices
* fix: Don't pass id to manager create in upsertWithReplace
2024-07-02 17:06:58 +02:00
Stevche Radevski
5c7c28709f
fix: Only list price set prices when calling the price set methods ( #7889 )
...
FIXES CORE-2417
2024-07-01 14:24:14 +00:00
Stevche Radevski
63e64e738a
fix: Return null for calculated price if no prices are defined ( #7886 )
2024-07-01 15:09:21 +02:00
Stevche Radevski
c661180c44
feat: Completely revamp the pricing module ( #7852 )
...
* feat: Completely revamp the pricing module
* chore: Update all places to the new pricing interfaces
* fix: Remove unnecessary join to itself
* chore: Add data migration for existing users
* fix: Apply the correct index to price rule
2024-07-01 09:47:03 +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
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
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
Carlos R. L. Rodrigues
12a57836a7
fix(pricing): Only get prices from active price list ( #7753 )
2024-06-17 20:18:08 +02:00
Riqwan Thamir
3d33f06e77
chore: upgrade jest everywhere ( #7703 )
2024-06-14 07:35:30 +02: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
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
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
Harminder Virk
2b62686ec6
implement events to the pricing module ( #7584 )
2024-06-05 17:33:49 +05:30
Harminder Virk
8d9d78029b
Remove redundant methods from pricing module ( #7597 )
2024-06-04 16:33:06 +05:30
Carlos R. L. Rodrigues
122186a78d
chore(order): cancel order ( #7586 )
2024-06-03 12:31:33 -03: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
9dae86daa2
chore: es target 2021 ( #7325 )
2024-05-14 08:07:14 -03:00