Commit Graph

18 Commits

Author SHA1 Message Date
Carlos R. L. Rodrigues
e413cfefc2 feat(utils): define file config (#13283)
** What
 - Allow auto-loaded Medusa files to export a config object.
 - Currently supports isDisabled to control loading.
 - new instance `FeatureFlag` exported by `@medusajs/framework/utils`
 - `feature-flags` is now a supported folder for medusa projects, modules, providers and plugins. They will be loaded and added to `FeatureFlag`

** Why
 - Enables conditional loading of routes, migrations, jobs, subscribers, workflows, and other files based on feature flags.

```ts
// /src/feature-flags

import { FlagSettings } from "@medusajs/framework/feature-flags"

const CustomFeatureFlag: FlagSettings = {
  key: "custom_feature",
  default_val: false,
  env_key: "FF_MY_CUSTOM_FEATURE",
  description: "Enable xyz",
}

export default CustomFeatureFlag
```

```ts
// /src/modules/my-custom-module/migration/Migration20250822135845.ts

import { FeatureFlag } from "@medusajs/framework/utils"

export class Migration20250822135845 extends Migration {
  override async up(){ }
  override async down(){ }
}

defineFileConfig({
  isDisabled: () => !FeatureFlag.isFeatureEnabled("custom_feature")
})
```
2025-08-26 12:22:30 +00:00
Harminder Virk
68560787e5 breaking: rename package names to be consistent and under @medusajs scope (#9580) 2024-10-16 22:28:09 +05:30
Sebastian Rindom
17b2868a50 feat(medusa,fulfillment): pass stock location data to fulfillment provider (#9322)
**What**
- Fetches the stock location's details when creating a fulfillment and return fulfillment.
- Passes the data to the fulfillment module, which in turn passes it to the fulfillment provider.

**Why**
- When creating a fulfillment in a multi-location setup the fulfillment provider will need to know where the package is being sent from (so the shipping service can pick it up). 
- Previously, we didn't pass anything but the location id to the fulfillment provider. Because the fulfillment provider can't have a dependency on the stock location module this was not sufficient. 
- This change ensures there is enough data passed to the fulfillment provider to build integrations properly.
2024-09-28 14:01:48 +00:00
Carlos R. L. Rodrigues
950cf9af79 chore: remove container registration name (#9137) 2024-09-16 06:22:24 -03:00
Riqwan Thamir
335061d8cd feat(medusa,types,core-flows): apply created_by values - claims, exchanges, returns, fulfillment (#8712)
what:

- Applies created_by values - claims, exchanges, returns, fulfillment

RESOLVES CC-96
2024-08-21 18:15:55 +00:00
Carlos R. L. Rodrigues
a7844efd09 chore: move ModuleRegistrationName to utils (#7911) 2024-07-03 06:30:56 -03:00
Carlos R. L. Rodrigues
61758f374b chore(medusa): return endpoints (#7823) 2024-06-25 13:53:18 +00:00
Adrien de Peretti
48963f55ef Chore/rm main entity concept (#7709)
**What**
Update the `MedusaService` class, factory and types to remove the concept of main modules. The idea being that all method will be explicitly named and suffixes to represent the object you are trying to manipulate.
This pr also includes various fixes in different modules

Co-authored-by: Stevche Radevski <4820812+sradevski@users.noreply.github.com>
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-06-19 13:02:16 +00:00
Frane Polić
521b4e7926 feat(dashboard): order fulfillment UI (#7262)
* feat: initial impl. of Unfulfilled section and create flow

* feat: create fulfillment

* feat: order <> fulfillment link, fulfillment section

* feat: accept order_id when creating fulfillment

* feat: finish create and cancel

* fix: integration test

* refactor: real Order<>Fulfillment link instead readonly, add link step to the workflow

* fix: revert `order_id` definitions

* chore: add changeset

* fix: build

* fix: address comments

* fix: fetch inventory and location levels for fulfilled variant

* fix: loading inventory details

* add isList to order fulfillment link

* fix: duplicate declaration

* fix: type

* refactor: link orders step, fix client

* fix: move translations to the new file

* fix: pass order id in test

---------

Co-authored-by: olivermrbl <oliver@mrbltech.com>
2024-05-20 13:41:09 +02:00
Riqwan Thamir
18f3aacee6 feat(core-flows,medusa,types): fulfillment API: create (#7101)
what:

- adds fulfillment create API

RESOLVES CORE-1962
2024-04-23 08:35:44 +00:00
Riqwan Thamir
62b9dcc6c1 feat(core-flows,medusa,types): cancel fulfillments API (#7095)
what:

- adds POST cancel fulfillments endpoint

RESOLVES CORE-1972
2024-04-18 11:00:01 +00:00
Adrien de Peretti
f132929c7e feat(*): shipping options update API (#6987)
**What**
- Update the `updateShippingOptions` module service API to follow the newest convention
- Add upsert support for shipping options
- update shipping options workflow
- update shipping options api end point and validation
- update shipping options all integration tests

FIXES CORE-1926
2024-04-07 16:28:59 +00:00
Adrien de Peretti
bc06ad2db4 feat: Clean up shipping options management (#6977)
**What**
- cleanup existing route on some aspects but not all
- add new create shipping options end point and types
- add set of integration tests
- cleanup existing fulfillment routes
- align existing integration tests
- transform old type to zod types and validators
- fix stock location route
2024-04-06 16:52:05 +00:00
Adrien de Peretti
65794f4bb5 feat: Create shipping options workflow (#6962)
**What**

- Create main workflow
- Update create pricing rule types step to be idempotent
- update remote joiner to support granular isList confguration on field aliases
- Add full workflow integration tests
2024-04-06 11:51:48 +00:00
Stevche Radevski
20e8df914e feat: Normalize known DB errors to a MedusaError when possible (#6922)
Before we would swallow the error and return a generic error to the user. This will provide more information to the caller if it is one of the known errors.
2024-04-04 19:12:59 +00:00
Riqwan Thamir
cc1b66842c feat(core-flows,medusa,types,utils): add/remove fulfillment shipping option rules (#6698)
what:

- adds fulfillment shipping option rules batch endpoint
- remove fulfillment shipping option rules batch endpoint
- breaks my British based education to not call it fulfilment with a single "l"
2024-03-14 16:02:50 +00:00
Oli Juhl
f0c8142635 feat: Add shipping method to cart (#6661) 2024-03-12 17:52:48 +01:00
Adrien de Peretti
87e63c024e feat(fulfillment): Migration backward compatibility (#6672)
**What**
- Update migration for backward compatibility. This does not take into account data migration and table cleanup (@olivermrbl do we have a general tasks for the modules on that subject)?
- Rename fulfillment provider id to provider id
- add integration tests to ensure the migration backward compatibility
- add new module type for the options to be used in the medusa config for example

FIXES CORE-1724
2024-03-12 13:53:33 +00:00