Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(order): dml #10292

Draft
wants to merge 236 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
236 commits
Select commit Hold shift + click to select a range
57a2562
feat: convert MikroORM entities to DML entities
thetutlage Nov 12, 2024
27ea828
feat: wip on repository changes
thetutlage Nov 12, 2024
afd19d2
continue repositories and types rework
adrien2p Nov 12, 2024
693c016
fix order repository usage
adrien2p Nov 12, 2024
b42b180
continue to update product category repository
adrien2p Nov 12, 2024
34c8b4c
Add foreign key as part of the inferred DML type
adrien2p Nov 12, 2024
74f67f0
../../core/types/src/dml/index.ts
adrien2p Nov 12, 2024
af6ea07
../../core/types/src/dml/index.ts
adrien2p Nov 12, 2024
9200ccf
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 13, 2024
5f57aec
fix: relationships mapping
thetutlage Nov 13, 2024
4a4c9a1
handle nullable foreign keys types
adrien2p Nov 13, 2024
f2c6f7e
handle nullable foreign keys types
adrien2p Nov 13, 2024
8e18193
handle nullable foreign keys types
adrien2p Nov 13, 2024
b28e016
continue to update product category repository
adrien2p Nov 13, 2024
a6a02c2
fix all product category repositories issues
adrien2p Nov 13, 2024
7c46858
fix product category service types
adrien2p Nov 13, 2024
9286e06
fix product module service types
adrien2p Nov 13, 2024
1db0746
fix product module service types
adrien2p Nov 13, 2024
c752d11
fix repository template type
adrien2p Nov 13, 2024
ba6bf6e
refactor: use a singleton DMLToMikroORM factory instance
thetutlage Nov 14, 2024
ce5e494
refactor: update product module to use DML in tests
thetutlage Nov 14, 2024
7512300
wip: tests
thetutlage Nov 14, 2024
5c0ad12
WIP product linkable fixes
adrien2p Nov 14, 2024
e6ec086
continue type fixing and start test fixing
adrien2p Nov 14, 2024
7334c33
test: fix more tests
thetutlage Nov 14, 2024
19ac9d4
fix repository
adrien2p Nov 14, 2024
7f4fd67
fix pivot table computaion + fix mikro orm repository
adrien2p Nov 14, 2024
8d53b32
fix many to many management and configuration
adrien2p Nov 14, 2024
ddb994a
fix many to many management and configuration
adrien2p Nov 14, 2024
dd5f67e
fix many to many management and configuration
adrien2p Nov 15, 2024
f77402d
update product tag relation configuration
adrien2p Nov 15, 2024
ec677fb
Introduce experimental dml hooks to fix some issues with categories
adrien2p Nov 15, 2024
c750b81
more fixes
adrien2p Nov 15, 2024
25ac61c
fix product tests
adrien2p Nov 15, 2024
bb8aaed
add missing id prefixes
adrien2p Nov 15, 2024
17fef8c
fix product category handle management
adrien2p Nov 15, 2024
b80e090
test: fix more failing tests
thetutlage Nov 15, 2024
3ab6945
test: make it all green
thetutlage Nov 15, 2024
7213140
resolve conflicts
adrien2p Nov 15, 2024
7ff10fb
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 18, 2024
1c962b0
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 19, 2024
f9e75c8
test: fix breaking tests
thetutlage Nov 19, 2024
ce2c02a
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 19, 2024
a30cbf6
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 19, 2024
8975cfb
fix: build issues
thetutlage Nov 19, 2024
1fd1f1b
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 19, 2024
09ad177
fix: build issues
thetutlage Nov 19, 2024
4a33215
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 19, 2024
7b981ab
fix: more breaking tests
thetutlage Nov 19, 2024
c87d157
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 19, 2024
348b53d
refactor: fix issues after merge
thetutlage Nov 19, 2024
f589f7c
refactor: fix issues after merge
thetutlage Nov 19, 2024
44b06ad
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 20, 2024
6452a64
refactor: surpress types error
thetutlage Nov 20, 2024
f5ebc5d
test: fix DML failing tests
thetutlage Nov 20, 2024
3aac614
improve many to many inference + tests
adrien2p Nov 20, 2024
c8c7682
resolve conflicts
adrien2p Nov 20, 2024
7241d91
Wip fix columns from product entity
adrien2p Nov 20, 2024
2ced83b
remove product model before create hook and manage handle validation …
adrien2p Nov 20, 2024
09551c3
test: fix breaking unit tests
thetutlage Nov 21, 2024
6d33f52
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 21, 2024
ed8d0ec
fix: product module service to not update handle on product update
thetutlage Nov 21, 2024
06b1b28
fix define link and joiner config
adrien2p Nov 21, 2024
ecc5c1d
Merge branch 'develop' into feat/product-module-dml-migration
adrien2p Nov 21, 2024
933ea9a
test: fix joiner config test
thetutlage Nov 21, 2024
79301f2
test: fix joiner config test
thetutlage Nov 21, 2024
52c214b
fix joiner config primary keys
adrien2p Nov 21, 2024
7a7cee2
Merge branch 'develop' into feat/product-module-dml-migration
adrien2p Nov 21, 2024
9c0d566
Fix joiner config builder
adrien2p Nov 21, 2024
4172582
Merge branch 'develop' into feat/product-module-dml-migration
adrien2p Nov 21, 2024
4986cae
Fix joiner config builder
adrien2p Nov 21, 2024
71eaaae
Merge branch 'develop' into feat/product-module-dml-migration
adrien2p Nov 21, 2024
c2914c6
test: remove only modifier from test
thetutlage Nov 22, 2024
402fe53
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 22, 2024
d033343
refactor: remove hooks usage from product collection
thetutlage Nov 22, 2024
6fb31fb
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 22, 2024
e5bf1c8
refactor: remove hooks usage from product-option
thetutlage Nov 22, 2024
819b4c1
refactor: remove hooks usage for computing category handle
thetutlage Nov 22, 2024
b127543
refactor: remove hooks usage from productCategory model
thetutlage Nov 22, 2024
4094dda
refactor: remove hooks from DML
thetutlage Nov 22, 2024
b38f85e
refactor: remove cruft
thetutlage Nov 22, 2024
d6b994b
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 22, 2024
ccd5d9b
order dml
carlos-r-l-rodrigues Nov 22, 2024
b700c63
cleanup
adrien2p Nov 22, 2024
21ab7a1
re add foerign key indexes
adrien2p Nov 22, 2024
f9b9068
wip
carlos-r-l-rodrigues Nov 22, 2024
1ac18ee
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 22, 2024
4a831fd
chore: remove unused types
thetutlage Nov 22, 2024
962ac0d
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 22, 2024
6ae6099
wip
carlos-r-l-rodrigues Nov 22, 2024
f6143e1
changes
carlos-r-l-rodrigues Nov 22, 2024
a4555d1
rm raw
carlos-r-l-rodrigues Nov 22, 2024
b816d56
autoincrement
carlos-r-l-rodrigues Nov 22, 2024
27b3a4f
wip
carlos-r-l-rodrigues Nov 22, 2024
0ca6939
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 22, 2024
894ae70
Merge branch 'feat/product-module-dml-migration' of https://github.co…
carlos-r-l-rodrigues Nov 22, 2024
02c08be
rel
carlos-r-l-rodrigues Nov 22, 2024
af8a543
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 25, 2024
bfe6702
refactor: cleanup
thetutlage Nov 25, 2024
bf63323
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 25, 2024
974be36
migration and models configuration adjustments
adrien2p Nov 25, 2024
35a6080
resolve conflicts
adrien2p Nov 25, 2024
57a47b2
Merge branch 'feat/product-module-dml-migration' of https://github.co…
carlos-r-l-rodrigues Nov 25, 2024
dc29b25
cleanup
adrien2p Nov 25, 2024
7938a5f
number searchable
carlos-r-l-rodrigues Nov 25, 2024
7e8785d
Merge branch 'feat/product-module-dml-migration' of https://github.co…
carlos-r-l-rodrigues Nov 25, 2024
e0d3ac0
fix random ordering
adrien2p Nov 25, 2024
6cc267b
fix
adrien2p Nov 25, 2024
f49c6c3
Merge branch 'develop' into feat/product-module-dml-migration
adrien2p Nov 25, 2024
25d9f27
Merge branch 'develop' into feat/product-module-dml-migration
thetutlage Nov 25, 2024
7c1631a
test: fix product-category tests
thetutlage Nov 25, 2024
206254f
test: update breaking DML tests
thetutlage Nov 25, 2024
35b1591
test: array assertion to not care about ordering
thetutlage Nov 25, 2024
9fb0549
fix: temporarily apply id ordering for products
thetutlage Nov 25, 2024
9b814d8
Merge branch 'develop' into feat/product-module-dml-migration
olivermrbl Nov 25, 2024
1374b9b
types
carlos-r-l-rodrigues Nov 25, 2024
2d2be49
Merge branch 'feat/product-module-dml-migration' of https://github.co…
carlos-r-l-rodrigues Nov 25, 2024
abc7d7a
wip
carlos-r-l-rodrigues Nov 26, 2024
eb693fe
WIP type improvements
adrien2p Nov 26, 2024
558042b
update order models
adrien2p Nov 26, 2024
b9a5240
partially fix types temporarely
adrien2p Nov 26, 2024
c2c07a3
rel
carlos-r-l-rodrigues Nov 26, 2024
2516c49
Merge branch 'develop' of https://github.com/medusajs/medusa into cho…
carlos-r-l-rodrigues Nov 26, 2024
5fa4e1d
fix: recursive type issue
thetutlage Nov 27, 2024
1e53148
improve type inference breaks
adrien2p Nov 27, 2024
60d1d24
improve type inference breaks
adrien2p Nov 27, 2024
8bb3f15
update models
adrien2p Nov 27, 2024
7c0a1d5
rm nullable
carlos-r-l-rodrigues Nov 27, 2024
02f4878
default value
carlos-r-l-rodrigues Nov 27, 2024
0e8374a
Merge branch 'develop' of https://github.com/medusajs/medusa into cho…
carlos-r-l-rodrigues Nov 27, 2024
903f585
repository
carlos-r-l-rodrigues Nov 27, 2024
e0c17cd
Merge branch 'develop' into chore/order-dml
adrien2p Nov 28, 2024
b793dc9
update default value handling
adrien2p Nov 28, 2024
45e4dfc
fix unit tests
adrien2p Nov 28, 2024
7bdfbb1
WIP
adrien2p Nov 28, 2024
15f2dcd
toMikroORM
carlos-r-l-rodrigues Nov 28, 2024
a6e1dbf
fix relations
adrien2p Nov 28, 2024
3be553b
cascades
carlos-r-l-rodrigues Nov 28, 2024
0888a6d
fix
adrien2p Nov 29, 2024
a351e45
Merge branch 'chore/order-dml' of https://github.com/medusajs/medusa …
carlos-r-l-rodrigues Nov 29, 2024
4aee038
experimental dml hooks
adrien2p Nov 15, 2024
bf1b50e
rm migration
carlos-r-l-rodrigues Nov 29, 2024
b7d5de9
Merge branch 'develop' of https://github.com/medusajs/medusa into cho…
carlos-r-l-rodrigues Nov 29, 2024
f84dd39
serial
carlos-r-l-rodrigues Nov 29, 2024
05699b3
nullable autoincrement
carlos-r-l-rodrigues Nov 29, 2024
2b68956
fix model
carlos-r-l-rodrigues Nov 29, 2024
e8635ed
Merge branch 'develop' into chore/order-dml
carlos-r-l-rodrigues Nov 29, 2024
7b5d65b
model changes
carlos-r-l-rodrigues Dec 2, 2024
14c6955
resolve conflicts
adrien2p Dec 2, 2024
5be3cee
fix one to one DML
adrien2p Dec 2, 2024
8e06ebe
order test
carlos-r-l-rodrigues Dec 2, 2024
236ba43
fix addresses
adrien2p Dec 3, 2024
0c32e2e
fix unit tests
adrien2p Dec 3, 2024
5385fbc
Re align dml entity name inference
adrien2p Dec 3, 2024
c45ee31
update model table name config
adrien2p Dec 3, 2024
e5a637d
update model table name config
adrien2p Dec 3, 2024
e16bcd6
Merge branch 'develop' into chore/order-dml
adrien2p Dec 3, 2024
f4361d9
revert
adrien2p Dec 3, 2024
f6c6475
update return relation
adrien2p Dec 3, 2024
2285bb2
WIP
adrien2p Dec 3, 2024
d3e2112
hasOne
carlos-r-l-rodrigues Dec 4, 2024
c498307
Merge branch 'develop' into chore/order-dml
carlos-r-l-rodrigues Dec 4, 2024
96b20ae
models
carlos-r-l-rodrigues Dec 4, 2024
265229d
Merge branch 'develop' of https://github.com/medusajs/medusa into cho…
carlos-r-l-rodrigues Dec 10, 2024
e1311f0
fix
carlos-r-l-rodrigues Dec 10, 2024
f0c3f92
model
carlos-r-l-rodrigues Dec 11, 2024
a79d148
initial commit
carlos-r-l-rodrigues Dec 16, 2024
70e7fb1
Merge branch 'develop' of https://github.com/medusajs/medusa into cho…
carlos-r-l-rodrigues Dec 17, 2024
66f48d0
cart service
carlos-r-l-rodrigues Dec 17, 2024
666f219
order module
carlos-r-l-rodrigues Dec 17, 2024
4808b37
utils unit test
carlos-r-l-rodrigues Dec 17, 2024
c4d93dc
index engine
carlos-r-l-rodrigues Dec 18, 2024
e934d21
changeset
carlos-r-l-rodrigues Dec 18, 2024
ee26f2b
Merge branch 'develop' of https://github.com/medusajs/medusa into cho…
carlos-r-l-rodrigues Dec 18, 2024
1c55990
merge
carlos-r-l-rodrigues Dec 18, 2024
d4e2afc
fix hasOne with fk
carlos-r-l-rodrigues Dec 18, 2024
986dd45
update
carlos-r-l-rodrigues Dec 18, 2024
4c8235c
Merge branch 'develop' of https://github.com/medusajs/medusa into cho…
carlos-r-l-rodrigues Dec 19, 2024
cd75aa0
free text filter per entity
carlos-r-l-rodrigues Dec 19, 2024
40f6a2b
tests
carlos-r-l-rodrigues Dec 19, 2024
30ebace
Merge branch 'develop' into chore/mikro-orm-6
carlos-r-l-rodrigues Dec 19, 2024
63fcdf5
prod category
carlos-r-l-rodrigues Dec 19, 2024
1a18a43
property string many to many
carlos-r-l-rodrigues Dec 19, 2024
27111f7
fix big number
carlos-r-l-rodrigues Dec 19, 2024
65be12d
link modules migration set names
carlos-r-l-rodrigues Dec 20, 2024
a38bf25
Merge branch 'develop' of https://github.com/medusajs/medusa into cho…
carlos-r-l-rodrigues Dec 20, 2024
1e203d0
merge
carlos-r-l-rodrigues Dec 20, 2024
a623e68
shipping option rules
carlos-r-l-rodrigues Dec 20, 2024
ca2cacf
serializer
carlos-r-l-rodrigues Dec 20, 2024
7a784e6
unit test
carlos-r-l-rodrigues Dec 20, 2024
2f43720
fix test mikro orm init
adrien2p Dec 20, 2024
024bea6
Merge branch 'chore/mikro-orm-6' of github.com:medusajs/medusa into c…
adrien2p Dec 20, 2024
eabe606
fix test mikro orm init
adrien2p Dec 20, 2024
c8f0962
Merge branch 'chore/mikro-orm-6' of https://github.com/medusajs/medus…
carlos-r-l-rodrigues Dec 20, 2024
6c6caac
Maintain merge object properties
adrien2p Dec 20, 2024
2568185
fix test mikro orm init
adrien2p Dec 20, 2024
e827a9f
prevent unit test from connecting to db
adrien2p Dec 20, 2024
a98476c
wip
carlos-r-l-rodrigues Dec 20, 2024
dddd0fb
Merge branch 'chore/mikro-orm-6' of https://github.com/medusajs/medus…
carlos-r-l-rodrigues Dec 20, 2024
a842d14
fix test
carlos-r-l-rodrigues Dec 20, 2024
88dcd49
fix test
carlos-r-l-rodrigues Dec 20, 2024
b3a346d
Merge branch 'chore/mikro-orm-6' of https://github.com/medusajs/medus…
carlos-r-l-rodrigues Dec 20, 2024
0548870
link test
carlos-r-l-rodrigues Dec 20, 2024
4028119
Merge branch 'chore/mikro-orm-6' of https://github.com/medusajs/medus…
carlos-r-l-rodrigues Dec 20, 2024
a8b6c07
schema
carlos-r-l-rodrigues Dec 20, 2024
f25cf28
models
carlos-r-l-rodrigues Dec 20, 2024
261d723
auto increment
carlos-r-l-rodrigues Dec 20, 2024
f5c5f17
Merge branch 'develop' into chore/mikro-orm-6
carlos-r-l-rodrigues Dec 20, 2024
72c2c07
Merge branch 'chore/mikro-orm-6' of https://github.com/medusajs/medus…
carlos-r-l-rodrigues Dec 20, 2024
2a37ce3
hook
carlos-r-l-rodrigues Dec 20, 2024
0ed533a
model hooks
carlos-r-l-rodrigues Dec 20, 2024
5ae3a0c
order
carlos-r-l-rodrigues Dec 21, 2024
dc83bdc
wip
carlos-r-l-rodrigues Jan 6, 2025
deef4af
Merge branch 'develop' of https://github.com/medusajs/medusa into cho…
carlos-r-l-rodrigues Jan 6, 2025
18549f9
orm version
carlos-r-l-rodrigues Jan 6, 2025
8ae22b7
Merge branch 'chore/mikro-orm-6' of https://github.com/medusajs/medus…
carlos-r-l-rodrigues Jan 6, 2025
2862b97
Merge branch 'develop' into chore/mikro-orm-6
carlos-r-l-rodrigues Jan 6, 2025
cf7fb01
Merge branch 'chore/mikro-orm-6' of https://github.com/medusajs/medus…
carlos-r-l-rodrigues Jan 6, 2025
f4c5d0c
request return field
carlos-r-l-rodrigues Jan 6, 2025
5c0d897
fix return configuration on order model
adrien2p Jan 7, 2025
a708664
workflows
carlos-r-l-rodrigues Jan 7, 2025
5dd6b53
core flows
carlos-r-l-rodrigues Jan 8, 2025
4893483
Merge branch 'develop' of https://github.com/medusajs/medusa into cho…
carlos-r-l-rodrigues Jan 8, 2025
c73ebbf
unit test
carlos-r-l-rodrigues Jan 8, 2025
824dfdb
test
carlos-r-l-rodrigues Jan 9, 2025
815383d
base repo
carlos-r-l-rodrigues Jan 9, 2025
656d831
test
carlos-r-l-rodrigues Jan 9, 2025
fa36673
base repo
carlos-r-l-rodrigues Jan 9, 2025
96b4892
test fix
carlos-r-l-rodrigues Jan 9, 2025
feeed01
inventory move
carlos-r-l-rodrigues Jan 9, 2025
1bd1a64
locking inventory
carlos-r-l-rodrigues Jan 9, 2025
605b79c
Merge branch 'develop' into chore/order-dml
carlos-r-l-rodrigues Jan 9, 2025
c9bebec
test
carlos-r-l-rodrigues Jan 9, 2025
5ecdcc6
free text fix
carlos-r-l-rodrigues Jan 10, 2025
a20977b
rm timeout mock
carlos-r-l-rodrigues Jan 10, 2025
9c9a691
Merge branch 'develop' into chore/order-dml
carlos-r-l-rodrigues Jan 10, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .changeset/fair-ants-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
"@medusajs/locking-postgres": minor
"@medusajs/workflow-engine-inmemory": minor
"@medusajs/workflow-engine-redis": minor
"@medusajs/stock-location": minor
"@medusajs/sales-channel": minor
"@medusajs/link-modules": minor
"@medusajs/notification": minor
"@medusajs/fulfillment": minor
"@medusajs/orchestration": minor
"@medusajs/workflows-sdk": minor
"@medusajs/test-utils": minor
"@medusajs/inventory": minor
"@medusajs/promotion": minor
"@medusajs/modules-sdk": minor
"@medusajs/currency": minor
"@medusajs/customer": minor
"@medusajs/core-flows": minor
"@medusajs/api-key": minor
"@medusajs/locking": minor
"@medusajs/payment": minor
"@medusajs/pricing": minor
"@medusajs/product": minor
"@medusajs/cli": minor
"@medusajs/framework": minor
"@medusajs/region": minor
"integration-tests-http": minor
"@medusajs/index": minor
"@medusajs/order": minor
"@medusajs/store": minor
"@medusajs/auth": minor
"@medusajs/cart": minor
"@medusajs/file": minor
"@medusajs/user": minor
"@medusajs/tax": minor
"@medusajs/types": minor
"@medusajs/utils": minor
"@medusajs/medusa": minor
---

