@platform-modules/foreign-ministry 1.0.64 → 1.0.65
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/data-source.js +6 -8
- package/dist/index.d.ts +3 -4
- package/dist/index.js +3 -4
- package/dist/models/AttendanceModel.d.ts +19 -0
- package/dist/models/AttendanceModel.js +77 -0
- package/dist/models/LeaveApprovalDetailsModel.d.ts +13 -0
- package/dist/models/LeaveApprovalDetailsModel.js +51 -0
- package/dist/models/LeaveApprovalMatrixModel.d.ts +7 -0
- package/dist/models/LeaveApprovalMatrixModel.js +40 -0
- package/dist/models/ShifttimesModel.d.ts +11 -0
- package/dist/models/ShifttimesModel.js +59 -0
- package/dist/models/UserShiftModel.d.ts +6 -0
- package/dist/models/{questionTagsModel.js → UserShiftModel.js} +13 -13
- package/package.json +1 -1
- package/src/data-source.ts +6 -8
- package/src/index.ts +3 -4
- package/src/models/AttendanceModel.ts +64 -0
- package/src/models/ShifttimesModel.ts +46 -0
- package/src/models/UserShiftModel.ts +18 -0
- package/dist/models/ConversationParticipantsV2Model.d.ts +0 -15
- package/dist/models/ConversationParticipantsV2Model.js +0 -69
- package/dist/models/ConversationsV2Model.d.ts +0 -15
- package/dist/models/ConversationsV2Model.js +0 -57
- package/dist/models/MessageReadStatusModel.d.ts +0 -11
- package/dist/models/MessageReadStatusModel.js +0 -51
- package/dist/models/MessagesV2Model.d.ts +0 -24
- package/dist/models/MessagesV2Model.js +0 -89
- package/dist/models/questionTagsModel.d.ts +0 -6
- package/src/models/ConversationParticipantsV2Model.ts +0 -48
- package/src/models/ConversationsV2Model.ts +0 -41
- package/src/models/MessageReadStatusModel.ts +0 -34
- package/src/models/MessagesV2Model.ts +0 -66
package/dist/data-source.js
CHANGED
|
@@ -42,10 +42,9 @@ const HelpContentModel_1 = require("./models/HelpContentModel");
|
|
|
42
42
|
const HelpContentCategoryModel_1 = require("./models/HelpContentCategoryModel");
|
|
43
43
|
const HelpContentAttachmentModel_1 = require("./models/HelpContentAttachmentModel");
|
|
44
44
|
const contactInfoModel_1 = require("./models/contactInfoModel");
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const MessageReadStatusModel_1 = require("./models/MessageReadStatusModel");
|
|
45
|
+
const ShifttimesModel_1 = require("./models/ShifttimesModel");
|
|
46
|
+
const AttendanceModel_1 = require("./models/AttendanceModel");
|
|
47
|
+
const UserShiftModel_1 = require("./models/UserShiftModel");
|
|
49
48
|
exports.AppDataSource = new typeorm_1.DataSource({
|
|
50
49
|
type: 'postgres',
|
|
51
50
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -93,9 +92,8 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
93
92
|
HelpContentCategoryModel_1.HelpContentCategories,
|
|
94
93
|
HelpContentAttachmentModel_1.HelpContentAttachments,
|
|
95
94
|
contactInfoModel_1.ContactInfo,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
MessageReadStatusModel_1.MessageReadStatus
|
|
95
|
+
ShifttimesModel_1.ShiftDetails,
|
|
96
|
+
AttendanceModel_1.AttendanceDetails,
|
|
97
|
+
UserShiftModel_1.UserShift
|
|
100
98
|
],
|
|
101
99
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -22,10 +22,6 @@ export * from './models/FaqsReactionsModel';
|
|
|
22
22
|
export * from './models/ConversationModel';
|
|
23
23
|
export * from './models/ConversationParticipantModel';
|
|
24
24
|
export * from './models/MessageModel';
|
|
25
|
-
export * from './models/ConversationsV2Model';
|
|
26
|
-
export * from './models/ConversationParticipantsV2Model';
|
|
27
|
-
export * from './models/MessagesV2Model';
|
|
28
|
-
export * from './models/MessageReadStatusModel';
|
|
29
25
|
export * from './models/FMServices';
|
|
30
26
|
export * from './models/FMSubservices';
|
|
31
27
|
export * from './models/serviceBookmarksModel';
|
|
@@ -38,4 +34,7 @@ export * from './models/PostReactionsModel';
|
|
|
38
34
|
export * from './models/HelpContentModel';
|
|
39
35
|
export * from './models/HelpContentCategoryModel';
|
|
40
36
|
export * from './models/HelpContentAttachmentModel';
|
|
37
|
+
export * from './models/ShifttimesModel';
|
|
38
|
+
export * from './models/AttendanceModel';
|
|
41
39
|
export * from './models/contactInfoModel';
|
|
40
|
+
export * from './models/UserShiftModel';
|
package/dist/index.js
CHANGED
|
@@ -38,10 +38,6 @@ __exportStar(require("./models/FaqsReactionsModel"), exports);
|
|
|
38
38
|
__exportStar(require("./models/ConversationModel"), exports);
|
|
39
39
|
__exportStar(require("./models/ConversationParticipantModel"), exports);
|
|
40
40
|
__exportStar(require("./models/MessageModel"), exports);
|
|
41
|
-
__exportStar(require("./models/ConversationsV2Model"), exports);
|
|
42
|
-
__exportStar(require("./models/ConversationParticipantsV2Model"), exports);
|
|
43
|
-
__exportStar(require("./models/MessagesV2Model"), exports);
|
|
44
|
-
__exportStar(require("./models/MessageReadStatusModel"), exports);
|
|
45
41
|
__exportStar(require("./models/FMServices"), exports);
|
|
46
42
|
__exportStar(require("./models/FMSubservices"), exports);
|
|
47
43
|
__exportStar(require("./models/serviceBookmarksModel"), exports);
|
|
@@ -54,4 +50,7 @@ __exportStar(require("./models/PostReactionsModel"), exports);
|
|
|
54
50
|
__exportStar(require("./models/HelpContentModel"), exports);
|
|
55
51
|
__exportStar(require("./models/HelpContentCategoryModel"), exports);
|
|
56
52
|
__exportStar(require("./models/HelpContentAttachmentModel"), exports);
|
|
53
|
+
__exportStar(require("./models/ShifttimesModel"), exports);
|
|
54
|
+
__exportStar(require("./models/AttendanceModel"), exports);
|
|
57
55
|
__exportStar(require("./models/contactInfoModel"), exports);
|
|
56
|
+
__exportStar(require("./models/UserShiftModel"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare enum AttendanceStatus {
|
|
3
|
+
PRESENT = "PRESENT",
|
|
4
|
+
ABSENT = "ABSENT",
|
|
5
|
+
LEAVE = "LEAVE",
|
|
6
|
+
HALF_DAY = "HALF_DAY"
|
|
7
|
+
}
|
|
8
|
+
export declare class AttendanceDetails extends BaseModel {
|
|
9
|
+
user_id: string;
|
|
10
|
+
shift_id: number;
|
|
11
|
+
attendance_date: string;
|
|
12
|
+
check_in_time: string;
|
|
13
|
+
check_out_time: string;
|
|
14
|
+
first_half_status: AttendanceStatus;
|
|
15
|
+
second_half_status: AttendanceStatus;
|
|
16
|
+
attendance_status: AttendanceStatus;
|
|
17
|
+
excess_hours: string;
|
|
18
|
+
constructor(user_id: string, shift_id: number, attendance_date: string, check_in_time: string, check_out_time: string, first_half_status: AttendanceStatus, second_half_status: AttendanceStatus, attendance_status: AttendanceStatus, excess_hours: string);
|
|
19
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
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.AttendanceDetails = exports.AttendanceStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
//CHECK (first_half_status IN ('Present', 'Absent', 'Leave')
|
|
16
|
+
var AttendanceStatus;
|
|
17
|
+
(function (AttendanceStatus) {
|
|
18
|
+
AttendanceStatus["PRESENT"] = "PRESENT";
|
|
19
|
+
AttendanceStatus["ABSENT"] = "ABSENT";
|
|
20
|
+
AttendanceStatus["LEAVE"] = "LEAVE";
|
|
21
|
+
AttendanceStatus["HALF_DAY"] = "HALF_DAY";
|
|
22
|
+
})(AttendanceStatus || (exports.AttendanceStatus = AttendanceStatus = {}));
|
|
23
|
+
let AttendanceDetails = class AttendanceDetails extends BaseModel_1.BaseModel {
|
|
24
|
+
constructor(user_id, shift_id, attendance_date, check_in_time, check_out_time, first_half_status, second_half_status, attendance_status, excess_hours) {
|
|
25
|
+
super();
|
|
26
|
+
this.user_id = user_id;
|
|
27
|
+
this.shift_id = shift_id;
|
|
28
|
+
this.attendance_date = attendance_date;
|
|
29
|
+
this.check_in_time = check_in_time;
|
|
30
|
+
this.check_out_time = check_out_time;
|
|
31
|
+
this.first_half_status = first_half_status;
|
|
32
|
+
this.second_half_status = second_half_status;
|
|
33
|
+
this.attendance_status = attendance_status;
|
|
34
|
+
this.excess_hours = excess_hours;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
exports.AttendanceDetails = AttendanceDetails;
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], AttendanceDetails.prototype, "user_id", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], AttendanceDetails.prototype, "shift_id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: 'date', nullable: true, unique: true }),
|
|
48
|
+
__metadata("design:type", String)
|
|
49
|
+
], AttendanceDetails.prototype, "attendance_date", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ type: 'time', nullable: true }),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], AttendanceDetails.prototype, "check_in_time", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: 'time', nullable: true }),
|
|
56
|
+
__metadata("design:type", String)
|
|
57
|
+
], AttendanceDetails.prototype, "check_out_time", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'varchar', default: AttendanceStatus.PRESENT, nullable: true }),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], AttendanceDetails.prototype, "first_half_status", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ type: 'varchar', default: AttendanceStatus.PRESENT, nullable: true }),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], AttendanceDetails.prototype, "second_half_status", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ type: 'varchar', default: AttendanceStatus.PRESENT, nullable: true }),
|
|
68
|
+
__metadata("design:type", String)
|
|
69
|
+
], AttendanceDetails.prototype, "attendance_status", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.Column)({ type: 'time', nullable: true }),
|
|
72
|
+
__metadata("design:type", String)
|
|
73
|
+
], AttendanceDetails.prototype, "excess_hours", void 0);
|
|
74
|
+
exports.AttendanceDetails = AttendanceDetails = __decorate([
|
|
75
|
+
(0, typeorm_1.Entity)({ name: 'attendance_details' }),
|
|
76
|
+
__metadata("design:paramtypes", [String, Number, String, String, String, String, String, String, String])
|
|
77
|
+
], AttendanceDetails);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare enum ApprovalStatus {
|
|
3
|
+
PENDING = "Pending",
|
|
4
|
+
APPROVED = "Approved",
|
|
5
|
+
REJECTED = "Rejected"
|
|
6
|
+
}
|
|
7
|
+
export declare class LeaveApprovalDetails extends BaseModel {
|
|
8
|
+
leave_request_id: number;
|
|
9
|
+
level: number;
|
|
10
|
+
approver_id: number;
|
|
11
|
+
approval_status: ApprovalStatus;
|
|
12
|
+
constructor(leave_request_id: number, approver_id: number, approval_status: ApprovalStatus, level: number);
|
|
13
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
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.LeaveApprovalDetails = exports.ApprovalStatus = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
var ApprovalStatus;
|
|
16
|
+
(function (ApprovalStatus) {
|
|
17
|
+
ApprovalStatus["PENDING"] = "Pending";
|
|
18
|
+
ApprovalStatus["APPROVED"] = "Approved";
|
|
19
|
+
ApprovalStatus["REJECTED"] = "Rejected";
|
|
20
|
+
})(ApprovalStatus || (exports.ApprovalStatus = ApprovalStatus = {}));
|
|
21
|
+
//This model is used to store the store the leave apporval details of the user for the leave request
|
|
22
|
+
let LeaveApprovalDetails = class LeaveApprovalDetails extends BaseModel_1.BaseModel {
|
|
23
|
+
constructor(leave_request_id, approver_id, approval_status, level) {
|
|
24
|
+
super();
|
|
25
|
+
this.leave_request_id = leave_request_id;
|
|
26
|
+
this.approver_id = approver_id;
|
|
27
|
+
this.approval_status = approval_status;
|
|
28
|
+
this.level = level;
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
exports.LeaveApprovalDetails = LeaveApprovalDetails;
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
34
|
+
__metadata("design:type", Number)
|
|
35
|
+
], LeaveApprovalDetails.prototype, "leave_request_id", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
38
|
+
__metadata("design:type", Number)
|
|
39
|
+
], LeaveApprovalDetails.prototype, "level", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
42
|
+
__metadata("design:type", Number)
|
|
43
|
+
], LeaveApprovalDetails.prototype, "approver_id", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'enum', enum: ApprovalStatus, default: ApprovalStatus.PENDING, nullable: false }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], LeaveApprovalDetails.prototype, "approval_status", void 0);
|
|
48
|
+
exports.LeaveApprovalDetails = LeaveApprovalDetails = __decorate([
|
|
49
|
+
(0, typeorm_1.Entity)({ name: 'leave_approval_details' }),
|
|
50
|
+
__metadata("design:paramtypes", [Number, Number, String, Number])
|
|
51
|
+
], LeaveApprovalDetails);
|
|
@@ -0,0 +1,40 @@
|
|
|
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.LeaveApprovalMatrix = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
//This model is used to store the store the leave apporval matrix(HOD, Manager, HR, Director) based on leave type along with the levels
|
|
16
|
+
let LeaveApprovalMatrix = class LeaveApprovalMatrix extends BaseModel_1.BaseModel {
|
|
17
|
+
constructor(leave_type, level, approval_matrix) {
|
|
18
|
+
super();
|
|
19
|
+
this.leave_type = leave_type;
|
|
20
|
+
this.level = level;
|
|
21
|
+
this.approval_matrix = approval_matrix;
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.LeaveApprovalMatrix = LeaveApprovalMatrix;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], LeaveApprovalMatrix.prototype, "leave_type", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], LeaveApprovalMatrix.prototype, "level", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], LeaveApprovalMatrix.prototype, "approval_matrix", void 0);
|
|
37
|
+
exports.LeaveApprovalMatrix = LeaveApprovalMatrix = __decorate([
|
|
38
|
+
(0, typeorm_1.Entity)({ name: 'leave_approval_matrix' }),
|
|
39
|
+
__metadata("design:paramtypes", [Number, Number, String])
|
|
40
|
+
], LeaveApprovalMatrix);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
export declare class ShiftDetails extends BaseModel {
|
|
3
|
+
shift_name: string;
|
|
4
|
+
start_time: string;
|
|
5
|
+
end_time: string;
|
|
6
|
+
first_session_start_time: string;
|
|
7
|
+
first_session_end_time: string;
|
|
8
|
+
second_session_start_time: string;
|
|
9
|
+
second_session_end_time: string;
|
|
10
|
+
constructor(shift_name: string, start_time: string, end_time: string, first_session_start_time: string, first_session_end_time: string, second_session_start_time: string, second_session_end_time: string);
|
|
11
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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.ShiftDetails = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let ShiftDetails = class ShiftDetails extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(shift_name, start_time, end_time, first_session_start_time, first_session_end_time, second_session_start_time, second_session_end_time) {
|
|
17
|
+
super();
|
|
18
|
+
this.shift_name = shift_name;
|
|
19
|
+
this.start_time = start_time;
|
|
20
|
+
this.end_time = end_time;
|
|
21
|
+
this.first_session_start_time = first_session_start_time;
|
|
22
|
+
this.first_session_end_time = first_session_end_time;
|
|
23
|
+
this.second_session_start_time = second_session_start_time;
|
|
24
|
+
this.second_session_end_time = second_session_end_time;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.ShiftDetails = ShiftDetails;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], ShiftDetails.prototype, "shift_name", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'time', nullable: true }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], ShiftDetails.prototype, "start_time", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'time', nullable: true }),
|
|
38
|
+
__metadata("design:type", String)
|
|
39
|
+
], ShiftDetails.prototype, "end_time", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
(0, typeorm_1.Column)({ type: 'time', nullable: true }),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], ShiftDetails.prototype, "first_session_start_time", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'time', nullable: true }),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], ShiftDetails.prototype, "first_session_end_time", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'time', nullable: true }),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], ShiftDetails.prototype, "second_session_start_time", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'time', nullable: true }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], ShiftDetails.prototype, "second_session_end_time", void 0);
|
|
56
|
+
exports.ShiftDetails = ShiftDetails = __decorate([
|
|
57
|
+
(0, typeorm_1.Entity)({ name: 'shift_details' }),
|
|
58
|
+
__metadata("design:paramtypes", [String, String, String, String, String, String, String])
|
|
59
|
+
], ShiftDetails);
|
|
@@ -9,26 +9,26 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.UserShift = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const BaseModel_1 = require("./BaseModel");
|
|
15
|
-
let
|
|
16
|
-
constructor(
|
|
15
|
+
let UserShift = class UserShift extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor(user_id, shift_id) {
|
|
17
17
|
super();
|
|
18
|
-
this.
|
|
19
|
-
|
|
18
|
+
this.user_id = user_id;
|
|
19
|
+
this.shift_id = shift_id;
|
|
20
20
|
}
|
|
21
21
|
};
|
|
22
|
-
exports.
|
|
22
|
+
exports.UserShift = UserShift;
|
|
23
23
|
__decorate([
|
|
24
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
24
|
+
(0, typeorm_1.Column)({ type: 'varchar', nullable: true }),
|
|
25
25
|
__metadata("design:type", String)
|
|
26
|
-
],
|
|
26
|
+
], UserShift.prototype, "user_id", void 0);
|
|
27
27
|
__decorate([
|
|
28
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
28
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
29
29
|
__metadata("design:type", Number)
|
|
30
|
-
],
|
|
31
|
-
exports.
|
|
32
|
-
(0, typeorm_1.Entity)({ name: '
|
|
30
|
+
], UserShift.prototype, "shift_id", void 0);
|
|
31
|
+
exports.UserShift = UserShift = __decorate([
|
|
32
|
+
(0, typeorm_1.Entity)({ name: 'user_shift' }),
|
|
33
33
|
__metadata("design:paramtypes", [String, Number])
|
|
34
|
-
],
|
|
34
|
+
], UserShift);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -43,10 +43,9 @@ import { HelpContent } from './models/HelpContentModel';
|
|
|
43
43
|
import { HelpContentCategories } from './models/HelpContentCategoryModel';
|
|
44
44
|
import { HelpContentAttachments } from './models/HelpContentAttachmentModel';
|
|
45
45
|
import { ContactInfo } from './models/contactInfoModel';
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import { MessageReadStatus } from './models/MessageReadStatusModel';
|
|
46
|
+
import { ShiftDetails } from './models/ShifttimesModel';
|
|
47
|
+
import { AttendanceDetails } from './models/AttendanceModel';
|
|
48
|
+
import { UserShift } from './models/UserShiftModel';
|
|
50
49
|
|
|
51
50
|
|
|
52
51
|
export const AppDataSource = new DataSource({
|
|
@@ -96,9 +95,8 @@ export const AppDataSource = new DataSource({
|
|
|
96
95
|
HelpContentCategories,
|
|
97
96
|
HelpContentAttachments,
|
|
98
97
|
ContactInfo,
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
MessageReadStatus
|
|
98
|
+
ShiftDetails,
|
|
99
|
+
AttendanceDetails,
|
|
100
|
+
UserShift
|
|
103
101
|
],
|
|
104
102
|
});
|
package/src/index.ts
CHANGED
|
@@ -22,10 +22,6 @@ export * from './models/FaqsReactionsModel';
|
|
|
22
22
|
export * from './models/ConversationModel';
|
|
23
23
|
export * from './models/ConversationParticipantModel';
|
|
24
24
|
export * from './models/MessageModel';
|
|
25
|
-
export * from './models/ConversationsV2Model';
|
|
26
|
-
export * from './models/ConversationParticipantsV2Model';
|
|
27
|
-
export * from './models/MessagesV2Model';
|
|
28
|
-
export * from './models/MessageReadStatusModel';
|
|
29
25
|
export * from './models/FMServices';
|
|
30
26
|
export * from './models/FMSubservices';
|
|
31
27
|
export * from './models/serviceBookmarksModel';
|
|
@@ -38,4 +34,7 @@ export * from './models/PostReactionsModel';
|
|
|
38
34
|
export * from './models/HelpContentModel';
|
|
39
35
|
export * from './models/HelpContentCategoryModel';
|
|
40
36
|
export * from './models/HelpContentAttachmentModel';
|
|
37
|
+
export * from './models/ShifttimesModel';
|
|
38
|
+
export * from './models/AttendanceModel';
|
|
41
39
|
export * from './models/contactInfoModel';
|
|
40
|
+
export * from './models/UserShiftModel';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
//CHECK (first_half_status IN ('Present', 'Absent', 'Leave')
|
|
5
|
+
export enum AttendanceStatus {
|
|
6
|
+
PRESENT = 'PRESENT',
|
|
7
|
+
ABSENT = 'ABSENT',
|
|
8
|
+
LEAVE = 'LEAVE',
|
|
9
|
+
HALF_DAY = 'HALF_DAY',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
@Entity({ name: 'attendance_details' })
|
|
13
|
+
export class AttendanceDetails extends BaseModel {
|
|
14
|
+
|
|
15
|
+
//user_id, shift_name, check_in_time, check_out_time
|
|
16
|
+
@Column({ type: 'varchar', nullable: true })
|
|
17
|
+
user_id: string;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'int', nullable: true })
|
|
20
|
+
shift_id: number;
|
|
21
|
+
|
|
22
|
+
@Column({ type: 'date', nullable: true , unique: true})
|
|
23
|
+
attendance_date: string;
|
|
24
|
+
|
|
25
|
+
@Column({ type: 'time', nullable: true })
|
|
26
|
+
check_in_time: string;
|
|
27
|
+
|
|
28
|
+
@Column({ type: 'time', nullable: true })
|
|
29
|
+
check_out_time: string;
|
|
30
|
+
|
|
31
|
+
@Column({ type: 'varchar', default: AttendanceStatus.PRESENT, nullable: true })
|
|
32
|
+
first_half_status: AttendanceStatus;
|
|
33
|
+
|
|
34
|
+
@Column({ type: 'varchar', default: AttendanceStatus.PRESENT, nullable: true })
|
|
35
|
+
second_half_status: AttendanceStatus;
|
|
36
|
+
|
|
37
|
+
@Column({ type: 'varchar', default: AttendanceStatus.PRESENT, nullable: true })
|
|
38
|
+
attendance_status: AttendanceStatus;
|
|
39
|
+
|
|
40
|
+
@Column({ type: 'time', nullable: true })
|
|
41
|
+
excess_hours : string
|
|
42
|
+
|
|
43
|
+
constructor(
|
|
44
|
+
user_id: string,
|
|
45
|
+
shift_id: number,
|
|
46
|
+
attendance_date: string,
|
|
47
|
+
check_in_time: string,
|
|
48
|
+
check_out_time: string,
|
|
49
|
+
first_half_status: AttendanceStatus,
|
|
50
|
+
second_half_status: AttendanceStatus,
|
|
51
|
+
attendance_status: AttendanceStatus,
|
|
52
|
+
excess_hours: string) {
|
|
53
|
+
super();
|
|
54
|
+
this.user_id = user_id;
|
|
55
|
+
this.shift_id = shift_id;
|
|
56
|
+
this.attendance_date = attendance_date;
|
|
57
|
+
this.check_in_time = check_in_time;
|
|
58
|
+
this.check_out_time = check_out_time;
|
|
59
|
+
this.first_half_status = first_half_status;
|
|
60
|
+
this.second_half_status = second_half_status;
|
|
61
|
+
this.attendance_status = attendance_status;
|
|
62
|
+
this.excess_hours = excess_hours;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'shift_details' })
|
|
5
|
+
export class ShiftDetails extends BaseModel {
|
|
6
|
+
|
|
7
|
+
//shift_name, start_time, end_time
|
|
8
|
+
@Column({ type: 'varchar', nullable: true })
|
|
9
|
+
shift_name: string;
|
|
10
|
+
|
|
11
|
+
@Column({ type: 'time', nullable: true })
|
|
12
|
+
start_time: string;
|
|
13
|
+
|
|
14
|
+
@Column({ type: 'time', nullable: true })
|
|
15
|
+
end_time: string;
|
|
16
|
+
|
|
17
|
+
@Column({ type: 'time', nullable: true })
|
|
18
|
+
first_session_start_time: string;
|
|
19
|
+
|
|
20
|
+
@Column({ type: 'time', nullable: true })
|
|
21
|
+
first_session_end_time: string;
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'time', nullable: true })
|
|
24
|
+
second_session_start_time: string;
|
|
25
|
+
|
|
26
|
+
@Column({ type: 'time', nullable: true })
|
|
27
|
+
second_session_end_time: string;
|
|
28
|
+
|
|
29
|
+
constructor(
|
|
30
|
+
shift_name: string,
|
|
31
|
+
start_time: string,
|
|
32
|
+
end_time: string,
|
|
33
|
+
first_session_start_time: string,
|
|
34
|
+
first_session_end_time: string,
|
|
35
|
+
second_session_start_time: string,
|
|
36
|
+
second_session_end_time: string) {
|
|
37
|
+
super();
|
|
38
|
+
this.shift_name = shift_name;
|
|
39
|
+
this.start_time = start_time;
|
|
40
|
+
this.end_time = end_time;
|
|
41
|
+
this.first_session_start_time = first_session_start_time;
|
|
42
|
+
this.first_session_end_time = first_session_end_time;
|
|
43
|
+
this.second_session_start_time = second_session_start_time;
|
|
44
|
+
this.second_session_end_time = second_session_end_time;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'user_shift' })
|
|
5
|
+
export class UserShift extends BaseModel {
|
|
6
|
+
|
|
7
|
+
@Column({ type: 'varchar', nullable: true })
|
|
8
|
+
user_id: string;
|
|
9
|
+
|
|
10
|
+
@Column({ type: 'int', nullable: true })
|
|
11
|
+
shift_id: number;
|
|
12
|
+
|
|
13
|
+
constructor(user_id: string, shift_id: number) {
|
|
14
|
+
super();
|
|
15
|
+
this.user_id = user_id;
|
|
16
|
+
this.shift_id = shift_id;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BaseModel } from './BaseModel';
|
|
2
|
-
import { ConversationsV2 } from './ConversationsV2Model';
|
|
3
|
-
import { User } from './user';
|
|
4
|
-
export declare class ConversationParticipantsV2 extends BaseModel {
|
|
5
|
-
conversation_id: number;
|
|
6
|
-
user_id: number;
|
|
7
|
-
joined_at: Date;
|
|
8
|
-
left_at?: Date;
|
|
9
|
-
is_admin: boolean;
|
|
10
|
-
unread_count: number;
|
|
11
|
-
last_read_at?: Date;
|
|
12
|
-
conversation?: ConversationsV2;
|
|
13
|
-
user?: User;
|
|
14
|
-
constructor();
|
|
15
|
-
}
|
|
@@ -1,69 +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.ConversationParticipantsV2 = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const BaseModel_1 = require("./BaseModel");
|
|
15
|
-
const ConversationsV2Model_1 = require("./ConversationsV2Model");
|
|
16
|
-
const user_1 = require("./user");
|
|
17
|
-
let ConversationParticipantsV2 = class ConversationParticipantsV2 extends BaseModel_1.BaseModel {
|
|
18
|
-
constructor() {
|
|
19
|
-
super();
|
|
20
|
-
this.conversation_id = 0;
|
|
21
|
-
this.user_id = 0;
|
|
22
|
-
this.joined_at = new Date();
|
|
23
|
-
this.is_admin = false;
|
|
24
|
-
this.unread_count = 0;
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
exports.ConversationParticipantsV2 = ConversationParticipantsV2;
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
30
|
-
__metadata("design:type", Number)
|
|
31
|
-
], ConversationParticipantsV2.prototype, "conversation_id", void 0);
|
|
32
|
-
__decorate([
|
|
33
|
-
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
34
|
-
__metadata("design:type", Number)
|
|
35
|
-
], ConversationParticipantsV2.prototype, "user_id", void 0);
|
|
36
|
-
__decorate([
|
|
37
|
-
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
38
|
-
__metadata("design:type", Date)
|
|
39
|
-
], ConversationParticipantsV2.prototype, "joined_at", void 0);
|
|
40
|
-
__decorate([
|
|
41
|
-
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
|
|
42
|
-
__metadata("design:type", Date)
|
|
43
|
-
], ConversationParticipantsV2.prototype, "left_at", void 0);
|
|
44
|
-
__decorate([
|
|
45
|
-
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
46
|
-
__metadata("design:type", Boolean)
|
|
47
|
-
], ConversationParticipantsV2.prototype, "is_admin", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
50
|
-
__metadata("design:type", Number)
|
|
51
|
-
], ConversationParticipantsV2.prototype, "unread_count", void 0);
|
|
52
|
-
__decorate([
|
|
53
|
-
(0, typeorm_1.Column)({ type: 'timestamp', nullable: true }),
|
|
54
|
-
__metadata("design:type", Date)
|
|
55
|
-
], ConversationParticipantsV2.prototype, "last_read_at", void 0);
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, typeorm_1.ManyToOne)(() => ConversationsV2Model_1.ConversationsV2, conversation => conversation.participants),
|
|
58
|
-
(0, typeorm_1.JoinColumn)({ name: 'conversation_id' }),
|
|
59
|
-
__metadata("design:type", ConversationsV2Model_1.ConversationsV2)
|
|
60
|
-
], ConversationParticipantsV2.prototype, "conversation", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
(0, typeorm_1.ManyToOne)(() => user_1.User),
|
|
63
|
-
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
64
|
-
__metadata("design:type", user_1.User)
|
|
65
|
-
], ConversationParticipantsV2.prototype, "user", void 0);
|
|
66
|
-
exports.ConversationParticipantsV2 = ConversationParticipantsV2 = __decorate([
|
|
67
|
-
(0, typeorm_1.Entity)({ name: 'conversation_participants_v2' }),
|
|
68
|
-
__metadata("design:paramtypes", [])
|
|
69
|
-
], ConversationParticipantsV2);
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { BaseModel } from './BaseModel';
|
|
2
|
-
import { ConversationParticipantsV2 } from './ConversationParticipantsV2Model';
|
|
3
|
-
import { MessagesV2 } from './MessagesV2Model';
|
|
4
|
-
export declare enum ConversationTypeV2 {
|
|
5
|
-
DIRECT = "direct",
|
|
6
|
-
GROUP = "group"
|
|
7
|
-
}
|
|
8
|
-
export declare class ConversationsV2 extends BaseModel {
|
|
9
|
-
conversation_type: ConversationTypeV2;
|
|
10
|
-
conversation_name?: string;
|
|
11
|
-
last_message_at: Date;
|
|
12
|
-
participants?: ConversationParticipantsV2[];
|
|
13
|
-
messages?: MessagesV2[];
|
|
14
|
-
constructor();
|
|
15
|
-
}
|
|
@@ -1,57 +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.ConversationsV2 = exports.ConversationTypeV2 = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const BaseModel_1 = require("./BaseModel");
|
|
15
|
-
const ConversationParticipantsV2Model_1 = require("./ConversationParticipantsV2Model");
|
|
16
|
-
const MessagesV2Model_1 = require("./MessagesV2Model");
|
|
17
|
-
var ConversationTypeV2;
|
|
18
|
-
(function (ConversationTypeV2) {
|
|
19
|
-
ConversationTypeV2["DIRECT"] = "direct";
|
|
20
|
-
ConversationTypeV2["GROUP"] = "group";
|
|
21
|
-
})(ConversationTypeV2 || (exports.ConversationTypeV2 = ConversationTypeV2 = {}));
|
|
22
|
-
let ConversationsV2 = class ConversationsV2 extends BaseModel_1.BaseModel {
|
|
23
|
-
constructor() {
|
|
24
|
-
super();
|
|
25
|
-
this.conversation_type = ConversationTypeV2.DIRECT;
|
|
26
|
-
this.last_message_at = new Date();
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
exports.ConversationsV2 = ConversationsV2;
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, typeorm_1.Column)({
|
|
32
|
-
type: 'enum',
|
|
33
|
-
enum: ConversationTypeV2,
|
|
34
|
-
default: ConversationTypeV2.DIRECT
|
|
35
|
-
}),
|
|
36
|
-
__metadata("design:type", String)
|
|
37
|
-
], ConversationsV2.prototype, "conversation_type", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
40
|
-
__metadata("design:type", String)
|
|
41
|
-
], ConversationsV2.prototype, "conversation_name", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
44
|
-
__metadata("design:type", Date)
|
|
45
|
-
], ConversationsV2.prototype, "last_message_at", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, typeorm_1.OneToMany)(() => ConversationParticipantsV2Model_1.ConversationParticipantsV2, participant => participant.conversation),
|
|
48
|
-
__metadata("design:type", Array)
|
|
49
|
-
], ConversationsV2.prototype, "participants", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, typeorm_1.OneToMany)(() => MessagesV2Model_1.MessagesV2, message => message.conversation),
|
|
52
|
-
__metadata("design:type", Array)
|
|
53
|
-
], ConversationsV2.prototype, "messages", void 0);
|
|
54
|
-
exports.ConversationsV2 = ConversationsV2 = __decorate([
|
|
55
|
-
(0, typeorm_1.Entity)({ name: 'conversations_v2' }),
|
|
56
|
-
__metadata("design:paramtypes", [])
|
|
57
|
-
], ConversationsV2);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { BaseModel } from './BaseModel';
|
|
2
|
-
import { MessagesV2 } from './MessagesV2Model';
|
|
3
|
-
import { User } from './user';
|
|
4
|
-
export declare class MessageReadStatus extends BaseModel {
|
|
5
|
-
message_id: number;
|
|
6
|
-
user_id: number;
|
|
7
|
-
read_at: Date;
|
|
8
|
-
message?: MessagesV2;
|
|
9
|
-
user?: User;
|
|
10
|
-
constructor();
|
|
11
|
-
}
|
|
@@ -1,51 +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.MessageReadStatus = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const BaseModel_1 = require("./BaseModel");
|
|
15
|
-
const MessagesV2Model_1 = require("./MessagesV2Model");
|
|
16
|
-
const user_1 = require("./user");
|
|
17
|
-
let MessageReadStatus = class MessageReadStatus extends BaseModel_1.BaseModel {
|
|
18
|
-
constructor() {
|
|
19
|
-
super();
|
|
20
|
-
this.message_id = 0;
|
|
21
|
-
this.user_id = 0;
|
|
22
|
-
this.read_at = new Date();
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
exports.MessageReadStatus = MessageReadStatus;
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
28
|
-
__metadata("design:type", Number)
|
|
29
|
-
], MessageReadStatus.prototype, "message_id", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
32
|
-
__metadata("design:type", Number)
|
|
33
|
-
], MessageReadStatus.prototype, "user_id", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
36
|
-
__metadata("design:type", Date)
|
|
37
|
-
], MessageReadStatus.prototype, "read_at", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, typeorm_1.ManyToOne)(() => MessagesV2Model_1.MessagesV2, message => message.readStatuses),
|
|
40
|
-
(0, typeorm_1.JoinColumn)({ name: 'message_id' }),
|
|
41
|
-
__metadata("design:type", MessagesV2Model_1.MessagesV2)
|
|
42
|
-
], MessageReadStatus.prototype, "message", void 0);
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, typeorm_1.ManyToOne)(() => user_1.User),
|
|
45
|
-
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
46
|
-
__metadata("design:type", user_1.User)
|
|
47
|
-
], MessageReadStatus.prototype, "user", void 0);
|
|
48
|
-
exports.MessageReadStatus = MessageReadStatus = __decorate([
|
|
49
|
-
(0, typeorm_1.Entity)({ name: 'message_read_status' }),
|
|
50
|
-
__metadata("design:paramtypes", [])
|
|
51
|
-
], MessageReadStatus);
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { BaseModel } from './BaseModel';
|
|
2
|
-
import { ConversationsV2 } from './ConversationsV2Model';
|
|
3
|
-
import { User } from './user';
|
|
4
|
-
import { MessageReadStatus } from './MessageReadStatusModel';
|
|
5
|
-
export declare enum MessageTypeV2 {
|
|
6
|
-
TEXT = "text",
|
|
7
|
-
IMAGE = "image",
|
|
8
|
-
FILE = "file",
|
|
9
|
-
VIDEO = "video"
|
|
10
|
-
}
|
|
11
|
-
export declare class MessagesV2 extends BaseModel {
|
|
12
|
-
conversation_id: number;
|
|
13
|
-
sender_id: number;
|
|
14
|
-
message_type: MessageTypeV2;
|
|
15
|
-
content: string;
|
|
16
|
-
attachment_url?: string;
|
|
17
|
-
attachment_name?: string;
|
|
18
|
-
reply_to_message_id?: number;
|
|
19
|
-
conversation?: ConversationsV2;
|
|
20
|
-
sender?: User;
|
|
21
|
-
replyToMessage?: MessagesV2;
|
|
22
|
-
readStatuses?: MessageReadStatus[];
|
|
23
|
-
constructor();
|
|
24
|
-
}
|
|
@@ -1,89 +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.MessagesV2 = exports.MessageTypeV2 = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const BaseModel_1 = require("./BaseModel");
|
|
15
|
-
const ConversationsV2Model_1 = require("./ConversationsV2Model");
|
|
16
|
-
const user_1 = require("./user");
|
|
17
|
-
const MessageReadStatusModel_1 = require("./MessageReadStatusModel");
|
|
18
|
-
var MessageTypeV2;
|
|
19
|
-
(function (MessageTypeV2) {
|
|
20
|
-
MessageTypeV2["TEXT"] = "text";
|
|
21
|
-
MessageTypeV2["IMAGE"] = "image";
|
|
22
|
-
MessageTypeV2["FILE"] = "file";
|
|
23
|
-
MessageTypeV2["VIDEO"] = "video";
|
|
24
|
-
})(MessageTypeV2 || (exports.MessageTypeV2 = MessageTypeV2 = {}));
|
|
25
|
-
let MessagesV2 = class MessagesV2 extends BaseModel_1.BaseModel {
|
|
26
|
-
constructor() {
|
|
27
|
-
super();
|
|
28
|
-
this.conversation_id = 0;
|
|
29
|
-
this.sender_id = 0;
|
|
30
|
-
this.message_type = MessageTypeV2.TEXT;
|
|
31
|
-
this.content = '';
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
exports.MessagesV2 = MessagesV2;
|
|
35
|
-
__decorate([
|
|
36
|
-
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
37
|
-
__metadata("design:type", Number)
|
|
38
|
-
], MessagesV2.prototype, "conversation_id", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
41
|
-
__metadata("design:type", Number)
|
|
42
|
-
], MessagesV2.prototype, "sender_id", void 0);
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, typeorm_1.Column)({
|
|
45
|
-
type: 'enum',
|
|
46
|
-
enum: MessageTypeV2,
|
|
47
|
-
default: MessageTypeV2.TEXT
|
|
48
|
-
}),
|
|
49
|
-
__metadata("design:type", String)
|
|
50
|
-
], MessagesV2.prototype, "message_type", void 0);
|
|
51
|
-
__decorate([
|
|
52
|
-
(0, typeorm_1.Column)({ type: 'text', nullable: false }),
|
|
53
|
-
__metadata("design:type", String)
|
|
54
|
-
], MessagesV2.prototype, "content", void 0);
|
|
55
|
-
__decorate([
|
|
56
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 500, nullable: true }),
|
|
57
|
-
__metadata("design:type", String)
|
|
58
|
-
], MessagesV2.prototype, "attachment_url", void 0);
|
|
59
|
-
__decorate([
|
|
60
|
-
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
61
|
-
__metadata("design:type", String)
|
|
62
|
-
], MessagesV2.prototype, "attachment_name", void 0);
|
|
63
|
-
__decorate([
|
|
64
|
-
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
65
|
-
__metadata("design:type", Number)
|
|
66
|
-
], MessagesV2.prototype, "reply_to_message_id", void 0);
|
|
67
|
-
__decorate([
|
|
68
|
-
(0, typeorm_1.ManyToOne)(() => ConversationsV2Model_1.ConversationsV2, conversation => conversation.messages),
|
|
69
|
-
(0, typeorm_1.JoinColumn)({ name: 'conversation_id' }),
|
|
70
|
-
__metadata("design:type", ConversationsV2Model_1.ConversationsV2)
|
|
71
|
-
], MessagesV2.prototype, "conversation", void 0);
|
|
72
|
-
__decorate([
|
|
73
|
-
(0, typeorm_1.ManyToOne)(() => user_1.User),
|
|
74
|
-
(0, typeorm_1.JoinColumn)({ name: 'sender_id' }),
|
|
75
|
-
__metadata("design:type", user_1.User)
|
|
76
|
-
], MessagesV2.prototype, "sender", void 0);
|
|
77
|
-
__decorate([
|
|
78
|
-
(0, typeorm_1.ManyToOne)(() => MessagesV2, { nullable: true }),
|
|
79
|
-
(0, typeorm_1.JoinColumn)({ name: 'reply_to_message_id' }),
|
|
80
|
-
__metadata("design:type", MessagesV2)
|
|
81
|
-
], MessagesV2.prototype, "replyToMessage", void 0);
|
|
82
|
-
__decorate([
|
|
83
|
-
(0, typeorm_1.OneToMany)(() => MessageReadStatusModel_1.MessageReadStatus, readStatus => readStatus.message),
|
|
84
|
-
__metadata("design:type", Array)
|
|
85
|
-
], MessagesV2.prototype, "readStatuses", void 0);
|
|
86
|
-
exports.MessagesV2 = MessagesV2 = __decorate([
|
|
87
|
-
(0, typeorm_1.Entity)({ name: 'messages_v2' }),
|
|
88
|
-
__metadata("design:paramtypes", [])
|
|
89
|
-
], MessagesV2);
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
import { ConversationsV2 } from './ConversationsV2Model';
|
|
4
|
-
import { User } from './user';
|
|
5
|
-
|
|
6
|
-
@Entity({ name: 'conversation_participants_v2' })
|
|
7
|
-
export class ConversationParticipantsV2 extends BaseModel {
|
|
8
|
-
|
|
9
|
-
@Column({ type: 'int', nullable: false })
|
|
10
|
-
conversation_id: number;
|
|
11
|
-
|
|
12
|
-
@Column({ type: 'int', nullable: false })
|
|
13
|
-
user_id: number;
|
|
14
|
-
|
|
15
|
-
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
16
|
-
joined_at: Date;
|
|
17
|
-
|
|
18
|
-
@Column({ type: 'timestamp', nullable: true })
|
|
19
|
-
left_at?: Date;
|
|
20
|
-
|
|
21
|
-
@Column({ type: 'boolean', default: false })
|
|
22
|
-
is_admin: boolean;
|
|
23
|
-
|
|
24
|
-
@Column({ type: 'int', default: 0 })
|
|
25
|
-
unread_count: number;
|
|
26
|
-
|
|
27
|
-
@Column({ type: 'timestamp', nullable: true })
|
|
28
|
-
last_read_at?: Date;
|
|
29
|
-
|
|
30
|
-
// Relations
|
|
31
|
-
@ManyToOne(() => ConversationsV2, conversation => conversation.participants)
|
|
32
|
-
@JoinColumn({ name: 'conversation_id' })
|
|
33
|
-
conversation?: ConversationsV2;
|
|
34
|
-
|
|
35
|
-
@ManyToOne(() => User)
|
|
36
|
-
@JoinColumn({ name: 'user_id' })
|
|
37
|
-
user?: User;
|
|
38
|
-
|
|
39
|
-
constructor() {
|
|
40
|
-
super();
|
|
41
|
-
this.conversation_id = 0;
|
|
42
|
-
this.user_id = 0;
|
|
43
|
-
this.joined_at = new Date();
|
|
44
|
-
this.is_admin = false;
|
|
45
|
-
this.unread_count = 0;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, OneToMany } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
import { ConversationParticipantsV2 } from './ConversationParticipantsV2Model';
|
|
4
|
-
import { MessagesV2 } from './MessagesV2Model';
|
|
5
|
-
|
|
6
|
-
export enum ConversationTypeV2 {
|
|
7
|
-
DIRECT = "direct",
|
|
8
|
-
GROUP = "group"
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
@Entity({ name: 'conversations_v2' })
|
|
12
|
-
export class ConversationsV2 extends BaseModel {
|
|
13
|
-
|
|
14
|
-
@Column({
|
|
15
|
-
type: 'enum',
|
|
16
|
-
enum: ConversationTypeV2,
|
|
17
|
-
default: ConversationTypeV2.DIRECT
|
|
18
|
-
})
|
|
19
|
-
conversation_type: ConversationTypeV2;
|
|
20
|
-
|
|
21
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
22
|
-
conversation_name?: string;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
26
|
-
last_message_at: Date;
|
|
27
|
-
|
|
28
|
-
// Relations
|
|
29
|
-
@OneToMany(() => ConversationParticipantsV2, participant => participant.conversation)
|
|
30
|
-
participants?: ConversationParticipantsV2[];
|
|
31
|
-
|
|
32
|
-
@OneToMany(() => MessagesV2, message => message.conversation)
|
|
33
|
-
messages?: MessagesV2[];
|
|
34
|
-
|
|
35
|
-
constructor() {
|
|
36
|
-
super();
|
|
37
|
-
this.conversation_type = ConversationTypeV2.DIRECT;
|
|
38
|
-
this.last_message_at = new Date();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
import { MessagesV2 } from './MessagesV2Model';
|
|
4
|
-
import { User } from './user';
|
|
5
|
-
|
|
6
|
-
@Entity({ name: 'message_read_status' })
|
|
7
|
-
export class MessageReadStatus extends BaseModel {
|
|
8
|
-
|
|
9
|
-
@Column({ type: 'int', nullable: false })
|
|
10
|
-
message_id: number;
|
|
11
|
-
|
|
12
|
-
@Column({ type: 'int', nullable: false })
|
|
13
|
-
user_id: number;
|
|
14
|
-
|
|
15
|
-
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
16
|
-
read_at: Date;
|
|
17
|
-
|
|
18
|
-
// Relations
|
|
19
|
-
@ManyToOne(() => MessagesV2, message => message.readStatuses)
|
|
20
|
-
@JoinColumn({ name: 'message_id' })
|
|
21
|
-
message?: MessagesV2;
|
|
22
|
-
|
|
23
|
-
@ManyToOne(() => User)
|
|
24
|
-
@JoinColumn({ name: 'user_id' })
|
|
25
|
-
user?: User;
|
|
26
|
-
|
|
27
|
-
constructor() {
|
|
28
|
-
super();
|
|
29
|
-
this.message_id = 0;
|
|
30
|
-
this.user_id = 0;
|
|
31
|
-
this.read_at = new Date();
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Column, Entity, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
|
2
|
-
import { BaseModel } from './BaseModel';
|
|
3
|
-
import { ConversationsV2 } from './ConversationsV2Model';
|
|
4
|
-
import { User } from './user';
|
|
5
|
-
import { MessageReadStatus } from './MessageReadStatusModel';
|
|
6
|
-
|
|
7
|
-
export enum MessageTypeV2 {
|
|
8
|
-
TEXT = "text",
|
|
9
|
-
IMAGE = "image",
|
|
10
|
-
FILE = "file",
|
|
11
|
-
VIDEO = "video"
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@Entity({ name: 'messages_v2' })
|
|
15
|
-
export class MessagesV2 extends BaseModel {
|
|
16
|
-
|
|
17
|
-
@Column({ type: 'int', nullable: false })
|
|
18
|
-
conversation_id: number;
|
|
19
|
-
|
|
20
|
-
@Column({ type: 'int', nullable: false })
|
|
21
|
-
sender_id: number;
|
|
22
|
-
|
|
23
|
-
@Column({
|
|
24
|
-
type: 'enum',
|
|
25
|
-
enum: MessageTypeV2,
|
|
26
|
-
default: MessageTypeV2.TEXT
|
|
27
|
-
})
|
|
28
|
-
message_type: MessageTypeV2;
|
|
29
|
-
|
|
30
|
-
@Column({ type: 'text', nullable: false })
|
|
31
|
-
content: string;
|
|
32
|
-
|
|
33
|
-
@Column({ type: 'varchar', length: 500, nullable: true })
|
|
34
|
-
attachment_url?: string;
|
|
35
|
-
|
|
36
|
-
@Column({ type: 'varchar', length: 255, nullable: true })
|
|
37
|
-
attachment_name?: string;
|
|
38
|
-
|
|
39
|
-
@Column({ type: 'int', nullable: true })
|
|
40
|
-
reply_to_message_id?: number;
|
|
41
|
-
|
|
42
|
-
// Relations
|
|
43
|
-
@ManyToOne(() => ConversationsV2, conversation => conversation.messages)
|
|
44
|
-
@JoinColumn({ name: 'conversation_id' })
|
|
45
|
-
conversation?: ConversationsV2;
|
|
46
|
-
|
|
47
|
-
@ManyToOne(() => User)
|
|
48
|
-
@JoinColumn({ name: 'sender_id' })
|
|
49
|
-
sender?: User;
|
|
50
|
-
|
|
51
|
-
@ManyToOne(() => MessagesV2, { nullable: true })
|
|
52
|
-
@JoinColumn({ name: 'reply_to_message_id' })
|
|
53
|
-
replyToMessage?: MessagesV2;
|
|
54
|
-
|
|
55
|
-
@OneToMany(() => MessageReadStatus, readStatus => readStatus.message)
|
|
56
|
-
readStatuses?: MessageReadStatus[];
|
|
57
|
-
|
|
58
|
-
constructor() {
|
|
59
|
-
super();
|
|
60
|
-
this.conversation_id = 0;
|
|
61
|
-
this.sender_id = 0;
|
|
62
|
-
this.message_type = MessageTypeV2.TEXT;
|
|
63
|
-
this.content = '';
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|