Commit Graph

142 Commits

Author SHA1 Message Date
Riqwan Thamir
fb2e86484a feat(core-flows,types,cart): add credit lines to cart (#11419)
* feat(core-flows,types,cart): add credit lines to cart

* chore: fix specs

* chore: credit lines hook

* chore: update types

* chore: added credit line totals

* chore: add totals fields to query config

* chore: add complete cart hook

* chore: add credit lines creation to order

* chore: pr ready for review

* chore: fix tests

* Apply suggestions from code review

* chore: fix types

* chore: adjust summary calculations with new totals
2025-02-24 14:34:36 +01:00
olivermrbl
3f7470022c chore: Version packages 2025-02-24 11:36:46 +01:00
Carlos R. L. Rodrigues
0c957350a6 fix(order): calculate taxes on order edit flows (#11518)
* fix(order): calcualte taxes on order edit flows

* merge summary

* tests

* fix pending difference

* comments

* claim test

* revert method
2025-02-21 15:27:40 +01:00
olivermrbl
682dcf6507 chore: Version packages 2025-02-11 12:00:43 +01:00
Oli Juhl
db03738b5f chore: Revert version range to ^ (#11390) 2025-02-11 11:35:25 +01:00
Harminder Virk
016e332e9b feat: make AbstractModuleService create method type-safe (#11216) 2025-02-03 21:25:01 +05:30
Shahed Nasser
16fe43f214 fix(order): add data model name in define schema (#11181)
Add missing data model name in `model.define` in the Order Module where missing, as we need to infer the names in the references we generate

Closes DX-1305
2025-01-29 10:53:13 +00:00
olivermrbl
986ee8008e chore: Version packages 2025-01-27 09:35:06 +01:00
Adrien de Peretti
9321920227 fix: Medusa package version should use ~ instead of ^ (#11077)
RESOLVES FRMW-2859
2025-01-22 15:15:30 +00:00
Carlos R. L. Rodrigues
cc73802ab3 chore(order): dml (#10292)
* ../../core/types/src/dml/index.ts

* ../../core/types/src/dml/index.ts

* fix: relationships mapping

* handle nullable foreign keys types

* handle nullable foreign keys types

* handle nullable foreign keys types

* continue to update product category repository

* fix all product category repositories issues

* fix product category service types

* fix product module service types

* fix product module service types

* fix repository template type

* refactor: use a singleton DMLToMikroORM factory instance

Since the MikroORM MetadataStorage is global, we will also have to turn DML
to MikroORM entities conversion use a global bucket as well

* refactor: update product module to use DML in tests

* wip: tests

* WIP product linkable fixes

* continue type fixing and start test fixing

* test: fix more tests

* fix repository

* fix pivot table computaion + fix mikro orm repository

* fix many to many management and configuration

* fix many to many management and configuration

* fix many to many management and configuration

* update product tag relation configuration

* Introduce experimental dml hooks to fix some issues with categories

* more fixes

* fix product tests

* add missing id prefixes

* fix product category handle management

* test: fix more failing tests

* test: make it all green

* test: fix breaking tests

* fix: build issues

* fix: build issues

* fix: more breaking tests

* refactor: fix issues after merge

* refactor: fix issues after merge

* refactor: surpress types error

* test: fix DML failing tests

* improve many to many inference + tests

* Wip fix columns from product entity

* remove product model before create hook and manage handle validation and transformation at the service level

* test: fix breaking unit tests

* fix: product module service to not update handle on product update

* fix define link and joiner config

* test: fix joiner config test

* test: fix joiner config test

* fix joiner config primary keys

* Fix joiner config builder

* Fix joiner config builder

* test: remove only modifier from test

* refactor: remove hooks usage from product collection

* refactor: remove hooks usage from product-option

* refactor: remove hooks usage for computing category handle

* refactor: remove hooks usage from productCategory model

* refactor: remove hooks from DML

* refactor: remove cruft

* order dml

* cleanup

* re add foerign key indexes

* wip

* chore: remove unused types

* wip

* changes

* rm raw

* autoincrement

* wip

* rel

* refactor: cleanup

* migration and models configuration adjustments

* cleanup

* number searchable

* fix random ordering

* fix

* test: fix product-category tests

* test: update breaking DML tests

* test: array assertion to not care about ordering

* fix: temporarily apply id ordering for products

* types

* wip

* WIP type improvements

* update order models

* partially fix types temporarely

* rel

* fix: recursive type issue

* improve type inference breaks

* improve type inference breaks

* update models

* rm nullable

* default value

* repository

* update default value handling

* fix unit tests

* WIP

* toMikroORM

* fix relations

* cascades

* fix

* experimental dml hooks

* rm migration

* serial

* nullable autoincrement

* fix model

* model changes

* fix one to one DML

* order test

* fix addresses

* fix unit tests

* Re align dml entity name inference

* update model table name config

* update model table name config

* revert

* update return relation

* WIP

* hasOne

* models

* fix

* model

* initial commit

* cart service

* order module

* utils unit test

* index engine

* changeset

* merge

* fix hasOne with fk

* update

* free text filter per entity

* tests

* prod category

* property string many to many

* fix big number

* link modules migration set names

* merge

* shipping option rules

* serializer

* unit test

* fix test mikro orm init

* fix test mikro orm init

* Maintain merge object properties

* fix test mikro orm init

* prevent unit test from connecting to db

* wip

* fix test

* fix test

* link test

* schema

* models

* auto increment

* hook

* model hooks

* order

* wip

* orm version

* request return field

* fix return configuration on order model

* workflows

* core flows

* unit test

* test

* base repo

* test

* base repo

* test fix

* inventory move

* locking inventory

* test

* free text fix

* rm timeout mock

* migrate fulfillment values

* v6.4.3

* cleanup

* link-modules update sql

* revert test

* remove fake timers

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
Co-authored-by: Harminder Virk <virk.officials@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-01-21 08:04:47 -05:00
olivermrbl
57e9a7a5bf chore: Version packages 2025-01-20 07:41:15 -05:00
olivermrbl
efe141f54b chore: Version packages 2025-01-17 10:29:04 -05:00
Rahul R.
ecf73780e0 [Fix] Update Repository Directory Paths for All Packages (#10910)
This PR updates the `repository.directory` field in the `package.json` files for packages located within the `modules` folder.
2025-01-13 12:49:50 +01:00
olivermrbl
3919b26eb6 chore: Version packages 2025-01-07 13:31:40 +01:00
Riqwan Thamir
47594192b7 feat(dashboard,core-flows,types,utils,medusa): Order cancelations will refund payments (#10667)
* feat(order, types): Add Credit Line to order module

* chore: add action to inject credit lines

* WIP

* chore: add fixes + observe

* chore: fix balances

* chore: add canceled badge

* chore: fix i18n schema

* chore: remove redunddant query

* chore: add changeset

* chore: add credit lines for all cancel cases

* chore: add accounting total

* chore: address review & cleanup
2025-01-07 07:56:28 +01:00
olivermrbl
348f866ffe chore: Version packages 2024-12-20 11:25:36 +01:00
Riqwan Thamir
3f4d574748 feat(order, types): Add Credit Line to order module (#10636)
* feat(order, types): Add Credit Line to order module

* chore: add action to inject credit lines
2024-12-19 10:36:59 +01:00
olivermrbl
a391a29aa8 chore: Version packages 2024-12-17 14:41:05 +01:00
olivermrbl
0e342b491d chore: Version packages 2024-12-10 14:01:50 +01:00
olivermrbl
4723acd949 chore: Version packages 2024-12-04 18:36:57 +01:00
Frane Polić
340769595a feat(admin, js-sdk, types): update order forms (#10418)
* feat: edit shipping, billing and email forms

* feat: timeline history, update change model, update tests

* fix: address comments

* fix: invalidation, translation schema, update label

* fix: old/new
2024-12-04 14:56:40 +01:00
Frane Polić
ab948b7c65 feat(core-flows,medusa,order,types): update orders (#10373)
**What**
- add order update endpoint
- add workflows and steps for updating orders
- add `registerChanges` method to Order module + workflow step

---

CLOSES CMRC-633
2024-12-03 17:15:26 +00:00
Frane Polić
805fe4b1db fix(order): archive order status update (#10340)
**What**
- array was passed as an id when updating order status upon archive

---

RESOLVES SUP-305
CLOSES https://github.com/medusajs/medusa/issues/10328
2024-11-28 16:51:02 +00:00
olivermrbl
e9c1b1127e chore: Version packages 2024-11-27 15:40:07 +01:00
Harminder Virk
9f204817b0 feat: convert MikroORM entities to DML entities (#10043)
* feat: convert MikroORM entities to DML entities

* feat: wip on repository changes

* continue repositories and types rework

* fix order repository usage

* continue to update product category repository

* Add foreign key as part of the inferred DML type

* ../../core/types/src/dml/index.ts

* ../../core/types/src/dml/index.ts

* fix: relationships mapping

* handle nullable foreign keys types

* handle nullable foreign keys types

* handle nullable foreign keys types

* continue to update product category repository

* fix all product category repositories issues

* fix product category service types

* fix product module service types

* fix product module service types

* fix repository template type

* refactor: use a singleton DMLToMikroORM factory instance

Since the MikroORM MetadataStorage is global, we will also have to turn DML
to MikroORM entities conversion use a global bucket as well

* refactor: update product module to use DML in tests

* wip: tests

* WIP product linkable fixes

* continue type fixing and start test fixing

* test: fix more tests

* fix repository

* fix pivot table computaion + fix mikro orm repository

* fix many to many management and configuration

* fix many to many management and configuration

* fix many to many management and configuration

* update product tag relation configuration

* Introduce experimental dml hooks to fix some issues with categories

* more fixes

* fix product tests

* add missing id prefixes

* fix product category handle management

* test: fix more failing tests

* test: make it all green

* test: fix breaking tests

* fix: build issues

* fix: build issues

* fix: more breaking tests

* refactor: fix issues after merge

* refactor: fix issues after merge

* refactor: surpress types error

* test: fix DML failing tests

* improve many to many inference + tests

* Wip fix columns from product entity

* remove product model before create hook and manage handle validation and transformation at the service level

* test: fix breaking unit tests

* fix: product module service to not update handle on product update

* fix define link and joiner config

* test: fix joiner config test

* test: fix joiner config test

* fix joiner config primary keys

* Fix joiner config builder

* Fix joiner config builder

* test: remove only modifier from test

* refactor: remove hooks usage from product collection

* refactor: remove hooks usage from product-option

* refactor: remove hooks usage for computing category handle

* refactor: remove hooks usage from productCategory model

* refactor: remove hooks from DML

* refactor: remove cruft

* cleanup

* re add foerign key indexes

* chore: remove unused types

* refactor: cleanup

* migration and models configuration adjustments

* cleanup

* fix random ordering

* fix

* test: fix product-category tests

* test: update breaking DML tests

* test: array assertion to not care about ordering

* fix: temporarily apply id ordering for products

* fix ordering

* fix ordering remove logs

---------

Co-authored-by: adrien2p <adrien.deperetti@gmail.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-11-26 20:01:02 +05:30
olivermrbl
ccf4e801f3 chore: Version packages 2024-11-25 12:14:36 +01:00
olivermrbl
4245312d8d chore: Version packages 2024-11-25 09:57:00 +01:00
Frane Polić
36460a3a07 feat(medusa, types, utils, core-flows, order) request & accept order transfer (#10106)
**What**
- add request order transfer workflow
- add admin endpoint for transferring an order to a customer
- accept order transfer storefront endpoint
- accept transfer workflow
- changes in the order module to introduce new change and action types

---

**Note**
- we return 400 instead 409 currently if there is already an active order edit, I will revisit this in a followup
- endpoint for requesting order transfer from the storefront will be added in a separate PR

---

RESOLVES CMRC-701
RESOLVES CMRC-703
RESOLVES CMRC-704
RESOLVES CMRC-705
2024-11-19 08:53:22 +00:00
Adrien de Peretti
2822972e04 fix(product): wrong snapshot name and inexistent script (#10119)
* chore(product): Rename wrong snapshot name and add missing elements

* rm non existing command

* Create proud-pigs-deny.md
2024-11-15 15:53:41 +01:00
olivermrbl
d5605656ae chore: Version packages 2024-11-12 10:10:07 +01:00
olivermrbl
ecece05b72 chore: Version packages 2024-11-11 10:58:20 +01:00
olivermrbl
8feb589659 chore: Release 2024-11-06 21:47:01 +01:00
Oli Juhl
505768dd9f fix: Product type tax overrides (#9951)
* fix: Make product type tax override work

* fix: Make product type tax override work
2024-11-06 20:33:40 +01:00
olivermrbl
4ccab16336 chore: Version packages 2024-10-25 17:19:36 +02:00
olivermrbl
2fbebb60e3 chore: Release 2024-10-22 20:43:47 +02:00
Oli Juhl
c3418a2b93 chore: Prepare versions + changeset (#9707)
* chore: Prepare version + changeset

* chore: Bump dependencies

* chore: Update lock-file
2024-10-22 20:31:33 +02:00
Carlos R. L. Rodrigues
2a98be6b65 feat(medusa): ordem items endpoint (#9646) 2024-10-18 05:59:24 -03:00
Harminder Virk
68560787e5 breaking: rename package names to be consistent and under @medusajs scope (#9580) 2024-10-16 22:28:09 +05:30
Riqwan Thamir
537567b679 chore: add compare_at_unit_price when price list price is retrieved (#9564)
* chore: add compare_at_unit_price when price list price is retrieved

* chore: add test for update item + more fixes along the way

* chore: fix tests

* chore: add refresh spec

* Apply suggestions from code review

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

* chore: use undefined checker

* chore: switch to map

---------

Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com>
2024-10-15 13:05:14 +02:00
Adrien de Peretti
1d8939df3a chore(): Allow to register modules through array (#9522) 2024-10-11 15:17:00 +02:00
Carlos R. L. Rodrigues
4daf57dc1f fix(order): undo order change (#9497)
FIXES: CC-573

Co-authored-by: Frane Polić <16856471+fPolic@users.noreply.github.com>
2024-10-09 11:50:50 +00:00
Carlos R. L. Rodrigues
8fbef8a667 fix(order): searchable fields (#9493)
FIXES: TRI-353
2024-10-07 17:45:20 +00:00
Riqwan Thamir
70564c3c66 fix(medusa): use transform order for store order endpoints (#9489)
* fix(medusa): use transform order for store order endpoints

* chore: update amount when unit price is present
2024-10-07 13:55:06 +02:00
Riqwan Thamir
2d1f4bcabc feat(dashboard,core-flows,types,order): change order accepts price updates (#9476)
* chore: change order can accept price updates

* chore: add changes to transformed order

* chore: fix transform

* chore: transform raw unit price
2024-10-07 10:54:21 +02:00
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
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