orbitx-core-models 11.17.0 → 11.19.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/index.d.ts CHANGED
@@ -28,6 +28,14 @@ import { ILead } from "./interfaces/lead.interface";
28
28
  import { ITierConfig } from "./interfaces/tierConfig.interface";
29
29
  import { ITierProgress } from "./interfaces/tierProgress.interface";
30
30
  import { IMonthlyTierSnapshot } from "@interfaces/monthlyTierSnapshot.interface";
31
- export { Chat, Message, User, Vertical, Macro, Partner, Company, Review, Wallet, StripeLog, Transaction, Lead, TierConfig, TierProgress, MonthlyTierSnapshot, };
32
- export type { IChat, IMessage, IUser, IVertical, IMacro, IPartner, ICompany, IReview, IWallet, IStripeLog, ITransaction, ILead, ITierConfig, ITierProgress, IMonthlyTierSnapshot };
31
+ import { Addon } from "@models/addons.model";
32
+ import { PlanOption } from "@models/plan-options.model";
33
+ import { Plan } from "@models/plan.model";
34
+ import { Product } from "@models/product.model";
35
+ import { IAddon } from "@interfaces/addons.interface";
36
+ import { IPlanOption } from "@interfaces/plan-options.interface";
37
+ import { IPlan } from "@interfaces/plan.interface";
38
+ import { IProduct } from "@interfaces/product.interface";
39
+ export { Chat, Message, User, Vertical, Macro, Partner, Company, Review, Wallet, StripeLog, Transaction, Lead, TierConfig, TierProgress, MonthlyTierSnapshot, Product, Plan, PlanOption, Addon, };
40
+ export type { IChat, IMessage, IUser, IVertical, IMacro, IPartner, ICompany, IReview, IWallet, IStripeLog, ITransaction, ILead, ITierConfig, ITierProgress, IMonthlyTierSnapshot, IProduct, IPlan, IPlanOption, IAddon, };
33
41
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EA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AW,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,OAAO,EACL,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAM,EACN,SAAS,EACT,WAAW,EACX,IAAI,EACJ,UAAU,EACV,YAAY,EACZ,mBAAmB,EACnB,OAAO,EACP,IAAI,EACJ,UAAU,EACV,KAAK,GACN,CAAC;AACF,YAAY,EACV,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,EACP,UAAU,EACV,YAAY,EACZ,KAAK,EACL,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,QAAQ,EACR,KAAK,EACL,WAAW,EACX,MAAM,GACP,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MonthlyTierSnapshot = exports.TierProgress = exports.TierConfig = exports.Lead = exports.Transaction = exports.StripeLog = exports.Wallet = exports.Review = exports.Company = exports.Partner = exports.Macro = exports.Vertical = exports.User = exports.Message = exports.Chat = void 0;
3
+ exports.Addon = exports.PlanOption = exports.Plan = exports.Product = exports.MonthlyTierSnapshot = exports.TierProgress = exports.TierConfig = exports.Lead = exports.Transaction = exports.StripeLog = exports.Wallet = exports.Review = exports.Company = exports.Partner = exports.Macro = exports.Vertical = exports.User = exports.Message = exports.Chat = void 0;
4
4
  // MODELS
5
5
  const chat_model_1 = require("./models/chat.model");
6
6
  Object.defineProperty(exports, "Chat", { enumerable: true, get: function () { return chat_model_1.Chat; } });
@@ -32,3 +32,11 @@ const tierProgress_model_1 = require("./models/tierProgress.model");
32
32
  Object.defineProperty(exports, "TierProgress", { enumerable: true, get: function () { return tierProgress_model_1.TierProgress; } });
33
33
  const monthlyTierSnapshot_model_1 = require("./models/monthlyTierSnapshot.model");
34
34
  Object.defineProperty(exports, "MonthlyTierSnapshot", { enumerable: true, get: function () { return monthlyTierSnapshot_model_1.MonthlyTierSnapshot; } });
