@medusajs/pricing 0.0.3 → 0.0.4-next-20230929123725
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/loaders/container.d.ts +1 -1
- package/dist/loaders/container.js +4 -0
- package/dist/migrations/{Migration20230913123118.d.ts → Migration20230928154931.d.ts} +1 -1
- package/dist/migrations/Migration20230928154931.js +33 -0
- package/dist/models/index.d.ts +2 -0
- package/dist/models/index.js +5 -1
- package/dist/models/price-rule.d.ts +19 -0
- package/dist/models/price-rule.js +83 -0
- package/dist/models/price-set-money-amount-rules.d.ts +9 -0
- package/dist/models/price-set-money-amount-rules.js +53 -0
- package/dist/models/price-set-money-amount.d.ts +6 -1
- package/dist/models/price-set-money-amount.js +22 -0
- package/dist/models/price-set.d.ts +6 -1
- package/dist/models/price-set.js +15 -0
- package/dist/repositories/index.d.ts +2 -0
- package/dist/repositories/index.js +5 -1
- package/dist/repositories/price-rule.d.ts +15 -0
- package/dist/repositories/price-rule.js +76 -0
- package/dist/repositories/price-set-money-amount-rules.d.ts +15 -0
- package/dist/repositories/price-set-money-amount-rules.js +69 -0
- package/dist/scripts/bin/run-migration-down.js +0 -0
- package/dist/scripts/bin/run-migration-up.js +0 -0
- package/dist/scripts/bin/run-seed.js +0 -0
- package/dist/services/index.d.ts +2 -0
- package/dist/services/index.js +5 -1
- package/dist/services/money-amount.d.ts +0 -1
- package/dist/services/money-amount.js +3 -8
- package/dist/services/price-rule.d.ts +16 -0
- package/dist/services/price-rule.js +91 -0
- package/dist/services/price-set-money-amount-rules.d.ts +17 -0
- package/dist/services/price-set-money-amount-rules.js +96 -0
- package/dist/services/price-set.d.ts +0 -1
- package/dist/services/price-set.js +3 -8
- package/dist/services/pricing-module.d.ts +21 -5
- package/dist/services/pricing-module.js +230 -26
- package/dist/services/rule-type.d.ts +0 -1
- package/dist/services/rule-type.js +3 -8
- package/package.json +4 -4
- package/dist/migrations/Migration20230913123118.js +0 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/pricing",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4-next-20230929123725",
|
|
4
4
|
"description": "Medusa Pricing module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"typescript": "^5.1.6"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@medusajs/modules-sdk": "
|
|
51
|
-
"@medusajs/types": "
|
|
52
|
-
"@medusajs/utils": "
|
|
50
|
+
"@medusajs/modules-sdk": "1.11.3-next-20230929123725",
|
|
51
|
+
"@medusajs/types": "1.11.2-next-20230929123725",
|
|
52
|
+
"@medusajs/utils": "1.10.2-next-20230929123725",
|
|
53
53
|
"@mikro-orm/core": "5.7.12",
|
|
54
54
|
"@mikro-orm/migrations": "5.7.12",
|
|
55
55
|
"@mikro-orm/postgresql": "5.7.12",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Migration20230913123118 = void 0;
|
|
4
|
-
const migrations_1 = require("@mikro-orm/migrations");
|
|
5
|
-
class Migration20230913123118 extends migrations_1.Migration {
|
|
6
|
-
async up() {
|
|
7
|
-
this.addSql('create table "currency" ("code" text not null, "symbol" text not null, "symbol_native" text not null, "name" text not null, constraint "currency_pkey" primary key ("code"));');
|
|
8
|
-
this.addSql('create table "money_amount" ("id" text not null, "currency_code" text null, "amount" numeric null, "min_quantity" numeric null, "max_quantity" numeric null, constraint "money_amount_pkey" primary key ("id"));');
|
|
9
|
-
this.addSql('create index "IDX_money_amount_currency_code" on "money_amount" ("currency_code");');
|
|
10
|
-
this.addSql('create table "price_set" ("id" text not null, constraint "price_set_pkey" primary key ("id"));');
|
|
11
|
-
this.addSql('create table "price_set_money_amount" ("id" text not null, "title" text not null, "price_set_id" text not null, "money_amount_id" text not null, constraint "price_set_money_amount_pkey" primary key ("id"));');
|
|
12
|
-
this.addSql('create index "IDX_price_set_money_amount_price_set_id" on "price_set_money_amount" ("price_set_id");');
|
|
13
|
-
this.addSql('create index "IDX_price_set_money_amount_money_amount_id" on "price_set_money_amount" ("money_amount_id");');
|
|
14
|
-
this.addSql('create table "rule_type" ("id" text not null, "name" text not null, "rule_attribute" text not null, "default_priority" integer not null default 0, constraint "rule_type_pkey" primary key ("id"));');
|
|
15
|
-
this.addSql('create index "IDX_rule_type_rule_attribute" on "rule_type" ("rule_attribute");');
|
|
16
|
-
this.addSql('alter table "money_amount" add constraint "money_amount_currency_code_foreign" foreign key ("currency_code") references "currency" ("code") on update cascade on delete set null;');
|
|
17
|
-
this.addSql('alter table "price_set_money_amount" add constraint "price_set_money_amount_price_set_id_foreign" foreign key ("price_set_id") references "price_set" ("id") on update cascade on delete cascade;');
|
|
18
|
-
this.addSql('alter table "price_set_money_amount" add constraint "price_set_money_amount_money_amount_id_foreign" foreign key ("money_amount_id") references "money_amount" ("id") on update cascade;');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.Migration20230913123118 = Migration20230913123118;
|