Commit Graph

9297 Commits

Author SHA1 Message Date
Mayuresh-1306
1b6e53f032 docs: Set cache to no-cache in digital product examples (#13778)
Fixes medusajs/medusa#13687
2025-10-20 06:08:30 +00:00
Frane Polić
2d45ba7be1 fix(draft-order): email reset when changing customer (#13771) 2025-10-19 10:40:20 +02:00
Shahed Nasser
441e5e4710 docs: add deep thinking to AI assistant (#13770)
* docs: add deep thinking to AI assistant

* add disabled styling
2025-10-17 12:07:10 +03:00
Shahed Nasser
415d13091d docs: fix content shift in references (#13765) 2025-10-17 08:12:15 +03:00
Shahed Nasser
ee2734c23d docs: add troubleshooting for middlewares (#13764) 2025-10-16 14:43:21 +03:00
Shahed Nasser
e36c054780 docs: improve references loading (#13761)
* docs: improve references loading

* remove comment

* try remove generate metadata

* improvements and fixes
2025-10-16 14:25:01 +03:00
Shahed Nasser
4eb9628514 docs: add troubleshooting for subscribers + scheduled jobs not working (#13762) 2025-10-16 13:07:37 +03:00
Stevche Radevski
ee1c77a01f feat: Add support for multiple active keys at a time (#13754) 2025-10-16 10:07:08 +02:00
Shahed Nasser
1ca329d9b3 docs: clarify relation name for read-only links (#13758)
* docs: clarify relation name for read-only links

* small fix

* fix vale error
2025-10-16 10:27:14 +03:00
Shahed Nasser
26d497f285 docs: clarify how to use token in Auth Provider guide (#13759)
* docs: clarify how to use token in Auth Provider guide

* small fix
2025-10-16 08:27:42 +03:00
Shahed Nasser
a5df43cde7 docs: fix limit text length code (#13752) 2025-10-16 08:23:29 +03:00
William Bouchard
8642d41aac fix(dashboard): add error message in toaster on product delete (#13756)
* fix(dashboard): add error message in toaster on product delete

* Create fuzzy-icons-hope.md

* add description instead
2025-10-15 14:13:28 -04:00
Shahed Nasser
8bb036457c docs: improve headings and context in Cloud docs (#13757) 2025-10-15 18:49:48 +03:00
William Bouchard
4e3090ab26 chore(core-flows): send error on csv parsing error (#13749)
* chore(core-flows): send error on csv parsing error

* Create two-dragons-visit.md
2025-10-14 15:24:13 -04:00
docloulou
459fbcdf99 feat(medusa,dashboard): Add support for configurable additional columns in entity views (#13566)
This pull request enhances the entity column generation logic in the admin views by adding support for including fields from additional GraphQL types, specifically for the `orders` entity. The changes allow more flexible and comprehensive column definitions by pulling in fields from related types (like `OrderDetail`) and updating the filtering and type resolution logic accordingly.

**This adding payment_status & fulfillment_status from OrderDetail in view configuration feature**

**Entity column generation enhancements:**

* Added the `ADDITIONAL_ENTITY_TYPES` mapping to specify extra GraphQL types whose fields should be included for certain entities (currently, `OrderDetail` for `orders`). ([packages/medusa/src/api/admin/views/[entity]/columns/helpers.tsR260-R263](diffhunk://#diff-ce197feb4e4d1273d9ee19126e284b65fdb4367f0871774a75add5c8cd749d02R260-R263))
* Updated the column generation process to collect fields from both the main entity type and any additional types, while properly filtering out arrays and excluded fields. ([packages/medusa/src/api/admin/views/[entity]/columns/helpers.tsR340-R345](diffhunk://#diff-ce197feb4e4d1273d9ee19126e284b65fdb4367f0871774a75add5c8cd749d02R340-R345), [packages/medusa/src/api/admin/views/[entity]/columns/helpers.tsR373-R414](diffhunk://#diff-ce197feb4e4d1273d9ee19126e284b65fdb4367f0871774a75add5c8cd749d02R373-R414))
* Changed field lookup logic to use a unified `entityFields` object and a new `additionalFieldDefinitions` map for extra fields, ensuring correct type info resolution for all columns. ([packages/medusa/src/api/admin/views/[entity]/columns/helpers.tsL344-R354](diffhunk://#diff-ce197feb4e4d1273d9ee19126e284b65fdb4367f0871774a75add5c8cd749d02L344-R354), [packages/medusa/src/api/admin/views/[entity]/columns/helpers.tsL411-R463](diffhunk://#diff-ce197feb4e4d1273d9ee19126e284b65fdb4367f0871774a75add5c8cd749d02L411-R463))
2025-10-14 12:13:03 +00:00
William Bouchard
a61d1825ea fix(utils,core-flows): fix import erasing tags, categories and others (#13724)
* fix(utils,core-flows): fix import erasins tags, categories and others

* Create pink-pumpkins-sin.md

* fix changeset

* fix tests
2025-10-14 08:08:20 -04:00
Oli Juhl
b5ecdfcd12 feat: Add allocation method type ONCE (#13700)
### What
Add a new `once` allocation strategy to promotions that limits application to a maximum number of items across the entire cart, rather than per line item.

### Why
Merchants want to create promotions that apply to a limited number of items across the entire cart. For example:
- "Get $10 off, applied to one item only"
- "20% off up to 2 items in your cart"

Current allocation strategies:
- `each`: Applies to each line item independently (respects `max_quantity` per item)
- `across`: Distributes proportionally across all items

Neither supports limiting total applications across the entire cart.

### How

Add `once` to the `ApplicationMethodAllocation` enum.

Behavior:
- Applies promotion to maximum `max_quantity` items across entire cart
- Always prioritizes lowest-priced eligible items first
- Distributes sequentially across items until quota exhausted
- Requires `max_quantity` field to be set

### Example Usage

**Scenario 1: Fixed discount**
```javascript
{
  type: "fixed",
  allocation: "once",
  value: 10,        // $10 off
  max_quantity: 2   // Apply to 2 items max across cart
}

Cart:
- Item A: 3 units @ $100/unit
- Item B: 5 units @ $50/unit (lowest price)

Result: $20 discount on Item B (2 units × $10)
```

**Scenario 2: Distribution across items**
```javascript
{
  type: "fixed",
  allocation: "once",
  value: 5,
  max_quantity: 4
}

Cart:
- Item A: 2 units @ $50/unit
- Item B: 3 units @ $60/unit

Result:
- Item A: $10 discount (2 units × $5)
- Item B: $10 discount (2 units × $5, remaining quota)
```

**Scenario 3: Percentage discount - single item**
```javascript
{
  type: "percentage",
  allocation: "once",
  value: 20,         // 20% off
  max_quantity: 3    // Apply to 3 items max
}

Cart:
- Item A: 5 units @ $100/unit
- Item B: 4 units @ $50/unit (lowest price)

Result: $30 discount on Item B (3 units × $50 × 20% = $30)
```

**Scenario 4: Percentage discount - distributed across items**
```javascript
{
  type: "percentage",
  allocation: "once",
  value: 15,         // 15% off
  max_quantity: 5
}

Cart:
- Item A: 2 units @ $40/unit (lowest price)
- Item B: 4 units @ $80/unit

Result:
- Item A: $12 discount (2 units × $40 × 15% = $12)
- Item B: $36 discount (3 units × $80 × 15% = $36, remaining quota)
Total: $48 discount
```

**Scenario 5: Percentage with max_quantity = 1**
```javascript
{
  type: "percentage",
  allocation: "once",
  value: 25,         // 25% off
  max_quantity: 1    // Only one item
}

Cart:
- Item A: 3 units @ $60/unit
- Item B: 2 units @ $30/unit (lowest price)

Result: $7.50 discount on Item B (1 unit × $30 × 25%)
```
2025-10-14 11:01:00 +00:00
olivermrbl
57030fa43e chore: Prepare minor bump 2025-10-14 12:55:20 +02:00
Oli Juhl
1d2b4566fd chore: Ensure refund doesn't exceed captured amount (#13744)
* wip

* chore: prepare for PR

* move to end

* Change order of operations in refundPaymentWorkflow

Updated the order of operations in the refundPaymentWorkflow.

* chore: Add validation
2025-10-13 22:09:46 +02:00
Frane Polić
723dc082f0 fix(dashboard): campaign budget labels improvements (#13740)
* fix(dashboard): budget labels and remove promo code

* fix: sidebar label

* fix: update translation
2025-10-13 18:49:12 +02:00
Shahed Nasser
379d763e50 chore: general TSDoc updates (#13742) 2025-10-13 14:27:19 +03:00
Shahed Nasser
9a5ca86b76 docs: support since, deprecated, and feature flag tags in dml reference (#13741) 2025-10-13 13:31:48 +03:00
Shahed Nasser
958b003a11 chore: add since tags for latest release (#13739) 2025-10-13 11:24:51 +03:00
Shahed Nasser
fc2ded4b10 fix(core-flows): fix warning for when usage in updateOrderTaxLinesWorkflow (#13738)
When starting the Medusa application i see the following in the console:

```
update-order-tax-lines: "when" name should be defined. A random one will be assigned to it, which is not recommended for production.
 ({ input }) => {
        return input.item_ids?.length > 0;
    }
update-order-tax-lines: "when" name should be defined. A random one will be assigned to it, which is not recommended for production.
 ({ input }) => {
        return input.shipping_method_ids?.length > 0;
    }
```

This PR fixes the issue by passing a step name as a first parameter to the `when` usages in `updateOrderTaxLinesWorkflow`
2025-10-13 08:22:22 +00:00
Shahed Nasser
a48ee395ed chore: added TSDocs to refund reason HTTP type (#13717) 2025-10-13 11:17:36 +03:00
Nicolas Gorga
137b237c84 feat(medusa): export feature flag configs (#13714)
* Export feature-flags

* Add changeset

---------

Co-authored-by: William Bouchard <46496014+willbouch@users.noreply.github.com>
2025-10-10 11:14:28 -04:00
Patel Aryan Saurabhkumar
a1c56d29d0 fix(dashboard): replace native select Element in CountrySelect & ProvinceSelect with Select(Medusa UI). (#13521)
* fix: replace CountrySelect fallback with Medusa Select

* Country Select Component Fix to use Medusa UI Select Component

* added Change set

* using the props supported by the Select

* value should be lowercased if passed from the pareant component

* fix province Select with medusa UI select and added change set

* bug fix the province with providing

---------

Co-authored-by: Aryan Patel <21cs038@charusat.edu.in>
Co-authored-by: William Bouchard <46496014+willbouch@users.noreply.github.com>
2025-10-10 10:22:51 -04:00
Adrien de Peretti
c54c5ed6de chore(): improve cart operations + Mikro orm 6.4.16 (#13712)
* chore(): Mikro orm 6.4.16

* Create small-ghosts-draw.md

* update config

* update config

* fix delete

* update config

* update workflows

* order improvements

* test pricing quuery

* test pricing quuery

* configurable connection options

* configurable connection options

* configurable connection options

* Update packages/modules/pricing/src/models/price.ts

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-10-10 08:58:19 +02:00
Nicolas Gorga
76bf364440 fix(js-sdk): pass headers to auth.refresh() (#13690)
Fixes #13689
2025-10-09 16:58:17 +00:00
Frane Polić
c6896ffa6a fix(dashboard): campaign UI improvements (#13723)
* fix(dashboard): campaign UI improvements

* fix: camel case translation key
2025-10-09 16:15:26 +02:00
William Bouchard
21fbc0756f chore(): add PR template (#13721)
* chore(): add PR template

* remove emojis
2025-10-09 09:40:04 -04:00
Frane Polić
7dc3b0c5ff feat(core-flows,dashboard,js-sdk,promotion,medusa,types,utils): limit promotion usage per customer (#13451)
**What**
- implement promotion usage limits per customer/email
- fix registering spend usage over the limit
- fix type errors in promotion module tests

**How**
- introduce a new type of campaign budget that can be defined by an attribute such as customer id or email
- add `CampaignBudgetUsage` entity to keep track of the number of uses per attribute value
- update `registerUsage` and `computeActions` in the promotion module to work with the new type
- update `core-flows` to pass context needed for usage calculation to the promotion module

**Breaking**
- registering promotion usage now throws (and cart complete fails) if the budget limit is exceeded or if the cart completion would result in a breached limit

---

CLOSES CORE-1172
CLOSES CORE-1173
CLOSES CORE-1174
CLOSES CORE-1175


Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2025-10-09 12:35:54 +00:00
William Bouchard
924564bee5 fix(core-flows): customer id filter not working in getOrderDetails (#13695)
As discussed, fixed the get order detail and also changed the remotequery to graph a bunch of workflows
2025-10-09 12:13:12 +00:00
William Bouchard
82f3b0413a fix(dashboard): export with filters not working (#13711)
* fix(dashboard): export with filters not working

* page size

* own cr

* Create tiny-beans-poke.md
2025-10-09 08:00:06 -04:00
Shahed Nasser
2cfd0dfc6e docs: add note to tutorials related to types (#13720) 2025-10-09 14:52:23 +03:00
Shahed Nasser
85f543e01d chore: fixes to Caching Module's TSDocs (#13709) 2025-10-09 13:09:51 +03:00
Shahed Nasser
87a66ff37e docs: separate Billing + Plans guide and add note for Indian cards (#13710) 2025-10-09 08:53:40 +03:00
Adrien de Peretti
0cbd9f0bc3 chore(): Improve caching rollout (#13702)
* chore(): Improve caching rollout

* Create bright-cobras-complain.md

* chore(): Improve caching rollout

* downgrade orm to 6.4.3

* chore(): Improve caching rollout

* chore(): Improve caching rollout

* chore(): Improve caching rollout

* chore(): Improve caching rollout

* chore(): Improve caching rollout

* fix

* update changeset

* update modules definition

* update engine tests

* update engine tests

* improve integration

* improve integration

* gracefully disconnect

* update test

* another attempt

* another attempt

* fix workflow storage

* fix remote joiner

* fix remote joiner

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2025-10-08 17:44:00 +02:00
William Bouchard
e9b7a8c1f3 fix(dashboard): nan in tax total (#13699)
CLOSES CORE-1210
2025-10-08 11:45:32 +00:00
Adrien de Peretti
b43b285125 fix(): Workflow save to db + index integration instability (#13707)
**What**
- Fix index integration tests instability
- Fix workflow engine storage save to db
2025-10-08 08:45:15 +00:00
Shahed Nasser
c75a76636a docs: meilisearch integration tutorial (#13532)
* docs: meilisearch integration tutorial

* generate llms
2025-10-08 11:23:43 +03:00
Oli Juhl
439969b015 chore: Temporary patch to bypass changesets issue with too many commits (#13706)
* chore: Temporary patch for changesets

* bump lockfile
2025-10-08 09:36:24 +02:00
William Bouchard
c61f3150c1 fix(medusa,utils,types): inventory management nullable (#13703)
* fix(medusa,utils,types): inventory management nullable

* fix unit

* fix changeset
2025-10-07 14:44:30 -04:00
Nicolas Gorga
86c975258b fix(core-flows): fix shipping_total showing as 0 in createFulfillment method (#13704)
Fixes #13454
2025-10-07 16:47:49 +00:00
Adrien de Peretti
51859c38a7 chore(): Default caching configuration and gracefull redis error handling (#13663)
* chore(): Default caching configuration and gracefull redis error handling

* Create odd-moons-crash.md

* chore(): Default caching configuration and gracefull redis error handling

* fixes

* address feedback

* revert(): Test utils imit module fix

* reconnect

* reconnect

* reconnect
2025-10-06 17:57:11 +02:00
William Bouchard
28d57b7bf8 fix(types): missing rules in prices types (#13669)
This was missing from the types although they are in validators. bb6cc586f7/packages/medusa/src/api/admin/shipping-options/validators.ts (L88-L103)

CLOSES #13610
CLOSES #12910
2025-10-06 15:22:55 +00:00
Shahed Nasser
f85df8fcdc chore: updated TSDocs of the Caching Module service + provider (#13696) 2025-10-06 18:06:46 +03:00
Shahed Nasser
54cf8811af docs: show badge for community integrations (#13691) 2025-10-06 11:18:51 +03:00
Adrien de Peretti
62d340b897 fix(): caching better identify default provider (#13675) 2025-10-03 21:04:27 +02:00
Shahed Nasser
80371a4344 docs: fix client error in UI docs (#13686) 2025-10-03 21:42:09 +03:00