35
+ const addons_model_1 = require("@models/addons.model");
36
+ Object.defineProperty(exports, "Addon", { enumerable: true, get: function () { return addons_model_1.Addon; } });
37
+ const plan_options_model_1 = require("@models/plan-options.model");
38
+ Object.defineProperty(exports, "PlanOption", { enumerable: true, get: function () { return plan_options_model_1.PlanOption; } });
39
+ const plan_model_1 = require("@models/plan.model");
40
+ Object.defineProperty(exports, "Plan", { enumerable: true, get: function () { return plan_model_1.Plan; } });
41
+ const product_model_1 = require("@models/product.model");
42
+ Object.defineProperty(exports, "Product", { enumerable: true, get: function () { return product_model_1.Product; } });
@@ -0,0 +1,17 @@
1
+ export interface IAddon {
2
+ uid: string;
3
+ name: string;
4
+ slug: string;
5
+ description?: string;
6
+ stripePriceId?: string;
7
+ stripeProductId?: string;
8
+ price: number;
9
+ currency: string;
10
+ billingCycle: "monthly" | "yearly";
11
+ settings?: Map<string, any>;
12
+ displayOrder: number;
13
+ isActive: boolean;
14
+ createdAt?: Date;
15
+ updatedAt?: Date;
16
+ }
17
+ //# sourceMappingURL=addons.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addons.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/addons.interface.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,SAAS,GAAG,QAAQ,CAAC;IACnC,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import { Types } from "mongoose";
2
+ export interface IPlanOption {
3
+ planId: Types.ObjectId;
4
+ optionNumber?: number;
5
+ name: string;
6
+ description?: string;
7
+ stripePriceId?: string;
8
+ stripeProductId?: string;
9
+ price: number;
10
+ currency: string;
11
+ billingCycle?: "monthly" | "yearly" | null;
12
+ quota?: number;
13
+ quotaType?: "visitors" | "leads" | null;
14
+ pricePerLead?: number;
15
+ isRecommended: boolean;
16
+ displayOrder: number;
17
+ metadata?: Map<string, any>;
18
+ isActive: boolean;
19
+ createdAt?: Date;
20
+ updatedAt?: Date;
21
+ }
22
+ //# sourceMappingURL=plan-options.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-options.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/plan-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,UAAU,GAAG,OAAO,GAAG,IAAI,CAAC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import { Types } from "mongoose";
2
+ export interface IPlan {
3
+ productId: Types.ObjectId;
4
+ name: string;
5
+ slug: string;
6
+ planType: "subscription" | "budget_inclusive" | "pay_per_lead";
7
+ description?: string;
8
+ options: Types.ObjectId[];
9
+ availableAddons: Types.ObjectId[];
10
+ isActive: boolean;
11
+ createdAt?: Date;
12
+ updatedAt?: Date;
13
+ }
14
+ //# sourceMappingURL=plan.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/plan.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,WAAW,KAAK;IACpB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,GAAG,kBAAkB,GAAG,cAAc,CAAC;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,eAAe,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;IAClC,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ export interface IProduct {
2
+ name: string;
3
+ slug: string;
4
+ description?: string;
5
+ isActive: boolean;
6
+ createdAt?: Date;
7
+ updatedAt?: Date;
8
+ }
9
+ //# sourceMappingURL=product.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/product.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ import mongoose from "mongoose";
2
+ import { IAddon } from "../interfaces/addons.interface";
3
+ export declare const Addon: mongoose.Model<IAddon, {}, {}, {}, mongoose.Document<unknown, {}, IAddon, {}, {}> & IAddon & {
4
+ _id: mongoose.Types.ObjectId;
5
+ } & {
6
+ __v: number;
7
+ }, any>;
8
+ export default Addon;
9
+ //# sourceMappingURL=addons.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addons.model.d.ts","sourceRoot":"","sources":["../../src/models/addons.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAsExD,eAAO,MAAM,KAAK;;;;OAA+C,CAAC;AAClE,eAAe,KAAK,CAAC"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Addon = void 0;
37
+ const mongoose_1 = __importStar(require("mongoose"));
38
+ const addonSchema = new mongoose_1.Schema({
39
+ name: {
40
+ type: String,
41
+ required: [true, "Addon name is required"],
42
+ trim: true,
43
+ },
44
+ slug: {
45
+ type: String,
46
+ required: [true, "Addon slug is required"],
47
+ trim: true,
48
+ lowercase: true,
49
+ unique: true,
50
+ },
51
+ description: {
52
+ type: String,
53
+ trim: true,
54
+ },
55
+ stripePriceId: {
56
+ type: String,
57
+ trim: true,
58
+ },
59
+ stripeProductId: {
60
+ type: String,
61
+ trim: true,
62
+ },
63
+ price: {
64
+ type: Number,
65
+ required: [true, "Price is required"],
66
+ min: [0, "Price must be non-negative"],
67
+ },
68
+ currency: {
69
+ type: String,
70
+ default: "usd",
71
+ lowercase: true,
72
+ trim: true,
73
+ },
74
+ billingCycle: {
75
+ type: String,
76
+ enum: ["monthly", "yearly"],
77
+ default: "monthly",
78
+ },
79
+ settings: {
80
+ type: Map,
81
+ of: mongoose_1.Schema.Types.Mixed,
82
+ },
83
+ displayOrder: {
84
+ type: Number,
85
+ default: 0,
86
+ },
87
+ isActive: {
88
+ type: Boolean,
89
+ default: true,
90
+ },
91
+ }, {
92
+ timestamps: true,
93
+ toJSON: { virtuals: true },
94
+ toObject: { virtuals: true },
95
+ });
96
+ addonSchema.index({ productId: 1 });
97
+ addonSchema.index({ slug: 1 });
98
+ addonSchema.index({ displayOrder: 1 });
99
+ addonSchema.index({ isActive: 1 });
100
+ addonSchema.index({ stripePriceId: 1 });
101
+ exports.Addon = mongoose_1.default.model("Addon", addonSchema);
102
+ exports.default = exports.Addon;
@@ -0,0 +1,9 @@
1
+ import mongoose from "mongoose";
2
+ import { IPlanOption } from "../interfaces/plan-options.interface";
3
+ export declare const PlanOption: mongoose.Model<IPlanOption, {}, {}, {}, mongoose.Document<unknown, {}, IPlanOption, {}, {}> & IPlanOption & {
4
+ _id: mongoose.Types.ObjectId;
5
+ } & {
6
+ __v: number;
7
+ }, any>;
8
+ export default PlanOption;
9
+ //# sourceMappingURL=plan-options.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-options.model.d.ts","sourceRoot":"","sources":["../../src/models/plan-options.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAqFnE,eAAO,MAAM,UAAU;;;;OAGtB,CAAC;AACF,eAAe,UAAU,CAAC"}
@@ -0,0 +1,117 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.PlanOption = void 0;
37
+ const mongoose_1 = __importStar(require("mongoose"));
38
+ const planOptionSchema = new mongoose_1.Schema({
39
+ planId: {
40
+ type: mongoose_1.Schema.Types.ObjectId,
41
+ ref: "Plan",
42
+ required: [true, "Plan ID is required"],
43
+ },
44
+ optionNumber: {
45
+ type: Number,
46
+ },
47
+ name: {
48
+ type: String,
49
+ required: [true, "Option name is required"],
50
+ trim: true,
51
+ },
52
+ description: {
53
+ type: String,
54
+ trim: true,
55
+ },
56
+ stripePriceId: {
57
+ type: String,
58
+ trim: true,
59
+ },
60
+ stripeProductId: {
61
+ type: String,
62
+ trim: true,
63
+ },
64
+ price: {
65
+ type: Number,
66
+ required: [true, "Price is required"],
67
+ min: [0, "Price must be non-negative"],
68
+ },
69
+ currency: {
70
+ type: String,
71
+ default: "usd",
72
+ lowercase: true,
73
+ trim: true,
74
+ },
75
+ billingCycle: {
76
+ type: String,
77
+ enum: ["monthly", "yearly", null],
78
+ },
79
+ quota: {
80
+ type: Number,
81
+ min: [0, "Quota must be non-negative"],
82
+ },
83
+ quotaType: {
84
+ type: String,
85
+ enum: ["visitors", "leads", null],
86
+ },
87
+ pricePerLead: {
88
+ type: Number,
89
+ min: [0, "Price per lead must be non-negative"],
90
+ },
91
+ isRecommended: {
92
+ type: Boolean,
93
+ default: false,
94
+ },
95
+ displayOrder: {
96
+ type: Number,
97
+ default: 0,
98
+ },
99
+ metadata: {
100
+ type: Map,
101
+ of: mongoose_1.Schema.Types.Mixed,
102
+ },
103
+ isActive: {
104
+ type: Boolean,
105
+ default: true,
106
+ },
107
+ }, {
108
+ timestamps: true,
109
+ toJSON: { virtuals: true },
110
+ toObject: { virtuals: true },
111
+ });
112
+ planOptionSchema.index({ planId: 1 });
113
+ planOptionSchema.index({ displayOrder: 1 });
114
+ planOptionSchema.index({ isActive: 1 });
115
+ planOptionSchema.index({ stripePriceId: 1 });
116
+ exports.PlanOption = mongoose_1.default.model("PlanOption", planOptionSchema);
117
+ exports.default = exports.PlanOption;
@@ -0,0 +1,9 @@
1
+ import mongoose from "mongoose";
2
+ import { IPlan } from "../interfaces/plan.interface";
3
+ export declare const Plan: mongoose.Model<IPlan, {}, {}, {}, mongoose.Document<unknown, {}, IPlan, {}, {}> & IPlan & {
4
+ _id: mongoose.Types.ObjectId;
5
+ } & {
6
+ __v: number;
7
+ }, any>;
8
+ export default Plan;
9
+ //# sourceMappingURL=plan.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan.model.d.ts","sourceRoot":"","sources":["../../src/models/plan.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AA0DrD,eAAO,MAAM,IAAI;;;;OAA4C,CAAC;AAC9D,eAAe,IAAI,CAAC"}
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Plan = void 0;
37
+ const mongoose_1 = __importStar(require("mongoose"));
38
+ const planSchema = new mongoose_1.Schema({
39
+ productId: {
40
+ type: mongoose_1.Schema.Types.ObjectId,
41
+ ref: "Product",
42
+ required: [true, "Product ID is required"],
43
+ },
44
+ name: {
45
+ type: String,
46
+ required: [true, "Plan name is required"],
47
+ trim: true,
48
+ },
49
+ slug: {
50
+ type: String,
51
+ required: [true, "Plan slug is required"],
52
+ trim: true,
53
+ lowercase: true,
54
+ },
55
+ planType: {
56
+ type: String,
57
+ enum: ["subscription", "budget_inclusive", "pay_per_lead"],
58
+ required: [true, "Plan type is required"],
59
+ },
60
+ description: {
61
+ type: String,
62
+ trim: true,
63
+ },
64
+ options: [
65
+ {
66
+ type: mongoose_1.Schema.Types.ObjectId,
67
+ ref: "PlanOption",
68
+ },
69
+ ],
70
+ availableAddons: [
71
+ {
72
+ type: mongoose_1.Schema.Types.ObjectId,
73
+ ref: "Addon",
74
+ },
75
+ ],
76
+ isActive: {
77
+ type: Boolean,
78
+ default: true,
79
+ },
80
+ }, {
81
+ timestamps: true,
82
+ toJSON: { virtuals: true },
83
+ toObject: { virtuals: true },
84
+ });
85
+ planSchema.index({ productId: 1 });
86
+ planSchema.index({ slug: 1 });
87
+ planSchema.index({ planType: 1 });
88
+ planSchema.index({ isActive: 1 });
89
+ exports.Plan = mongoose_1.default.model("Plan", planSchema);
90
+ exports.default = exports.Plan;
@@ -0,0 +1,9 @@
1
+ import mongoose from "mongoose";
2
+ import { IProduct } from "../interfaces/product.interface";
3
+ export declare const Product: mongoose.Model<IProduct, {}, {}, {}, mongoose.Document<unknown, {}, IProduct, {}, {}> & IProduct & {
4
+ _id: mongoose.Types.ObjectId;
5
+ } & {
6
+ __v: number;
7
+ }, any>;
8
+ export default Product;
9
+ //# sourceMappingURL=product.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product.model.d.ts","sourceRoot":"","sources":["../../src/models/product.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAmC3D,eAAO,MAAM,OAAO;;;;OAAqD,CAAC;AAC1E,eAAe,OAAO,CAAC"}
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Product = void 0;
37
+ const mongoose_1 = __importStar(require("mongoose"));
38
+ const productSchema = new mongoose_1.Schema({
39
+ name: {
40
+ type: String,
41
+ required: [true, "Product name is required"],
42
+ trim: true,
43
+ },
44
+ slug: {
45
+ type: String,
46
+ required: [true, "Product slug is required"],
47
+ trim: true,
48
+ lowercase: true,
49
+ unique: true,
50
+ },
51
+ description: {
52
+ type: String,
53
+ trim: true,
54
+ },
55
+ isActive: {
56
+ type: Boolean,
57
+ default: true,
58
+ },
59
+ }, {
60
+ timestamps: true,
61
+ toJSON: { virtuals: true },
62
+ toObject: { virtuals: true },
63
+ });
64
+ productSchema.index({ slug: 1 });
65
+ productSchema.index({ isActive: 1 });
66
+ exports.Product = mongoose_1.default.model("Product", productSchema);
67
+ exports.default = exports.Product;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orbitx-core-models",
3
- "version": "11.17.0",
3
+ "version": "11.19.0",
4
4
  "description": "Shared Mongoose models and interfaces for OrbitX services",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",