@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModulesSdkTypes } from "@medusajs/types";
|
|
2
1
|
import { LoaderOptions } from "@medusajs/modules-sdk";
|
|
2
|
+
import { ModulesSdkTypes } from "@medusajs/types";
|
|
3
3
|
declare const _default: ({ container, options, }: LoaderOptions<ModulesSdkTypes.ModuleServiceInitializeOptions | ModulesSdkTypes.ModuleServiceInitializeCustomDataLayerOptions>) => Promise<void>;
|
|
4
4
|
export default _default;
|
|
@@ -34,6 +34,8 @@ exports.default = async ({ container, options, }) => {
|
|
|
34
34
|
moneyAmountService: (0, awilix_1.asClass)(defaultServices.MoneyAmountService).singleton(),
|
|
35
35
|
priceSetService: (0, awilix_1.asClass)(defaultServices.PriceSetService).singleton(),
|
|
36
36
|
ruleTypeService: (0, awilix_1.asClass)(defaultServices.RuleTypeService).singleton(),
|
|
37
|
+
priceSetMoneyAmountRulesService: (0, awilix_1.asClass)(defaultServices.PriceSetMoneyAmountRulesService).singleton(),
|
|
38
|
+
priceRuleService: (0, awilix_1.asClass)(defaultServices.PriceRuleService).singleton(),
|
|
37
39
|
});
|
|
38
40
|
if (customRepositories) {
|
|
39
41
|
(0, utils_1.loadCustomRepositories)({
|
|
@@ -53,5 +55,7 @@ function loadDefaultRepositories({ container }) {
|
|
|
53
55
|
moneyAmountRepository: (0, awilix_1.asClass)(defaultRepositories.MoneyAmountRepository).singleton(),
|
|
54
56
|
priceSetRepository: (0, awilix_1.asClass)(defaultRepositories.PriceSetRepository).singleton(),
|
|
55
57
|
ruleTypeRepository: (0, awilix_1.asClass)(defaultRepositories.RuleTypeRepository).singleton(),
|
|
58
|
+
priceSetMoneyAmountRulesRepository: (0, awilix_1.asClass)(defaultRepositories.PriceSetMoneyAmountRulesRepository).singleton(),
|
|
59
|
+
priceRuleRepository: (0, awilix_1.asClass)(defaultRepositories.PriceRuleRepository).singleton(),
|
|
56
60
|
});
|
|
57
61
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Migration20230928154931 = void 0;
|
|
4
|
+
const migrations_1 = require("@mikro-orm/migrations");
|
|
5
|
+
class Migration20230928154931 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, "number_rules" integer not null default 0, 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('create table "price_set_money_amount_rules" ("id" text not null, "price_set_money_amount_id" text not null, "rule_type_id" text not null, "value" text not null, constraint "price_set_money_amount_rules_pkey" primary key ("id"));');
|
|
17
|
+
this.addSql('create index "IDX_price_set_money_amount_rules_price_set_money_amount_id" on "price_set_money_amount_rules" ("price_set_money_amount_id");');
|
|
18
|
+
this.addSql('create index "IDX_price_set_money_amount_rules_rule_type_id" on "price_set_money_amount_rules" ("rule_type_id");');
|
|
19
|
+
this.addSql('create table "price_rule" ("id" text not null, "price_set_id" text not null, "rule_type_id" text not null, "is_dynamic" boolean not null default false, "value" text not null, "priority" integer not null default 0, "price_set_money_amount_id" text not null, "price_list_id" text not null, constraint "price_rule_pkey" primary key ("id"));');
|
|
20
|
+
this.addSql('create index "IDX_price_rule_price_set_id" on "price_rule" ("price_set_id");');
|
|
21
|
+
this.addSql('create index "IDX_price_rule_rule_type_id" on "price_rule" ("rule_type_id");');
|
|
22
|
+
this.addSql('create index "IDX_price_rule_price_set_money_amount_id" on "price_rule" ("price_set_money_amount_id");');
|
|
23
|
+
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;');
|
|
24
|
+
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;');
|
|
25
|
+
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;');
|
|
26
|
+
this.addSql('alter table "price_set_money_amount_rules" add constraint "price_set_money_amount_rules_price_set_money_amount_id_foreign" foreign key ("price_set_money_amount_id") references "price_set_money_amount" ("id") on update cascade;');
|
|
27
|
+
this.addSql('alter table "price_set_money_amount_rules" add constraint "price_set_money_amount_rules_rule_type_id_foreign" foreign key ("rule_type_id") references "rule_type" ("id") on update cascade;');
|
|
28
|
+
this.addSql('alter table "price_rule" add constraint "price_rule_price_set_id_foreign" foreign key ("price_set_id") references "price_set" ("id") on update cascade on delete cascade;');
|
|
29
|
+
this.addSql('alter table "price_rule" add constraint "price_rule_rule_type_id_foreign" foreign key ("rule_type_id") references "rule_type" ("id") on update cascade;');
|
|
30
|
+
this.addSql('alter table "price_rule" add constraint "price_rule_price_set_money_amount_id_foreign" foreign key ("price_set_money_amount_id") references "price_set_money_amount" ("id") on update cascade;');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.Migration20230928154931 = Migration20230928154931;
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as Currency } from "./currency";
|
|
2
2
|
export { default as MoneyAmount } from "./money-amount";
|
|
3
|
+
export { default as PriceRule } from "./price-rule";
|
|
3
4
|
export { default as PriceSet } from "./price-set";
|
|
4
5
|
export { default as PriceSetMoneyAmount } from "./price-set-money-amount";
|
|
6
|
+
export { default as PriceSetMoneyAmountRules } from "./price-set-money-amount-rules";
|
|
5
7
|
export { default as RuleType } from "./rule-type";
|
package/dist/models/index.js
CHANGED
|
@@ -3,14 +3,18 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.RuleType = exports.PriceSetMoneyAmount = exports.PriceSet = exports.MoneyAmount = exports.Currency = void 0;
|
|
6
|
+
exports.RuleType = exports.PriceSetMoneyAmountRules = exports.PriceSetMoneyAmount = exports.PriceSet = exports.PriceRule = exports.MoneyAmount = exports.Currency = void 0;
|
|
7
7
|
var currency_1 = require("./currency");
|
|
8
8
|
Object.defineProperty(exports, "Currency", { enumerable: true, get: function () { return __importDefault(currency_1).default; } });
|
|
9
9
|
var money_amount_1 = require("./money-amount");
|
|
10
10
|
Object.defineProperty(exports, "MoneyAmount", { enumerable: true, get: function () { return __importDefault(money_amount_1).default; } });
|
|
11
|
+
var price_rule_1 = require("./price-rule");
|
|
12
|
+
Object.defineProperty(exports, "PriceRule", { enumerable: true, get: function () { return __importDefault(price_rule_1).default; } });
|
|
11
13
|
var price_set_1 = require("./price-set");
|
|
12
14
|
Object.defineProperty(exports, "PriceSet", { enumerable: true, get: function () { return __importDefault(price_set_1).default; } });
|
|
13
15
|
var price_set_money_amount_1 = require("./price-set-money-amount");
|
|
14
16
|
Object.defineProperty(exports, "PriceSetMoneyAmount", { enumerable: true, get: function () { return __importDefault(price_set_money_amount_1).default; } });
|
|
17
|
+
var price_set_money_amount_rules_1 = require("./price-set-money-amount-rules");
|
|
18
|
+
Object.defineProperty(exports, "PriceSetMoneyAmountRules", { enumerable: true, get: function () { return __importDefault(price_set_money_amount_rules_1).default; } });
|
|
15
19
|
var rule_type_1 = require("./rule-type");
|
|
16
20
|
Object.defineProperty(exports, "RuleType", { enumerable: true, get: function () { return __importDefault(rule_type_1).default; } });
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OptionalProps } from "@mikro-orm/core";
|
|
2
|
+
import PriceSet from "./price-set";
|
|
3
|
+
import PriceSetMoneyAmount from "./price-set-money-amount";
|
|
4
|
+
import RuleType from "./rule-type";
|
|
5
|
+
type OptionalFields = "id" | "is_dynamic" | "priority";
|
|
6
|
+
type OptionalRelations = "price_set" | "rule_type" | "price_set_money_amount";
|
|
7
|
+
export default class PriceRule {
|
|
8
|
+
[OptionalProps]: OptionalFields | OptionalRelations;
|
|
9
|
+
id: string;
|
|
10
|
+
price_set: PriceSet;
|
|
11
|
+
rule_type: RuleType;
|
|
12
|
+
is_dynamic: boolean;
|
|
13
|
+
value: string;
|
|
14
|
+
priority: number;
|
|
15
|
+
price_set_money_amount: PriceSetMoneyAmount;
|
|
16
|
+
price_list_id: string;
|
|
17
|
+
beforeCreate(): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const core_1 = require("@mikro-orm/core");
|
|
16
|
+
const utils_1 = require("@medusajs/utils");
|
|
17
|
+
const price_set_1 = __importDefault(require("./price-set"));
|
|
18
|
+
const price_set_money_amount_1 = __importDefault(require("./price-set-money-amount"));
|
|
19
|
+
const rule_type_1 = __importDefault(require("./rule-type"));
|
|
20
|
+
let PriceRule = class PriceRule {
|
|
21
|
+
// TODO: Add price list
|
|
22
|
+
beforeCreate() {
|
|
23
|
+
this.id = (0, utils_1.generateEntityId)(this.id, "pset");
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, core_1.PrimaryKey)({ columnType: "text" }),
|
|
28
|
+
__metadata("design:type", String)
|
|
29
|
+
], PriceRule.prototype, "id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, core_1.ManyToOne)({
|
|
32
|
+
entity: () => price_set_1.default,
|
|
33
|
+
fieldName: "price_set_id",
|
|
34
|
+
name: "price_rule_price_set_id_unique",
|
|
35
|
+
onDelete: "cascade",
|
|
36
|
+
index: "IDX_price_rule_price_set_id",
|
|
37
|
+
}),
|
|
38
|
+
__metadata("design:type", price_set_1.default)
|
|
39
|
+
], PriceRule.prototype, "price_set", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, core_1.ManyToOne)({
|
|
42
|
+
entity: () => rule_type_1.default,
|
|
43
|
+
fieldName: "rule_type_id",
|
|
44
|
+
name: "price_rule_rule_type_id_unique",
|
|
45
|
+
index: "IDX_price_rule_rule_type_id",
|
|
46
|
+
}),
|
|
47
|
+
__metadata("design:type", rule_type_1.default)
|
|
48
|
+
], PriceRule.prototype, "rule_type", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, core_1.Property)({ columnType: "boolean", default: false }),
|
|
51
|
+
__metadata("design:type", Boolean)
|
|
52
|
+
], PriceRule.prototype, "is_dynamic", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, core_1.Property)({ columnType: "text" }),
|
|
55
|
+
__metadata("design:type", String)
|
|
56
|
+
], PriceRule.prototype, "value", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, core_1.Property)({ columnType: "integer", default: 0 }),
|
|
59
|
+
__metadata("design:type", Number)
|
|
60
|
+
], PriceRule.prototype, "priority", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, core_1.ManyToOne)({
|
|
63
|
+
entity: () => price_set_money_amount_1.default,
|
|
64
|
+
fieldName: "price_set_money_amount_id",
|
|
65
|
+
name: "price_set_money_amount_id_unique",
|
|
66
|
+
index: "IDX_price_rule_price_set_money_amount_id",
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:type", price_set_money_amount_1.default)
|
|
69
|
+
], PriceRule.prototype, "price_set_money_amount", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, core_1.Property)({ columnType: "text" }),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], PriceRule.prototype, "price_list_id", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, core_1.BeforeCreate)(),
|
|
76
|
+
__metadata("design:type", Function),
|
|
77
|
+
__metadata("design:paramtypes", []),
|
|
78
|
+
__metadata("design:returntype", void 0)
|
|
79
|
+
], PriceRule.prototype, "beforeCreate", null);
|
|
80
|
+
PriceRule = __decorate([
|
|
81
|
+
(0, core_1.Entity)()
|
|
82
|
+
], PriceRule);
|
|
83
|
+
exports.default = PriceRule;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import PriceSetMoneyAmount from "./price-set-money-amount";
|
|
2
|
+
import RuleType from "./rule-type";
|
|
3
|
+
export default class PriceSetMoneyAmountRules {
|
|
4
|
+
id: string;
|
|
5
|
+
price_set_money_amount?: PriceSetMoneyAmount | string;
|
|
6
|
+
rule_type?: RuleType | string;
|
|
7
|
+
value: string;
|
|
8
|
+
onCreate(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const utils_1 = require("@medusajs/utils");
|
|
16
|
+
const core_1 = require("@mikro-orm/core");
|
|
17
|
+
const price_set_money_amount_1 = __importDefault(require("./price-set-money-amount"));
|
|
18
|
+
const rule_type_1 = __importDefault(require("./rule-type"));
|
|
19
|
+
let PriceSetMoneyAmountRules = class PriceSetMoneyAmountRules {
|
|
20
|
+
onCreate() {
|
|
21
|
+
this.id = (0, utils_1.generateEntityId)(this.id, "psmar");
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
__decorate([
|
|
25
|
+
(0, core_1.PrimaryKey)({ columnType: "text" }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], PriceSetMoneyAmountRules.prototype, "id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, core_1.ManyToOne)(() => price_set_money_amount_1.default, {
|
|
30
|
+
index: "IDX_price_set_money_amount_rules_price_set_money_amount_id",
|
|
31
|
+
}),
|
|
32
|
+
__metadata("design:type", Object)
|
|
33
|
+
], PriceSetMoneyAmountRules.prototype, "price_set_money_amount", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, core_1.ManyToOne)(() => rule_type_1.default, {
|
|
36
|
+
index: "IDX_price_set_money_amount_rules_rule_type_id",
|
|
37
|
+
}),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], PriceSetMoneyAmountRules.prototype, "rule_type", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, core_1.Property)({ columnType: "text" }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], PriceSetMoneyAmountRules.prototype, "value", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, core_1.BeforeCreate)(),
|
|
46
|
+
__metadata("design:type", Function),
|
|
47
|
+
__metadata("design:paramtypes", []),
|
|
48
|
+
__metadata("design:returntype", void 0)
|
|
49
|
+
], PriceSetMoneyAmountRules.prototype, "onCreate", null);
|
|
50
|
+
PriceSetMoneyAmountRules = __decorate([
|
|
51
|
+
(0, core_1.Entity)()
|
|
52
|
+
], PriceSetMoneyAmountRules);
|
|
53
|
+
exports.default = PriceSetMoneyAmountRules;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
-
import { PrimaryKeyType } from "@mikro-orm/core";
|
|
1
|
+
import { Collection, PrimaryKeyType } from "@mikro-orm/core";
|
|
2
2
|
import MoneyAmount from "./money-amount";
|
|
3
|
+
import PriceRule from "./price-rule";
|
|
3
4
|
import PriceSet from "./price-set";
|
|
5
|
+
import PriceSetMoneyAmountRules from "./price-set-money-amount-rules";
|
|
4
6
|
export default class PriceSetMoneyAmount {
|
|
5
7
|
id: string;
|
|
6
8
|
title: string;
|
|
7
9
|
price_set?: PriceSet;
|
|
8
10
|
money_amount?: MoneyAmount;
|
|
11
|
+
number_rules?: number;
|
|
12
|
+
price_rules: Collection<PriceRule, object>;
|
|
13
|
+
price_set_money_amount_rules: Collection<PriceSetMoneyAmountRules, object>;
|
|
9
14
|
onCreate(): void;
|
|
10
15
|
[PrimaryKeyType]?: [string, string];
|
|
11
16
|
constructor(money_amount: MoneyAmount, price_set: PriceSet);
|
|
@@ -15,12 +15,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const utils_1 = require("@medusajs/utils");
|
|
16
16
|
const core_1 = require("@mikro-orm/core");
|
|
17
17
|
const money_amount_1 = __importDefault(require("./money-amount"));
|
|
18
|
+
const price_rule_1 = __importDefault(require("./price-rule"));
|
|
18
19
|
const price_set_1 = __importDefault(require("./price-set"));
|
|
20
|
+
const price_set_money_amount_rules_1 = __importDefault(require("./price-set-money-amount-rules"));
|
|
19
21
|
let PriceSetMoneyAmount = class PriceSetMoneyAmount {
|
|
20
22
|
onCreate() {
|
|
21
23
|
this.id = (0, utils_1.generateEntityId)(this.id, "psma");
|
|
22
24
|
}
|
|
23
25
|
constructor(money_amount, price_set) {
|
|
26
|
+
this.price_rules = new core_1.Collection(this);
|
|
27
|
+
this.price_set_money_amount_rules = new core_1.Collection(this);
|
|
24
28
|
this.money_amount = money_amount;
|
|
25
29
|
this.price_set = price_set;
|
|
26
30
|
}
|
|
@@ -46,6 +50,24 @@ __decorate([
|
|
|
46
50
|
}),
|
|
47
51
|
__metadata("design:type", money_amount_1.default)
|
|
48
52
|
], PriceSetMoneyAmount.prototype, "money_amount", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, core_1.Property)({ columnType: "integer", default: 0 }),
|
|
55
|
+
__metadata("design:type", Number)
|
|
56
|
+
], PriceSetMoneyAmount.prototype, "number_rules", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, core_1.OneToMany)({
|
|
59
|
+
entity: () => price_rule_1.default,
|
|
60
|
+
mappedBy: (pr) => pr.price_set_money_amount,
|
|
61
|
+
}),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], PriceSetMoneyAmount.prototype, "price_rules", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, core_1.OneToMany)({
|
|
66
|
+
entity: () => price_set_money_amount_rules_1.default,
|
|
67
|
+
mappedBy: (psmar) => psmar.price_set_money_amount,
|
|
68
|
+
}),
|
|
69
|
+
__metadata("design:type", Object)
|
|
70
|
+
], PriceSetMoneyAmount.prototype, "price_set_money_amount_rules", void 0);
|
|
49
71
|
__decorate([
|
|
50
72
|
(0, core_1.BeforeCreate)(),
|
|
51
73
|
__metadata("design:type", Function),
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { Collection } from "@mikro-orm/core";
|
|
1
|
+
import { Collection, OptionalProps } from "@mikro-orm/core";
|
|
2
2
|
import MoneyAmount from "./money-amount";
|
|
3
|
+
import PriceRule from "./price-rule";
|
|
4
|
+
import PriceSetMoneyAmount from "./price-set-money-amount";
|
|
3
5
|
export default class PriceSet {
|
|
6
|
+
[OptionalProps]?: "price_set_money_amounts";
|
|
4
7
|
id: string;
|
|
8
|
+
price_set_money_amounts: Collection<PriceSetMoneyAmount, object>;
|
|
9
|
+
price_rules: Collection<PriceRule, object>;
|
|
5
10
|
money_amounts: Collection<MoneyAmount, object>;
|
|
6
11
|
onCreate(): void;
|
|
7
12
|
}
|
package/dist/models/price-set.js
CHANGED
|
@@ -15,9 +15,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const utils_1 = require("@medusajs/utils");
|
|
16
16
|
const core_1 = require("@mikro-orm/core");
|
|
17
17
|
const money_amount_1 = __importDefault(require("./money-amount"));
|
|
18
|
+
const price_rule_1 = __importDefault(require("./price-rule"));
|
|
18
19
|
const price_set_money_amount_1 = __importDefault(require("./price-set-money-amount"));
|
|
19
20
|
let PriceSet = class PriceSet {
|
|
20
21
|
constructor() {
|
|
22
|
+
this.price_set_money_amounts = new core_1.Collection(this);
|
|
23
|
+
this.price_rules = new core_1.Collection(this);
|
|
21
24
|
this.money_amounts = new core_1.Collection(this);
|
|
22
25
|
}
|
|
23
26
|
onCreate() {
|
|
@@ -28,6 +31,18 @@ __decorate([
|
|
|
28
31
|
(0, core_1.PrimaryKey)({ columnType: "text" }),
|
|
29
32
|
__metadata("design:type", String)
|
|
30
33
|
], PriceSet.prototype, "id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, core_1.OneToMany)(() => price_set_money_amount_1.default, (psma) => psma.price_set, {
|
|
36
|
+
cascade: [core_1.Cascade.REMOVE],
|
|
37
|
+
}),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], PriceSet.prototype, "price_set_money_amounts", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, core_1.OneToMany)(() => price_rule_1.default, (pr) => pr.price_set, {
|
|
42
|
+
cascade: [core_1.Cascade.REMOVE],
|
|
43
|
+
}),
|
|
44
|
+
__metadata("design:type", Object)
|
|
45
|
+
], PriceSet.prototype, "price_rules", void 0);
|
|
31
46
|
__decorate([
|
|
32
47
|
(0, core_1.ManyToMany)({
|
|
33
48
|
entity: () => money_amount_1.default,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { MikroOrmBaseRepository as BaseRepository } from "@medusajs/utils";
|
|
2
2
|
export { CurrencyRepository } from "./currency";
|
|
3
3
|
export { MoneyAmountRepository } from "./money-amount";
|
|
4
|
+
export { PriceRuleRepository } from "./price-rule";
|
|
4
5
|
export { PriceSetRepository } from "./price-set";
|
|
6
|
+
export { PriceSetMoneyAmountRulesRepository } from "./price-set-money-amount-rules";
|
|
5
7
|
export { RuleTypeRepository } from "./rule-type";
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RuleTypeRepository = exports.PriceSetRepository = exports.MoneyAmountRepository = exports.CurrencyRepository = exports.BaseRepository = void 0;
|
|
3
|
+
exports.RuleTypeRepository = exports.PriceSetMoneyAmountRulesRepository = exports.PriceSetRepository = exports.PriceRuleRepository = exports.MoneyAmountRepository = exports.CurrencyRepository = exports.BaseRepository = void 0;
|
|
4
4
|
var utils_1 = require("@medusajs/utils");
|
|
5
5
|
Object.defineProperty(exports, "BaseRepository", { enumerable: true, get: function () { return utils_1.MikroOrmBaseRepository; } });
|
|
6
6
|
var currency_1 = require("./currency");
|
|
7
7
|
Object.defineProperty(exports, "CurrencyRepository", { enumerable: true, get: function () { return currency_1.CurrencyRepository; } });
|
|
8
8
|
var money_amount_1 = require("./money-amount");
|
|
9
9
|
Object.defineProperty(exports, "MoneyAmountRepository", { enumerable: true, get: function () { return money_amount_1.MoneyAmountRepository; } });
|
|
10
|
+
var price_rule_1 = require("./price-rule");
|
|
11
|
+
Object.defineProperty(exports, "PriceRuleRepository", { enumerable: true, get: function () { return price_rule_1.PriceRuleRepository; } });
|
|
10
12
|
var price_set_1 = require("./price-set");
|
|
11
13
|
Object.defineProperty(exports, "PriceSetRepository", { enumerable: true, get: function () { return price_set_1.PriceSetRepository; } });
|
|
14
|
+
var price_set_money_amount_rules_1 = require("./price-set-money-amount-rules");
|
|
15
|
+
Object.defineProperty(exports, "PriceSetMoneyAmountRulesRepository", { enumerable: true, get: function () { return price_set_money_amount_rules_1.PriceSetMoneyAmountRulesRepository; } });
|
|
12
16
|
var rule_type_1 = require("./rule-type");
|
|
13
17
|
Object.defineProperty(exports, "RuleTypeRepository", { enumerable: true, get: function () { return rule_type_1.RuleTypeRepository; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Context, CreatePriceRuleDTO, DAL, UpdatePriceRuleDTO } from "@medusajs/types";
|
|
2
|
+
import { DALUtils } from "@medusajs/utils";
|
|
3
|
+
import { PriceRule } from "../models";
|
|
4
|
+
import { SqlEntityManager } from "@mikro-orm/postgresql";
|
|
5
|
+
export declare class PriceRuleRepository extends DALUtils.MikroOrmBaseRepository {
|
|
6
|
+
protected readonly manager_: SqlEntityManager;
|
|
7
|
+
constructor({ manager }: {
|
|
8
|
+
manager: SqlEntityManager;
|
|
9
|
+
});
|
|
10
|
+
find(findOptions?: DAL.FindOptions<PriceRule>, context?: Context): Promise<PriceRule[]>;
|
|
11
|
+
findAndCount(findOptions?: DAL.FindOptions<PriceRule>, context?: Context): Promise<[PriceRule[], number]>;
|
|
12
|
+
delete(ids: string[], context?: Context): Promise<void>;
|
|
13
|
+
create(data: CreatePriceRuleDTO[], context?: Context): Promise<PriceRule[]>;
|
|
14
|
+
update(data: UpdatePriceRuleDTO[], context?: Context): Promise<PriceRule[]>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PriceRuleRepository = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
|
5
|
+
const core_1 = require("@mikro-orm/core");
|
|
6
|
+
const _models_1 = require("../models");
|
|
7
|
+
class PriceRuleRepository extends utils_1.DALUtils.MikroOrmBaseRepository {
|
|
8
|
+
constructor({ manager }) {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
// eslint-disable-next-line prefer-rest-params
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.manager_ = manager;
|
|
13
|
+
}
|
|
14
|
+
async find(findOptions = { where: {} }, context = {}) {
|
|
15
|
+
const manager = this.getActiveManager(context);
|
|
16
|
+
const findOptions_ = { ...findOptions };
|
|
17
|
+
findOptions_.options ?? (findOptions_.options = {});
|
|
18
|
+
Object.assign(findOptions_.options, {
|
|
19
|
+
strategy: core_1.LoadStrategy.SELECT_IN,
|
|
20
|
+
});
|
|
21
|
+
return await manager.find(_models_1.PriceRule, findOptions_.where, findOptions_.options);
|
|
22
|
+
}
|
|
23
|
+
async findAndCount(findOptions = { where: {} }, context = {}) {
|
|
24
|
+
const manager = this.getActiveManager(context);
|
|
25
|
+
const findOptions_ = { ...findOptions };
|
|
26
|
+
findOptions_.options ?? (findOptions_.options = {});
|
|
27
|
+
Object.assign(findOptions_.options, {
|
|
28
|
+
strategy: core_1.LoadStrategy.SELECT_IN,
|
|
29
|
+
});
|
|
30
|
+
return await manager.findAndCount(_models_1.PriceRule, findOptions_.where, findOptions_.options);
|
|
31
|
+
}
|
|
32
|
+
async delete(ids, context = {}) {
|
|
33
|
+
const manager = this.getActiveManager(context);
|
|
34
|
+
await manager.nativeDelete(_models_1.PriceRule, { id: { $in: ids } }, {});
|
|
35
|
+
}
|
|
36
|
+
async create(data, context = {}) {
|
|
37
|
+
const manager = this.getActiveManager(context);
|
|
38
|
+
const toCreate = data.map((ruleData) => {
|
|
39
|
+
const ruleDataClone = { ...ruleData };
|
|
40
|
+
ruleDataClone.rule_type = ruleData.rule_type_id;
|
|
41
|
+
ruleDataClone.price_set = ruleData.price_set_id;
|
|
42
|
+
ruleDataClone.price_set_money_amount = ruleData.price_set_money_amount_id;
|
|
43
|
+
return ruleDataClone;
|
|
44
|
+
});
|
|
45
|
+
const priceRules = toCreate.map((ruleData) => {
|
|
46
|
+
return manager.create(_models_1.PriceRule, ruleData);
|
|
47
|
+
});
|
|
48
|
+
manager.persist(priceRules);
|
|
49
|
+
return priceRules;
|
|
50
|
+
}
|
|
51
|
+
async update(data, context = {}) {
|
|
52
|
+
const manager = this.getActiveManager(context);
|
|
53
|
+
const priceRuleIds = data.map((priceRuleData) => priceRuleData.id);
|
|
54
|
+
const existingPriceRules = await this.find({
|
|
55
|
+
where: {
|
|
56
|
+
id: {
|
|
57
|
+
$in: priceRuleIds,
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
}, context);
|
|
61
|
+
const existingPriceRulesMap = new Map(existingPriceRules.map((priceRule) => [
|
|
62
|
+
priceRule.id,
|
|
63
|
+
priceRule,
|
|
64
|
+
]));
|
|
65
|
+
const priceRules = data.map((priceRuleData) => {
|
|
66
|
+
const existingPriceRule = existingPriceRulesMap.get(priceRuleData.id);
|
|
67
|
+
if (!existingPriceRule) {
|
|
68
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_FOUND, `PriceRule with id "${priceRuleData.id}" not found`);
|
|
69
|
+
}
|
|
70
|
+
return manager.assign(existingPriceRule, priceRuleData);
|
|
71
|
+
});
|
|
72
|
+
manager.persist(priceRules);
|
|
73
|
+
return priceRules;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.PriceRuleRepository = PriceRuleRepository;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Context, CreatePriceSetMoneyAmountRulesDTO, DAL, UpdatePriceSetMoneyAmountRulesDTO } from "@medusajs/types";
|
|
2
|
+
import { DALUtils } from "@medusajs/utils";
|
|
3
|
+
import { SqlEntityManager } from "@mikro-orm/postgresql";
|
|
4
|
+
import { PriceSetMoneyAmountRules } from "../models";
|
|
5
|
+
export declare class PriceSetMoneyAmountRulesRepository extends DALUtils.MikroOrmBaseRepository {
|
|
6
|
+
protected readonly manager_: SqlEntityManager;
|
|
7
|
+
constructor({ manager }: {
|
|
8
|
+
manager: SqlEntityManager;
|
|
9
|
+
});
|
|
10
|
+
find(findOptions?: DAL.FindOptions<PriceSetMoneyAmountRules>, context?: Context): Promise<PriceSetMoneyAmountRules[]>;
|
|
11
|
+
findAndCount(findOptions?: DAL.FindOptions<PriceSetMoneyAmountRules>, context?: Context): Promise<[PriceSetMoneyAmountRules[], number]>;
|
|
12
|
+
delete(ids: string[], context?: Context): Promise<void>;
|
|
13
|
+
create(data: CreatePriceSetMoneyAmountRulesDTO[], context?: Context): Promise<PriceSetMoneyAmountRules[]>;
|
|
14
|
+
update(data: UpdatePriceSetMoneyAmountRulesDTO[], context?: Context): Promise<PriceSetMoneyAmountRules[]>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PriceSetMoneyAmountRulesRepository = void 0;
|
|
4
|
+
const utils_1 = require("@medusajs/utils");
|
|
5
|
+
const core_1 = require("@mikro-orm/core");
|
|
6
|
+
const _models_1 = require("../models");
|
|
7
|
+
class PriceSetMoneyAmountRulesRepository extends utils_1.DALUtils.MikroOrmBaseRepository {
|
|
8
|
+
constructor({ manager }) {
|
|
9
|
+
// @ts-ignore
|
|
10
|
+
// eslint-disable-next-line prefer-rest-params
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.manager_ = manager;
|
|
13
|
+
}
|
|
14
|
+
async find(findOptions = { where: {} }, context = {}) {
|
|
15
|
+
const manager = this.getActiveManager(context);
|
|
16
|
+
const findOptions_ = { ...findOptions };
|
|
17
|
+
findOptions_.options ?? (findOptions_.options = {});
|
|
18
|
+
Object.assign(findOptions_.options, {
|
|
19
|
+
strategy: core_1.LoadStrategy.SELECT_IN,
|
|
20
|
+
});
|
|
21
|
+
return await manager.find(_models_1.PriceSetMoneyAmountRules, findOptions_.where, findOptions_.options);
|
|
22
|
+
}
|
|
23
|
+
async findAndCount(findOptions = { where: {} }, context = {}) {
|
|
24
|
+
const manager = this.getActiveManager(context);
|
|
25
|
+
const findOptions_ = { ...findOptions };
|
|
26
|
+
findOptions_.options ?? (findOptions_.options = {});
|
|
27
|
+
Object.assign(findOptions_.options, {
|
|
28
|
+
strategy: core_1.LoadStrategy.SELECT_IN,
|
|
29
|
+
});
|
|
30
|
+
return await manager.findAndCount(_models_1.PriceSetMoneyAmountRules, findOptions_.where, findOptions_.options);
|
|
31
|
+
}
|
|
32
|
+
async delete(ids, context = {}) {
|
|
33
|
+
const manager = this.getActiveManager(context);
|
|
34
|
+
await manager.nativeDelete(_models_1.PriceSetMoneyAmountRules, { id: { $in: ids } });
|
|
35
|
+
}
|
|
36
|
+
async create(data, context = {}) {
|
|
37
|
+
const manager = this.getActiveManager(context);
|
|
38
|
+
const psmar = data.map((psmarData) => {
|
|
39
|
+
return manager.create(_models_1.PriceSetMoneyAmountRules, psmarData);
|
|
40
|
+
});
|
|
41
|
+
manager.persistAndFlush(psmar);
|
|
42
|
+
return psmar;
|
|
43
|
+
}
|
|
44
|
+
async update(data, context = {}) {
|
|
45
|
+
const manager = this.getActiveManager(context);
|
|
46
|
+
const psmarIds = data.map((psmar) => psmar.id);
|
|
47
|
+
const existingRecords = await this.find({
|
|
48
|
+
where: {
|
|
49
|
+
id: {
|
|
50
|
+
$in: psmarIds,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
}, context);
|
|
54
|
+
const psmarMap = new Map(existingRecords.map((psmar) => [
|
|
55
|
+
psmar.id,
|
|
56
|
+
psmar,
|
|
57
|
+
]));
|
|
58
|
+
const psmar = data.map((psmarData) => {
|
|
59
|
+
const existingRecord = psmarMap.get(psmarData.id);
|
|
60
|
+
if (!existingRecord) {
|
|
61
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_FOUND, `PriceSetMoneyAmountRules with id "${psmarData.id}" not found`);
|
|
62
|
+
}
|
|
63
|
+
return manager.assign(existingRecord, psmarData);
|
|
64
|
+
});
|
|
65
|
+
manager.persist(psmar);
|
|
66
|
+
return psmar;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.PriceSetMoneyAmountRulesRepository = PriceSetMoneyAmountRulesRepository;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export { default as CurrencyService } from "./currency";
|
|
2
2
|
export { default as MoneyAmountService } from "./money-amount";
|
|
3
|
+
export { default as PriceRuleService } from "./price-rule";
|
|
3
4
|
export { default as PriceSetService } from "./price-set";
|
|
5
|
+
export { default as PriceSetMoneyAmountRulesService } from "./price-set-money-amount-rules";
|
|
4
6
|
export { default as PricingModuleService } from "./pricing-module";
|
|
5
7
|
export { default as RuleTypeService } from "./rule-type";
|
package/dist/services/index.js
CHANGED
|
@@ -3,13 +3,17 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.RuleTypeService = exports.PricingModuleService = exports.PriceSetService = exports.MoneyAmountService = exports.CurrencyService = void 0;
|
|
6
|
+
exports.RuleTypeService = exports.PricingModuleService = exports.PriceSetMoneyAmountRulesService = exports.PriceSetService = exports.PriceRuleService = exports.MoneyAmountService = exports.CurrencyService = void 0;
|
|
7
7
|
var currency_1 = require("./currency");
|
|
8
8
|
Object.defineProperty(exports, "CurrencyService", { enumerable: true, get: function () { return __importDefault(currency_1).default; } });
|
|
9
9
|
var money_amount_1 = require("./money-amount");
|
|
10
10
|
Object.defineProperty(exports, "MoneyAmountService", { enumerable: true, get: function () { return __importDefault(money_amount_1).default; } });
|
|
11
|
+
var price_rule_1 = require("./price-rule");
|
|
12
|
+
Object.defineProperty(exports, "PriceRuleService", { enumerable: true, get: function () { return __importDefault(price_rule_1).default; } });
|
|
11
13
|
var price_set_1 = require("./price-set");
|
|
12
14
|
Object.defineProperty(exports, "PriceSetService", { enumerable: true, get: function () { return __importDefault(price_set_1).default; } });
|
|
15
|
+
var price_set_money_amount_rules_1 = require("./price-set-money-amount-rules");
|
|
16
|
+
Object.defineProperty(exports, "PriceSetMoneyAmountRulesService", { enumerable: true, get: function () { return __importDefault(price_set_money_amount_rules_1).default; } });
|
|
13
17
|
var pricing_module_1 = require("./pricing-module");
|
|
14
18
|
Object.defineProperty(exports, "PricingModuleService", { enumerable: true, get: function () { return __importDefault(pricing_module_1).default; } });
|
|
15
19
|
var rule_type_1 = require("./rule-type");
|
|
@@ -9,7 +9,6 @@ export default class MoneyAmountService<TEntity extends MoneyAmount = MoneyAmoun
|
|
|
9
9
|
retrieve(moneyAmountId: string, config?: FindConfig<PricingTypes.MoneyAmountDTO>, sharedContext?: Context): Promise<TEntity>;
|
|
10
10
|
list(filters?: PricingTypes.FilterableMoneyAmountProps, config?: FindConfig<PricingTypes.MoneyAmountDTO>, sharedContext?: Context): Promise<TEntity[]>;
|
|
11
11
|
listAndCount(filters?: PricingTypes.FilterableMoneyAmountProps, config?: FindConfig<PricingTypes.MoneyAmountDTO>, sharedContext?: Context): Promise<[TEntity[], number]>;
|
|
12
|
-
private buildQueryForList;
|
|
13
12
|
create(data: PricingTypes.CreateMoneyAmountDTO[], sharedContext?: Context): Promise<TEntity[]>;
|
|
14
13
|
update(data: PricingTypes.UpdateMoneyAmountDTO[], sharedContext?: Context): Promise<TEntity[]>;
|
|
15
14
|
delete(ids: string[], sharedContext?: Context): Promise<void>;
|