orbitx-core-models 7.0.2 → 8.0.1
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 +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/interfaces/chat.interface.d.ts +2 -14
- package/dist/interfaces/chat.interface.d.ts.map +1 -1
- package/dist/interfaces/company.interface.d.ts +2 -0
- package/dist/interfaces/company.interface.d.ts.map +1 -1
- package/dist/interfaces/lead.interface.d.ts +22 -0
- package/dist/interfaces/lead.interface.d.ts.map +1 -0
- package/dist/interfaces/lead.interface.js +2 -0
- package/dist/models/chat.model.d.ts.map +1 -1
- package/dist/models/chat.model.js +6 -14
- package/dist/models/company.model.d.ts.map +1 -1
- package/dist/models/company.model.js +2 -0
- package/dist/models/lead.model.d.ts +9 -0
- package/dist/models/lead.model.d.ts.map +1 -0
- package/dist/models/lead.model.js +73 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { Company } from "./models/company.model";
|
|
|
8
8
|
import { Review } from "./models/review.model";
|
|
9
9
|
import { Wallet } from "./models/wallet.model";
|
|
10
10
|
import { StripeLog } from "./models/stripeLog.model";
|
|
11
|
+
import { Lead } from "./models/lead.model";
|
|
11
12
|
import { IChat } from "./interfaces/chat.interface";
|
|
12
13
|
import { IMacro } from "./interfaces/macro.interface";
|
|
13
14
|
import { IVertical } from "./interfaces/vertical.interface";
|
|
@@ -18,6 +19,7 @@ import { ICompany } from "./interfaces/company.interface";
|
|
|
18
19
|
import { IReview } from "./interfaces/review.interface";
|
|
19
20
|
import { IWallet } from "./interfaces/wallet.interface";
|
|
20
21
|
import { IStripeLog } from "./interfaces/stripeLog.interface";
|
|
21
|
-
|
|
22
|
-
export
|
|
22
|
+
import { ILead } from "./interfaces/lead.interface";
|
|
23
|
+
export { Chat, Message, User, Vertical, Macro, Partner, Company, Review, Wallet, StripeLog, Lead, };
|
|
24
|
+
export type { IChat, IMessage, IUser, IVertical, IMacro, IPartner, ICompany, IReview, IWallet, IStripeLog, ILead, };
|
|
23
25
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;
|
|
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,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAG3C,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEpD,OAAO,EACL,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,QAAQ,EACR,KAAK,EACL,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAM,EACN,SAAS,EACT,IAAI,GACL,CAAC;AACF,YAAY,EACV,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,OAAO,EACP,UAAU,EACV,KAAK,GACN,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StripeLog = exports.Wallet = exports.Review = exports.Company = exports.Partner = exports.Macro = exports.Vertical = exports.User = exports.Message = exports.Chat = void 0;
|
|
3
|
+
exports.Lead = 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; } });
|
|
@@ -22,3 +22,5 @@ const wallet_model_1 = require("./models/wallet.model");
|
|
|
22
22
|
Object.defineProperty(exports, "Wallet", { enumerable: true, get: function () { return wallet_model_1.Wallet; } });
|
|
23
23
|
const stripeLog_model_1 = require("./models/stripeLog.model");
|
|
24
24
|
Object.defineProperty(exports, "StripeLog", { enumerable: true, get: function () { return stripeLog_model_1.StripeLog; } });
|
|
25
|
+
const lead_model_1 = require("./models/lead.model");
|
|
26
|
+
Object.defineProperty(exports, "Lead", { enumerable: true, get: function () { return lead_model_1.Lead; } });
|
|
@@ -2,25 +2,13 @@ import { Document, Types } from "mongoose";
|
|
|
2
2
|
export interface IChat extends Document {
|
|
3
3
|
chatNumber?: number;
|
|
4
4
|
userId: Types.ObjectId;
|
|
5
|
-
company:
|
|
5
|
+
company: Types.ObjectId;
|
|
6
6
|
domain: string;
|
|
7
7
|
status: "open" | "closed" | "active" | "inactive" | "shelved";
|
|
8
8
|
leadStatus: "none" | "sent" | "unsent";
|
|
9
9
|
messages: Types.ObjectId[];
|
|
10
10
|
isDeleted: boolean;
|
|
11
|
-
|
|
12
|
-
email?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
companyName?: string;
|
|
15
|
-
leadType?: string;
|
|
16
|
-
phone?: string;
|
|
17
|
-
category?: string;
|
|
18
|
-
city?: string;
|
|
19
|
-
address?: string;
|
|
20
|
-
state?: string;
|
|
21
|
-
zipCode?: string;
|
|
22
|
-
otherReason?: string;
|
|
23
|
-
};
|
|
11
|
+
leads?: Types.ObjectId[];
|
|
24
12
|
ipAddress?: string;
|
|
25
13
|
note?: string;
|
|
26
14
|
createdAt?: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/chat.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,KAAM,SAAQ,QAAQ;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC;IACvB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"chat.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/chat.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,KAAM,SAAQ,QAAQ;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC;IACvB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;IAC9D,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAC;IACvC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"company.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/company.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,WAAW,GACX,UAAU,GACV,QAAQ,GACR,UAAU,CAAC;AAEf,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,SAAS,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"company.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/company.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,MAAM,SAAS,GACjB,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,WAAW,GACX,UAAU,GACV,QAAQ,GACR,UAAU,CAAC;AAEf,MAAM,WAAW,KAAK;IACpB,GAAG,EAAE,SAAS,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,QAAQ;IACvB,GAAG,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,SAAS,EAAE,UAAU,CAAC;IACtB,WAAW,EAAE,YAAY,CAAC;IAC1B,YAAY,EAAE,aAAa,CAAC;IAC5B,gBAAgB,CAAC,EAAE,KAAK,EAAE,CAAC;IAC3B,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC;IACtB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Types } from "mongoose";
|
|
2
|
+
export interface ILeadData {
|
|
3
|
+
name: string;
|
|
4
|
+
email: string;
|
|
5
|
+
companyName?: string;
|
|
6
|
+
leadType?: string;
|
|
7
|
+
phone: string;
|
|
8
|
+
category?: string;
|
|
9
|
+
city?: string;
|
|
10
|
+
address?: string;
|
|
11
|
+
state?: string;
|
|
12
|
+
zipCode?: string;
|
|
13
|
+
otherReason?: string;
|
|
14
|
+
type?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ILead {
|
|
17
|
+
_id?: Types.ObjectId;
|
|
18
|
+
data: ILeadData;
|
|
19
|
+
createdAt?: Date;
|
|
20
|
+
updatedAt?: Date;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=lead.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lead.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/lead.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,KAAK;IACpB,GAAG,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IACrB,IAAI,EAAE,SAAS,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.model.d.ts","sourceRoot":"","sources":["../../src/models/chat.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"chat.model.d.ts","sourceRoot":"","sources":["../../src/models/chat.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAwCrD,eAAO,MAAM,IAAI;;;;OAA4C,CAAC"}
|
|
@@ -43,7 +43,11 @@ const AutoIncrement = (0, mongoose_sequence_1.default)(mongoose_1.default);
|
|
|
43
43
|
const chatSchema = new mongoose_1.Schema({
|
|
44
44
|
chatNumber: { type: Number, unique: true },
|
|
45
45
|
userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true },
|
|
46
|
-
company: {
|
|
46
|
+
company: {
|
|
47
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
48
|
+
ref: "Company",
|
|
49
|
+
required: [true, "Company is required"],
|
|
50
|
+
},
|
|
47
51
|
domain: { type: String, required: [true, "Domain is required"] },
|
|
48
52
|
status: {
|
|
49
53
|
type: String,
|
|
@@ -57,19 +61,7 @@ const chatSchema = new mongoose_1.Schema({
|
|
|
57
61
|
},
|
|
58
62
|
messages: [{ type: mongoose_1.Schema.Types.ObjectId, ref: "Message" }],
|
|
59
63
|
isDeleted: { type: Boolean, default: false },
|
|
60
|
-
|
|
61
|
-
email: String,
|
|
62
|
-
name: String,
|
|
63
|
-
companyName: String,
|
|
64
|
-
leadType: String,
|
|
65
|
-
phone: String,
|
|
66
|
-
category: String,
|
|
67
|
-
city: String,
|
|
68
|
-
address: String,
|
|
69
|
-
state: String,
|
|
70
|
-
zipCode: String,
|
|
71
|
-
otherReason: String,
|
|
72
|
-
},
|
|
64
|
+
leads: [{ type: mongoose_1.Schema.Types.ObjectId, ref: "Lead" }],
|
|
73
65
|
ipAddress: String,
|
|
74
66
|
note: String,
|
|
75
67
|
}, { timestamps: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"company.model.d.ts","sourceRoot":"","sources":["../../src/models/company.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,
|
|
1
|
+
{"version":3,"file":"company.model.d.ts","sourceRoot":"","sources":["../../src/models/company.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAoB,MAAM,iCAAiC,CAAC;AAuL7E,eAAO,MAAM,OAAO;;;;OAAqD,CAAC;AAC1E,eAAe,OAAO,CAAC"}
|
|
@@ -82,6 +82,8 @@ const companySchema = new mongoose_1.Schema({
|
|
|
82
82
|
},
|
|
83
83
|
},
|
|
84
84
|
language: { type: String, required: true, trim: true },
|
|
85
|
+
industry: { type: String, required: true, trim: true },
|
|
86
|
+
pricePerLead: { type: Number, required: true, trim: true },
|
|
85
87
|
},
|
|
86
88
|
contactInfo: {
|
|
87
89
|
name: { type: String, required: true, trim: true },
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { ILead } from "../interfaces/lead.interface";
|
|
3
|
+
export declare const Lead: mongoose.Model<ILead, {}, {}, {}, mongoose.Document<unknown, {}, ILead, {}, {}> & ILead & Required<{
|
|
4
|
+
_id: mongoose.Types.ObjectId;
|
|
5
|
+
}> & {
|
|
6
|
+
__v: number;
|
|
7
|
+
}, any>;
|
|
8
|
+
export default Lead;
|
|
9
|
+
//# sourceMappingURL=lead.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lead.model.d.ts","sourceRoot":"","sources":["../../src/models/lead.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,KAAK,EAAa,MAAM,8BAA8B,CAAC;AA6ChE,eAAO,MAAM,IAAI;;;;OAA4C,CAAC;AAC9D,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
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.Lead = void 0;
|
|
37
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
38
|
+
const leadDataSchema = new mongoose_1.Schema({
|
|
39
|
+
name: { type: String, required: true, trim: true },
|
|
40
|
+
email: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: true,
|
|
43
|
+
lowercase: true,
|
|
44
|
+
trim: true,
|
|
45
|
+
match: [/^\S+@\S+\.\S+$/, "Invalid email format"],
|
|
46
|
+
},
|
|
47
|
+
companyName: { type: String, trim: true },
|
|
48
|
+
leadType: { type: String, trim: true },
|
|
49
|
+
phone: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: true,
|
|
52
|
+
trim: true,
|
|
53
|
+
validate: {
|
|
54
|
+
validator: (v) => /^\+?[\d\s-]{7,15}$/.test(v),
|
|
55
|
+
message: "Invalid phone number format",
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
category: { type: String, trim: true },
|
|
59
|
+
city: { type: String, trim: true },
|
|
60
|
+
address: { type: String, trim: true },
|
|
61
|
+
state: { type: String, trim: true },
|
|
62
|
+
zipCode: { type: String, trim: true },
|
|
63
|
+
otherReason: { type: String, trim: true },
|
|
64
|
+
type: { type: String, trim: true },
|
|
65
|
+
}, { _id: false });
|
|
66
|
+
const leadSchema = new mongoose_1.Schema({
|
|
67
|
+
data: leadDataSchema,
|
|
68
|
+
}, {
|
|
69
|
+
timestamps: true,
|
|
70
|
+
});
|
|
71
|
+
leadSchema.index({ "data.email": 1 });
|
|
72
|
+
exports.Lead = mongoose_1.default.model("Lead", leadSchema);
|
|
73
|
+
exports.default = exports.Lead;
|