orbitx-core-models 11.80.0 → 11.82.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.
@@ -14,6 +14,24 @@ export interface ILeadConfig {
14
14
  /** List of email addresses that will receive lead notification emails. */
15
15
  sentToEmails?: string[];
16
16
  }
17
+ export interface ILeadDelivery {
18
+ /** Primary email address for lead delivery notifications. */
19
+ primaryEmail?: string;
20
+ /** Secondary (fallback) email address for lead delivery notifications. */
21
+ secondaryEmail?: string;
22
+ }
23
+ export interface ICallConnectLocation {
24
+ /** Location name (e.g. branch or office label). */
25
+ name: string;
26
+ /** Phone number assigned to this location for call connect. */
27
+ phoneNumber: string;
28
+ }
29
+ export interface IEmailRouting {
30
+ /** Location name (e.g. branch or office label). */
31
+ location: string;
32
+ /** Email address to route leads for this location. */
33
+ email: string;
34
+ }
17
35
  export interface ICompanySettings extends mongoose.Document {
18
36
  /** Reference to the owning Company document. */
19
37
  company: Types.ObjectId;
@@ -29,6 +47,12 @@ export interface ICompanySettings extends mongoose.Document {
29
47
  widgetConfig?: IWidgetConfig;
30
48
  /** Lead delivery configuration. */
31
49
  leadConfig?: ILeadConfig;
50
+ /** Lead delivery notification emails (primary & secondary). */
51
+ leadDelivery?: ILeadDelivery;
52
+ /** Per-location phone numbers for Advanced Call Connect. */
53
+ callConnectLocations?: ICallConnectLocation[];
54
+ /** Per-location email addresses for Custom Email Routing. */
55
+ emailRouting?: IEmailRouting[];
32
56
  createdAt?: Date;
33
57
  updatedAt?: Date;
34
58
  }
@@ -1 +1 @@
1
- {"version":3,"file":"companySettings.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/companySettings.interface.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EACL,KAAK,EACL,aAAa,EACb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAM7B,MAAM,WAAW,oBAAoB;IACnC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAMD,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAMD,MAAM,WAAW,gBAAiB,SAAQ,QAAQ,CAAC,QAAQ;IACzD,gDAAgD;IAChD,OAAO,EAAE,KAAK,CAAC,QAAQ,CAAC;IAExB,4CAA4C;IAC5C,YAAY,CAAC,EAAE,aAAa,CAAC;IAE7B,sCAAsC;IACtC,mBAAmB,CAAC,EAAE,oBAAoB,CAAC;IAE3C,qDAAqD;IACrD,gBAAgB,CAAC,EAAE,KAAK,EAAE,CAAC;IAE3B,oCAAoC;IACpC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC;IAEtB,+CAA+C;IAC/C,YAAY,CAAC,EAAE,aAAa,CAAC;IAE7B,mCAAmC;IACnC,UAAU,CAAC,EAAE,WAAW,CAAC;IAEzB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
1
+ {"version":3,"file":"companySettings.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/companySettings.interface.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EACL,KAAK,EACL,aAAa,EACb,aAAa,EACd,MAAM,qBAAqB,CAAC;AAM7B,MAAM,WAAW,oBAAoB;IACnC,+CAA+C;IAC/C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yEAAyE;IACzE,+BAA+B,CAAC,EAAE,OAAO,CAAC;IAC1C,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC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+6,7 @@ export interface IPlan {
6
6
  planType: "subscription" | "budget_inclusive" | "pay_per_lead";
7
7
  description?: string;
8
8
  options: Types.ObjectId[];
9
- availableAddons: Types.ObjectId[];
9
+ availableAddons: string[];
10
10
  isActive: boolean;
11
11
  createdAt?: Date;
12
12
  updatedAt?: Date;
@@ -1 +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"}
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,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
@@ -1 +1 @@
1
- {"version":3,"file":"companySettings.model.d.ts","sourceRoot":"","sources":["../../src/models/companySettings.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAA2B,MAAM,UAAU,CAAC;AACnD,OAAO,EACL,gBAAgB,EAGjB,MAAM,yCAAyC,CAAC;AAqLjD,eAAO,MAAM,eAAe;;;;OAG3B,CAAC;AACF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"companySettings.model.d.ts","sourceRoot":"","sources":["../../src/models/companySettings.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAA2B,MAAM,UAAU,CAAC;AACnD,OAAO,EACL,gBAAgB,EAMjB,MAAM,yCAAyC,CAAC;AAyOjD,eAAO,MAAM,eAAe;;;;OAG3B,CAAC;AACF,eAAe,eAAe,CAAC"}
@@ -135,6 +135,43 @@ const leadConfigSchema = new mongoose_1.Schema({
135
135
  },
136
136
  }, { _id: false });
137
137
  // ─────────────────────────────────────────────
138
+ // LEAD DELIVERY SUB-SCHEMA (Step 2)
139
+ // ─────────────────────────────────────────────
140
+ const leadDeliverySchema = new mongoose_1.Schema({
141
+ primaryEmail: {
142
+ type: String,
143
+ trim: true,
144
+ lowercase: true,
145
+ match: [/^\S+@\S+\.\S+$/, "Invalid primary email format"],
146
+ },
147
+ secondaryEmail: {
148
+ type: String,
149
+ trim: true,
150
+ lowercase: true,
151
+ match: [/^\S+@\S+\.\S+$/, "Invalid secondary email format"],
152
+ },
153
+ }, { _id: false });
154
+ // ─────────────────────────────────────────────
155
+ // CALL CONNECT LOCATION SUB-SCHEMA (Step 4b)
156
+ // ─────────────────────────────────────────────
157
+ const callConnectLocationSchema = new mongoose_1.Schema({
158
+ name: { type: String, required: true, trim: true },
159
+ phoneNumber: { type: String, required: true, trim: true },
160
+ }, { _id: false });
161
+ // ─────────────────────────────────────────────
162
+ // EMAIL ROUTING SUB-SCHEMA (Step 5)
163
+ // ─────────────────────────────────────────────
164
+ const emailRoutingSchema = new mongoose_1.Schema({
165
+ location: { type: String, required: true, trim: true },
166
+ email: {
167
+ type: String,
168
+ required: true,
169
+ trim: true,
170
+ lowercase: true,
171
+ match: [/^\S+@\S+\.\S+$/, "Invalid email routing address"],
172
+ },
173
+ }, { _id: false });
174
+ // ─────────────────────────────────────────────
138
175
  // COMPANY SETTINGS SCHEMA
139
176
  // ─────────────────────────────────────────────
140
177
  const companySettingsSchema = new mongoose_1.Schema({
@@ -168,6 +205,9 @@ const companySettingsSchema = new mongoose_1.Schema({
168
205
  },
169
206
  widgetConfig: widgetConfigSchema,
170
207
  leadConfig: leadConfigSchema,
208
+ leadDelivery: leadDeliverySchema,
209
+ callConnectLocations: { type: [callConnectLocationSchema], default: undefined },
210
+ emailRouting: { type: [emailRoutingSchema], default: undefined },
171
211
  }, {
172
212
  timestamps: true,
173
213
  toJSON: { virtuals: true },
@@ -69,8 +69,8 @@ const planSchema = new mongoose_1.Schema({
69
69
  ],
70
70
  availableAddons: [
71
71
  {
72
- type: mongoose_1.Schema.Types.ObjectId,
73
- ref: "Addon",
72
+ type: String,
73
+ trim: true,
74
74
  },
75
75
  ],
76
76
  isActive: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orbitx-core-models",
3
- "version": "11.80.0",
3
+ "version": "11.82.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",