@winible/winible-typed 2.4.2 → 2.4.4
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/subscription-plan.js +5 -28
- package/dist/typed-model/subscription-plan.js.map +1 -1
- package/dist/typed-model/subscription-pricing-option.js +5 -14
- package/dist/typed-model/subscription-pricing-option.js.map +1 -1
- package/package.json +1 -1
- package/typed-model/subscription-plan.ts +10 -36
- package/typed-model/subscription-pricing-option.ts +6 -14
@@ -33,34 +33,11 @@ SubscriptionPlan.init({
|
|
33
33
|
type: sequelize_1.DataTypes.STRING,
|
34
34
|
field: "plan_description",
|
35
35
|
},
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
// intervalUnit: {
|
42
|
-
// type: DataTypes.STRING,
|
43
|
-
// field: "interval_unit",
|
44
|
-
// defaultValue: "months",
|
45
|
-
// },
|
46
|
-
// isArchived: {
|
47
|
-
// type: DataTypes.BOOLEAN,
|
48
|
-
// field: "is_archived",
|
49
|
-
// defaultValue: false,
|
50
|
-
// },
|
51
|
-
// oneTimePurchase: {
|
52
|
-
// type: DataTypes.BOOLEAN,
|
53
|
-
// field: "one_time_purchase",
|
54
|
-
// defaultValue: false,
|
55
|
-
// },
|
56
|
-
// accessEndDate: {
|
57
|
-
// type: DataTypes.DATE,
|
58
|
-
// field: "access_end_date",
|
59
|
-
// },
|
60
|
-
// recurlyPlanId: {
|
61
|
-
// type: DataTypes.STRING,
|
62
|
-
// field: "recurly_plan_id",
|
63
|
-
// },
|
36
|
+
isArchived: {
|
37
|
+
type: sequelize_1.DataTypes.BOOLEAN,
|
38
|
+
field: "is_archived",
|
39
|
+
defaultValue: false,
|
40
|
+
},
|
64
41
|
order: {
|
65
42
|
type: sequelize_1.DataTypes.INTEGER,
|
66
43
|
field: "order",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subscription-plan.js","sourceRoot":"","sources":["../../typed-model/subscription-plan.ts"],"names":[],"mappings":";;;;;AAAA,yCAOmB;AAEnB,kEAAuC;AACvC,kDAA0B;
|
1
|
+
{"version":3,"file":"subscription-plan.js","sourceRoot":"","sources":["../../typed-model/subscription-plan.ts"],"names":[],"mappings":";;;;;AAAA,yCAOmB;AAEnB,kEAAuC;AACvC,kDAA0B;AAG1B,gFAAuD;AAEvD,mEAAmE;AACnE,MAAM,gBAAiB,SAAQ,iBAG9B;CAmBA;AAED,gBAAgB,CAAC,IAAI,CACnB;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,MAAM,EAAE;QACN,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,SAAS;QAChB,UAAU,EAAE;YACV,KAAK,EAAE,cAAI;SACZ;KACF;IACD,QAAQ,EAAE;QACR,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,WAAW;KACnB;IACD,eAAe,EAAE;QACf,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,kBAAkB;KAC1B;IACD,UAAU,EAAE;QACV,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,KAAK,EAAE,aAAa;QACpB,YAAY,EAAE,KAAK;KACpB;IACD,KAAK,EAAE;QACL,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,KAAK,EAAE,OAAO;QACd,YAAY,EAAE,CAAC;KAChB;IACD,SAAS,EAAE,qBAAS,CAAC,IAAI;IACzB,SAAS,EAAE,qBAAS,CAAC,IAAI;CAC1B,EACD;IACE,SAAS,EAAE,oBAAoB;IAC/B,SAAS,EAAT,sBAAS;CACV,CACF,CAAC;AAEF;;;;EAIE;AAEF,gBAAgB,CAAC,OAAO,GAAG,KAAK,EAAE,EAAU,EAAE,EAAE;IAC9C,OAAO,MAAM,gBAAgB,CAAC,OAAO,CAAC;QACpC,KAAK,EAAE;YACL,EAAE;SACH;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,gBAAgB,CAAC,WAAW,GAAG,KAAK,EAAE,MAAc,EAAE,EAAE;IACtD,OAAO,MAAM,gBAAgB,CAAC,OAAO,CAAC;QACpC,KAAK,EAAE;YACL,MAAM;SACP;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,cAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE;IAC7B,UAAU,EAAE,QAAQ;IACpB,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,gBAAgB,CAAC,MAAM,CAAC,cAAI,EAAE;IAC5B,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,QAAQ;CACpB,CAAC,CAAC;AAEH,gBAAgB,CAAC,OAAO,CAAC,6BAAkB,EAAE;IAC3C,UAAU,EAAE,oBAAoB;IAChC,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,6BAAkB,CAAC,MAAM,CAAC,gBAAgB,EAAE;IAC1C,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,oBAAoB;CAChC,CAAC,CAAC;AAEH,kBAAe,gBAAgB,CAAC"}
|
@@ -24,6 +24,11 @@ SubscriptionPricingOption.init({
|
|
24
24
|
model: subscription_plan_1.default,
|
25
25
|
},
|
26
26
|
},
|
27
|
+
price: {
|
28
|
+
type: sequelize_1.DataTypes.BIGINT,
|
29
|
+
allowNull: false,
|
30
|
+
field: "price",
|
31
|
+
},
|
27
32
|
intervalLength: {
|
28
33
|
type: sequelize_1.DataTypes.INTEGER,
|
29
34
|
field: "interval_length",
|
@@ -34,20 +39,6 @@ SubscriptionPricingOption.init({
|
|
34
39
|
field: "interval_unit",
|
35
40
|
defaultValue: "months",
|
36
41
|
},
|
37
|
-
// isArchived: {
|
38
|
-
// type: DataTypes.BOOLEAN,
|
39
|
-
// field: "is_archived",
|
40
|
-
// defaultValue: false,
|
41
|
-
// },
|
42
|
-
// oneTimePurchase: {
|
43
|
-
// type: DataTypes.BOOLEAN,
|
44
|
-
// field: "one_time_purchase",
|
45
|
-
// defaultValue: false,
|
46
|
-
// },
|
47
|
-
// accessEndDate: {
|
48
|
-
// type: DataTypes.DATE,
|
49
|
-
// field: "access_end_date",
|
50
|
-
// },
|
51
42
|
recurlyPlanId: {
|
52
43
|
type: sequelize_1.DataTypes.STRING,
|
53
44
|
field: "recurly_plan_id",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"subscription-pricing-option.js","sourceRoot":"","sources":["../../typed-model/subscription-pricing-option.ts"],"names":[],"mappings":";;;;;AAAA,yCAMmB;AAEnB,kEAAuC;AACvC,4EAAmD;AAInD,mEAAmE;AACnE,MAAM,yBAA0B,SAAQ,iBAGvC;
|
1
|
+
{"version":3,"file":"subscription-pricing-option.js","sourceRoot":"","sources":["../../typed-model/subscription-pricing-option.ts"],"names":[],"mappings":";;;;;AAAA,yCAMmB;AAEnB,kEAAuC;AACvC,4EAAmD;AAInD,mEAAmE;AACnE,MAAM,yBAA0B,SAAQ,iBAGvC;CAYA;AAED,yBAAyB,CAAC,IAAI,CAC5B;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,2BAAgB;SACxB;KACF;IACD,KAAK,EAAE;QACL,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,SAAS,EAAE,KAAK;QAChB,KAAK,EAAE,OAAO;KACf;IACD,cAAc,EAAE;QACd,IAAI,EAAE,qBAAS,CAAC,OAAO;QACvB,KAAK,EAAE,iBAAiB;QACxB,YAAY,EAAE,CAAC;KAChB;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,eAAe;QACtB,YAAY,EAAE,QAAQ;KACvB;IACD,aAAa,EAAE;QACb,IAAI,EAAE,qBAAS,CAAC,MAAM;QACtB,KAAK,EAAE,iBAAiB;KACzB;IACD,SAAS,EAAE,qBAAS,CAAC,IAAI;IACzB,SAAS,EAAE,qBAAS,CAAC,IAAI;CAC1B,EACD;IACE,SAAS,EAAE,8BAA8B;IACzC,SAAS,EAAT,sBAAS;CACV,CACF,CAAC;AAEF,2BAAgB,CAAC,OAAO,CAAC,yBAAyB,EAAE;IAClD,UAAU,EAAE,oBAAoB;IAChC,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,WAAW;IACrB,WAAW,EAAE,KAAK;CACnB,CAAC,CAAC;AAEH,yBAAyB,CAAC,MAAM,CAAC,2BAAgB,EAAE;IACjD,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,oBAAoB;CAChC,CAAC,CAAC;AAEH,kBAAe,yBAAyB,CAAC"}
|
package/package.json
CHANGED
@@ -10,10 +10,9 @@ import {
|
|
10
10
|
import sequelize from "./pb-sequelize";
|
11
11
|
import User from "./user";
|
12
12
|
import SubscriptionPlanOnUsers from "./subscription-plan-on-users";
|
13
|
+
import SubscriptionPricingOption from "./subscription-pricing-option";
|
13
14
|
import SubscriptionCoupon from "./subscription-coupon";
|
14
15
|
|
15
|
-
type IntervalUnitType = "months" | "days";
|
16
|
-
|
17
16
|
// order of InferAttributes & InferCreationAttributes is important.
|
18
17
|
class SubscriptionPlan extends Model<
|
19
18
|
InferAttributes<SubscriptionPlan>,
|
@@ -25,12 +24,7 @@ class SubscriptionPlan extends Model<
|
|
25
24
|
declare userId: string;
|
26
25
|
declare planName?: string;
|
27
26
|
declare planDescription?: string;
|
28
|
-
|
29
|
-
// declare intervalCount?: number;
|
30
|
-
// declare isArchived?: boolean;
|
31
|
-
// declare oneTimePurchase?: boolean;
|
32
|
-
// declare accessEndDate?: Date;
|
33
|
-
// declare recurlyPlanId?: string;
|
27
|
+
declare isArchived?: boolean;
|
34
28
|
declare order?: number;
|
35
29
|
declare createdAt: CreationOptional<Date>;
|
36
30
|
declare updatedAt: CreationOptional<Date>;
|
@@ -39,6 +33,9 @@ class SubscriptionPlan extends Model<
|
|
39
33
|
static getByUserId: (ownerId: string) => Promise<SubscriptionPlan | null>;
|
40
34
|
|
41
35
|
declare subscriptions?: NonAttribute<SubscriptionPlanOnUsers[]>;
|
36
|
+
declare subscriptionPricingOptions?: NonAttribute<
|
37
|
+
SubscriptionPricingOption[]
|
38
|
+
>;
|
42
39
|
}
|
43
40
|
|
44
41
|
SubscriptionPlan.init(
|
@@ -65,34 +62,11 @@ SubscriptionPlan.init(
|
|
65
62
|
type: DataTypes.STRING,
|
66
63
|
field: "plan_description",
|
67
64
|
},
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
// intervalUnit: {
|
74
|
-
// type: DataTypes.STRING,
|
75
|
-
// field: "interval_unit",
|
76
|
-
// defaultValue: "months",
|
77
|
-
// },
|
78
|
-
// isArchived: {
|
79
|
-
// type: DataTypes.BOOLEAN,
|
80
|
-
// field: "is_archived",
|
81
|
-
// defaultValue: false,
|
82
|
-
// },
|
83
|
-
// oneTimePurchase: {
|
84
|
-
// type: DataTypes.BOOLEAN,
|
85
|
-
// field: "one_time_purchase",
|
86
|
-
// defaultValue: false,
|
87
|
-
// },
|
88
|
-
// accessEndDate: {
|
89
|
-
// type: DataTypes.DATE,
|
90
|
-
// field: "access_end_date",
|
91
|
-
// },
|
92
|
-
// recurlyPlanId: {
|
93
|
-
// type: DataTypes.STRING,
|
94
|
-
// field: "recurly_plan_id",
|
95
|
-
// },
|
65
|
+
isArchived: {
|
66
|
+
type: DataTypes.BOOLEAN,
|
67
|
+
field: "is_archived",
|
68
|
+
defaultValue: false,
|
69
|
+
},
|
96
70
|
order: {
|
97
71
|
type: DataTypes.INTEGER,
|
98
72
|
field: "order",
|
@@ -20,6 +20,7 @@ class SubscriptionPricingOption extends Model<
|
|
20
20
|
// when creating an instance of the model (such as using Model.create()).
|
21
21
|
declare id: CreationOptional<string>;
|
22
22
|
declare subscriptionPlanId: string;
|
23
|
+
declare price: number;
|
23
24
|
declare intervalUnit: CreationOptional<IntervalUnitType>;
|
24
25
|
declare intervalLength?: number;
|
25
26
|
declare recurlyPlanId?: string;
|
@@ -44,6 +45,11 @@ SubscriptionPricingOption.init(
|
|
44
45
|
model: SubscriptionPlan,
|
45
46
|
},
|
46
47
|
},
|
48
|
+
price: {
|
49
|
+
type: DataTypes.BIGINT,
|
50
|
+
allowNull: false,
|
51
|
+
field: "price",
|
52
|
+
},
|
47
53
|
intervalLength: {
|
48
54
|
type: DataTypes.INTEGER,
|
49
55
|
field: "interval_length",
|
@@ -54,20 +60,6 @@ SubscriptionPricingOption.init(
|
|
54
60
|
field: "interval_unit",
|
55
61
|
defaultValue: "months",
|
56
62
|
},
|
57
|
-
// isArchived: {
|
58
|
-
// type: DataTypes.BOOLEAN,
|
59
|
-
// field: "is_archived",
|
60
|
-
// defaultValue: false,
|
61
|
-
// },
|
62
|
-
// oneTimePurchase: {
|
63
|
-
// type: DataTypes.BOOLEAN,
|
64
|
-
// field: "one_time_purchase",
|
65
|
-
// defaultValue: false,
|
66
|
-
// },
|
67
|
-
// accessEndDate: {
|
68
|
-
// type: DataTypes.DATE,
|
69
|
-
// field: "access_end_date",
|
70
|
-
// },
|
71
63
|
recurlyPlanId: {
|
72
64
|
type: DataTypes.STRING,
|
73
65
|
field: "recurly_plan_id",
|