Commit Graph

160 Commits

Author SHA1 Message Date
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
Riqwan Thamir
276c8b925f chore: fix notification loader error (#7969) 2024-07-05 12:05:18 +02:00
Carlos R. L. Rodrigues
9badad24aa feat(workflows-sdk): conditional step (#7912)
* chore: move ModuleRegistrationName to utils

* chore(workflows-sdk): conditional step

* type

* when condition
2024-07-05 10:54:18 +02: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
Riqwan Thamir
0d534d4f70 fix(product): category tree breaks due to pagination limit (#7947)
what:

- when children scope beyond the pagination limit, we fail to load all descendants and ancestors
- we fix this by fetching all categories in the tree scoped by the where clause
2024-07-04 14:58:21 +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
32998b7527 fix: The table existence check should quote the table name (#7949) 2024-07-04 16:17:24 +02:00
Adrien de Peretti
7b84d854f0 Feat/mikro orm based linkable (#7944)
**What**
- Generate simple linkable for mikro orm based modules 
- fix module util
- fix joiner config builder
- fix define link relationship extension
- fix migrations not loading custom links
2024-07-04 13:30:47 +00:00
Adrien de Peretti
cb36655b63 chore: Update defineMikroOrmCliConfig api (#7940)
* chore: Update defineMikroOrmCliConfig api

* update usage
2024-07-04 12:58:43 +02:00
Carlos R. L. Rodrigues
56394fe0d4 fix(order): order list payment and fulfillment status (#7934) 2024-07-04 06:37:25 -03:00
Adrien de Peretti
41c4307fc7 feat: define link util (#7931)
* feat: define link util

* handle pluralized fieldAlias for isList

* serviceName ar reference

* finalize

* todo

* WIP

* finalize

* fix tests

* update typings

* fix Module

* linkable

* update errors
2024-07-04 10:37:30 +02:00
Stevche Radevski
012a624ee4 feat: Flatten the provider config for all modules (#7930) 2024-07-03 16:57:12 +02:00
Riqwan Thamir
b6e4435c23 chore: cleanup migrations logs (#7924)
what:

when running `medusa run migrations`, cleanup logs with short descriptive message.

Before:

<img width="1262" alt="Screenshot 2024-07-03 at 14 31 36" src="https://github.com/medusajs/medusa/assets/5105988/504e9c24-371c-476d-9b6d-2dfe1a4088dc">

After:

<img width="1004" alt="Screenshot 2024-07-03 at 14 42 57" src="https://github.com/medusajs/medusa/assets/5105988/a89eaed5-04a4-4efb-a2e9-ca480f1eaa6e">
2024-07-03 13:53:59 +00:00
Adrien de Peretti
2711012d96 feat: Make the Module require the service name (#7923)
* feat: Make the Module require the service name

* finalize types
2024-07-03 15:44:57 +02: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
19d7d01805 fix: Update stripe options input (#7919) 2024-07-03 12:51:38 +02:00
Riqwan Thamir
00ba74c71f fix: user email is set to a unique index (#7917) 2024-07-03 12:32:30 +02:00
Carlos R. L. Rodrigues
a7844efd09 chore: move ModuleRegistrationName to utils (#7911) 2024-07-03 06:30:56 -03: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
8244fe03b7 fix: Several fixes based on preview testing (#7906)
* fix: Add searchable properties on currency

* fix: Format product type dates in table

* fix: Preserve line whitespace in section row

* fix: Continue through tabs on Enter in create product form

* fix: Pagination in variant prices section

* fix: Add missing inventory edit item translation

* fix: Use the correct options URL for editing

* fix: Correctly get the variant title in inventory item details

* fix: Completely remove variant titles section in inventory item
2024-07-02 14:56:34 +02:00
Carlos R. L. Rodrigues
07715e6b50 chore(order): cancel return (#7881) 2024-07-02 06:52:58 -03:00
Harminder Virk
074e4a888e Mark keys as primary with explicit method call (#7900) 2024-07-02 13:27:21 +05:30
Carlos R. L. Rodrigues
17e6a83b59 fix(utils): joiner config from medusa project (#7896) 2024-07-01 13:48:34 -03:00
Riqwan Thamir
d58a626d0a fix: fix tabs + required fields (#7892) 2024-07-01 17:23:45 +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
9daec5d7ac chore: Migrate notification module to DML (#7835) 2024-07-01 09:17:32 +00: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
Shahed Nasser
2833e3c4d0 fix(order): set correct change type for exchanges (#7870) 2024-07-01 10:20:58 +03:00
Oli Juhl
fa6cd84049 chore: Migrate region module to use DML (#7837) 2024-06-29 13:14:52 +00:00
Oli Juhl
b1df20b0dc fix(inventory): Entity Formulas + softDelete and restore (#7851) 2024-06-26 20:51:19 +02:00
Oli Juhl
b5f248f154 fix(region): Soft deleting region unsets region on countries (#7786)
**What**

Unset `region_id` on countries when soft deleting the associated region. Otherwise, countries cannot be added to new or other regions

Alternatively, we hard delete the region, which will trigger the DB level cascade

In both cases, we cannot easily restore the region countries.
2024-06-26 16:44:16 +00:00
Carlos R. L. Rodrigues
61758f374b chore(medusa): return endpoints (#7823) 2024-06-25 13:53:18 +00:00
Carlos R. L. Rodrigues
5600e58b7f chore(orchestration): idempotent (#7771) 2024-06-25 10:34:00 -03:00
Adrien de Peretti
66d17fabde chore: rename extractor type to InferEntityType (#7829) 2024-06-25 13:43:11 +02:00
Adrien de Peretti
34c44078e7 fix: DML relation management for many to one relation ship foreign keys (#7790)
FIXES CORE-2369

cc @thetutlage 

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-06-24 18:54:54 +00:00
Oli Juhl
25210369d9 fix(utils): Uppercase event action name (#7822)
Currently, the keys of the events contain a lowercased action, e.g. `INVENTORY_ITEM_created`, which is breaking our usage across multiple modules
2024-06-24 17:43:49 +00:00
Riqwan Thamir
96fb7a962e feat(utils,currency): Migrate currency to use DML (#7807) 2024-06-24 19:07:26 +02:00
Riqwan Thamir
7414034ac4 chore: scope campaign identifier index with deleted at (#7821) 2024-06-24 18:06:14 +02:00
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