c6dff873de72e5367c083a595b94a94d517b3f3e
12 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
378ca1b36e | feat(pricing,types,utils): Move calculate pricing query to a repository + rule type validation (#5294) | ||
|
|
c5703a4765 |
feat(pricing,types): addPrice and removePricreRules APIs (#5237)
* initial * initial service * update pricing module service * add integration test for rule-type * update pricing-module integration tests * update pricing service interface * feat(pricing): PriceSets as entry point to pricing module * chore: add price set money amount * chore: add price set money amount * chore: change name of test * chore: added changeset * chore: use filterable props from money amount in price sets * chore: update migrations * test update integration test * fix weird behavior * Update packages/pricing/integration-tests/__fixtures__/rule-type/index.ts Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * Apply suggestions from code review Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * move rule-type to common * chore: reset migration * chore: remove incorrect conflicts * chore: address review * chore: remove ghost price list * Apply suggestions from code review Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * update id prefix * use persist not persistAndflush * rename key_value to rule_attribute * more renaming * feat(types,pricing): add price set money amount rules to pricing module * chore: cleanup + add test cases for relationship update * chore: revert package json * chore: cleanup * initial * update pricing module service * update pricing-module integration tests * update pricing service interface * chore: update migrations * fix weird behavior * Apply suggestions from code review Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * move rule-type to common * chore: delete duplicate migration files * fix(link-modules): Fix link module initialization (#4990) **What** Add a new configuration on the relationship to specify if the relation is consumed from an internal service (from medusa core). In that case do not check if the service is part of the loaded modules * initial price rule * rebase develop * save here * final changes to create * update price rule integration test * add module integraiton tests for price rules * fix merge * redo wierd order change * pr cleanup * pr cleanup * pr cleanup * update pr * sort out migrations * [wip] * wip * chore: temporarily emulate mikroorm internals * currency code hard filtering * before creating subqueries * chore: wip * chore: wip * chore: add exact match multiple contexts * chore: add one more test * chore: add query that works with exact match * chore: qb the thingy * chore: add some comments * chore: removed extra filter * chore: added some more comments + prettify * chore: test with carlos * chore: add fallbacks and exact match tests * chore: cleanup * feat(types,pricing): add price set money amount rules to pricing module (#5065) * initial * initial service * update pricing module service * add integration test for rule-type * update pricing-module integration tests * update pricing service interface * feat(pricing): PriceSets as entry point to pricing module * chore: add price set money amount * chore: add price set money amount * chore: change name of test * chore: added changeset * chore: use filterable props from money amount in price sets * chore: update migrations * test update integration test * fix weird behavior * Update packages/pricing/integration-tests/__fixtures__/rule-type/index.ts Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * Apply suggestions from code review Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * move rule-type to common * chore: reset migration * chore: remove incorrect conflicts * chore: address review * chore: remove ghost price list * Apply suggestions from code review Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * update id prefix * use persist not persistAndflush * rename key_value to rule_attribute * more renaming * feat(types,pricing): add price set money amount rules to pricing module * chore: cleanup + add test cases for relationship update * chore: revert package json * chore: cleanup --------- Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com> Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * chore: minor cleanup * chore: added money amount scoping * chore: added review comments * chore: update changset and undo test scoping * add migration for price_set_rule_type table * update types * initial add * update tests * working create with rule-types * initial testing for money amount creation * add price set money amount repo and service * fix broken build * create price list with prices and rule types * create price set with info not being rules and money amounts * create price set initial working implementation * chore: introduce group by util + no queries on empty context * addPrices * remove comments * Feat/pricing module methods (#5218) chore: add removePrices to pricing module * fix broken integration test * Revert "Feat/pricing module methods (#5218)" (#5236) This reverts commit 95c8aaa66423d290a35b6e736e5b187e12d44a36. * feat(types,pricing): remove prices from a price set (#5235) feat(types,pricing): remove prices from a price set * add addRules * typing * add validation of price set ids for addRules * add rule_attribute check for addRules method * chore: review changes * chore: update schema * chore: first part of reviews * chore: reset migration * remove unnecessary init * update interface * use persist not persistAndflush * chore: added money amount scoping * chore: update schema * fix * fix 2 * add default pricing * addPrices * create * update pricing service interface * chore: rename money amounts to prices * chore: cleanup + changelog * chore: update package.json * chore: cleanup persistAndFlushes from services * jsdoc * chore: add js docs for price rules * chore: added js doc for psma and rule types * chore: added jsdoc for currencies * more jsdocs * jsdoc money amounts * chore: move jsdoc to interface * chore: remove persist and flush to persist * change overload --------- Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com> Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com> |
||
|
|
1e7db5a5cb |
feat(pricing, types, utils): Exact match based on context + fallback on rule priority if not (#5214)
* initial * initial service * update pricing module service * add integration test for rule-type * update pricing-module integration tests * update pricing service interface * feat(pricing): PriceSets as entry point to pricing module * chore: add price set money amount * chore: add price set money amount * chore: change name of test * chore: added changeset * chore: use filterable props from money amount in price sets * chore: update migrations * test update integration test * fix weird behavior * Update packages/pricing/integration-tests/__fixtures__/rule-type/index.ts Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * Apply suggestions from code review Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * move rule-type to common * chore: reset migration * chore: remove incorrect conflicts * chore: address review * chore: remove ghost price list * Apply suggestions from code review Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * update id prefix * use persist not persistAndflush * rename key_value to rule_attribute * more renaming * feat(types,pricing): add price set money amount rules to pricing module * chore: cleanup + add test cases for relationship update * chore: revert package json * chore: cleanup * initial * update pricing module service * update pricing-module integration tests * update pricing service interface * chore: update migrations * fix weird behavior * Apply suggestions from code review Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * move rule-type to common * chore: delete duplicate migration files * fix(link-modules): Fix link module initialization (#4990) **What** Add a new configuration on the relationship to specify if the relation is consumed from an internal service (from medusa core). In that case do not check if the service is part of the loaded modules * initial price rule * rebase develop * save here * final changes to create * update price rule integration test * add module integraiton tests for price rules * fix merge * redo wierd order change * pr cleanup * pr cleanup * pr cleanup * update pr * sort out migrations * [wip] * wip * chore: temporarily emulate mikroorm internals * currency code hard filtering * before creating subqueries * chore: wip * chore: wip * chore: add exact match multiple contexts * chore: add one more test * chore: add query that works with exact match * chore: qb the thingy * chore: add some comments * chore: removed extra filter * chore: added some more comments + prettify * chore: test with carlos * chore: add fallbacks and exact match tests * chore: cleanup * feat(types,pricing): add price set money amount rules to pricing module (#5065) * initial * initial service * update pricing module service * add integration test for rule-type * update pricing-module integration tests * update pricing service interface * feat(pricing): PriceSets as entry point to pricing module * chore: add price set money amount * chore: add price set money amount * chore: change name of test * chore: added changeset * chore: use filterable props from money amount in price sets * chore: update migrations * test update integration test * fix weird behavior * Update packages/pricing/integration-tests/__fixtures__/rule-type/index.ts Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * Apply suggestions from code review Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * move rule-type to common * chore: reset migration * chore: remove incorrect conflicts * chore: address review * chore: remove ghost price list * Apply suggestions from code review Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * update id prefix * use persist not persistAndflush * rename key_value to rule_attribute * more renaming * feat(types,pricing): add price set money amount rules to pricing module * chore: cleanup + add test cases for relationship update * chore: revert package json * chore: cleanup --------- Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com> Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * chore: minor cleanup * chore: added money amount scoping * chore: added review comments * chore: update changset and undo test scoping * chore: introduce group by util + no queries on empty context * Feat/pricing module methods (#5218) chore: add removePrices to pricing module * Revert "Feat/pricing module methods (#5218)" (#5236) This reverts commit 95c8aaa66423d290a35b6e736e5b187e12d44a36. * chore: review changes * chore: update schema * chore: reset migration --------- Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com> Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Adrien de Peretti <adrien.deperetti@gmail.com> |
||
|
|
bc42b201ea |
feat(pricing): add price rule entity (#5050)
**What** - add price-rule entity to pricing module blocked by #4977 Fixes CORE-1497 Co-authored-by: Riqwan Thamir <5105988+riqwan@users.noreply.github.com> Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com> |
||
|
|
edf90eecb4 |
feat(pricing) Add Price Set Rule Type (#4977)
* initial * initial service * update pricing module service * add integration test for rule-type * update pricing-module integration tests * update pricing service interface * feat(pricing): PriceSets as entry point to pricing module * chore: add price set money amount * chore: add price set money amount * chore: change name of test * chore: added changeset * chore: use filterable props from money amount in price sets * chore: update migrations * test update integration test * fix weird behavior * Update packages/pricing/integration-tests/__fixtures__/rule-type/index.ts Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * Apply suggestions from code review Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> * move rule-type to common * chore: reset migration * chore: remove incorrect conflicts * chore: address review * chore: remove ghost price list * Apply suggestions from code review Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> * update id prefix * use persist not persistAndflush * rename key_value to rule_attribute * more renaming --------- Co-authored-by: Riqwan Thamir <rmthamir@gmail.com> Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> |
||
|
|
5d10c46bb1 |
feat(medusa): Separate money amount and variant (#4906)
* initial changes * working test * final changes to product tests * update integration tests * update price list integration tests * update integration tests * update unit tests * update plugin integration tests * remove catch from integration test * undo change * add andWhere * update upsertCurrencyMoneyAmount method * undo line item changes * undo changes * update deprecated method * Update packages/medusa/src/migrations/1692953518123-drop_money_amount_constraints_for_pricing_module.ts Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com> * rename joinTable * update with joinTable entity * update load methods * remove await create * re-add context test * update price list behavior for prices * update price list snapshots * re-add admin seeder * pr feedback * fix unit tests * fix plugin integration tests * initial review changes * redo changes to variant creation --------- 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> |
||
|
|
3d68be2b6b |
fix(orchestration,link-modules,pricing,types): fix shippingprofile errror outside of core + change link alias name (#5025)
* fix(orchestration,link-modules,pricing,types): fix shippingprofile error outside of core + change link alias name * chore: scope relationships and move condition inside * chore: remove islist * chore: fix merge conflict * chore: reverted serviceName scoping * chore: change shape to make methodOverride compatible * chore: added methodOverride to remote query * chore: revert override |
||
|
|
834da5c41a |
feat(pricing, types): PriceSets as entry point to pricing module (#4978)
What: - Adds PriceSet, PriceSetMoneyAmount, updates schema - Adds service/repo for PriceSet - Shifts entry point to use PriceSet - Updates link/joiner config RESOLVES CORE-1495 |
||
|
|
66bd9a835c |
feat(products,types,pricing): allow scoping products by collection_id + pricing by currency_code (#4965)
* chore: allow scoping products by collection_id * chore: scope money amounts by currency code + change category_ids to category_id * chore: add an extra product to test without collection --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> |
||
|
|
fcb6b4f510 |
feat(pricing, utils, types): adds money amount to pricing module (#4909)
What: - Adds money amount service / repo / model - Adds money amount to entry service - Adds tests for services - Refreshes schema - Update joiner config to include money amounts RESOLVES CORE-1478 RESOLVES CORE-1479 Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com> Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com> |
||
|
|
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>
|
||
|
|
460161a69f |
feat(pricing, types, utils, medusa-sdk): Pricing Module Setup + Currency (#4860)
What: - Setups the skeleton for pricing module - Creates service/model/repository for currency model - Setups types - Setups DB - Moved some utils to a common place RESOLVES CORE-1477 RESOLVES CORE-1476 |