chore: upgrade to mikro-orm 6
6 changes: 3 additions & 3 deletions integration-tests/http/__tests__/cart/store/cart.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ medusaIntegrationTestRunner({
rules: [
{
attribute: "enabled_in_store",
value: '"true"',
value: "true",
operator: "eq",
},
{
Expand Down Expand Up @@ -1717,7 +1717,7 @@ medusaIntegrationTestRunner({
rules: [
{
attribute: "enabled_in_store",
value: '"true"',
value: "true",
operator: "eq",
},
{
Expand Down Expand Up @@ -2088,7 +2088,7 @@ medusaIntegrationTestRunner({
rules: [
{
attribute: "enabled_in_store",
value: '"true"',
value: "true",
operator: "eq",
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ medusaIntegrationTestRunner({
await api
.post("/admin/customer-groups", payload, adminHeaders)
.catch((err) => {
console.log(err)
// BREAKING: Duplicate error is now 400
expect(err.response.status).toEqual(400)
expect(err.response.data.type).toEqual("invalid_data")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
ContainerRegistrationKeys,
Modules,
RuleOperator,
} from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
adminHeaders,
createAdminUser,
} from "../../../helpers/create-admin-user"
import { setupTaxStructure } from "../../../modules/__tests__/fixtures/tax"

jest.setTimeout(30000)
jest.setTimeout(300000)

medusaIntegrationTestRunner({
testSuite: ({ dbConnection, getContainer, api }) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { ClaimType, Modules, RuleOperator } from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import { ClaimType, Modules, RuleOperator } from "@medusajs/utils"
import {
adminHeaders,
createAdminUser,
} from "../../../../helpers/create-admin-user"
import { setupTaxStructure } from "../../../../modules/__tests__/fixtures"
import { createOrderSeeder } from "../../fixtures/order"

jest.setTimeout(30000)
jest.setTimeout(300000)

medusaIntegrationTestRunner({
testSuite: ({ dbConnection, getContainer, api }) => {
Expand Down Expand Up @@ -268,6 +268,7 @@ medusaIntegrationTestRunner({
{
items: [
{
title: "new ITEM",
variant_id: order.items[0].variant_id,
quantity: 1,
},
Expand Down Expand Up @@ -480,6 +481,7 @@ medusaIntegrationTestRunner({
{
items: [
{
title: "Test item 2",
variant_id: order.items[0].variant_id,
quantity: 1,
},
Expand Down Expand Up @@ -551,7 +553,7 @@ medusaIntegrationTestRunner({
})
)

inboundItem = orderResult.items[0]
inboundItem = orderResult.items[1]

await api.post(
`/admin/claims/${claimWithInboundAndOutbound.id}/inbound/items`,
Expand Down
8 changes: 6 additions & 2 deletions integration-tests/modules/__tests__/link-modules/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { getMigrationPlanner, initialize } from "@medusajs/link-modules"
import { MedusaModule } from "@medusajs/modules-sdk"
import { ModuleJoinerConfig } from "@medusajs/types"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import { ModuleJoinerConfig } from "@medusajs/types"

jest.setTimeout(5000000)

Expand Down Expand Up @@ -73,7 +73,11 @@ medusaIntegrationTestRunner({
}) as any)

const planner = getMigrationPlanner(dbConfig, linkDefinition)
await planner.executePlan(await planner.createPlan())
let plans = await planner.createPlan()

// TODO: review update plan of Order module tables
plans = plans.filter((p) => p.action !== "update")
await planner.executePlan(plans)
links = await initialize(dbConfig, linkDefinition)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ medusaIntegrationTestRunner({
summary: expect.objectContaining({
// TODO: add summary fields
}),
items: [
items: expect.arrayContaining([
expect.objectContaining({
title: "Test variant",
subtitle: "Test product",
Expand Down Expand Up @@ -335,7 +335,7 @@ medusaIntegrationTestRunner({
value: "1",
}),
}),
],
]),
shipping_address: expect.objectContaining({
last_name: "Test",
address_1: "Test",
Expand Down
2 changes: 2 additions & 0 deletions integration-tests/modules/__tests__/order/order.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ medusaIntegrationTestRunner({
metadata: null,
created_at: expect.any(String),
updated_at: expect.any(String),
deleted_at: null,
},
billing_address: {
id: expect.any(String),
Expand All @@ -379,6 +380,7 @@ medusaIntegrationTestRunner({
metadata: null,
created_at: expect.any(String),
updated_at: expect.any(String),
deleted_at: null,
},
shipping_methods: [
expect.objectContaining({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
createShippingOptionsWorkflow,
orderClaimRequestItemReturnWorkflow,
} from "@medusajs/core-flows"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
FulfillmentWorkflow,
IOrderModuleService,
Expand All @@ -19,7 +20,6 @@ import {
RuleOperator,
remoteQueryObjectFromString,
} from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"

jest.setTimeout(500000)

Expand Down Expand Up @@ -186,7 +186,7 @@ async function prepareDataFixtures({ container }) {
{
attribute: "is_return",
operator: RuleOperator.EQ,
value: '"true"',
value: "true",
},
],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
orderExchangeAddNewItemWorkflow,
orderExchangeRequestItemReturnWorkflow,
} from "@medusajs/core-flows"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
FulfillmentWorkflow,
IRegionModuleService,
Expand All @@ -21,7 +22,6 @@ import {
RuleOperator,
remoteQueryObjectFromString,
} from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"

jest.setTimeout(500000)

Expand Down Expand Up @@ -234,7 +234,7 @@ async function prepareDataFixtures({ container }) {
{
attribute: "is_return",
operator: RuleOperator.EQ,
value: '"true"',
value: "true",
},
],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
beginReturnOrderWorkflow,
createShippingOptionsWorkflow,
} from "@medusajs/core-flows"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
FulfillmentWorkflow,
IOrderModuleService,
Expand All @@ -17,7 +18,6 @@ import {
RuleOperator,
remoteQueryObjectFromString,
} from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"

jest.setTimeout(500000)

Expand Down Expand Up @@ -187,7 +187,7 @@ async function prepareDataFixtures({ container }) {
{
attribute: "is_return",
operator: RuleOperator.EQ,
value: '"true"',
value: "true",
},
],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
createShippingOptionsWorkflow,
} from "@medusajs/core-flows"
import { RemoteLink } from "@medusajs/modules-sdk"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
FulfillmentSetDTO,
FulfillmentWorkflow,
Expand All @@ -21,7 +22,6 @@ import {
RuleOperator,
remoteQueryObjectFromString,
} from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"

jest.setTimeout(500000)

Expand Down Expand Up @@ -190,7 +190,7 @@ async function prepareDataFixtures({ container }) {
{
attribute: "is_return",
operator: RuleOperator.EQ,
value: '"true"',
value: "true",
},
],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
createOrderFulfillmentWorkflow,
createShippingOptionsWorkflow,
} from "@medusajs/core-flows"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
FulfillmentWorkflow,
IOrderModuleService,
Expand All @@ -20,7 +21,6 @@ import {
Modules,
remoteQueryObjectFromString,
} from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"

jest.setTimeout(500000)

Expand Down Expand Up @@ -305,12 +305,15 @@ async function createOrderFixture({ container, product, location }) {

const inventoryModule = container.resolve(Modules.INVENTORY)

const itemWithInventory = order.items!.find(
(o) => o.variant_sku === variantSkuWithInventory
)!
const reservation = await inventoryModule.createReservationItems([
{
line_item_id: order.items![0].id,
line_item_id: itemWithInventory.id,
inventory_item_id: inventoryItem.id,
location_id: location.id,
quantity: order.items![0].quantity,
quantity: itemWithInventory.quantity,
},
])

Expand Down Expand Up @@ -440,7 +443,6 @@ medusaIntegrationTestRunner({
id: order.id,
},
fields: [
"*",
"items.*",
"shipping_methods.*",
"total",
Expand All @@ -458,14 +460,15 @@ medusaIntegrationTestRunner({
)!

expect(orderFulfillAfterCancelled.fulfillments).toHaveLength(1)
expect(orderFulfillItemWithInventory.detail.fulfilled_quantity).toEqual(
0
)
expect(
orderFulfillItemWithInventory.detail.fulfilled_quantity.valueOf()
).toEqual(0)

const stockAvailabilityAfterCancelled =
await inventoryModule.retrieveStockedQuantity(inventoryItem.id, [
location.id,
])

expect(stockAvailabilityAfterCancelled.valueOf()).toEqual(2)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
createOrderShipmentWorkflow,
createShippingOptionsWorkflow,
} from "@medusajs/core-flows"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"
import {
FulfillmentWorkflow,
IOrderModuleService,
Expand All @@ -20,7 +21,6 @@ import {
RuleOperator,
remoteQueryObjectFromString,
} from "@medusajs/utils"
import { medusaIntegrationTestRunner } from "@medusajs/test-utils"

jest.setTimeout(500000)

Expand Down Expand Up @@ -177,7 +177,7 @@ async function prepareDataFixtures({ container }) {
{
attribute: "is_return",
operator: RuleOperator.EQ,
value: '"true"',
value: "true",
},
],
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ medusaIntegrationTestRunner({
throwOnError: false,
})

expect(error.error.message).toEqual(`Order id not found: ${order.id}`)
expect(error.error.message).toEqual(
`Return id not found: ${returnOrder.id}`
)
})

it("should throw an error if order change does not exist", async () => {
Expand Down
Loading
Loading