EchoTex_Payroll/HRM.UI/ClientApp/src/app/_models/Employee/employee.ts

231 lines
6.7 KiB
TypeScript

import { Nationality } from '../HRBasic/nationality';
import { HrEmployee } from '../HREmployee/hrEmployee';
import {
EnumBaseStation,
EnumEmployeeStatus,
EnumGender,
EnumMaritalStatus,
EnumPaymentMode,
EnumPersonType,
EnumPFMembershipType,
EnumProfileStatus,
EnumRole,
EnumTaxCircle
} from '../enums';
import {SearchEmployee} from './searchEmployee';
// do not change this class without discuss with shamim
export class Employee {
id: number;
modifiedBy?: number;
createdDate: Date;
createdBy: number;
modifiedDate?: Date;
globalID: string;
employeeNo: string;
name: string;
gender: EnumGender;
birthDate: Date;
joiningDate: Date;
retirementDate: Date;
sBU: string;
endOfContractDate?: Date;
cardDate?: Date;
emailAddress: string;
mobileNo: string;
tinNo: string;
categoryID: number;
categoryName: string;
foreignExPat: boolean;
personType: EnumPersonType;
profileStatus: EnumProfileStatus;
continueGratuity: number;
taxCircle: EnumTaxCircle;
isConfirmed: boolean;
status: EnumEmployeeStatus;
statusName: string;
isShownInTaxSheet: boolean;
pfMemberType: EnumPFMembershipType;
pfMemberShiptDate: Date;
branchID: number;
accountNo: string;
outPayBranchID: number;
outPayAccountNo: string;
departmentName: string;
departmentID: number;
address: string;
locationName: string;
locationID: number;
religionName: string;
religionID: number;
maritalStatus: EnumMaritalStatus;
designationName: string;
designationID: number;
gradeName: string;
gradeID: number;
basicSalary: number;
currentHistoryID: number;
prevBasic: number;
paymentMode: EnumPaymentMode;
outPayPaymentMode: EnumPaymentMode;
fatherName: string;
isEligibleOT: boolean;
// do not change this class without discuss with shamim
descriptionText: string;
desktopUserPass: string;
payrollTypeID: number;
isAutoProcess: boolean;
role: EnumRole;
cardID?: number;
grossSalary: number;
photoPath: string;
payScaleId: number;
taxAmount: number;
confirDate: Date;
discontinueDate: Date;
arrearFrom: string;
salaryFractionate: number;
monthStatusUpdate: EnumEmployeeStatus;
lineManagerID: number;
secondLineManagerID: number;
lineManagerNo: string;
lineManager: string = '';
positionID?: number;
positionName: string;
costcenterName: string;
employeeID: number;
geId: string;
extraField1: string;
extraField2: EnumBaseStation;
extraField3: string;
extraField4: string;
extraField5: string;
vendorCode: string;
firstName: string;
lastName: string;
crgId: number;
profileCompletionPercent: number;
insuranceId: string;
inclusionDate: Date;
isFixedLocation: boolean;
nationalId: string;
passportNo: string;
lineManagerDeg: string;
lastWorkingDate: Date;//resignationrequest
resignationDate: Date;//resignationrequest
nationality: Nationality;
nationalityID: number;
// do not change this class without discuss with shamim
constructor() {
this.globalID = '';
this.employeeNo = '';
this.name = '';
this.gender = EnumGender.Regardless;
this.birthDate = new Date();
this.joiningDate = new Date();
this.retirementDate = new Date();
this.sBU = '';
this.emailAddress = '';
this.mobileNo = '';
this.tinNo = '';
this.categoryID = 0;
this.categoryName = '';
this.foreignExPat = false;
this.personType = EnumPersonType.None;
this.profileStatus = EnumProfileStatus.Approve;
this.taxCircle = EnumTaxCircle.CityCorporation;
this.isConfirmed = false;
this.endOfContractDate = null;
this.status = EnumEmployeeStatus.Waitingforjoin;
this.statusName = '';
this.isShownInTaxSheet = false;
this.pfMemberType = EnumPFMembershipType.NotYetLive;
this.branchID = null;
this.accountNo = '';
this.outPayBranchID = null;
this.outPayAccountNo = '';
this.departmentName = '';
this.departmentID = null;
this.locationName = '';
this.locationID = null;
this.religionName = '';
this.religionID = undefined;
this.maritalStatus = EnumMaritalStatus.None;
this.designationName = '';
this.designationID = null;
this.gradeName = '';
this.gradeID = null;
this.basicSalary = 0;
this.currentHistoryID = null;
this.prevBasic = 0;
this.paymentMode = EnumPaymentMode.Cash_Payment;
this.outPayPaymentMode = EnumPaymentMode.Cash_Payment;
this.fatherName = '';
this.isEligibleOT = false;
this.descriptionText = '';
this.payrollTypeID = 0;
this.grossSalary = 0;
this.taxAmount = 0;
this.lineManagerID = null;
this.secondLineManagerID = null;
this.lineManagerNo = '';
this.positionID = null;
this.positionName = '';
this.costcenterName = '';
this.role = EnumRole.None;
this.geId = '';
this.extraField1 = '';
this.extraField2 = EnumBaseStation.None;
this.extraField3 = '';
this.extraField4 = '';
this.extraField5 = '';
this.vendorCode = '';
this.firstName = '';
this.lastName = '';
this.crgId = undefined;
this.profileCompletionPercent = undefined;
this.insuranceId = '';
this.inclusionDate = null;
this.isFixedLocation = false;
this.lineManagerDeg = '';
}
public getSearchEmployee(): SearchEmployee {
var emp: SearchEmployee = new SearchEmployee();
emp.employeeID = this.id;
emp.name = this.name;
emp.employeeNo = this.employeeNo;
emp.departmentID = this.departmentID;
emp.locationID = this.locationID;
emp.designationID = this.designationID;
emp.gradeID = this.gradeID;
emp.email = this.emailAddress;
return emp;
}
getStatusString(empStatus: EnumEmployeeStatus):string {
var str: string = "Live";
switch (empStatus) {
case EnumEmployeeStatus.Live:
str = "Live";
break;
case EnumEmployeeStatus.Suspend:
//case EnumEmployeeStatus.Withheld:
case EnumEmployeeStatus.IA:
case EnumEmployeeStatus.Discontinued:
str = "Discontinued";
break;
case EnumEmployeeStatus.Waitingforjoin:
str = "Waiting For Join";
break;
default:
}
return str;
}
}