Riqwan Thamir
cedab58339
feat(workflows,medusa,utils): add medusa v2 feature flag ( #5603 )
...
* chore: add medusa v2 feature flag
* chore: cleanup more FF
* chore: cleanup workflows FF
* chore: add comments on broken specs
* chore: added check for package registration
* chore: reenable workflows FF for create order workflow
* chore: disable FF on test cli db
* chore: hide loader validation behind FF
* chore: use medusa v2 enabled
* chore: register feature flag router in use-db
* chore: change to minro
2023-11-13 16:18:05 +01:00
github-actions[bot]
71d59d2c81
chore: Version Packages ( #5527 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-11-10 10:28:21 +01:00
Adrien de Peretti
f90ba02087
feat(utils): Introduce promiseAll util ( #5543 )
2023-11-08 08:48:48 +01:00
Adrien de Peretti
f88d75b0a7
feat(product, pricing, utils): Transaction issues and reference issues ( #5533 )
...
* feat(product, pricing, utils): Transaction issues and reference issues
* fixes decorators
* cleanup
* fix product module upsert
* fix missing active manager
* increase timeout
* revert package.json
* WIP
* try another node version based on findings with memory issues with jest introduced after 16.11 but fixed in 21
* re add bail
* fix variant options
* chore: bulk create pricing
* chore: workflow bulk
* Create big-chefs-dream.md
* fix missing update for upserty
* Add integration tests for product options upsert
* rm unnecessary return
* fix product prices workflow issue
* cleanup
* fix flag
* fix model
---------
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com >
Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com >
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com >
2023-11-06 12:24:29 +01:00
Philip Korsholm
148f537b47
feat(medusa): integrate pricing module to core ( #5304 )
...
* add pricing integraiton feature flag
* init
* first endpoint
* cleanup
* remove console.logs
* refactor to util and implement across endpoints
* add changeset
* rename variables
* remove mistype
* feat(medusa): move price module integration to pricing service (#5322 )
* initial changes
* chore: make product service always internal for pricing module
* add notes
---------
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com >
* nit
* cleanup
* update to object querying
* update cart integration test
* remove uppercase currency_code
* nit
* Feat/admin product pricing module reads (#5354 )
* initial changes to list prices for admin
* working price module implementation of list prices
* nit
* variant pricing
* redo integration test changes
* cleanup
* cleanup
* fix unit tests
* [wip] Core <> Pricing - price updates (#5364 )
* chore: update medusa-app
* wip
* get links and modules working with migration
* wip
* chore: make test pass
* Feat/rule type utils (#5371 )
* initial rule type utils
* update migration script
* chore: cleanup
* ensure prices are always decorated
* chore: use seed instead
* chore: fix oas conflict
* region id add to admin price read!
---------
Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com >
Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com >
* pr feedback
* create remoteQueryFunction type
* fix merge
* fix loaders issue
* Feat(medusa, types, pricing): pricing module migration script (#5409 )
* add migration script for money amounts in pricing module
* add changeset
* rename file
* cleanup imports
* update changeset
* add check for pricing module and ff
* feat(medusa,workflows,types): update prices on product and variant update (#5412 )
* wip
* chore: update product prices through workflow
* chore: cleanup
* chore: update product handler updates prices for variants
* chore: handle reverts
* chore: address pr comments
* chore: scope workflow handlers to flag handlers
* chore: update return
* chore: update db url
* chore: remove migration
* chore: increase jest timeout
* Feat(medusa): update migration and initDb to run link-migrations (#5437 )
* initial
* loader update
* more progress on loaders
* update integration tests and remote-query loader
* remove helper
* migrate isolated modules
* fix test
* fix integration test
* update with pr feedback
* unregister medusa-app
* re-register medusaApp
* fix featureflag
* set timeout
* set timeout
* conditionally run link-module migrations
* pr feedback 1
* add driver options for db
* throw if link is not defined in migration script
* pass config module directly
* include container in migrate command
* chore: increase timeout
* rm redis from api integration tests to test
* chore: temporarily skip tests
* chore: undo skips + add timeout for workflow tests
* chore: increase timeout for order edits
* re-add redis
* include final resolution
* add sharedcontainer to medusaapp loader
* chore: move migration under run command
* try removing redis_url from api tests
* chore: cleanup server on process exit
* chore: clear container on exit
* chore: adjustments
* chore: remove consoles
* chore: close express app on finish
* chore: destroy pg connection on shutdown
* chore: skip
* chore: unskip test
* chore: cleanup container pg connection
* chore: skip
---------
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com >
2023-10-30 14:42:17 +01:00
github-actions[bot]
c0d74bc682
chore: Version Packages ( #5340 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-10-19 15:58:48 +02:00
Frane Polić
aba9ded2a3
feat(workflows): update product workflow ( #4982 )
...
**What**
- added "update product" workflow
Co-authored-by: Riqwan Thamir <5105988+riqwan@users.noreply.github.com >
2023-10-19 12:02:40 +00:00
Sebastian Rindom
66413d094e
feat: move create inventory to @medusajs/workflows ( #5301 )
...
**Why**
- We have some workflow-like flows in @medusajs/medusa. These should be moved over to the workflows package.
- Inventory Items <> Variant currently assume a 1-1 mapping. There should be support for a many-to-many mapping.
**What**
- PR introduces a feature flag for supporting many-to-many mappings for inventory and variants.
- Deletes legacy transaction handler in @medusajs/medusa.
- Adjusts existing createInventoryItems handler to remove dependency on variant data.
**Unkowns**
~~1. Couldn't find an existing test for the CreateProduct workflow. It should be tested that this still works as expected.~~
2. Have removed transaction managers as we should move to handling consistency through orchestration tooling. Are we ready for that?
2023-10-11 18:01:56 +00:00
github-actions[bot]
dab8a82cc1
chore: Version Packages ( #5171 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-29 14:17:21 -04:00
Adrien de Peretti
202049f8aa
fix(medusa, workflows): Create product workflow with Isolated modules + module registration ( #5081 )
...
* fix(medusa, workflows): Isolated modules
* Create polite-kangaroos-rhyme.md
* finalise
* naming
2023-09-21 17:10:14 +02:00
github-actions[bot]
223a4a4cd9
chore: Version Packages ( #5002 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-15 17:09:34 +02:00
github-actions[bot]
98b91d1137
chore: Version Packages ( #4891 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-09-08 14:09:39 +02:00
Carlos R. L. Rodrigues
4d16acf5f0
feat(link-modules,modules-sdk, utils, types, products) - Remote Link and Link modules ( #4695 )
...
What:
- Definition of all Modules links
- `link-modules` package to manage the creation of all pre-defined link or custom ones
```typescript
import { initialize as iniInventory } from "@medusajs/inventory";
import { initialize as iniProduct } from "@medusajs/product";
import {
initialize as iniLinks,
runMigrations as migrateLinks
} from "@medusajs/link-modules";
await Promise.all([iniInventory(), iniProduct()]);
await migrateLinks(); // create tables based on previous loaded modules
await iniLinks(); // load link based on previous loaded modules
await iniLinks(undefined, [
{
serviceName: "product_custom_translation_service_link",
isLink: true,
databaseConfig: {
tableName: "product_transalations",
},
alias: [
{
name: "translations",
},
],
primaryKeys: ["id", "product_id", "translation_id"],
relationships: [
{
serviceName: Modules.PRODUCT,
primaryKey: "id",
foreignKey: "product_id",
alias: "product",
},
{
serviceName: "custom_translation_service",
primaryKey: "id",
foreignKey: "translation_id",
alias: "transalation",
deleteCascade: true,
},
],
extends: [
{
serviceName: Modules.PRODUCT,
relationship: {
serviceName: "product_custom_translation_service_link",
primaryKey: "product_id",
foreignKey: "id",
alias: "translations",
isList: true,
},
},
{
serviceName: "custom_translation_service",
relationship: {
serviceName: "product_custom_translation_service_link",
primaryKey: "product_id",
foreignKey: "id",
alias: "product_link",
},
},
],
},
]); // custom links
```
Remote Link
```typescript
import { RemoteLink, Modules } from "@medusajs/modules-sdk";
// [...] initialize modules and links
const remoteLink = new RemoteLink();
// upsert the relationship
await remoteLink.create({ // one (object) or many (array)
[Modules.PRODUCT]: {
variant_id: "var_abc",
},
[Modules.INVENTORY]: {
inventory_item_id: "iitem_abc",
},
data: { // optional additional fields
required_quantity: 5
}
});
// dismiss (doesn't cascade)
await remoteLink.dismiss({ // one (object) or many (array)
[Modules.PRODUCT]: {
variant_id: "var_abc",
},
[Modules.INVENTORY]: {
inventory_item_id: "iitem_abc",
},
});
// delete
await remoteLink.delete({
// every key is a module
[Modules.PRODUCT]: {
// every key is a linkable field
variant_id: "var_abc", // single or multiple values
},
});
// restore
await remoteLink.restore({
// every key is a module
[Modules.PRODUCT]: {
// every key is a linkable field
variant_id: "var_abc", // single or multiple values
},
});
```
Co-authored-by: Riqwan Thamir <5105988+riqwan@users.noreply.github.com >
2023-08-30 14:31:32 +00:00
github-actions[bot]
db36258885
chore: Version Packages ( #4711 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-17 17:17:41 +02:00
Oli Juhl
1d2637572b
chore: Remove rimraf from prepare ( #4741 )
2023-08-11 22:55:59 +02:00
Adrien de Peretti
a268d2cb0b
feat(workflows): Data aggregation ( #4732 )
...
* apply the aggregator automatically
* add comment
* apply aggregate
* improve pipe aggregation
* improve test cases
* improvements
* clean tests
* renameing to merge
* fix merge apply
* move merge apply
* cleanup cart workflow and end point
* fixes and naming
2023-08-10 14:01:56 +02:00
Adrien de Peretti
ac866ebb51
test(): Test the create product workflow compensation ( #4716 )
...
**What**
Integration tests to validate the workflow compensation.
Also, fix the transaction state when the workflow is compensating and some steps does not have any compensation
2023-08-09 14:33:04 +00:00
Carlos R. L. Rodrigues
c0ca002901
feat(orchestration,workflows): pipe oncomplete and workflow preparation ( #4697 )
...
* chore: pipe onComplete and workflow preparation step
* changeset
* fix: tests
---------
Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com >
Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com >
2023-08-08 13:06:47 +02:00
Riqwan Thamir
281b0746cf
feat(medusa,workflows) Create cart workflow ( #4685 )
...
* chore: add baseline test for create cart
* chore: add basic paths into handlers + make first tests pass
* chore: move input alias to cart specific workflow
* chore: move data around into buckets
* chore: normalize handlers and introduce types
* chore: move aliases to handlers concern
* chore: add compensation step for create cart
* chore: merge with latest develop
* chore: handle error manually + type inputs
* chore: handle error manually
* chore: added types for each handler
* chore: remove addresses
* chore: added changset
* chore: undo package changes
* chore: added config settings to retreieve, cleanup of types
* chore: capitalize cart handlers
* chore: rename todo
* chore: add feature flag for workflow
* chore: reorder handlers
* chore: add logger to route handler
* chore: removed weird vscode moving around things
* chore: refactor handlers
* chore: refactor compensate step
* chore: changed poistion
* chore: aggregate config data
* chore: moved handlers to their own domain + pr review addressing
* chore: address pr reviews
* chore: move types to type package
* chore: update type to include config
* chore: remove error scoping
2023-08-08 12:10:27 +02:00
Riqwan Thamir
a42c41e8ab
chore: scope errors on workflow to invoke ( #4709 )
...
what:
Scopes the errors from the exported workflow to return only invoke errors.
If an error occurs on the invoke level, it'll stop the invoke flow and begin the compensation flow. If another error shows up on the compensate level, it doesn't make sense to throw that error since the user won't be able to do anything about it.
2023-08-07 17:02:38 +00:00
Adrien de Peretti
8ae31aff4b
feat(workflows):product handlers should be reusable in different context ( #4703 )
...
**What**
The listProducts handler should not be specific to the workflow.
Same for the product removal, shouldn't expect an entire DTO but just a collection of object that at least contains the id.
Same principle applied to other product handlers
2023-08-07 16:22:22 +00:00
github-actions[bot]
0deecf353f
chore: Version Packages ( #4643 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-07 13:43:54 +02:00
Adrien de Peretti
dc46927bc6
feat(medusa, types, utils, workflow): Migrate medusa workflow to the workflow package ( #4682 )
2023-08-05 16:03:45 +02:00
Adrien de Peretti
43f34866c8
feat(workflows): Improve typings ( #4689 )
...
Just improve some typings for simpler usage
2023-08-04 08:11:44 +00:00
Adrien de Peretti
8b67c676fa
feat(workflow): Add pipe tests ( #4675 )
...
* feat(workflow): Add pipe tests
* improve tests
2023-08-02 16:46:30 +02:00
Adrien de Peretti
e78c47b66f
fix(workflows): Workflow types ( #4673 )
...
* fix(workflow): types and handlers
* add middleware pipe example
* Create nine-gorillas-collect.md
2023-08-02 13:50:06 +02:00
github-actions[bot]
5a569c4a20
chore: Version Packages ( #4591 )
...
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-07-27 13:19:14 +02:00
Carlos R. L. Rodrigues
f12299deb1
Feat: @medusajs/workflows ( #4553 )
...
feat: medusa workflows
2023-07-25 10:13:14 -03:00