@brimble/models 1.5.14 → 1.5.16

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.
@@ -1,3 +1,3 @@
1
1
  yarn run v1.22.19
2
2
  $ tsc -p .
3
- Done in 3.07s.
3
+ Done in 3.10s.
@@ -48,6 +48,10 @@ const domainSchema = new mongoose_1.Schema({
48
48
  type: Array,
49
49
  required: false,
50
50
  },
51
+ purchased: {
52
+ type: Boolean,
53
+ default: false
54
+ },
51
55
  dns: [
52
56
  {
53
57
  ref: "Dns",
@@ -13,10 +13,10 @@ const subscriptionPlanSchema = new mongoose_1.Schema({
13
13
  required: true,
14
14
  ref: "User",
15
15
  },
16
- plan_code: {
16
+ plan_type: {
17
17
  type: String,
18
- required: true,
19
- unique: true,
18
+ enum: Object.values(enum_1.SUBSCRIPTION_PLAN_TYPE),
19
+ default: enum_1.SUBSCRIPTION_PLAN_TYPE.FreePlan,
20
20
  },
21
21
  status: {
22
22
  type: String,
@@ -9,6 +9,7 @@ export interface IDomain extends Document {
9
9
  primary: boolean;
10
10
  preview: IPreview;
11
11
  is_free: boolean;
12
+ purchased: boolean;
12
13
  privacy_enabled: boolean;
13
14
  renewal_date: string;
14
15
  renewal_price: number;
package/domain/index.ts CHANGED
@@ -49,6 +49,10 @@ const domainSchema = new Schema(
49
49
  type: Array,
50
50
  required: false,
51
51
  },
52
+ purchased: {
53
+ type: Boolean,
54
+ default: false
55
+ },
52
56
  dns: [
53
57
  {
54
58
  ref: "Dns",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "1.5.14",
3
+ "version": "1.5.16",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,5 +21,5 @@
21
21
  "ts-node": "^8.10.2",
22
22
  "typescript": "^4.9.4"
23
23
  },
24
- "gitHead": "76a28d7492e5e4850b2b1fce3cd74f1a4f90fe84"
24
+ "gitHead": "0756aadbb9b2981e0da7fa986d508e20037cad5e"
25
25
  }
package/subscription.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { model, Schema } from "mongoose";
2
- import { SUBSCRIPTION_STATUS } from "./enum";
2
+ import {SUBSCRIPTION_PLAN_TYPE, SUBSCRIPTION_STATUS} from "./enum";
3
3
  import { ISubscription } from "./types";
4
4
 
5
5
  const subscriptionPlanSchema: Schema = new Schema(
@@ -14,10 +14,10 @@ const subscriptionPlanSchema: Schema = new Schema(
14
14
  required: true,
15
15
  ref: "User",
16
16
  },
17
- plan_code: {
17
+ plan_type: {
18
18
  type: String,
19
- required: true,
20
- unique: true,
19
+ enum: Object.values(SUBSCRIPTION_PLAN_TYPE),
20
+ default: SUBSCRIPTION_PLAN_TYPE.FreePlan,
21
21
  },
22
22
  status: {
23
23
  type: String,
@@ -10,6 +10,7 @@ export interface IDomain extends Document {
10
10
  primary: boolean;
11
11
  preview: IPreview;
12
12
  is_free: boolean;
13
+ purchased: boolean;
13
14
  privacy_enabled: boolean;
14
15
  renewal_date: string;
15
16
  renewal_price: number;