orbitx-core-models 11.100.0 → 11.102.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/callSession.interface.d.ts +25 -0
- package/dist/interfaces/callSession.interface.d.ts.map +1 -0
- package/dist/interfaces/callSession.interface.js +2 -0
- package/dist/interfaces/employee.interface.d.ts +41 -0
- package/dist/interfaces/employee.interface.d.ts.map +1 -0
- package/dist/interfaces/employee.interface.js +2 -0
- package/dist/models/callSession.model.d.ts +9 -0
- package/dist/models/callSession.model.d.ts.map +1 -0
- package/dist/models/callSession.model.js +125 -0
- package/dist/models/employee.model.d.ts +5 -0
- package/dist/models/employee.model.d.ts.map +1 -0
- package/dist/models/employee.model.js +196 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -28,6 +28,8 @@ import { LeadDispute } from "./models/leadDispute.model";
|
|
|
28
28
|
import { Session } from "./models/session.model";
|
|
29
29
|
import { LoginOtp } from "./models/loginOtp.model";
|
|
30
30
|
import { Counter } from "./models/counter.model";
|
|
31
|
+
import { Employee } from "./models/employee.model";
|
|
32
|
+
import { CallSession } from "./models/callSession.model";
|
|
31
33
|
import { IChat } from "./interfaces/chat.interface";
|
|
32
34
|
import { IMacro } from "./interfaces/macro.interface";
|
|
33
35
|
import { IVertical } from "./interfaces/vertical.interface";
|
|
@@ -57,6 +59,8 @@ import { IInvoice } from "./interfaces/invoice.interface";
|
|
|
57
59
|
import { ILeadDispute } from "./interfaces/leadDispute.interface";
|
|
58
60
|
import { ISession } from "./interfaces/session.interface";
|
|
59
61
|
import { ILoginOtp } from "./interfaces/loginOtp.interface";
|
|
60
|
-
|
|
61
|
-
|
|
62
|
+
import { IEmployee } from "./interfaces/employee.interface";
|
|
63
|
+
import { ICallSession, CallSessionStatus, CallSessionDirection } from "./interfaces/callSession.interface";
|
|
64
|
+
export { Chat, Message, User, Vertical, Macro, Partner, Company, CompanySettings, Review, Wallet, StripeLog, Transaction, Lead, TierConfig, TierProgress, MonthlyTierSnapshot, Product, Plan, PlanOption, Addon, Subscription, Visitor, Group, Agent, LeadLedger, Invoice, LeadDispute, Session, LoginOtp, Counter, Employee, CallSession, };
|
|
65
|
+
export type { IChat, IMessage, IUser, IVertical, IMacro, IPartner, ICompany, IOnboardingStep, ITwilioConfig, ICompanySettings, ICallConnectSettings, ILeadConfig, ILeadFields, IReview, IWallet, IStripeLog, ITransaction, ILead, ITierConfig, ITierProgress, IMonthlyTierSnapshot, IProduct, IPlan, IPlanOption, IAddon, ISubscription, IVisitor, IGroup, IAgent, ILeadLedger, IInvoice, ILeadDispute, ISession, ILoginOtp, IEmployee, ICallSession, CallSessionStatus, CallSessionDirection, };
|
|
62
66
|
//# 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,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,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,OAA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,EACP,UAAU,EACV,YAAY,EACZ,KAAK,EACL,WAAW,EACX,aAAa,EACb,oBAAoB,EACpB,QAAQ,EACR,KAAK,EACL,WAAW,EACX,MAAM,EACN,aAAa,EACb,QAAQ,EACR,MAAM,EACN,MAAM,EACN,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,SAAS,EACT,SAAS,EACT,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,GACrB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Counter = exports.LoginOtp = exports.Session = exports.LeadDispute = exports.Invoice = exports.LeadLedger = exports.Agent = exports.Group = exports.Visitor = exports.Subscription = 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.CompanySettings = exports.Company = exports.Partner = exports.Macro = exports.Vertical = exports.User = exports.Message = exports.Chat = void 0;
|
|
3
|
+
exports.CallSession = exports.Employee = exports.Counter = exports.LoginOtp = exports.Session = exports.LeadDispute = exports.Invoice = exports.LeadLedger = exports.Agent = exports.Group = exports.Visitor = exports.Subscription = 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.CompanySettings = 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; } });
|
|
@@ -62,3 +62,7 @@ const loginOtp_model_1 = require("./models/loginOtp.model");
|
|
|
62
62
|
Object.defineProperty(exports, "LoginOtp", { enumerable: true, get: function () { return loginOtp_model_1.LoginOtp; } });
|
|
63
63
|
const counter_model_1 = require("./models/counter.model");
|
|
64
64
|
Object.defineProperty(exports, "Counter", { enumerable: true, get: function () { return counter_model_1.Counter; } });
|
|
65
|
+
const employee_model_1 = require("./models/employee.model");
|
|
66
|
+
Object.defineProperty(exports, "Employee", { enumerable: true, get: function () { return employee_model_1.Employee; } });
|
|
67
|
+
const callSession_model_1 = require("./models/callSession.model");
|
|
68
|
+
Object.defineProperty(exports, "CallSession", { enumerable: true, get: function () { return callSession_model_1.CallSession; } });
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Types } from "mongoose";
|
|
2
|
+
export type CallSessionStatus = "pending" | "ringing" | "connected" | "completed" | "failed" | "busy" | "no-answer" | "cancelled";
|
|
3
|
+
export type CallSessionDirection = "company-first" | "visitor-first";
|
|
4
|
+
export interface ICallSession {
|
|
5
|
+
_id?: Types.ObjectId;
|
|
6
|
+
companyId: Types.ObjectId;
|
|
7
|
+
chatId: Types.ObjectId;
|
|
8
|
+
visitorPhoneNumber: string;
|
|
9
|
+
businessPhoneNumber: string;
|
|
10
|
+
conferenceName?: string;
|
|
11
|
+
visitorCallSid?: string;
|
|
12
|
+
businessCallSid?: string;
|
|
13
|
+
status: CallSessionStatus;
|
|
14
|
+
direction: CallSessionDirection;
|
|
15
|
+
recordingSid?: string;
|
|
16
|
+
recordingUrl?: string;
|
|
17
|
+
durationSeconds?: number;
|
|
18
|
+
failureReason?: string;
|
|
19
|
+
startedAt?: Date;
|
|
20
|
+
connectedAt?: Date;
|
|
21
|
+
endedAt?: Date;
|
|
22
|
+
createdAt?: Date;
|
|
23
|
+
updatedAt?: Date;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=callSession.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callSession.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/callSession.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,MAAM,MAAM,iBAAiB,GACzB,SAAS,GACT,SAAS,GACT,WAAW,GACX,WAAW,GACX,QAAQ,GACR,MAAM,GACN,WAAW,GACX,WAAW,CAAC;AAEhB,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAAG,eAAe,CAAC;AAErE,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IAGrB,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC1B,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC;IAGvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAG5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,EAAE,oBAAoB,CAAC;IAGhC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IAGtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IAGvB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,OAAO,CAAC,EAAE,IAAI,CAAC;IAEf,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Document, Schema } from "mongoose";
|
|
2
|
+
export interface IEmployee extends Document {
|
|
3
|
+
agentId?: Schema.Types.ObjectId | null;
|
|
4
|
+
fullName: string;
|
|
5
|
+
username?: string;
|
|
6
|
+
employeeCode?: string;
|
|
7
|
+
phoneNumber?: string;
|
|
8
|
+
alternateNumber?: string;
|
|
9
|
+
personalEmail?: string;
|
|
10
|
+
workEmail?: string;
|
|
11
|
+
maritalStatus?: string;
|
|
12
|
+
gender?: string;
|
|
13
|
+
dateOfBirth?: Date | null;
|
|
14
|
+
placeOfBirth?: string;
|
|
15
|
+
nationality?: string;
|
|
16
|
+
religion?: string;
|
|
17
|
+
cnic?: string;
|
|
18
|
+
guardian?: string;
|
|
19
|
+
guardianName?: string;
|
|
20
|
+
guardianPhone?: string;
|
|
21
|
+
homeAddress?: string;
|
|
22
|
+
company?: Schema.Types.ObjectId | string | null;
|
|
23
|
+
department?: string;
|
|
24
|
+
employeeGroup?: string;
|
|
25
|
+
grade?: string;
|
|
26
|
+
designation?: string;
|
|
27
|
+
employeeStatus?: string;
|
|
28
|
+
joiningDate?: Date | null;
|
|
29
|
+
confirmationDate?: Date | null;
|
|
30
|
+
contractStartDate?: Date | null;
|
|
31
|
+
contractEndDate?: Date | null;
|
|
32
|
+
resignationDate?: Date | null;
|
|
33
|
+
bankName?: string;
|
|
34
|
+
branchCode?: string;
|
|
35
|
+
accountTitle?: string;
|
|
36
|
+
accountNumber?: string;
|
|
37
|
+
ibanNumber?: string;
|
|
38
|
+
createdAt: Date;
|
|
39
|
+
updatedAt: Date;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=employee.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"employee.interface.d.ts","sourceRoot":"","sources":["../../src/interfaces/employee.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAE5C,MAAM,WAAW,SAAU,SAAQ,QAAQ;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IAGvC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE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SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { ICallSession } from "../interfaces/callSession.interface";
|
|
3
|
+
export declare const CallSession: mongoose.Model<ICallSession, {}, {}, {}, mongoose.Document<unknown, {}, ICallSession, {}, {}> & ICallSession & Required<{
|
|
4
|
+
_id: mongoose.Types.ObjectId;
|
|
5
|
+
}> & {
|
|
6
|
+
__v: number;
|
|
7
|
+
}, any>;
|
|
8
|
+
export default CallSession;
|
|
9
|
+
//# sourceMappingURL=callSession.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"callSession.model.d.ts","sourceRoot":"","sources":["../../src/models/callSession.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAoB,MAAM,UAAU,CAAC;AAC5C,OAAO,EACL,YAAY,EACb,MAAM,qCAAqC,CAAC;AA0G7C,eAAO,MAAM,WAAW;;;;OAGvB,CAAC;AACF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,125 @@
|
|
|
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.CallSession = void 0;
|
|
37
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
38
|
+
const callSessionSchema = new mongoose_1.Schema({
|
|
39
|
+
// ─────────────────────────────────────────────
|
|
40
|
+
// RELATIONS
|
|
41
|
+
// ─────────────────────────────────────────────
|
|
42
|
+
companyId: {
|
|
43
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
44
|
+
ref: "Company",
|
|
45
|
+
required: true,
|
|
46
|
+
},
|
|
47
|
+
chatId: {
|
|
48
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
49
|
+
ref: "Chat",
|
|
50
|
+
required: true,
|
|
51
|
+
},
|
|
52
|
+
// ─────────────────────────────────────────────
|
|
53
|
+
// PHONE NUMBERS
|
|
54
|
+
// ─────────────────────────────────────────────
|
|
55
|
+
visitorPhoneNumber: {
|
|
56
|
+
type: String,
|
|
57
|
+
required: true,
|
|
58
|
+
},
|
|
59
|
+
businessPhoneNumber: {
|
|
60
|
+
type: String,
|
|
61
|
+
required: true,
|
|
62
|
+
},
|
|
63
|
+
// ─────────────────────────────────────────────
|
|
64
|
+
// TWILIO / CALL META
|
|
65
|
+
// ─────────────────────────────────────────────
|
|
66
|
+
conferenceName: { type: String },
|
|
67
|
+
visitorCallSid: { type: String },
|
|
68
|
+
businessCallSid: { type: String },
|
|
69
|
+
// ─────────────────────────────────────────────
|
|
70
|
+
// CALL CONTROL
|
|
71
|
+
// ─────────────────────────────────────────────
|
|
72
|
+
status: {
|
|
73
|
+
type: String,
|
|
74
|
+
enum: [
|
|
75
|
+
"pending",
|
|
76
|
+
"ringing",
|
|
77
|
+
"connected",
|
|
78
|
+
"completed",
|
|
79
|
+
"failed",
|
|
80
|
+
"busy",
|
|
81
|
+
"no-answer",
|
|
82
|
+
"cancelled",
|
|
83
|
+
],
|
|
84
|
+
default: "pending",
|
|
85
|
+
required: true,
|
|
86
|
+
},
|
|
87
|
+
direction: {
|
|
88
|
+
type: String,
|
|
89
|
+
enum: ["company-first", "visitor-first"],
|
|
90
|
+
required: true,
|
|
91
|
+
},
|
|
92
|
+
// ─────────────────────────────────────────────
|
|
93
|
+
// RECORDING
|
|
94
|
+
// ─────────────────────────────────────────────
|
|
95
|
+
recordingSid: { type: String },
|
|
96
|
+
recordingUrl: { type: String },
|
|
97
|
+
// ─────────────────────────────────────────────
|
|
98
|
+
// METRICS & REASON
|
|
99
|
+
// ─────────────────────────────────────────────
|
|
100
|
+
durationSeconds: { type: Number },
|
|
101
|
+
failureReason: { type: String },
|
|
102
|
+
// ─────────────────────────────────────────────
|
|
103
|
+
// TIMESTAMPS
|
|
104
|
+
// ─────────────────────────────────────────────
|
|
105
|
+
startedAt: { type: Date },
|
|
106
|
+
connectedAt: { type: Date },
|
|
107
|
+
endedAt: { type: Date },
|
|
108
|
+
}, { timestamps: true });
|
|
109
|
+
// ─────────────────────────────────────────────
|
|
110
|
+
// INDEXES
|
|
111
|
+
// ─────────────────────────────────────────────
|
|
112
|
+
callSessionSchema.index({ companyId: 1, createdAt: -1 });
|
|
113
|
+
callSessionSchema.index({ chatId: 1, createdAt: -1 });
|
|
114
|
+
callSessionSchema.index({ visitorCallSid: 1 }, { sparse: true });
|
|
115
|
+
callSessionSchema.index({ businessCallSid: 1 }, { sparse: true });
|
|
116
|
+
callSessionSchema.index({ status: 1 });
|
|
117
|
+
// Guarantee only ONE active CallSession per chat
|
|
118
|
+
callSessionSchema.index({ chatId: 1 }, {
|
|
119
|
+
unique: true,
|
|
120
|
+
partialFilterExpression: {
|
|
121
|
+
status: { $in: ["pending", "ringing", "connected"] },
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
exports.CallSession = mongoose_1.default.model("CallSession", callSessionSchema);
|
|
125
|
+
exports.default = exports.CallSession;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"employee.model.d.ts","sourceRoot":"","sources":["../../src/models/employee.model.ts"],"names":[],"mappings":"AAEA,OAAiB,EAAU,KAAK,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAqK7D,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAyD,CAAC;AAChG,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,196 @@
|
|
|
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.Employee = void 0;
|
|
37
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
38
|
+
const employeeSchema = new mongoose_1.Schema({
|
|
39
|
+
agentId: {
|
|
40
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
41
|
+
ref: "Agent",
|
|
42
|
+
default: null,
|
|
43
|
+
index: true,
|
|
44
|
+
},
|
|
45
|
+
// Personal Information
|
|
46
|
+
fullName: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: true,
|
|
49
|
+
trim: true,
|
|
50
|
+
},
|
|
51
|
+
username: {
|
|
52
|
+
type: String,
|
|
53
|
+
trim: true,
|
|
54
|
+
index: true,
|
|
55
|
+
},
|
|
56
|
+
employeeCode: {
|
|
57
|
+
type: String,
|
|
58
|
+
trim: true,
|
|
59
|
+
index: true,
|
|
60
|
+
},
|
|
61
|
+
phoneNumber: {
|
|
62
|
+
type: String,
|
|
63
|
+
trim: true,
|
|
64
|
+
},
|
|
65
|
+
alternateNumber: {
|
|
66
|
+
type: String,
|
|
67
|
+
trim: true,
|
|
68
|
+
},
|
|
69
|
+
personalEmail: {
|
|
70
|
+
type: String,
|
|
71
|
+
trim: true,
|
|
72
|
+
lowercase: true,
|
|
73
|
+
},
|
|
74
|
+
workEmail: {
|
|
75
|
+
type: String,
|
|
76
|
+
trim: true,
|
|
77
|
+
lowercase: true,
|
|
78
|
+
index: true,
|
|
79
|
+
},
|
|
80
|
+
maritalStatus: {
|
|
81
|
+
type: String,
|
|
82
|
+
trim: true,
|
|
83
|
+
},
|
|
84
|
+
gender: {
|
|
85
|
+
type: String,
|
|
86
|
+
trim: true,
|
|
87
|
+
},
|
|
88
|
+
dateOfBirth: {
|
|
89
|
+
type: Date,
|
|
90
|
+
default: null,
|
|
91
|
+
},
|
|
92
|
+
placeOfBirth: {
|
|
93
|
+
type: String,
|
|
94
|
+
trim: true,
|
|
95
|
+
},
|
|
96
|
+
nationality: {
|
|
97
|
+
type: String,
|
|
98
|
+
trim: true,
|
|
99
|
+
},
|
|
100
|
+
religion: {
|
|
101
|
+
type: String,
|
|
102
|
+
trim: true,
|
|
103
|
+
},
|
|
104
|
+
cnic: {
|
|
105
|
+
type: String,
|
|
106
|
+
trim: true,
|
|
107
|
+
},
|
|
108
|
+
guardian: {
|
|
109
|
+
type: String,
|
|
110
|
+
trim: true,
|
|
111
|
+
},
|
|
112
|
+
guardianName: {
|
|
113
|
+
type: String,
|
|
114
|
+
trim: true,
|
|
115
|
+
},
|
|
116
|
+
guardianPhone: {
|
|
117
|
+
type: String,
|
|
118
|
+
trim: true,
|
|
119
|
+
},
|
|
120
|
+
homeAddress: {
|
|
121
|
+
type: String,
|
|
122
|
+
trim: true,
|
|
123
|
+
},
|
|
124
|
+
// Employment Information
|
|
125
|
+
company: {
|
|
126
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
127
|
+
ref: "Company",
|
|
128
|
+
default: null,
|
|
129
|
+
},
|
|
130
|
+
department: {
|
|
131
|
+
type: String,
|
|
132
|
+
trim: true,
|
|
133
|
+
},
|
|
134
|
+
employeeGroup: {
|
|
135
|
+
type: String,
|
|
136
|
+
trim: true,
|
|
137
|
+
},
|
|
138
|
+
grade: {
|
|
139
|
+
type: String,
|
|
140
|
+
trim: true,
|
|
141
|
+
},
|
|
142
|
+
designation: {
|
|
143
|
+
type: String,
|
|
144
|
+
trim: true,
|
|
145
|
+
},
|
|
146
|
+
employeeStatus: {
|
|
147
|
+
type: String,
|
|
148
|
+
trim: true,
|
|
149
|
+
default: "Active",
|
|
150
|
+
},
|
|
151
|
+
joiningDate: {
|
|
152
|
+
type: Date,
|
|
153
|
+
default: null,
|
|
154
|
+
},
|
|
155
|
+
confirmationDate: {
|
|
156
|
+
type: Date,
|
|
157
|
+
default: null,
|
|
158
|
+
},
|
|
159
|
+
contractStartDate: {
|
|
160
|
+
type: Date,
|
|
161
|
+
default: null,
|
|
162
|
+
},
|
|
163
|
+
contractEndDate: {
|
|
164
|
+
type: Date,
|
|
165
|
+
default: null,
|
|
166
|
+
},
|
|
167
|
+
resignationDate: {
|
|
168
|
+
type: Date,
|
|
169
|
+
default: null,
|
|
170
|
+
},
|
|
171
|
+
// Bank Information
|
|
172
|
+
bankName: {
|
|
173
|
+
type: String,
|
|
174
|
+
trim: true,
|
|
175
|
+
},
|
|
176
|
+
branchCode: {
|
|
177
|
+
type: String,
|
|
178
|
+
trim: true,
|
|
179
|
+
},
|
|
180
|
+
accountTitle: {
|
|
181
|
+
type: String,
|
|
182
|
+
trim: true,
|
|
183
|
+
},
|
|
184
|
+
accountNumber: {
|
|
185
|
+
type: String,
|
|
186
|
+
trim: true,
|
|
187
|
+
},
|
|
188
|
+
ibanNumber: {
|
|
189
|
+
type: String,
|
|
190
|
+
trim: true,
|
|
191
|
+
},
|
|
192
|
+
}, {
|
|
193
|
+
timestamps: true,
|
|
194
|
+
});
|
|
195
|
+
exports.Employee = mongoose_1.default.model("Employee", employeeSchema);
|
|
196
|
+
exports.default = exports.Employee;
|