Commit Graph

411 Commits

Author SHA1 Message Date
Harminder Virk
be15240909 refactor: migrate sales-channel to DML (#10452)
Fixes: FRMW-2830
2024-12-05 14:02:08 +00:00
Harminder Virk
0a16efa426 refactor: migrate cart module to DML (#10385)
FIXES: FRMW-2815

This PR has no breaking changes
2024-12-05 12:30:50 +00: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
Kasper Fabricius Kristensen
4e7d242a78 fix(stock-location): Fix export of StockLocation module (#10406) 2024-12-03 18:35:52 +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
Adrien de Peretti
ac79585232 feat(user): Migrate user module to DML (#10389)
* feat(user): Migrate user module to DML

* Create rotten-tigers-worry.md

* update indexes names following conventions

* remove duplicate modifier
2024-12-02 12:36:40 +01:00
Adrien de Peretti
4ef353a7b9 feat(auth): Migrate auth module to DML (#10387)
* feat(auth): Migrate auth module to DML

* Create lazy-eagles-bow.md
2024-12-02 11:58:04 +01:00
Harminder Virk
913cf15e2b refactor: migrate pricing entities to DML models (#10335)
Fixes: FRMW-2810

## Breaking changes
There is only one breaking change

- The `min_quantity` and `max_quantity` properties are now consistently typed as numbers. Earlier, it was [typed as numbers](https://github.com/medusajs/medusa/blob/develop/integration-tests/http/__tests__/price-list/admin/price-list.spec.ts#L68-L69) in some API responses and as [string in others](https://github.com/medusajs/medusa/blob/develop/integration-tests/http/__tests__/price-list/admin/price-list.spec.ts#L186-L187). I did not go to the bottom of this inconsistency, but the tests reveals them.

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-12-02 09:44:41 +00:00
Riqwan Thamir
11bd556133 feat(core-flows,framework,medusa): list shipping options pass in cart as pricing context (#10374)
* feat(core-flows,framework,medusa): list shipping options pass in cart as pricing context

* chore: add test for shipping options returning free shipping
2024-12-01 20:59:26 +01:00
Riqwan Thamir
324b4ab438 feat(pricing, types): add price rule operators to price calculations (#10350)
what:

- adds price rule operators when doing price calculations
- rules now accepts a key where the value can be an array of objects `({ operator: string, value: number })`
  - validation for available types of operator and value to be a number
```
await service.createPriceSets({
  prices: [
    {
      amount: 50,
      currency_code: "usd",
      rules: {
        region_id: "de",
        cart_total: [
          { operator: "gte", value: 400 },
          { operator: "lte", value: 500 },
        ]
      },
    },
  ]
})
```
- price calculations will now account for the operators - lte, gte, lt, gt when the price context is a number

RESOLVES CMRC-747
2024-11-28 20:48:00 +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
Harminder Virk
d57c739052 fix: do not initialize FKs to null (#10337) 2024-11-28 17:15:08 +05:30
Stevche Radevski
f7279f1b96 fix: Use the correct defaults for the invite token expiry (#10344) 2024-11-28 12:06:32 +01:00
Riqwan Thamir
3b1a63eca7 feat(pricing,utils,types): add operator field to price rule (#10315)
what:

- adds an operator field to price rule with specific operator fields

RESOLVES CMRC-746
2024-11-28 09:23:26 +00:00
Shahed Nasser
2838100efc fix(product): change export name of ProductImage (#10326)
Change export of `Image` to `ProductImage` to match the data model's name.
2024-11-27 17:35:06 +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
Oli Juhl
cb2b06fab9 fix: Inventory module schema (#10262)
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-11-26 09:02:37 +01:00
olivermrbl
ccf4e801f3 chore: Version packages 2024-11-25 12:14:36 +01:00
Kasper Fabricius Kristensen
c28d0db164 fix(product, dashboard): manual cleanup of uploaded images (#10254)
* manual cleanup

* add changeset

* remove thumbnail on deletion
2024-11-25 11:44:22 +01:00
olivermrbl
4245312d8d chore: Version packages 2024-11-25 09:57:00 +01:00
Oli Juhl
29ce10b09e fix(product): Update images before adding not null constraint (#10248) 2024-11-25 08:39:43 +00:00
Kasper Fabricius Kristensen
1659c9be5d feat(product,dashboard): Allow re-ordering images (#10187)
* migration

* fix snapshot

* primarykey

* init work on dnd

* progress

* dnd

* undo changes

* undo changes

* undo changes

* undo changes

* fix firefox issue

* lint

* lint

* lint

* add changeset

* undo changes to product module

* set activator node

* init work on service layer

* alternative

* switch to OneToMany

* add tests

* progress

* update migration

* update approach and remove all references to images in product.ts tests

* handle delete images on empty array

* fix config and order type

* update changeset

* rm flag

* export type and fix type in test

* fix type

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-11-25 09:03:10 +01:00
Adrien de Peretti
b964b45fb2 fix(stripe): Wrong container type (#10223)
RESOLVES SUP-238

**What**

wrong container type withing payment providers
2024-11-22 10:57:41 +00:00
Oli Juhl
8091c5f5bc fix: Remove undefined from events in update (#10170) 2024-11-20 09:43:51 +01:00
Adrien de Peretti
1f44281ed6 fix(product): Update full descendant tree mpath when updating parent category id (#10144)
FIXES FRMW-2774

**What**
When updating the parent category id, all descendant mpath should be re computed
2024-11-19 12:51:34 +00:00
Adrien de Peretti
7aa990795c chore(): Update module provider retrieval error message and type (#10138)
Partially RESOLVES FRMW-2802

**What**
Improve error message and change the error type when retrieving a provider from a local container fail
2024-11-19 11:19:19 +00: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
b1b7a4abf1 fix(payment): Idempotent cancellation and proper creationg fail handling (#10135)
RESOLVES SUP-188

**What**
Two changes are happening here
- In the stripe payment provider, idempotent cancellation action, if not id is provided then return the existing data unchanged
- Payment module should not try to cancel a session that have failed to be created in the first place
2024-11-18 17:45:13 +00:00
Carlos R. L. Rodrigues
47ca1d4b54 fix(inventory): update reservation quantity (#10139) 2024-11-18 11:55:22 -03: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
Adrien de Peretti
1afc577e54 feat(product): Make product option value linkable (#10116)
RESOLVES FRMW-2799

**What**
Make the product option value linkable
2024-11-15 11:32:55 +00:00
Carlos R. L. Rodrigues
06ce16c90b chore(local-file): throw error if file exist (#10087) 2024-11-14 12:11:37 -03:00
Furman
4c983557f9 feature: Add email to google provider-identity metadata (#10081)
* feature: Add email to google provider-identity metadata

* Include changeset.

---------

Co-authored-by: Stevche Radevski <sradevski@live.com>
2024-11-14 15:01:53 +01:00
Carlos R. L. Rodrigues
3e265229f2 chore(event-bus): event bus error handling (#10085) 2024-11-13 18:03:29 -03:00
Carlos R. L. Rodrigues
2344012d1c fix(core-flows): capture before order created (#9980)
What:
 When `autocapture` is enabled, the webhook is processed before the order was created.
 The payment processing workflows were merged into a single one
 
FIXES: SUP-118, SUP-9

https://github.com/medusajs/medusa/issues/9998
2024-11-12 13:43:48 +00:00
Carlos R. L. Rodrigues
1eef324af3 fix(orchestration): fix set step failure (#10031)
What:
 - copy data before saving checkpoint
 - removed unused data format function
 - properly handle registerStepFailure to not throw
 - emit onFinish event even when execution failed
2024-11-12 10:06:36 +00: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
Dos
6ead7bf92d feat(stripe-payment): add promptpay (#9789)
* feat(stripe): add promptpay

* Create selfish-wombats-smash.md

---------

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-11-10 22:44:52 +01:00
Oli Juhl
094971775b chore: Add actor type check + more tests (#10005) 2024-11-10 21:38:19 +00:00
Carlos R. L. Rodrigues
03f4b66b90 fix(link-modules): generate graphql type of read only links (#9955) 2024-11-08 07:54:50 -03:00
Stevche Radevski
cd578e89ff fix: Use sub instead of email for google entity ID (#9949) 2024-11-07 09:24:14 +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
Carlos R. L. Rodrigues
898a437db0 chore(locking): disable default provider warning (#9956) 2024-11-06 14:06:01 -03:00
olivermrbl
4ccab16336 chore: Version packages 2024-10-25 17:19:36 +02:00
Shahed Nasser
92bbd7953b chore: update links to v2 docs in source code and comments (#9732) 2024-10-24 15:18:38 +03:00
olivermrbl
2fbebb60e3 chore: Release 2024-10-22 20:43:47 +02:00