orbitx-core-models 3.0.0 → 5.0.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 +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/interfaces/company.interface.d.ts +54 -0
- package/dist/interfaces/company.interface.d.ts.map +1 -0
- package/dist/interfaces/company.interface.js +2 -0
- package/dist/interfaces/review.interface.d.ts +13 -0
- package/dist/interfaces/review.interface.d.ts.map +1 -0
- package/dist/interfaces/review.interface.js +2 -0
- package/dist/models/company.model.d.ts +9 -0
- package/dist/models/company.model.d.ts.map +1 -0
- package/dist/models/company.model.js +190 -0
- package/dist/models/review.model.d.ts +9 -0
- package/dist/models/review.model.d.ts.map +1 -0
- package/dist/models/review.model.js +89 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,12 +4,16 @@ import { User } from "./models/user.model";
|
|
|
4
4
|
import { Vertical } from "./models/vertical.model";
|
|
5
5
|
import { Macro } from "./models/macro.model";
|
|
6
6
|
import { Partner } from "./models/partner.model";
|
|
7
|
+
import { Company } from "./models/company.model";
|
|
8
|
+
import { Review } from "./models/review.model";
|
|
7
9
|
import { IChat } from "./interfaces/chat.interface";
|
|
8
10
|
import { IMacro } from "./interfaces/macro.interface";
|
|
9
11
|
import { IVertical } from "./interfaces/vertical.interface";
|
|
10
12
|
import { IMessage } from "./interfaces/message.interface";
|
|
11
13
|
import { IUser } from "./interfaces/user.interface";
|
|
12
14
|
import { IPartner } from "./interfaces/partner.interface";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
import { ICompany } from "./interfaces/company.interface";
|
|
16
|
+
import { IReview } from "./interfaces/review.interface";
|
|
17
|
+
export { Chat, Message, User, Vertical, Macro, Partner, Company, Review };
|
|
18
|
+
export type { IChat, IMessage, IUser, IVertical, IMacro, IPartner, ICompany, IReview, };
|
|
15
19
|
//# 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;
|
|
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;AAG/C,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;AAExD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;AAC1E,YAAY,EACV,KAAK,EACL,QAAQ,EACR,KAAK,EACL,SAAS,EACT,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,OAAO,GACR,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Partner = exports.Macro = exports.Vertical = exports.User = exports.Message = exports.Chat = void 0;
|
|
3
|
+
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; } });
|
|
@@ -14,3 +14,7 @@ const macro_model_1 = require("./models/macro.model");
|
|
|
14
14
|
Object.defineProperty(exports, "Macro", { enumerable: true, get: function () { return macro_model_1.Macro; } });
|
|
15
15
|
const partner_model_1 = require("./models/partner.model");
|
|
16
16
|
Object.defineProperty(exports, "Partner", { enumerable: true, get: function () { return partner_model_1.Partner; } });
|
|
17
|
+
const company_model_1 = require("./models/company.model");
|
|
18
|
+
Object.defineProperty(exports, "Company", { enumerable: true, get: function () { return company_model_1.Company; } });
|
|
19
|
+
const review_model_1 = require("./models/review.model");
|
|
20
|
+
Object.defineProperty(exports, "Review", { enumerable: true, get: function () { return review_model_1.Review; } });
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Types } from "mongoose";
|
|
2
|
+
export type DayOfWeek = "Sunday" | "Monday" | "Tuesday" | "Wednesday" | "Thursday" | "Friday" | "Saturday";
|
|
3
|
+
export interface IHour {
|
|
4
|
+
day: DayOfWeek;
|
|
5
|
+
startTime: string;
|
|
6
|
+
endTime: string;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface IBasicInfo {
|
|
10
|
+
companyId: string;
|
|
11
|
+
host: string;
|
|
12
|
+
relationship?: "Customer" | "Partner";
|
|
13
|
+
website?: string;
|
|
14
|
+
language: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IContactInfo {
|
|
17
|
+
name: string;
|
|
18
|
+
email: string;
|
|
19
|
+
phoneNumber?: string;
|
|
20
|
+
alternatePhoneNumber?: string;
|
|
21
|
+
officialBusinessName: string;
|
|
22
|
+
address: string;
|
|
23
|
+
city: string;
|
|
24
|
+
state: string;
|
|
25
|
+
zipcode: string;
|
|
26
|
+
country: string;
|
|
27
|
+
coverageArea?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ICallSettings {
|
|
30
|
+
timezone?: string;
|
|
31
|
+
phoneNumber?: string;
|
|
32
|
+
transcriptEmail?: string;
|
|
33
|
+
smsChatNumber?: string;
|
|
34
|
+
visitorGreeting?: string;
|
|
35
|
+
visitorGreetingDelay?: number;
|
|
36
|
+
businessGreeting?: string;
|
|
37
|
+
businessGreetingDelay?: number;
|
|
38
|
+
transcriptOverride?: boolean;
|
|
39
|
+
useCallConnectNumberForCallerId?: boolean;
|
|
40
|
+
companyNumberFirst?: boolean;
|
|
41
|
+
override?: boolean;
|
|
42
|
+
officeHoursMonitoring?: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface ICompany {
|
|
45
|
+
_id?: Types.ObjectId;
|
|
46
|
+
basicInfo: IBasicInfo;
|
|
47
|
+
contactInfo: IContactInfo;
|
|
48
|
+
callSettings: ICallSettings;
|
|
49
|
+
callConnectHours?: IHour[];
|
|
50
|
+
officeHours?: IHour[];
|
|
51
|
+
createdAt?: Date;
|
|
52
|
+
updatedAt?: Date;
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=company.interface.d.ts.map
|
|
@@ -0,0 +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;CAClB;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,13 @@
|
|
|
1
|
+
import { Types } from "mongoose";
|
|
2
|
+
export interface IReview {
|
|
3
|
+
partner: Types.ObjectId;
|
|
4
|
+
client: Types.ObjectId;
|
|
5
|
+
reviewType: "Image" | "Video";
|
|
6
|
+
reviewLink: string;
|
|
7
|
+
reviewDate: Date;
|
|
8
|
+
reviewContent: string;
|
|
9
|
+
media: string[];
|
|
10
|
+
createdAt?: Date;
|
|
11
|
+
updatedAt?: Date;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=review.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/review.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC;IACxB,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC;IACvB,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { ICompany } from "../interfaces/company.interface";
|
|
3
|
+
export declare const Company: mongoose.Model<ICompany, {}, {}, {}, mongoose.Document<unknown, {}, ICompany, {}, {}> & ICompany & Required<{
|
|
4
|
+
_id: mongoose.Types.ObjectId;
|
|
5
|
+
}> & {
|
|
6
|
+
__v: number;
|
|
7
|
+
}, any>;
|
|
8
|
+
export default Company;
|
|
9
|
+
//# sourceMappingURL=company.model.d.ts.map
|
|
@@ -0,0 +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,EACL,QAAQ,EAGT,MAAM,iCAAiC,CAAC;AAqLzC,eAAO,MAAM,OAAO;;;;OAAqD,CAAC;AAC1E,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,190 @@
|
|
|
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.Company = void 0;
|
|
37
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
38
|
+
const daysOfWeek = [
|
|
39
|
+
"Sunday",
|
|
40
|
+
"Monday",
|
|
41
|
+
"Tuesday",
|
|
42
|
+
"Wednesday",
|
|
43
|
+
"Thursday",
|
|
44
|
+
"Friday",
|
|
45
|
+
"Saturday",
|
|
46
|
+
];
|
|
47
|
+
// Hour Schema
|
|
48
|
+
const hourSchema = new mongoose_1.Schema({
|
|
49
|
+
day: { type: String, enum: daysOfWeek, required: true },
|
|
50
|
+
startTime: {
|
|
51
|
+
type: String,
|
|
52
|
+
required: true,
|
|
53
|
+
match: [/^([01]\d|2[0-3]):([0-5]\d)$/, "Invalid time format. Use HH:mm."],
|
|
54
|
+
},
|
|
55
|
+
endTime: {
|
|
56
|
+
type: String,
|
|
57
|
+
required: true,
|
|
58
|
+
match: [/^([01]\d|2[0-3]):([0-5]\d)$/, "Invalid time format. Use HH:mm."],
|
|
59
|
+
},
|
|
60
|
+
active: { type: Boolean, default: false },
|
|
61
|
+
}, { _id: false });
|
|
62
|
+
// Company Schema
|
|
63
|
+
const companySchema = new mongoose_1.Schema({
|
|
64
|
+
basicInfo: {
|
|
65
|
+
companyId: {
|
|
66
|
+
type: String,
|
|
67
|
+
required: true,
|
|
68
|
+
unique: true,
|
|
69
|
+
trim: true,
|
|
70
|
+
},
|
|
71
|
+
host: { type: String, required: true, trim: true },
|
|
72
|
+
relationship: {
|
|
73
|
+
type: String,
|
|
74
|
+
enum: ["Customer", "Partner"],
|
|
75
|
+
},
|
|
76
|
+
website: {
|
|
77
|
+
type: String,
|
|
78
|
+
trim: true,
|
|
79
|
+
validate: {
|
|
80
|
+
validator: (v) => !v ? true : /^https?:\/\/[^\s$.?#].[^\s]*$/.test(v),
|
|
81
|
+
message: "Invalid URL format",
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
language: { type: String, required: true, trim: true },
|
|
85
|
+
},
|
|
86
|
+
contactInfo: {
|
|
87
|
+
name: { type: String, required: true, trim: true },
|
|
88
|
+
email: {
|
|
89
|
+
type: String,
|
|
90
|
+
required: true,
|
|
91
|
+
lowercase: true,
|
|
92
|
+
trim: true,
|
|
93
|
+
match: [/^\S+@\S+\.\S+$/, "Invalid email format"],
|
|
94
|
+
},
|
|
95
|
+
phoneNumber: {
|
|
96
|
+
type: String,
|
|
97
|
+
trim: true,
|
|
98
|
+
validate: {
|
|
99
|
+
validator: (v) => (!v ? true : /^\+?[\d\s-]{7,15}$/.test(v)),
|
|
100
|
+
message: "Invalid phone number format",
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
alternatePhoneNumber: {
|
|
104
|
+
type: String,
|
|
105
|
+
trim: true,
|
|
106
|
+
validate: {
|
|
107
|
+
validator: (v) => (!v ? true : /^\+?[\d\s-]{7,15}$/.test(v)),
|
|
108
|
+
message: "Invalid alternate phone number format",
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
officialBusinessName: {
|
|
112
|
+
type: String,
|
|
113
|
+
required: true,
|
|
114
|
+
trim: true,
|
|
115
|
+
lowercase: true,
|
|
116
|
+
},
|
|
117
|
+
address: { type: String, required: true, trim: true },
|
|
118
|
+
city: { type: String, required: true, trim: true },
|
|
119
|
+
state: { type: String, required: true, trim: true },
|
|
120
|
+
zipcode: { type: String, required: true, trim: true },
|
|
121
|
+
country: { type: String, required: true, trim: true },
|
|
122
|
+
coverageArea: { type: String, trim: true },
|
|
123
|
+
},
|
|
124
|
+
callSettings: {
|
|
125
|
+
timezone: { type: String, trim: true },
|
|
126
|
+
phoneNumber: {
|
|
127
|
+
type: String,
|
|
128
|
+
trim: true,
|
|
129
|
+
validate: {
|
|
130
|
+
validator: (v) => (!v ? true : /^\+?[\d\s-]{7,15}$/.test(v)),
|
|
131
|
+
message: "Invalid call connect phone number format",
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
transcriptEmail: {
|
|
135
|
+
type: String,
|
|
136
|
+
trim: true,
|
|
137
|
+
lowercase: true,
|
|
138
|
+
match: [/^\S+@\S+\.\S+$/, "Invalid transcript email format"],
|
|
139
|
+
},
|
|
140
|
+
smsChatNumber: {
|
|
141
|
+
type: String,
|
|
142
|
+
trim: true,
|
|
143
|
+
validate: {
|
|
144
|
+
validator: (v) => (!v ? true : /^\+?[\d\s-]{7,15}$/.test(v)),
|
|
145
|
+
message: "Invalid SMS chat number format",
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
visitorGreeting: { type: String, trim: true },
|
|
149
|
+
visitorGreetingDelay: { type: Number, min: 0, default: 0 },
|
|
150
|
+
businessGreeting: { type: String, trim: true },
|
|
151
|
+
businessGreetingDelay: { type: Number, min: 0, default: 0 },
|
|
152
|
+
transcriptOverride: { type: Boolean, default: false },
|
|
153
|
+
useCallConnectNumberForCallerId: { type: Boolean, default: false },
|
|
154
|
+
companyNumberFirst: { type: Boolean, default: false },
|
|
155
|
+
override: { type: Boolean, default: false },
|
|
156
|
+
officeHoursMonitoring: { type: Boolean, default: false },
|
|
157
|
+
},
|
|
158
|
+
callConnectHours: {
|
|
159
|
+
type: [hourSchema],
|
|
160
|
+
validate: {
|
|
161
|
+
validator: (arr) => {
|
|
162
|
+
const days = arr.map((h) => h.day);
|
|
163
|
+
return days.length === new Set(days).size;
|
|
164
|
+
},
|
|
165
|
+
message: "Duplicate days in call connect hours",
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
officeHours: {
|
|
169
|
+
type: [hourSchema],
|
|
170
|
+
validate: {
|
|
171
|
+
validator: (arr) => {
|
|
172
|
+
const days = arr.map((h) => h.day);
|
|
173
|
+
return days.length === new Set(days).size;
|
|
174
|
+
},
|
|
175
|
+
message: "Duplicate days in office hours",
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
}, {
|
|
179
|
+
timestamps: true,
|
|
180
|
+
toJSON: { virtuals: true },
|
|
181
|
+
toObject: { virtuals: true },
|
|
182
|
+
});
|
|
183
|
+
// Indexes
|
|
184
|
+
companySchema.index({ "contactInfo.officialBusinessName": 1 });
|
|
185
|
+
companySchema.index({ status: 1 });
|
|
186
|
+
companySchema.index({ "basicInfo.host": 1 });
|
|
187
|
+
companySchema.index({ "basicInfo.website": 1 });
|
|
188
|
+
companySchema.index({ "contactInfo.state": 1 });
|
|
189
|
+
exports.Company = mongoose_1.default.model("Company", companySchema);
|
|
190
|
+
exports.default = exports.Company;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { IReview } from "../interfaces/review.interface";
|
|
3
|
+
export declare const Review: mongoose.Model<IReview, {}, {}, {}, mongoose.Document<unknown, {}, IReview, {}, {}> & IReview & {
|
|
4
|
+
_id: mongoose.Types.ObjectId;
|
|
5
|
+
} & {
|
|
6
|
+
__v: number;
|
|
7
|
+
}, any>;
|
|
8
|
+
export default Review;
|
|
9
|
+
//# sourceMappingURL=review.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"review.model.d.ts","sourceRoot":"","sources":["../../src/models/review.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAyDzD,eAAO,MAAM,MAAM;;;;OAAkD,CAAC;AACtE,eAAe,MAAM,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
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.Review = void 0;
|
|
37
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
38
|
+
const reviewSchema = new mongoose_1.Schema({
|
|
39
|
+
partner: {
|
|
40
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
|
+
ref: "Partner",
|
|
42
|
+
required: [true, "Partner ID is required"],
|
|
43
|
+
},
|
|
44
|
+
client: {
|
|
45
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
46
|
+
ref: "Company",
|
|
47
|
+
required: [true, "Client ID is required"],
|
|
48
|
+
},
|
|
49
|
+
reviewType: {
|
|
50
|
+
type: String,
|
|
51
|
+
enum: ["Image", "Video"],
|
|
52
|
+
required: [true, "Review type is required"],
|
|
53
|
+
},
|
|
54
|
+
reviewLink: {
|
|
55
|
+
type: String,
|
|
56
|
+
required: [true, "Review link is required"],
|
|
57
|
+
trim: true,
|
|
58
|
+
validate: {
|
|
59
|
+
validator: (v) => /^https?:\/\/[^\s$.?#].[^\s]*$/.test(v),
|
|
60
|
+
message: "Invalid URL format",
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
reviewDate: {
|
|
64
|
+
type: Date,
|
|
65
|
+
required: [true, "Review date is required"],
|
|
66
|
+
},
|
|
67
|
+
reviewContent: {
|
|
68
|
+
type: String,
|
|
69
|
+
required: [true, "Review content is required"],
|
|
70
|
+
trim: true,
|
|
71
|
+
},
|
|
72
|
+
media: {
|
|
73
|
+
type: [String],
|
|
74
|
+
required: [true, "Media URL is required"],
|
|
75
|
+
validate: {
|
|
76
|
+
validator: (arr) => arr.length > 0,
|
|
77
|
+
message: "At least one media URL is required",
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
}, {
|
|
81
|
+
timestamps: true,
|
|
82
|
+
toJSON: { virtuals: true },
|
|
83
|
+
toObject: { virtuals: true },
|
|
84
|
+
});
|
|
85
|
+
reviewSchema.index({ partner: 1 });
|
|
86
|
+
reviewSchema.index({ client: 1 });
|
|
87
|
+
reviewSchema.index({ reviewDate: -1 });
|
|
88
|
+
exports.Review = mongoose_1.default.model("Review", reviewSchema);
|
|
89
|
+
exports.default = exports.Review;
|