@winible/winible-typed 2.4.9 → 2.5.0
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/typed-model/index.js +3 -1
- package/dist/typed-model/index.js.map +1 -1
- package/dist/typed-model/subscription-coupon.js +18 -18
- package/dist/typed-model/subscription-coupon.js.map +1 -1
- package/dist/typed-model/subscription-pricing-option-on-coupons.js +55 -0
- package/dist/typed-model/subscription-pricing-option-on-coupons.js.map +1 -0
- package/package.json +1 -1
- package/typed-model/index.ts +1 -0
- package/typed-model/subscription-coupon.ts +19 -19
- package/typed-model/subscription-pricing-option-on-coupons.ts +78 -0
@@ -3,7 +3,7 @@ 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.User = exports.LeagueOnUsers = exports.League = exports.Withdrawal = exports.RecurlyAccount = exports.SubscriptionPricingOption = exports.SubscriptionCoupon = exports.SubscriptionPlanOnPost = exports.SubscriptionPlanOnUsers = exports.SubscriptionPlan = exports.PostsOnUsers = exports.Post = exports.pbSequelize = exports.Notification = exports.Media = exports.MediaAsset = exports.Transaction = exports.ContentLike = void 0;
|
6
|
+
exports.SubscriptionPricingOptionOnCoupons = exports.User = exports.LeagueOnUsers = exports.League = exports.Withdrawal = exports.RecurlyAccount = exports.SubscriptionPricingOption = exports.SubscriptionCoupon = exports.SubscriptionPlanOnPost = exports.SubscriptionPlanOnUsers = exports.SubscriptionPlan = exports.PostsOnUsers = exports.Post = exports.pbSequelize = exports.Notification = exports.Media = exports.MediaAsset = exports.Transaction = exports.ContentLike = void 0;
|
7
7
|
var content_like_1 = require("./content-like");
|
8
8
|
Object.defineProperty(exports, "ContentLike", { enumerable: true, get: function () { return __importDefault(content_like_1).default; } });
|
9
9
|
var transaction_1 = require("./transaction");
|
@@ -40,4 +40,6 @@ var league_on_users_1 = require("./league-on-users");
|
|
40
40
|
Object.defineProperty(exports, "LeagueOnUsers", { enumerable: true, get: function () { return __importDefault(league_on_users_1).default; } });
|
41
41
|
var user_1 = require("./user");
|
42
42
|
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
|
43
|
+
var subscription_pricing_option_on_coupons_1 = require("./subscription-pricing-option-on-coupons");
|
44
|
+
Object.defineProperty(exports, "SubscriptionPricingOptionOnCoupons", { enumerable: true, get: function () { return __importDefault(subscription_pricing_option_on_coupons_1).default; } });
|
43
45
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../typed-model/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAwD;AAA/C,4HAAA,OAAO,OAAe;AAC/B,6CAAuD;AAA9C,2HAAA,OAAO,OAAe;AAC/B,6CAAsD;AAA7C,0HAAA,OAAO,OAAc;AAC9B,iCAA2C;AAAlC,+GAAA,OAAO,OAAS;AACzB,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,+CAAwD;AAA/C,4HAAA,OAAO,OAAe;AAC/B,+BAAyC;AAAhC,6GAAA,OAAO,OAAQ;AACxB,mDAA2D;AAAlD,+HAAA,OAAO,OAAgB;AAChC,yDAAkE;AAAzD,sIAAA,OAAO,OAAoB;AACpC,2EAAkF;AAAzE,sJAAA,OAAO,OAA2B;AAC3C,yEAAgF;AAAvE,oJAAA,OAAO,OAA0B;AAC1C,6DAAsE;AAA7D,0IAAA,OAAO,OAAsB;AACtC,6EAAqF;AAA5E,yJAAA,OAAO,OAA6B;AAC7C,qDAA8D;AAArD,kIAAA,OAAO,OAAkB;AAClC,2CAAqD;AAA5C,yHAAA,OAAO,OAAc;AAC9B,mCAA6C;AAApC,iHAAA,OAAO,OAAU;AAC1B,qDAA6D;AAApD,iIAAA,OAAO,OAAiB;AACjC,+BAAyC;AAAhC,6GAAA,OAAO,OAAQ"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../typed-model/index.ts"],"names":[],"mappings":";;;;;;AAAA,+CAAwD;AAA/C,4HAAA,OAAO,OAAe;AAC/B,6CAAuD;AAA9C,2HAAA,OAAO,OAAe;AAC/B,6CAAsD;AAA7C,0HAAA,OAAO,OAAc;AAC9B,iCAA2C;AAAlC,+GAAA,OAAO,OAAS;AACzB,+CAAyD;AAAhD,6HAAA,OAAO,OAAgB;AAChC,+CAAwD;AAA/C,4HAAA,OAAO,OAAe;AAC/B,+BAAyC;AAAhC,6GAAA,OAAO,OAAQ;AACxB,mDAA2D;AAAlD,+HAAA,OAAO,OAAgB;AAChC,yDAAkE;AAAzD,sIAAA,OAAO,OAAoB;AACpC,2EAAkF;AAAzE,sJAAA,OAAO,OAA2B;AAC3C,yEAAgF;AAAvE,oJAAA,OAAO,OAA0B;AAC1C,6DAAsE;AAA7D,0IAAA,OAAO,OAAsB;AACtC,6EAAqF;AAA5E,yJAAA,OAAO,OAA6B;AAC7C,qDAA8D;AAArD,kIAAA,OAAO,OAAkB;AAClC,2CAAqD;AAA5C,yHAAA,OAAO,OAAc;AAC9B,mCAA6C;AAApC,iHAAA,OAAO,OAAU;AAC1B,qDAA6D;AAApD,iIAAA,OAAO,OAAiB;AACjC,+BAAyC;AAAhC,6GAAA,OAAO,OAAQ;AACxB,mGAAyG;AAAhG,6KAAA,OAAO,OAAsC"}
|
@@ -26,14 +26,14 @@ SubscriptionCoupon.init({
|
|
26
26
|
model: _1.SubscriptionPlan,
|
27
27
|
},
|
28
28
|
},
|
29
|
-
subscriptionPricingOptionId: {
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
},
|
29
|
+
// subscriptionPricingOptionId: {
|
30
|
+
// type: DataTypes.BIGINT,
|
31
|
+
// allowNull: false,
|
32
|
+
// field: "subscription_pricing_option_id",
|
33
|
+
// references: {
|
34
|
+
// model: SubscriptionPricingOption,
|
35
|
+
// },
|
36
|
+
// },
|
37
37
|
name: {
|
38
38
|
type: sequelize_1.DataTypes.STRING,
|
39
39
|
field: "name",
|
@@ -82,15 +82,15 @@ SubscriptionCoupon.hasOne(_1.SubscriptionPlan, {
|
|
82
82
|
foreignKey: "id",
|
83
83
|
sourceKey: "subscriptionPlanId",
|
84
84
|
});
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
});
|
91
|
-
SubscriptionCoupon.hasOne(
|
92
|
-
|
93
|
-
|
94
|
-
});
|
85
|
+
// SubscriptionPricingOption.hasMany(SubscriptionCoupon, {
|
86
|
+
// foreignKey: "subscriptionPricingOptionId",
|
87
|
+
// sourceKey: "id",
|
88
|
+
// onDelete: "NO ACTION",
|
89
|
+
// constraints: false,
|
90
|
+
// });
|
91
|
+
// SubscriptionCoupon.hasOne(SubscriptionPricingOption, {
|
92
|
+
// foreignKey: "id",
|
93
|
+
// sourceKey: "subscriptionPricingOptionId",
|
94
|
+
// });
|
95
95
|
exports.default = SubscriptionCoupon;
|
96
96
|
//# sourceMappingURL=subscription-coupon.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subscription-coupon.js","sourceRoot":"","sources":["../../typed-model/subscription-coupon.ts"],"names":[],"mappings":";;;;;AAAA,yCAMmB;AAEnB,kEAAuC;AACvC,sDAAsD;AAEtD,wCAA0D;AAC1D,wBAAgE;AAEhE,mEAAmE;AACnE,MAAM,kBAAmB,SAAQ,iBAGhC;CAgBA;AAED,kBAAkB,CAAC,IAAI,CACrB;IACE,EAAE,EAAE;QACF,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,KAAK;QAChB,YAAY,EAAE,sBAAS,CAAC,EAAE,CAAC,SAAS,CAAC;KACtC;IACD,kBAAkB,EAAE;QAClB,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,sBAAsB;QAC7B,UAAU,EAAE;YACV,KAAK,EAAE,mBAAgB;SACxB;KACF;IACD,
|
1
|
+
{"version":3,"file":"subscription-coupon.js","sourceRoot":"","sources":["../../typed-model/subscription-coupon.ts"],"names":[],"mappings":";;;;;AAAA,yCAMmB;AAEnB,kEAAuC;AACvC,sDAAsD;AAEtD,wCAA0D;AAC1D,wBAAgE;AAEhE,mEAAmE;AACnE,MAAM,kBAAmB,SAAQ,iBAGhC;CAgBA;AAED,kBAAkB,CAAC,IAAI,CACrB;IACE,EAAE,EAAE;QACF,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,KAAK;QAChB,YAAY,EAAE,sBAAS,CAAC,EAAE,CAAC,SAAS,CAAC;KACtC;IACD,kBAAkB,EAAE;QAClB,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,sBAAsB;QAC7B,UAAU,EAAE;YACV,KAAK,EAAE,mBAAgB;SACxB;KACF;IACD,iCAAiC;IACjC,4BAA4B;IAC5B,sBAAsB;IACtB,6CAA6C;IAC7C,kBAAkB;IAClB,wCAAwC;IACxC,OAAO;IACP,KAAK;IACL,IAAI,EAAE;QACJ,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,MAAM;KACd;IACD,IAAI,EAAE;QACJ,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,MAAM;KACd;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,qBAAS,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC;QACpD,KAAK,EAAE,eAAe;KACvB;IACD,eAAe,EAAE;QACf,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,kBAAkB;KAC1B;IACD,cAAc,EAAE;QACd,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,iBAAiB;KACzB;IACD,WAAW,EAAE;QACX,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,aAAa;KACrB;IACD,cAAc,EAAE;QACd,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,iBAAiB;KACzB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,qBAAS,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,oBAAY,CAAC,CAAC;QACpD,KAAK,EAAE,eAAe;KACvB;IACD,SAAS,EAAE,qBAAS,CAAC,IAAI;IACzB,SAAS,EAAE,qBAAS,CAAC,IAAI;CAC1B,EACD;IACE,SAAS,EAAE,sBAAsB;IACjC,SAAS,EAAT,sBAAS;CACV,CACF,CAAC;AAEF,mBAAgB,CAAC,OAAO,CAAC,kBAAkB,EAAE;IAC3C,UAAU,EAAE,oBAAoB;IAChC,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,kBAAkB,CAAC,MAAM,CAAC,mBAAgB,EAAE;IAC1C,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,oBAAoB;CAChC,CAAC,CAAC;AAEH,0DAA0D;AAC1D,+CAA+C;AAC/C,qBAAqB;AACrB,2BAA2B;AAC3B,wBAAwB;AACxB,MAAM;AAEN,yDAAyD;AACzD,sBAAsB;AACtB,8CAA8C;AAC9C,MAAM;AAEN,kBAAe,kBAAkB,CAAC"}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
+
const sequelize_1 = require("sequelize");
|
7
|
+
const _1 = require(".");
|
8
|
+
const pb_sequelize_1 = __importDefault(require("./pb-sequelize"));
|
9
|
+
// order of InferAttributes & InferCreationAttributes is important.
|
10
|
+
class SubscriptionPricingOptionOnCoupons extends sequelize_1.Model {
|
11
|
+
}
|
12
|
+
SubscriptionPricingOptionOnCoupons.init({
|
13
|
+
id: {
|
14
|
+
type: sequelize_1.DataTypes.BIGINT,
|
15
|
+
primaryKey: true,
|
16
|
+
allowNull: false,
|
17
|
+
defaultValue: pb_sequelize_1.default.fn("next_id"),
|
18
|
+
},
|
19
|
+
subscriptionCouponId: {
|
20
|
+
type: sequelize_1.DataTypes.BIGINT,
|
21
|
+
field: "subscription_coupon_id",
|
22
|
+
},
|
23
|
+
subscriptionPricingOptionId: {
|
24
|
+
type: sequelize_1.DataTypes.BIGINT,
|
25
|
+
field: "subscription_pricing_option_id",
|
26
|
+
},
|
27
|
+
createdAt: sequelize_1.DataTypes.DATE,
|
28
|
+
updatedAt: sequelize_1.DataTypes.DATE,
|
29
|
+
}, {
|
30
|
+
sequelize: pb_sequelize_1.default,
|
31
|
+
tableName: "subscription_pricing_option_on_coupons",
|
32
|
+
});
|
33
|
+
_1.SubscriptionCoupon.hasMany(SubscriptionPricingOptionOnCoupons, {
|
34
|
+
foreignKey: "subscriptionCouponId",
|
35
|
+
sourceKey: "id",
|
36
|
+
});
|
37
|
+
SubscriptionPricingOptionOnCoupons.hasOne(_1.SubscriptionCoupon, {
|
38
|
+
foreignKey: "id",
|
39
|
+
sourceKey: "subscriptionCouponId",
|
40
|
+
onDelete: "NO ACTION",
|
41
|
+
constraints: false,
|
42
|
+
});
|
43
|
+
_1.SubscriptionPricingOption.hasMany(SubscriptionPricingOptionOnCoupons, {
|
44
|
+
foreignKey: "subscriptionPricingOptionId",
|
45
|
+
onDelete: "NO ACTION",
|
46
|
+
constraints: false,
|
47
|
+
});
|
48
|
+
SubscriptionPricingOptionOnCoupons.hasOne(_1.SubscriptionPricingOption, {
|
49
|
+
foreignKey: "id",
|
50
|
+
sourceKey: "subscriptionPricingOptionId",
|
51
|
+
onDelete: "NO ACTION",
|
52
|
+
constraints: false,
|
53
|
+
});
|
54
|
+
exports.default = SubscriptionPricingOptionOnCoupons;
|
55
|
+
//# sourceMappingURL=subscription-pricing-option-on-coupons.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"subscription-pricing-option-on-coupons.js","sourceRoot":"","sources":["../../typed-model/subscription-pricing-option-on-coupons.ts"],"names":[],"mappings":";;;;;AAAA,yCAMmB;AAEnB,wBAAkE;AAElE,kEAAuC;AAEvC,mEAAmE;AACnE,MAAM,kCAAmC,SAAQ,iBAGhD;CASA;AAED,kCAAkC,CAAC,IAAI,CACrC;IACE,EAAE,EAAE;QACF,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,UAAU,EAAE,IAAI;QAChB,SAAS,EAAE,KAAK;QAChB,YAAY,EAAE,sBAAS,CAAC,EAAE,CAAC,SAAS,CAAC;KACtC;IACD,oBAAoB,EAAE;QACpB,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,wBAAwB;KAChC;IACD,2BAA2B,EAAE;QAC3B,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,gCAAgC;KACxC;IACD,SAAS,EAAE,qBAAS,CAAC,IAAI;IACzB,SAAS,EAAE,qBAAS,CAAC,IAAI;CAC1B,EACD;IACE,SAAS,EAAT,sBAAS;IACT,SAAS,EAAE,wCAAwC;CACpD,CACF,CAAC;AAEF,qBAAkB,CAAC,OAAO,CAAC,kCAAkC,EAAE;IAC7D,UAAU,EAAE,sBAAsB;IAClC,SAAS,EAAE,IAAI;CAChB,CAAC,CAAC;AAEH,kCAAkC,CAAC,MAAM,CAAC,qBAAkB,EAAE;IAC5D,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,sBAAsB;IACjC,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,4BAAyB,CAAC,OAAO,CAAC,kCAAkC,EAAE;IACpE,UAAU,EAAE,6BAA6B;IACzC,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,kCAAkC,CAAC,MAAM,CAAC,4BAAyB,EAAE;IACnE,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,6BAA6B;IACxC,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,kBAAe,kCAAkC,CAAC"}
|
package/package.json
CHANGED
package/typed-model/index.ts
CHANGED
@@ -16,3 +16,4 @@ export { default as Withdrawal } from "./withdrawal";
|
|
16
16
|
export { default as League } from "./league";
|
17
17
|
export { default as LeagueOnUsers } from "./league-on-users";
|
18
18
|
export { default as User } from "./user";
|
19
|
+
export { default as SubscriptionPricingOptionOnCoupons } from "./subscription-pricing-option-on-coupons";
|
@@ -21,7 +21,7 @@ class SubscriptionCoupon extends Model<
|
|
21
21
|
// when creating an instance of the model (such as using Model.create()).
|
22
22
|
declare id: CreationOptional<string>;
|
23
23
|
declare subscriptionPlanId: string;
|
24
|
-
declare subscriptionPricingOptionId: string;
|
24
|
+
// declare subscriptionPricingOptionId: string;
|
25
25
|
declare name?: string;
|
26
26
|
declare code?: string;
|
27
27
|
declare discountType?: DiscountType;
|
@@ -50,14 +50,14 @@ SubscriptionCoupon.init(
|
|
50
50
|
model: SubscriptionPlan,
|
51
51
|
},
|
52
52
|
},
|
53
|
-
subscriptionPricingOptionId: {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
},
|
53
|
+
// subscriptionPricingOptionId: {
|
54
|
+
// type: DataTypes.BIGINT,
|
55
|
+
// allowNull: false,
|
56
|
+
// field: "subscription_pricing_option_id",
|
57
|
+
// references: {
|
58
|
+
// model: SubscriptionPricingOption,
|
59
|
+
// },
|
60
|
+
// },
|
61
61
|
name: {
|
62
62
|
type: DataTypes.STRING,
|
63
63
|
field: "name",
|
@@ -111,16 +111,16 @@ SubscriptionCoupon.hasOne(SubscriptionPlan, {
|
|
111
111
|
sourceKey: "subscriptionPlanId",
|
112
112
|
});
|
113
113
|
|
114
|
-
SubscriptionPricingOption.hasMany(SubscriptionCoupon, {
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
});
|
114
|
+
// SubscriptionPricingOption.hasMany(SubscriptionCoupon, {
|
115
|
+
// foreignKey: "subscriptionPricingOptionId",
|
116
|
+
// sourceKey: "id",
|
117
|
+
// onDelete: "NO ACTION",
|
118
|
+
// constraints: false,
|
119
|
+
// });
|
120
120
|
|
121
|
-
SubscriptionCoupon.hasOne(SubscriptionPricingOption, {
|
122
|
-
|
123
|
-
|
124
|
-
});
|
121
|
+
// SubscriptionCoupon.hasOne(SubscriptionPricingOption, {
|
122
|
+
// foreignKey: "id",
|
123
|
+
// sourceKey: "subscriptionPricingOptionId",
|
124
|
+
// });
|
125
125
|
|
126
126
|
export default SubscriptionCoupon;
|
@@ -0,0 +1,78 @@
|
|
1
|
+
import {
|
2
|
+
Model,
|
3
|
+
InferAttributes,
|
4
|
+
InferCreationAttributes,
|
5
|
+
CreationOptional,
|
6
|
+
DataTypes,
|
7
|
+
} from "sequelize";
|
8
|
+
|
9
|
+
import { SubscriptionCoupon, SubscriptionPricingOption } from ".";
|
10
|
+
|
11
|
+
import sequelize from "./pb-sequelize";
|
12
|
+
|
13
|
+
// order of InferAttributes & InferCreationAttributes is important.
|
14
|
+
class SubscriptionPricingOptionOnCoupons extends Model<
|
15
|
+
InferAttributes<SubscriptionPricingOptionOnCoupons>,
|
16
|
+
InferCreationAttributes<SubscriptionPricingOptionOnCoupons>
|
17
|
+
> {
|
18
|
+
// 'CreationOptional' is a special type that marks the field as optional
|
19
|
+
// when creating an instance of the model (such as using Model.create()).
|
20
|
+
declare id: CreationOptional<string>;
|
21
|
+
declare subscriptionCouponId: string;
|
22
|
+
declare subscriptionPricingOptionId: string;
|
23
|
+
|
24
|
+
declare createdAt: CreationOptional<Date>;
|
25
|
+
declare updatedAt: CreationOptional<Date>;
|
26
|
+
}
|
27
|
+
|
28
|
+
SubscriptionPricingOptionOnCoupons.init(
|
29
|
+
{
|
30
|
+
id: {
|
31
|
+
type: DataTypes.BIGINT,
|
32
|
+
primaryKey: true,
|
33
|
+
allowNull: false,
|
34
|
+
defaultValue: sequelize.fn("next_id"),
|
35
|
+
},
|
36
|
+
subscriptionCouponId: {
|
37
|
+
type: DataTypes.BIGINT,
|
38
|
+
field: "subscription_coupon_id",
|
39
|
+
},
|
40
|
+
subscriptionPricingOptionId: {
|
41
|
+
type: DataTypes.BIGINT,
|
42
|
+
field: "subscription_pricing_option_id",
|
43
|
+
},
|
44
|
+
createdAt: DataTypes.DATE,
|
45
|
+
updatedAt: DataTypes.DATE,
|
46
|
+
},
|
47
|
+
{
|
48
|
+
sequelize,
|
49
|
+
tableName: "subscription_pricing_option_on_coupons",
|
50
|
+
}
|
51
|
+
);
|
52
|
+
|
53
|
+
SubscriptionCoupon.hasMany(SubscriptionPricingOptionOnCoupons, {
|
54
|
+
foreignKey: "subscriptionCouponId",
|
55
|
+
sourceKey: "id",
|
56
|
+
});
|
57
|
+
|
58
|
+
SubscriptionPricingOptionOnCoupons.hasOne(SubscriptionCoupon, {
|
59
|
+
foreignKey: "id",
|
60
|
+
sourceKey: "subscriptionCouponId",
|
61
|
+
onDelete: "NO ACTION",
|
62
|
+
constraints: false,
|
63
|
+
});
|
64
|
+
|
65
|
+
SubscriptionPricingOption.hasMany(SubscriptionPricingOptionOnCoupons, {
|
66
|
+
foreignKey: "subscriptionPricingOptionId",
|
67
|
+
onDelete: "NO ACTION",
|
68
|
+
constraints: false,
|
69
|
+
});
|
70
|
+
|
71
|
+
SubscriptionPricingOptionOnCoupons.hasOne(SubscriptionPricingOption, {
|
72
|
+
foreignKey: "id",
|
73
|
+
sourceKey: "subscriptionPricingOptionId",
|
74
|
+
onDelete: "NO ACTION",
|
75
|
+
constraints: false,
|
76
|
+
});
|
77
|
+
|
78
|
+
export default SubscriptionPricingOptionOnCoupons;
|