@platform-modules/foreign-ministry 1.0.27 → 1.0.28
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/.env +2 -2
- package/dist/data-source.js +5 -40
- package/dist/index.d.ts +4 -14
- package/dist/index.js +4 -14
- package/dist/models/FMServices.d.ts +8 -0
- package/dist/models/{DepartmentsModel.js → FMServices.js} +20 -15
- package/dist/models/FMSubservices.d.ts +9 -0
- package/dist/models/{SectionModel.js → FMSubservices.js} +25 -20
- package/dist/models/LeaveApprovalDetailsModel.d.ts +8 -0
- package/dist/models/{LeaveApprovalsModel.js → LeaveApprovalDetailsModel.js} +7 -23
- package/dist/models/LeaveApprovalMatrixModel.d.ts +7 -0
- package/dist/models/{LeaveSettingsModel.js → LeaveApprovalMatrixModel.js} +14 -14
- package/dist/models/user.d.ts +16 -29
- package/dist/models/user.js +39 -99
- package/package.json +1 -1
- package/src/data-source.ts +5 -42
- package/src/index.ts +4 -14
- package/src/models/FMServices.ts +32 -0
- package/src/models/FMSubservices.ts +37 -0
- package/src/models/LeaveApprovalDetailsModel.ts +25 -0
- package/src/models/{LeaveSettingsModel.ts → LeaveApprovalMatrixModel.ts} +6 -6
- package/src/models/user.ts +60 -111
- package/dist/models/ConversationModel.d.ts +0 -16
- package/dist/models/ConversationModel.js +0 -64
- package/dist/models/ConversationParticipantModel.d.ts +0 -14
- package/dist/models/ConversationParticipantModel.js +0 -68
- package/dist/models/DepartmentsModel.d.ts +0 -7
- package/dist/models/DesignationModel.d.ts +0 -6
- package/dist/models/DesignationModel.js +0 -34
- package/dist/models/DivisionModel.d.ts +0 -6
- package/dist/models/DivisionModel.js +0 -34
- package/dist/models/LeaveApprovalsModel.d.ts +0 -15
- package/dist/models/LeaveAttachmentsModel.d.ts +0 -7
- package/dist/models/LeaveAttachmentsModel.js +0 -40
- package/dist/models/LeaveChatModel.d.ts +0 -7
- package/dist/models/LeaveChatModel.js +0 -40
- package/dist/models/LeaveSettingsModel.d.ts +0 -7
- package/dist/models/LeaveWorkFlowModel.d.ts +0 -13
- package/dist/models/LeaveWorkFlowModel.js +0 -51
- package/dist/models/MessageModel.d.ts +0 -27
- package/dist/models/MessageModel.js +0 -108
- package/dist/models/SectionModel.d.ts +0 -8
- package/dist/models/faqsModel.d.ts +0 -11
- package/dist/models/faqsModel.js +0 -57
- package/dist/models/questionTagsModel.d.ts +0 -6
- package/dist/models/questionTagsModel.js +0 -34
- package/src/models/ConversationModel.ts +0 -48
- package/src/models/ConversationParticipantModel.ts +0 -51
- package/src/models/DepartmentsModel.ts +0 -26
- package/src/models/DesignationModel.ts +0 -19
- package/src/models/DivisionModel.ts +0 -19
- package/src/models/LeaveApprovalsModel.ts +0 -41
- package/src/models/LeaveAttachmentsModel.ts +0 -21
- package/src/models/LeaveChatModel.ts +0 -21
- package/src/models/LeaveWorkFlowModel.ts +0 -32
- package/src/models/MessageModel.ts +0 -93
- package/src/models/SectionModel.ts +0 -31
- package/src/models/faqsModel.ts +0 -43
- package/src/models/questionTagsModel.ts +0 -22
package/src/data-source.ts
CHANGED
|
@@ -12,22 +12,10 @@ import { HajjLeaveDates } from './models/HajjLeaveDatesModel';
|
|
|
12
12
|
import { StudyLeaveDegrees } from './models/StudyLeaveDegreesModel';
|
|
13
13
|
import { UnpaidLeaveCategories } from './models/UnpaidLeaveCatgoriesModel';
|
|
14
14
|
import { MounringLeaveRelations } from './models/MounringLeaveRelationModel';
|
|
15
|
-
import {
|
|
16
|
-
import { LeaveApprovalDetails } from './models/
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { LeaveWorkFlow } from './models/LeaveWorkFlowModel';
|
|
20
|
-
import { Sections } from './models/SectionModel';
|
|
21
|
-
import { Designation } from './models/DesignationModel';
|
|
22
|
-
import { Departments } from './models/DepartmentsModel';
|
|
23
|
-
import { Division } from './models/DivisionModel';
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
import { Faqs } from './models/faqsModel';
|
|
27
|
-
import { QuestionTags } from './models/questionTagsModel';
|
|
28
|
-
import { Conversation } from './models/ConversationModel';
|
|
29
|
-
import { ConversationParticipant } from './models/ConversationParticipantModel';
|
|
30
|
-
import { Message } from './models/MessageModel';
|
|
15
|
+
import { LeaveApprovalMatrix } from './models/LeaveApprovalMatrixModel';
|
|
16
|
+
import { LeaveApprovalDetails } from './models/LeaveApprovalDetailsModel';
|
|
17
|
+
import { FMServices } from './models/FMServices';
|
|
18
|
+
import { FMSubServices } from './models/FMSubservices';
|
|
31
19
|
|
|
32
20
|
|
|
33
21
|
export const AppDataSource = new DataSource({
|
|
@@ -39,30 +27,5 @@ export const AppDataSource = new DataSource({
|
|
|
39
27
|
database: process.env.DB_NAME || 'common_models',
|
|
40
28
|
synchronize: true, // auto-create tables (disable in prod)
|
|
41
29
|
logging: false,
|
|
42
|
-
entities: [
|
|
43
|
-
User,
|
|
44
|
-
userSessions,
|
|
45
|
-
Role,
|
|
46
|
-
LeaveRequests,
|
|
47
|
-
LeaveTypes,
|
|
48
|
-
FinancialGrade,
|
|
49
|
-
HajjLeaveDates,
|
|
50
|
-
StudyLeaveDegrees,
|
|
51
|
-
UnpaidLeaveCategories,
|
|
52
|
-
MounringLeaveRelations,
|
|
53
|
-
LeaveSettings,
|
|
54
|
-
LeaveApprovalDetails,
|
|
55
|
-
LeaveAttachments,
|
|
56
|
-
LeaveChat,
|
|
57
|
-
LeaveWorkFlow,
|
|
58
|
-
Sections,
|
|
59
|
-
Designation,
|
|
60
|
-
Departments,
|
|
61
|
-
Division,
|
|
62
|
-
Faqs,
|
|
63
|
-
QuestionTags,
|
|
64
|
-
Conversation,
|
|
65
|
-
ConversationParticipant,
|
|
66
|
-
Message
|
|
67
|
-
],
|
|
30
|
+
entities: [User,userSessions,Role,LeaveRequests,LeaveTypes,FinancialGrade,HajjLeaveDates,StudyLeaveDegrees,UnpaidLeaveCategories,MounringLeaveRelations,LeaveApprovalMatrix,LeaveApprovalDetails,FMServices,FMSubServices],
|
|
68
31
|
});
|
package/src/index.ts
CHANGED
|
@@ -8,17 +8,7 @@ export * from './models/HajjLeaveDatesModel';
|
|
|
8
8
|
export * from './models/StudyLeaveDegreesModel';
|
|
9
9
|
export * from './models/UnpaidLeaveCatgoriesModel';
|
|
10
10
|
export * from './models/MounringLeaveRelationModel';
|
|
11
|
-
export * from './models/
|
|
12
|
-
export * from './models/
|
|
13
|
-
export * from './models/
|
|
14
|
-
export * from './models/
|
|
15
|
-
export * from './models/LeaveWorkFlowModel';
|
|
16
|
-
export * from './models/SectionModel';
|
|
17
|
-
export * from './models/DesignationModel';
|
|
18
|
-
export * from './models/DepartmentsModel';
|
|
19
|
-
export * from './models/DivisionModel';
|
|
20
|
-
export * from './models/faqsModel';
|
|
21
|
-
export * from './models/questionTagsModel';
|
|
22
|
-
export * from './models/ConversationModel';
|
|
23
|
-
export * from './models/ConversationParticipantModel';
|
|
24
|
-
export * from './models/MessageModel';
|
|
11
|
+
export * from './models/LeaveApprovalMatrixModel';
|
|
12
|
+
export * from './models/LeaveApprovalDetailsModel';
|
|
13
|
+
export * from './models/FMServices';
|
|
14
|
+
export * from './models/FMSubservices';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import { Column, Entity } from "typeorm";
|
|
3
|
+
import { BaseModel } from './BaseModel';
|
|
4
|
+
|
|
5
|
+
@Entity({ name: 'fm_services' })
|
|
6
|
+
export class FMServices extends BaseModel {
|
|
7
|
+
|
|
8
|
+
@Column({ type: 'varchar', length: 64, nullable: false, unique: true })
|
|
9
|
+
code: string;
|
|
10
|
+
|
|
11
|
+
@Column({ nullable: false })
|
|
12
|
+
name: string;
|
|
13
|
+
|
|
14
|
+
@Column({ nullable: false })
|
|
15
|
+
description: string;
|
|
16
|
+
|
|
17
|
+
@Column({ nullable: false })
|
|
18
|
+
logo_url: string;
|
|
19
|
+
|
|
20
|
+
constructor(
|
|
21
|
+
name: string,
|
|
22
|
+
description: string,
|
|
23
|
+
logo_url: string,
|
|
24
|
+
code?: string
|
|
25
|
+
) {
|
|
26
|
+
super();
|
|
27
|
+
this.name = name;
|
|
28
|
+
this.description = description;
|
|
29
|
+
this.logo_url = logo_url;
|
|
30
|
+
this.code = code || '';
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
import { Column, Entity } from "typeorm";
|
|
3
|
+
import { BaseModel } from './BaseModel';
|
|
4
|
+
|
|
5
|
+
@Entity({ name: 'fm_sub_services' })
|
|
6
|
+
export class FMSubServices extends BaseModel {
|
|
7
|
+
|
|
8
|
+
@Column({ type: 'varchar', length: 64, nullable: true, unique: true })
|
|
9
|
+
code: string | null;
|
|
10
|
+
|
|
11
|
+
@Column({ nullable: false })
|
|
12
|
+
sub_service_name: string;
|
|
13
|
+
|
|
14
|
+
@Column({ nullable: false })
|
|
15
|
+
description: string;
|
|
16
|
+
|
|
17
|
+
@Column({ nullable: true })
|
|
18
|
+
service_id: number;
|
|
19
|
+
|
|
20
|
+
@Column({ nullable: true })
|
|
21
|
+
logo_url: string;
|
|
22
|
+
|
|
23
|
+
constructor(
|
|
24
|
+
sub_service_name: string,
|
|
25
|
+
description: string,
|
|
26
|
+
service_id: number,
|
|
27
|
+
logo_url: string,
|
|
28
|
+
code: string | null = null
|
|
29
|
+
) {
|
|
30
|
+
super();
|
|
31
|
+
this.sub_service_name = sub_service_name
|
|
32
|
+
this.description = description
|
|
33
|
+
this.service_id = service_id
|
|
34
|
+
this.logo_url = logo_url
|
|
35
|
+
this.code = code
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
//This model is used to store the store the leave apporval details of the user for the leave request
|
|
4
|
+
@Entity({ name: 'leave_approval_details' })
|
|
5
|
+
export class LeaveApprovalDetails extends BaseModel {
|
|
6
|
+
@Column({ type: 'int', nullable: false })
|
|
7
|
+
leave_request_id: number;
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'int', nullable: false })
|
|
10
|
+
level: number;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'int', nullable: false })
|
|
13
|
+
approver_id: number;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'int', nullable: false })
|
|
16
|
+
approval_status: number;
|
|
17
|
+
|
|
18
|
+
constructor(leave_request_id: number, approver_id: number, approval_status: number, level: number) {
|
|
19
|
+
super();
|
|
20
|
+
this.leave_request_id = leave_request_id;
|
|
21
|
+
this.approver_id = approver_id;
|
|
22
|
+
this.approval_status = approval_status;
|
|
23
|
+
this.level = level;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { Column, Entity } from "typeorm";
|
|
2
2
|
import { BaseModel } from './BaseModel';
|
|
3
3
|
//This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
|
|
4
|
-
@Entity({ name: '
|
|
5
|
-
export class
|
|
4
|
+
@Entity({ name: 'leave_approval_matrix' })
|
|
5
|
+
export class LeaveApprovalMatrix extends BaseModel {
|
|
6
6
|
@Column({ type: 'int', nullable: false })
|
|
7
7
|
leave_type: number;
|
|
8
8
|
|
|
9
9
|
@Column({ type: 'int', nullable: false })
|
|
10
10
|
level: number;
|
|
11
11
|
|
|
12
|
-
@Column({ type: '
|
|
13
|
-
|
|
12
|
+
@Column({ type: 'int', nullable: false })
|
|
13
|
+
approval_matrix: number;
|
|
14
14
|
|
|
15
|
-
constructor(leave_type: number, level: number,
|
|
15
|
+
constructor(leave_type: number, level: number, approval_matrix: number) {
|
|
16
16
|
super();
|
|
17
17
|
this.leave_type = leave_type;
|
|
18
18
|
this.level = level;
|
|
19
|
-
this.
|
|
19
|
+
this.approval_matrix = approval_matrix;
|
|
20
20
|
}
|
|
21
21
|
}
|
package/src/models/user.ts
CHANGED
|
@@ -1,151 +1,100 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
import { Column, Entity ,BeforeInsert,BeforeUpdate } from "typeorm";
|
|
2
3
|
import { BaseModel } from './BaseModel';
|
|
3
4
|
|
|
4
5
|
@Entity({ name: 'users' })
|
|
5
6
|
export class User extends BaseModel {
|
|
6
7
|
|
|
7
|
-
@Column({ type: 'bigint', nullable: true })
|
|
8
|
-
employee_id?: number;
|
|
9
|
-
|
|
10
|
-
@Column({ nullable: true })
|
|
11
|
-
employee_name?: string;
|
|
12
|
-
|
|
13
|
-
@Column({ nullable: true })
|
|
14
|
-
employee_arabic_name?: string;
|
|
15
|
-
|
|
16
|
-
@Column({ nullable: true, type: 'date' })
|
|
17
|
-
date_of_birth?: string;
|
|
18
|
-
|
|
19
8
|
@Column({ nullable: true })
|
|
20
|
-
|
|
9
|
+
first_name: string;
|
|
21
10
|
|
|
22
11
|
@Column({ nullable: true })
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@Column({ nullable: true, type: 'date' })
|
|
26
|
-
date_of_joining?: string;
|
|
27
|
-
|
|
28
|
-
@Column({ nullable: true ,type: 'date'})
|
|
29
|
-
last_promotion_date?: string;
|
|
12
|
+
last_name: string;
|
|
30
13
|
|
|
31
14
|
@Column({ nullable: true })
|
|
32
|
-
|
|
15
|
+
full_name: string;
|
|
33
16
|
|
|
34
17
|
@Column({ nullable: true })
|
|
35
|
-
|
|
18
|
+
password: string;
|
|
36
19
|
|
|
37
20
|
@Column({ nullable: true })
|
|
38
|
-
|
|
21
|
+
mobile: string;
|
|
39
22
|
|
|
40
23
|
@Column({ nullable: true })
|
|
41
|
-
email
|
|
24
|
+
email: string;
|
|
42
25
|
|
|
43
26
|
@Column({ nullable: true })
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
@Column({ type: 'bigint', nullable: true })
|
|
47
|
-
national_id?: number;
|
|
27
|
+
address: string;
|
|
48
28
|
|
|
49
29
|
@Column({ nullable: true })
|
|
50
|
-
|
|
30
|
+
city: string;
|
|
51
31
|
|
|
52
32
|
@Column({ nullable: true })
|
|
53
|
-
|
|
33
|
+
state: string;
|
|
54
34
|
|
|
55
35
|
@Column({ nullable: true })
|
|
56
|
-
|
|
36
|
+
country: string;
|
|
57
37
|
|
|
58
38
|
@Column({ nullable: true })
|
|
59
|
-
|
|
39
|
+
pincode: string;
|
|
60
40
|
|
|
61
|
-
@Column({ nullable: true })
|
|
62
|
-
|
|
41
|
+
@Column({ nullable: true, default: true })
|
|
42
|
+
is_active: boolean;
|
|
63
43
|
|
|
64
44
|
@Column({ nullable: true })
|
|
65
|
-
|
|
45
|
+
EncryptPassword: string;
|
|
66
46
|
|
|
67
47
|
@Column({ nullable: true })
|
|
68
|
-
|
|
48
|
+
roleId: number;
|
|
69
49
|
|
|
70
|
-
@Column({ nullable: true
|
|
71
|
-
|
|
50
|
+
// @Column({ nullable: true })
|
|
51
|
+
// contract_start_date: string;
|
|
72
52
|
|
|
73
|
-
@Column({ nullable: true })
|
|
74
|
-
|
|
53
|
+
// @Column({ nullable: true })
|
|
54
|
+
// contract_end_date: string;
|
|
75
55
|
|
|
76
56
|
@Column({ nullable: true })
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
@Column({ nullable: true })
|
|
80
|
-
address?: string;
|
|
81
|
-
|
|
82
|
-
@Column({ nullable: true })
|
|
83
|
-
residential_status?: string;
|
|
84
|
-
|
|
85
|
-
@Column({ nullable: true })
|
|
86
|
-
religion?: string;
|
|
87
|
-
|
|
88
|
-
@Column({ nullable: true })
|
|
89
|
-
avatar?: string;
|
|
57
|
+
company: string;
|
|
90
58
|
|
|
91
59
|
constructor(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
location?: string,
|
|
111
|
-
country?: string,
|
|
112
|
-
is_admin?: boolean,
|
|
113
|
-
division?: number,
|
|
114
|
-
reporting_to?: number,
|
|
115
|
-
address?: string,
|
|
116
|
-
residential_status?: string,
|
|
117
|
-
religion?: string,
|
|
118
|
-
designation?: number,
|
|
119
|
-
avatar?: string,
|
|
60
|
+
first_name: string,
|
|
61
|
+
last_name: string,
|
|
62
|
+
full_name: string,
|
|
63
|
+
password: string,
|
|
64
|
+
mobile: string,
|
|
65
|
+
email: string,
|
|
66
|
+
address: string,
|
|
67
|
+
city: string,
|
|
68
|
+
state: string,
|
|
69
|
+
country: string,
|
|
70
|
+
pincode: string,
|
|
71
|
+
is_active: boolean,
|
|
72
|
+
EncryptPassword: string,
|
|
73
|
+
roleId: number,
|
|
74
|
+
// contract_start_date: string,
|
|
75
|
+
// contract_end_date: string,
|
|
76
|
+
company: string
|
|
77
|
+
|
|
120
78
|
) {
|
|
121
79
|
super();
|
|
122
|
-
this.
|
|
123
|
-
this.
|
|
124
|
-
this.
|
|
125
|
-
this.
|
|
126
|
-
this.
|
|
127
|
-
this.
|
|
128
|
-
this.
|
|
129
|
-
this.
|
|
130
|
-
this.
|
|
131
|
-
this.
|
|
132
|
-
this.
|
|
133
|
-
this.
|
|
134
|
-
this.
|
|
135
|
-
this.
|
|
136
|
-
this.
|
|
137
|
-
this.
|
|
138
|
-
this.
|
|
139
|
-
this.grade = grade;
|
|
140
|
-
this.location = location;
|
|
141
|
-
this.country = country;
|
|
142
|
-
this.is_admin = is_admin;
|
|
143
|
-
this.division = division;
|
|
144
|
-
this.reporting_to = reporting_to;
|
|
145
|
-
this.address = address;
|
|
146
|
-
this.residential_status = residential_status;
|
|
147
|
-
this.religion = religion;
|
|
148
|
-
this.designation = designation;
|
|
149
|
-
this.avatar = avatar;
|
|
80
|
+
this.first_name = first_name,
|
|
81
|
+
this.last_name = last_name,
|
|
82
|
+
this.full_name = full_name ,
|
|
83
|
+
this.password = password,
|
|
84
|
+
this.EncryptPassword = EncryptPassword,
|
|
85
|
+
this.mobile = mobile,
|
|
86
|
+
this.email = email,
|
|
87
|
+
this.is_active = is_active,
|
|
88
|
+
this.address = address,
|
|
89
|
+
this.city = city,
|
|
90
|
+
this.state = state,
|
|
91
|
+
this.country = country,
|
|
92
|
+
this.pincode = pincode,
|
|
93
|
+
this.roleId = roleId,
|
|
94
|
+
// this.contract_start_date = contract_start_date,
|
|
95
|
+
// this.contract_end_date = contract_end_date,
|
|
96
|
+
this.company = company
|
|
150
97
|
}
|
|
151
|
-
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BaseModel } from './BaseModel';
|
|
2
|
-
import { ConversationParticipant } from './ConversationParticipantModel';
|
|
3
|
-
import { Message } from './MessageModel';
|
|
4
|
-
export declare enum ConversationType {
|
|
5
|
-
DIRECT = "Direct",
|
|
6
|
-
GROUP = "Group"
|
|
7
|
-
}
|
|
8
|
-
export declare class Conversation extends BaseModel {
|
|
9
|
-
conversationType: ConversationType;
|
|
10
|
-
conversationName?: string;
|
|
11
|
-
createdAt: Date;
|
|
12
|
-
updatedAt?: Date;
|
|
13
|
-
participants?: ConversationParticipant[];
|
|
14
|
-
messages?: Message[];
|
|
15
|
-
constructor(conversationType?: ConversationType, conversationName?: string, createdAt?: Date, updatedAt?: Date);
|
|
16
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Conversation = exports.ConversationType = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const BaseModel_1 = require("./BaseModel");
|
|
15
|
-
const ConversationParticipantModel_1 = require("./ConversationParticipantModel");
|
|
16
|
-
const MessageModel_1 = require("./MessageModel");
|
|
17
|
-
var ConversationType;
|
|
18
|
-
(function (ConversationType) {
|
|
19
|
-
ConversationType["DIRECT"] = "Direct";
|
|
20
|
-
ConversationType["GROUP"] = "Group";
|
|
21
|
-
})(ConversationType || (exports.ConversationType = ConversationType = {}));
|
|
22
|
-
let Conversation = class Conversation extends BaseModel_1.BaseModel {
|
|
23
|
-
constructor(conversationType, conversationName, createdAt, updatedAt) {
|
|
24
|
-
super();
|
|
25
|
-
this.conversationType = conversationType || ConversationType.DIRECT;
|
|
26
|
-
this.conversationName = conversationName;
|
|
27
|
-
this.createdAt = createdAt || new Date();
|
|
28
|
-
this.updatedAt = updatedAt;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
exports.Conversation = Conversation;
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, typeorm_1.Column)({
|
|
34
|
-
type: 'enum',
|
|
35
|
-
enum: ConversationType,
|
|
36
|
-
default: ConversationType.DIRECT
|
|
37
|
-
}),
|
|
38
|
-
__metadata("design:type", String)
|
|
39
|
-
], Conversation.prototype, "conversationType", void 0);
|
|
40
|
-
__decorate([
|
|
41
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
42
|
-
__metadata("design:type", String)
|
|
43
|
-
], Conversation.prototype, "conversationName", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
46
|
-
__metadata("design:type", Date)
|
|
47
|
-
], Conversation.prototype, "createdAt", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
|
|
50
|
-
__metadata("design:type", Date)
|
|
51
|
-
], Conversation.prototype, "updatedAt", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, typeorm_1.OneToMany)(() => ConversationParticipantModel_1.ConversationParticipant, participant => participant.conversation),
|
|
54
|
-
__metadata("design:type", Array)
|
|
55
|
-
], Conversation.prototype, "participants", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, typeorm_1.OneToMany)(() => MessageModel_1.Message, message => message.conversation),
|
|
58
|
-
__metadata("design:type", Array)
|
|
59
|
-
], Conversation.prototype, "messages", void 0);
|
|
60
|
-
exports.Conversation = Conversation = __decorate([
|
|
61
|
-
(0, typeorm_1.Entity)({ name: 'conversations' }),
|
|
62
|
-
__metadata("design:paramtypes", [String, String, Date,
|
|
63
|
-
Date])
|
|
64
|
-
], Conversation);
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { BaseModel } from './BaseModel';
|
|
2
|
-
import { Conversation } from './ConversationModel';
|
|
3
|
-
import { User } from './user';
|
|
4
|
-
export declare class ConversationParticipant extends BaseModel {
|
|
5
|
-
conversationId: number;
|
|
6
|
-
userId: number;
|
|
7
|
-
roleId: number;
|
|
8
|
-
joinedAt: Date;
|
|
9
|
-
createdAt: Date;
|
|
10
|
-
updatedAt?: Date;
|
|
11
|
-
conversation?: Conversation;
|
|
12
|
-
user?: User;
|
|
13
|
-
constructor(conversationId?: number, userId?: number, roleId?: number, joinedAt?: Date, createdAt?: Date, updatedAt?: Date);
|
|
14
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ConversationParticipant = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const BaseModel_1 = require("./BaseModel");
|
|
15
|
-
const ConversationModel_1 = require("./ConversationModel");
|
|
16
|
-
const user_1 = require("./user");
|
|
17
|
-
let ConversationParticipant = class ConversationParticipant extends BaseModel_1.BaseModel {
|
|
18
|
-
constructor(conversationId, userId, roleId, joinedAt, createdAt, updatedAt) {
|
|
19
|
-
super();
|
|
20
|
-
this.conversationId = conversationId || 0;
|
|
21
|
-
this.userId = userId || 0;
|
|
22
|
-
this.roleId = roleId || 0;
|
|
23
|
-
this.joinedAt = joinedAt || new Date();
|
|
24
|
-
this.createdAt = createdAt || new Date();
|
|
25
|
-
this.updatedAt = updatedAt;
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
exports.ConversationParticipant = ConversationParticipant;
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, typeorm_1.Column)({ type: 'bigint' }),
|
|
31
|
-
__metadata("design:type", Number)
|
|
32
|
-
], ConversationParticipant.prototype, "conversationId", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, typeorm_1.Column)({ type: 'int' }),
|
|
35
|
-
__metadata("design:type", Number)
|
|
36
|
-
], ConversationParticipant.prototype, "userId", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, typeorm_1.Column)({ type: 'int' }),
|
|
39
|
-
__metadata("design:type", Number)
|
|
40
|
-
], ConversationParticipant.prototype, "roleId", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
43
|
-
__metadata("design:type", Date)
|
|
44
|
-
], ConversationParticipant.prototype, "joinedAt", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
47
|
-
__metadata("design:type", Date)
|
|
48
|
-
], ConversationParticipant.prototype, "createdAt", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
|
|
51
|
-
__metadata("design:type", Date)
|
|
52
|
-
], ConversationParticipant.prototype, "updatedAt", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, typeorm_1.ManyToOne)(() => ConversationModel_1.Conversation, conversation => conversation.participants),
|
|
55
|
-
(0, typeorm_1.JoinColumn)({ name: 'conversationId' }),
|
|
56
|
-
__metadata("design:type", ConversationModel_1.Conversation)
|
|
57
|
-
], ConversationParticipant.prototype, "conversation", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
(0, typeorm_1.ManyToOne)(() => user_1.User),
|
|
60
|
-
(0, typeorm_1.JoinColumn)({ name: 'userId' }),
|
|
61
|
-
__metadata("design:type", user_1.User)
|
|
62
|
-
], ConversationParticipant.prototype, "user", void 0);
|
|
63
|
-
exports.ConversationParticipant = ConversationParticipant = __decorate([
|
|
64
|
-
(0, typeorm_1.Entity)({ name: 'conversation_participants' }),
|
|
65
|
-
__metadata("design:paramtypes", [Number, Number, Number, Date,
|
|
66
|
-
Date,
|
|
67
|
-
Date])
|
|
68
|
-
], ConversationParticipant);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { BaseModel } from './BaseModel';
|
|
2
|
-
export declare class Departments extends BaseModel {
|
|
3
|
-
department_name: string;
|
|
4
|
-
department_code: string;
|
|
5
|
-
department_description: string;
|
|
6
|
-
constructor(department_name: string, department_code: string, department_description: string);
|
|
7
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Designation = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const BaseModel_1 = require("./BaseModel");
|
|
15
|
-
let Designation = class Designation extends BaseModel_1.BaseModel {
|
|
16
|
-
constructor(name, is_deleted) {
|
|
17
|
-
super();
|
|
18
|
-
this.name = name;
|
|
19
|
-
this.is_deleted = is_deleted;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
exports.Designation = Designation;
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], Designation.prototype, "name", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
29
|
-
__metadata("design:type", Boolean)
|
|
30
|
-
], Designation.prototype, "is_deleted", void 0);
|
|
31
|
-
exports.Designation = Designation = __decorate([
|
|
32
|
-
(0, typeorm_1.Entity)({ name: 'designation' }),
|
|
33
|
-
__metadata("design:paramtypes", [String, Boolean])
|
|
34
|
-
], Designation);
|