what:
- adds create endpoint for promotions including workflows and endpoint (RESOLVES CORE-1678)
- adds update endpoint for promotions including workflows and endpoint (RESOLVES CORE-1679)
- adds create endpoint for campaigns including workflows and endpoint (RESOLVES CORE-1684)
- adds update endpoint for campaigns including workflows and endpoint (RESOLVES CORE-1685)
**What**
Create a service abstraction for the modules internal service layer. The objective is to reduce the effort of building new modules when the logic is the same or otherwise allow to override the default behavior.
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
* chore: added item/shipping adjustments for order/items/shipping_methods
* chore: add validation for order type and target rules
* chore: add comment for applied promotions
* chore: add shipping method and item adjustments
* chore: include applied promotions to items/shipping_method for each case
* chore: handle case for items across and order to consider existing applications
* chore: handle case for applied promo values to shipping => across
* chore: added changeset
* chore: update return of function
* chore: campaigns and campaign budgets + services CRUD
* Apply suggestions from code review
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
* chore: minor refactor
* chore: added single/bulk interfaces
* Apply suggestions from code review
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
* chore: use DAL date entity
* chore: align nullable
* Update packages/promotion/src/models/promotion-rule.ts
* chore: fix types
* chore: review changes
* Update packages/promotion/src/utils/compute-actions/shipping-methods.ts
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
---------
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
what:
- adds compute actions for the following cases:
- items => each & across
- shipping_method => each & across
- order
- adds a remove compute actions when code is no longer present in adjustments array
RESOLVES CORE-1625
RESOLVES CORE-1626
RESOLVES CORE-1627
RESOLVES CORE-1628
RESOLVES CORE-1585
Duplicate of #6008, but I messed up my git history big time :'(
**What**
- CartService and CartRepository + tests
- AddressService and AddressRepository + tests
- CartModuleService skeleton. Full implementation + tests will be added in a separate PR
**What**
Reduce the work effort to create repositories when building new modules by abstracting the most common cases into the base class default implementation returned by a factory
- [x] Migrate all modules
Co-authored-by: Riqwan Thamir <5105988+riqwan@users.noreply.github.com>
* feat(types,utils): added promotion create with rules
* chore: add rules to promotion and application method
* chore: use common code for rule and values
* chore: address pr reviews
* chore: fix test
What:
- Promotions can be created with its bare attributes
- Promotions one to one relationship with ApplicationMethod can be created with its attributes + validation
RESOLVES CORE-1592
RESOLVES CORE-1595
* init
* remove date string validator;
* add transformOptionalDate transformer to api
* move type conversion to the datalayer
* fix final module integration test
* update arrow-function
* make string optional
* move work to utils
* make check for value exists
* move util back to pricng
* change utils
* refactor get-iso-string
* fix build
* flip transform condition
* add null check for isDate
* feat(pricing): Separate Pricing Module internal types from `@medusajs/types` (#5777)
* create types for pricing repositories
* create RepositoryTypes input
* add service types
* use models for repository types
* fix build
* update types to match interface types
* add aliases
* types instead of moduletypes
* move repository to types for pricing module
* add changeset
* fix merge error
* fix conflict
* fix build
* re-add validation of dates in updatePriceLists_
**What**
One problem with local development can be the dependencies management. To mitigate that, transform checks from an instance of to value check as well as harmonize utils function to be part of the class as a static method instead of separate utilities. By using this approach we are not dependent of the origin of the class and therefore it should ease the user experience.
**NOTE**
As a next step to discuss, we should probably move the interfaces from the interfaces/medusa package to the utils package. Then we can deprecate the interfaces package and remove it at a later time
**What**
- Allow to create step that can be configured to have a max retry
- Step end retry mechanism on permanent failure
Also added an API to override a step configuration from within the createWorkflow
```ts
const step = createStep({ name: "step", maxRetries: 3 }, async (_, context) => {
return new StepResponse({ output: "output" })
})
const workflow = createWorkflow("workflow", function () {
const res = step().config({ maxRetries: 5 }) // This will override the original maxRetries of 3
})
```
**NOTE**
We can maybe find another name than config on the step workflow data to override the step config.
* remove defaults
* take 2
* works now
* add changeset
* pricing module and pricing service list take null updates
* update handlers
* update product module service with take:null where relevant
* no spread
* note to self:default offset should be 0, not 15
**what:**
**PriceList Service APIs:**
- createPriceList
- updatePriceList
- addPriceListPrices
- removePriceListRules
- setPriceListRules
- deletePriceList
- listPriceLists
- listAndCountPriceLists
**Price Calculations**
- Returns prices with price list prices
- Returns a new shape with calculated and original prices
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
**What**
At the moment, when importing something from medusa entry point, if two medusa packages are installed because of a plugin, the evaluation of the import can end up throwing that a workflow is already defined. To prevent that from happening, we can just not throw if it is already defined and just return prematurely and make it idempotent.