@managesome/eposmatic-toolkit 0.2.559 → 0.2.560
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/lib/constants/ENUMS.d.ts +40 -0
- package/lib/constants/ENUMS.js +49 -1
- package/lib/schemas/models/index.d.ts +6 -0
- package/lib/schemas/models/index.js +6 -0
- package/lib/schemas/models/tenant_hr_attendance_records.d.ts +93 -0
- package/lib/schemas/models/tenant_hr_attendance_records.js +90 -0
- package/lib/schemas/models/tenant_hr_departments.d.ts +44 -0
- package/lib/schemas/models/tenant_hr_departments.js +45 -0
- package/lib/schemas/models/tenant_hr_employees.d.ts +975 -0
- package/lib/schemas/models/tenant_hr_employees.js +151 -0
- package/lib/schemas/models/tenant_hr_positions.d.ts +47 -0
- package/lib/schemas/models/tenant_hr_positions.js +51 -0
- package/lib/schemas/models/tenant_hr_shift_schedules.d.ts +63 -0
- package/lib/schemas/models/tenant_hr_shift_schedules.js +79 -0
- package/lib/schemas/models/tenant_hr_shifts.d.ts +77 -0
- package/lib/schemas/models/tenant_hr_shifts.js +63 -0
- package/lib/schemas/types/index.d.ts +6 -0
- package/lib/schemas/types/index.js +6 -0
- package/lib/schemas/types/tenant_hr_attendance_records.d.ts +21 -0
- package/lib/schemas/types/tenant_hr_attendance_records.js +2 -0
- package/lib/schemas/types/tenant_hr_departments.d.ts +9 -0
- package/lib/schemas/types/tenant_hr_departments.js +2 -0
- package/lib/schemas/types/tenant_hr_employees.d.ts +38 -0
- package/lib/schemas/types/tenant_hr_employees.js +2 -0
- package/lib/schemas/types/tenant_hr_positions.d.ts +10 -0
- package/lib/schemas/types/tenant_hr_positions.js +2 -0
- package/lib/schemas/types/tenant_hr_shift_schedules.d.ts +16 -0
- package/lib/schemas/types/tenant_hr_shift_schedules.js +2 -0
- package/lib/schemas/types/tenant_hr_shifts.d.ts +15 -0
- package/lib/schemas/types/tenant_hr_shifts.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TENANT_HR_EMPLOYEES_COLLECTION_NAME = exports.TenantHrEmployeeSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
const items_1 = require("./items");
|
|
7
|
+
const hrEmergencyContactSchema = new mongoose_1.Schema({
|
|
8
|
+
name: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
phone: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
relationship: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
}, { _id: false, minimize: false });
|
|
21
|
+
const hrEmployeeDocumentSchema = new mongoose_1.Schema({
|
|
22
|
+
doc_url: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
doc_name: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: null,
|
|
29
|
+
},
|
|
30
|
+
uploaded_at: {
|
|
31
|
+
type: Date,
|
|
32
|
+
default: null,
|
|
33
|
+
},
|
|
34
|
+
}, { _id: false, minimize: false });
|
|
35
|
+
exports.TenantHrEmployeeSchema = new mongoose_1.Schema({
|
|
36
|
+
_id: {
|
|
37
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
38
|
+
required: true,
|
|
39
|
+
immutable: true,
|
|
40
|
+
},
|
|
41
|
+
uid: {
|
|
42
|
+
type: String,
|
|
43
|
+
required: true,
|
|
44
|
+
immutable: true,
|
|
45
|
+
},
|
|
46
|
+
tenant_id: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: true,
|
|
49
|
+
immutable: true,
|
|
50
|
+
ref: 'tenants',
|
|
51
|
+
},
|
|
52
|
+
staff_auth_code: {
|
|
53
|
+
type: String,
|
|
54
|
+
default: null,
|
|
55
|
+
},
|
|
56
|
+
email: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: null,
|
|
59
|
+
},
|
|
60
|
+
email_verified: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false,
|
|
63
|
+
},
|
|
64
|
+
display_name: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: null,
|
|
67
|
+
},
|
|
68
|
+
image_url: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: null,
|
|
71
|
+
},
|
|
72
|
+
is_disabled: {
|
|
73
|
+
type: Boolean,
|
|
74
|
+
default: false,
|
|
75
|
+
},
|
|
76
|
+
phone_number: {
|
|
77
|
+
type: String,
|
|
78
|
+
required: true,
|
|
79
|
+
},
|
|
80
|
+
phone_number_verified: {
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: false,
|
|
83
|
+
},
|
|
84
|
+
role: {
|
|
85
|
+
type: String,
|
|
86
|
+
required: true,
|
|
87
|
+
enum: constants_1.ALL_USER_ROLES,
|
|
88
|
+
},
|
|
89
|
+
operational_hours: {
|
|
90
|
+
type: [items_1.SpecialHoursSchema],
|
|
91
|
+
required: false,
|
|
92
|
+
},
|
|
93
|
+
// --- HR-specific ---
|
|
94
|
+
address: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: null,
|
|
97
|
+
},
|
|
98
|
+
emergency_contact: {
|
|
99
|
+
type: hrEmergencyContactSchema,
|
|
100
|
+
default: null,
|
|
101
|
+
},
|
|
102
|
+
cnic_number: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: null,
|
|
105
|
+
},
|
|
106
|
+
position_id: {
|
|
107
|
+
type: String,
|
|
108
|
+
default: null,
|
|
109
|
+
ref: 'tenant_hr_positions',
|
|
110
|
+
},
|
|
111
|
+
join_date: {
|
|
112
|
+
type: Date,
|
|
113
|
+
required: true,
|
|
114
|
+
},
|
|
115
|
+
employment_status: {
|
|
116
|
+
type: String,
|
|
117
|
+
required: true,
|
|
118
|
+
enum: constants_1.ALL_HR_EMPLOYMENT_STATUS_NAMES,
|
|
119
|
+
default: constants_1.HR_EMPLOYMENT_STATUS_ENUM.ACTIVE,
|
|
120
|
+
},
|
|
121
|
+
salary_per_hour: {
|
|
122
|
+
type: Number,
|
|
123
|
+
required: true,
|
|
124
|
+
default: 0,
|
|
125
|
+
},
|
|
126
|
+
docs: {
|
|
127
|
+
type: Map,
|
|
128
|
+
of: hrEmployeeDocumentSchema,
|
|
129
|
+
default: {},
|
|
130
|
+
},
|
|
131
|
+
notes: {
|
|
132
|
+
type: String,
|
|
133
|
+
default: null,
|
|
134
|
+
},
|
|
135
|
+
createdAt: {
|
|
136
|
+
type: mongoose_1.Schema.Types.Date,
|
|
137
|
+
required: true,
|
|
138
|
+
default: () => new Date(),
|
|
139
|
+
immutable: true,
|
|
140
|
+
},
|
|
141
|
+
updatedAt: {
|
|
142
|
+
type: mongoose_1.Schema.Types.Date,
|
|
143
|
+
required: true,
|
|
144
|
+
default: () => new Date(),
|
|
145
|
+
},
|
|
146
|
+
}, {
|
|
147
|
+
timestamps: true,
|
|
148
|
+
versionKey: false,
|
|
149
|
+
minimize: false,
|
|
150
|
+
});
|
|
151
|
+
exports.TENANT_HR_EMPLOYEES_COLLECTION_NAME = 'tenant_hr_employees';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
export declare const TenantHrPositionSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
3
|
+
timestamps: true;
|
|
4
|
+
versionKey: false;
|
|
5
|
+
minimize: false;
|
|
6
|
+
}, {
|
|
7
|
+
createdAt: NativeDate;
|
|
8
|
+
updatedAt: NativeDate;
|
|
9
|
+
} & {
|
|
10
|
+
_id: import("mongoose").Types.ObjectId;
|
|
11
|
+
name: string;
|
|
12
|
+
tenant_id: string;
|
|
13
|
+
createdAt: NativeDate;
|
|
14
|
+
updatedAt: NativeDate;
|
|
15
|
+
description: string;
|
|
16
|
+
is_active: boolean;
|
|
17
|
+
department_id: string;
|
|
18
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
19
|
+
createdAt: NativeDate;
|
|
20
|
+
updatedAt: NativeDate;
|
|
21
|
+
} & {
|
|
22
|
+
_id: import("mongoose").Types.ObjectId;
|
|
23
|
+
name: string;
|
|
24
|
+
tenant_id: string;
|
|
25
|
+
createdAt: NativeDate;
|
|
26
|
+
updatedAt: NativeDate;
|
|
27
|
+
description: string;
|
|
28
|
+
is_active: boolean;
|
|
29
|
+
department_id: string;
|
|
30
|
+
}>> & import("mongoose").FlatRecord<{
|
|
31
|
+
createdAt: NativeDate;
|
|
32
|
+
updatedAt: NativeDate;
|
|
33
|
+
} & {
|
|
34
|
+
_id: import("mongoose").Types.ObjectId;
|
|
35
|
+
name: string;
|
|
36
|
+
tenant_id: string;
|
|
37
|
+
createdAt: NativeDate;
|
|
38
|
+
updatedAt: NativeDate;
|
|
39
|
+
description: string;
|
|
40
|
+
is_active: boolean;
|
|
41
|
+
department_id: string;
|
|
42
|
+
}> & Required<{
|
|
43
|
+
_id: import("mongoose").Types.ObjectId;
|
|
44
|
+
}> & {
|
|
45
|
+
__v: number;
|
|
46
|
+
}>;
|
|
47
|
+
export declare const TENANT_HR_POSITIONS_COLLECTION_NAME = "tenant_hr_positions";
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TENANT_HR_POSITIONS_COLLECTION_NAME = exports.TenantHrPositionSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
exports.TenantHrPositionSchema = new mongoose_1.Schema({
|
|
6
|
+
_id: {
|
|
7
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
8
|
+
required: true,
|
|
9
|
+
immutable: true,
|
|
10
|
+
},
|
|
11
|
+
tenant_id: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
immutable: true,
|
|
15
|
+
ref: 'tenants',
|
|
16
|
+
},
|
|
17
|
+
department_id: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
immutable: true,
|
|
21
|
+
ref: 'tenant_hr_departments',
|
|
22
|
+
},
|
|
23
|
+
name: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
description: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: null,
|
|
30
|
+
},
|
|
31
|
+
is_active: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: true,
|
|
34
|
+
},
|
|
35
|
+
createdAt: {
|
|
36
|
+
type: mongoose_1.Schema.Types.Date,
|
|
37
|
+
required: true,
|
|
38
|
+
default: () => new Date(),
|
|
39
|
+
immutable: true,
|
|
40
|
+
},
|
|
41
|
+
updatedAt: {
|
|
42
|
+
type: mongoose_1.Schema.Types.Date,
|
|
43
|
+
required: true,
|
|
44
|
+
default: () => new Date(),
|
|
45
|
+
},
|
|
46
|
+
}, {
|
|
47
|
+
timestamps: true,
|
|
48
|
+
versionKey: false,
|
|
49
|
+
minimize: false,
|
|
50
|
+
});
|
|
51
|
+
exports.TENANT_HR_POSITIONS_COLLECTION_NAME = 'tenant_hr_positions';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
import { HR_SHIFT_STATUS_ENUM, HR_SHIFT_TYPE_ENUM } from '../../constants';
|
|
3
|
+
export declare const TenantHrShiftScheduleSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
4
|
+
timestamps: true;
|
|
5
|
+
versionKey: false;
|
|
6
|
+
minimize: false;
|
|
7
|
+
}, {
|
|
8
|
+
createdAt: NativeDate;
|
|
9
|
+
updatedAt: NativeDate;
|
|
10
|
+
} & {
|
|
11
|
+
_id: import("mongoose").Types.ObjectId;
|
|
12
|
+
type: HR_SHIFT_TYPE_ENUM;
|
|
13
|
+
tenant_id: string;
|
|
14
|
+
createdAt: NativeDate;
|
|
15
|
+
updatedAt: NativeDate;
|
|
16
|
+
position: string;
|
|
17
|
+
start_time: number;
|
|
18
|
+
end_time: number;
|
|
19
|
+
status: HR_SHIFT_STATUS_ENUM;
|
|
20
|
+
notes: string;
|
|
21
|
+
employee_id: string;
|
|
22
|
+
day_indexes: string[];
|
|
23
|
+
template_id: string;
|
|
24
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
25
|
+
createdAt: NativeDate;
|
|
26
|
+
updatedAt: NativeDate;
|
|
27
|
+
} & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
type: HR_SHIFT_TYPE_ENUM;
|
|
30
|
+
tenant_id: string;
|
|
31
|
+
createdAt: NativeDate;
|
|
32
|
+
updatedAt: NativeDate;
|
|
33
|
+
position: string;
|
|
34
|
+
start_time: number;
|
|
35
|
+
end_time: number;
|
|
36
|
+
status: HR_SHIFT_STATUS_ENUM;
|
|
37
|
+
notes: string;
|
|
38
|
+
employee_id: string;
|
|
39
|
+
day_indexes: string[];
|
|
40
|
+
template_id: string;
|
|
41
|
+
}>> & import("mongoose").FlatRecord<{
|
|
42
|
+
createdAt: NativeDate;
|
|
43
|
+
updatedAt: NativeDate;
|
|
44
|
+
} & {
|
|
45
|
+
_id: import("mongoose").Types.ObjectId;
|
|
46
|
+
type: HR_SHIFT_TYPE_ENUM;
|
|
47
|
+
tenant_id: string;
|
|
48
|
+
createdAt: NativeDate;
|
|
49
|
+
updatedAt: NativeDate;
|
|
50
|
+
position: string;
|
|
51
|
+
start_time: number;
|
|
52
|
+
end_time: number;
|
|
53
|
+
status: HR_SHIFT_STATUS_ENUM;
|
|
54
|
+
notes: string;
|
|
55
|
+
employee_id: string;
|
|
56
|
+
day_indexes: string[];
|
|
57
|
+
template_id: string;
|
|
58
|
+
}> & Required<{
|
|
59
|
+
_id: import("mongoose").Types.ObjectId;
|
|
60
|
+
}> & {
|
|
61
|
+
__v: number;
|
|
62
|
+
}>;
|
|
63
|
+
export declare const TENANT_HR_SHIFT_SCHEDULES_COLLECTION_NAME = "tenant_hr_shift_schedules";
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TENANT_HR_SHIFT_SCHEDULES_COLLECTION_NAME = exports.TenantHrShiftScheduleSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const constants_1 = require("../../constants");
|
|
6
|
+
exports.TenantHrShiftScheduleSchema = new mongoose_1.Schema({
|
|
7
|
+
_id: {
|
|
8
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
9
|
+
required: true,
|
|
10
|
+
immutable: true,
|
|
11
|
+
},
|
|
12
|
+
tenant_id: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
immutable: true,
|
|
16
|
+
ref: 'tenants',
|
|
17
|
+
},
|
|
18
|
+
employee_id: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
immutable: true,
|
|
22
|
+
ref: 'tenant_hr_employees',
|
|
23
|
+
},
|
|
24
|
+
day_indexes: {
|
|
25
|
+
type: [String],
|
|
26
|
+
enum: constants_1.ALL_DAY_INDEX,
|
|
27
|
+
required: true,
|
|
28
|
+
default: [],
|
|
29
|
+
},
|
|
30
|
+
start_time: {
|
|
31
|
+
type: Number,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
end_time: {
|
|
35
|
+
type: Number,
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
position: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: null,
|
|
41
|
+
},
|
|
42
|
+
type: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: true,
|
|
45
|
+
enum: constants_1.ALL_HR_SHIFT_TYPE_NAMES,
|
|
46
|
+
default: constants_1.HR_SHIFT_TYPE_ENUM.REGULAR,
|
|
47
|
+
},
|
|
48
|
+
status: {
|
|
49
|
+
type: String,
|
|
50
|
+
required: true,
|
|
51
|
+
enum: constants_1.ALL_HR_SHIFT_STATUS_NAMES,
|
|
52
|
+
default: constants_1.HR_SHIFT_STATUS_ENUM.SCHEDULED,
|
|
53
|
+
},
|
|
54
|
+
notes: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: null,
|
|
57
|
+
},
|
|
58
|
+
template_id: {
|
|
59
|
+
type: String,
|
|
60
|
+
default: null,
|
|
61
|
+
ref: 'tenant_hr_shifts',
|
|
62
|
+
},
|
|
63
|
+
createdAt: {
|
|
64
|
+
type: mongoose_1.Schema.Types.Date,
|
|
65
|
+
required: true,
|
|
66
|
+
default: () => new Date(),
|
|
67
|
+
immutable: true,
|
|
68
|
+
},
|
|
69
|
+
updatedAt: {
|
|
70
|
+
type: mongoose_1.Schema.Types.Date,
|
|
71
|
+
required: true,
|
|
72
|
+
default: () => new Date(),
|
|
73
|
+
},
|
|
74
|
+
}, {
|
|
75
|
+
timestamps: true,
|
|
76
|
+
versionKey: false,
|
|
77
|
+
minimize: false,
|
|
78
|
+
});
|
|
79
|
+
exports.TENANT_HR_SHIFT_SCHEDULES_COLLECTION_NAME = 'tenant_hr_shift_schedules';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Schema } from 'mongoose';
|
|
2
|
+
export declare const TenantHrShiftSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
3
|
+
timestamps: true;
|
|
4
|
+
versionKey: false;
|
|
5
|
+
minimize: false;
|
|
6
|
+
}, {
|
|
7
|
+
createdAt: NativeDate;
|
|
8
|
+
updatedAt: NativeDate;
|
|
9
|
+
} & {
|
|
10
|
+
_id: import("mongoose").Types.ObjectId;
|
|
11
|
+
name: string;
|
|
12
|
+
tenant_id: string;
|
|
13
|
+
createdAt: NativeDate;
|
|
14
|
+
updatedAt: NativeDate;
|
|
15
|
+
start_time: number;
|
|
16
|
+
end_time: number;
|
|
17
|
+
is_active: boolean;
|
|
18
|
+
required_positions: import("mongoose").Types.DocumentArray<{
|
|
19
|
+
count: number;
|
|
20
|
+
position: string;
|
|
21
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
22
|
+
count: number;
|
|
23
|
+
position: string;
|
|
24
|
+
}> & {
|
|
25
|
+
count: number;
|
|
26
|
+
position: string;
|
|
27
|
+
}>;
|
|
28
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
29
|
+
createdAt: NativeDate;
|
|
30
|
+
updatedAt: NativeDate;
|
|
31
|
+
} & {
|
|
32
|
+
_id: import("mongoose").Types.ObjectId;
|
|
33
|
+
name: string;
|
|
34
|
+
tenant_id: string;
|
|
35
|
+
createdAt: NativeDate;
|
|
36
|
+
updatedAt: NativeDate;
|
|
37
|
+
start_time: number;
|
|
38
|
+
end_time: number;
|
|
39
|
+
is_active: boolean;
|
|
40
|
+
required_positions: import("mongoose").Types.DocumentArray<{
|
|
41
|
+
count: number;
|
|
42
|
+
position: string;
|
|
43
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
44
|
+
count: number;
|
|
45
|
+
position: string;
|
|
46
|
+
}> & {
|
|
47
|
+
count: number;
|
|
48
|
+
position: string;
|
|
49
|
+
}>;
|
|
50
|
+
}>> & import("mongoose").FlatRecord<{
|
|
51
|
+
createdAt: NativeDate;
|
|
52
|
+
updatedAt: NativeDate;
|
|
53
|
+
} & {
|
|
54
|
+
_id: import("mongoose").Types.ObjectId;
|
|
55
|
+
name: string;
|
|
56
|
+
tenant_id: string;
|
|
57
|
+
createdAt: NativeDate;
|
|
58
|
+
updatedAt: NativeDate;
|
|
59
|
+
start_time: number;
|
|
60
|
+
end_time: number;
|
|
61
|
+
is_active: boolean;
|
|
62
|
+
required_positions: import("mongoose").Types.DocumentArray<{
|
|
63
|
+
count: number;
|
|
64
|
+
position: string;
|
|
65
|
+
}, import("mongoose").Types.Subdocument<import("mongoose").Types.ObjectId, any, {
|
|
66
|
+
count: number;
|
|
67
|
+
position: string;
|
|
68
|
+
}> & {
|
|
69
|
+
count: number;
|
|
70
|
+
position: string;
|
|
71
|
+
}>;
|
|
72
|
+
}> & Required<{
|
|
73
|
+
_id: import("mongoose").Types.ObjectId;
|
|
74
|
+
}> & {
|
|
75
|
+
__v: number;
|
|
76
|
+
}>;
|
|
77
|
+
export declare const TENANT_HR_SHIFTS_COLLECTION_NAME = "tenant_hr_shifts";
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TENANT_HR_SHIFTS_COLLECTION_NAME = exports.TenantHrShiftSchema = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const hrRequiredPositionSchema = new mongoose_1.Schema({
|
|
6
|
+
position: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
count: {
|
|
11
|
+
type: Number,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
}, { _id: false, minimize: false });
|
|
15
|
+
exports.TenantHrShiftSchema = new mongoose_1.Schema({
|
|
16
|
+
_id: {
|
|
17
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
18
|
+
required: true,
|
|
19
|
+
immutable: true,
|
|
20
|
+
},
|
|
21
|
+
tenant_id: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
immutable: true,
|
|
25
|
+
ref: 'tenants',
|
|
26
|
+
},
|
|
27
|
+
name: {
|
|
28
|
+
type: String,
|
|
29
|
+
required: true,
|
|
30
|
+
},
|
|
31
|
+
start_time: {
|
|
32
|
+
type: Number,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
end_time: {
|
|
36
|
+
type: Number,
|
|
37
|
+
required: true,
|
|
38
|
+
},
|
|
39
|
+
required_positions: {
|
|
40
|
+
type: [hrRequiredPositionSchema],
|
|
41
|
+
default: [],
|
|
42
|
+
},
|
|
43
|
+
is_active: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true,
|
|
46
|
+
},
|
|
47
|
+
createdAt: {
|
|
48
|
+
type: mongoose_1.Schema.Types.Date,
|
|
49
|
+
required: true,
|
|
50
|
+
default: () => new Date(),
|
|
51
|
+
immutable: true,
|
|
52
|
+
},
|
|
53
|
+
updatedAt: {
|
|
54
|
+
type: mongoose_1.Schema.Types.Date,
|
|
55
|
+
required: true,
|
|
56
|
+
default: () => new Date(),
|
|
57
|
+
},
|
|
58
|
+
}, {
|
|
59
|
+
timestamps: true,
|
|
60
|
+
versionKey: false,
|
|
61
|
+
minimize: false,
|
|
62
|
+
});
|
|
63
|
+
exports.TENANT_HR_SHIFTS_COLLECTION_NAME = 'tenant_hr_shifts';
|
|
@@ -54,6 +54,12 @@ export * from './tenant_cash_drawers';
|
|
|
54
54
|
export * from './tenant_cash_in_hand_transactions';
|
|
55
55
|
export * from './tenant_cash_in_out';
|
|
56
56
|
export * from './tenant_day_sessions';
|
|
57
|
+
export * from './tenant_hr_attendance_records';
|
|
58
|
+
export * from './tenant_hr_departments';
|
|
59
|
+
export * from './tenant_hr_employees';
|
|
60
|
+
export * from './tenant_hr_positions';
|
|
61
|
+
export * from './tenant_hr_shift_schedules';
|
|
62
|
+
export * from './tenant_hr_shifts';
|
|
57
63
|
export * from './tenant_instore_shift_sessions';
|
|
58
64
|
export * from './tenant_instore_shifts';
|
|
59
65
|
export * from './tenant_metadata';
|
|
@@ -70,6 +70,12 @@ __exportStar(require("./tenant_cash_drawers"), exports);
|
|
|
70
70
|
__exportStar(require("./tenant_cash_in_hand_transactions"), exports);
|
|
71
71
|
__exportStar(require("./tenant_cash_in_out"), exports);
|
|
72
72
|
__exportStar(require("./tenant_day_sessions"), exports);
|
|
73
|
+
__exportStar(require("./tenant_hr_attendance_records"), exports);
|
|
74
|
+
__exportStar(require("./tenant_hr_departments"), exports);
|
|
75
|
+
__exportStar(require("./tenant_hr_employees"), exports);
|
|
76
|
+
__exportStar(require("./tenant_hr_positions"), exports);
|
|
77
|
+
__exportStar(require("./tenant_hr_shift_schedules"), exports);
|
|
78
|
+
__exportStar(require("./tenant_hr_shifts"), exports);
|
|
73
79
|
__exportStar(require("./tenant_instore_shift_sessions"), exports);
|
|
74
80
|
__exportStar(require("./tenant_instore_shifts"), exports);
|
|
75
81
|
__exportStar(require("./tenant_metadata"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { HR_ATTENDANCE_STATUS_ENUM, HR_CHECK_IN_METHOD_ENUM } from '../../constants';
|
|
2
|
+
export interface ITenantHrBreakTime {
|
|
3
|
+
start_time: number;
|
|
4
|
+
end_time?: number | null;
|
|
5
|
+
}
|
|
6
|
+
export interface ITenantHrAttendanceRecord {
|
|
7
|
+
_id: string;
|
|
8
|
+
tenant_id: string;
|
|
9
|
+
employee_id: string;
|
|
10
|
+
clock_in: Date | null;
|
|
11
|
+
clock_out: Date | null;
|
|
12
|
+
break_time: ITenantHrBreakTime[];
|
|
13
|
+
total_break_minutes: number;
|
|
14
|
+
total_hours: number;
|
|
15
|
+
status: HR_ATTENDANCE_STATUS_ENUM;
|
|
16
|
+
check_in_method: HR_CHECK_IN_METHOD_ENUM | null;
|
|
17
|
+
check_out_method: HR_CHECK_IN_METHOD_ENUM | null;
|
|
18
|
+
notes?: string | null;
|
|
19
|
+
createdAt: Date;
|
|
20
|
+
updatedAt: Date | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { HR_EMPLOYEE_DOCUMENT_TYPE_ENUM, HR_EMPLOYMENT_STATUS_ENUM, USER_ROLES_ENUM } from '../../constants';
|
|
2
|
+
import { IItemSpecialHour } from './common';
|
|
3
|
+
export interface ITenantHrEmergencyContact {
|
|
4
|
+
name: string;
|
|
5
|
+
phone: string;
|
|
6
|
+
relationship: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ITenantHrEmployeeDocument {
|
|
9
|
+
doc_url: string;
|
|
10
|
+
doc_name?: string | null;
|
|
11
|
+
uploaded_at?: Date;
|
|
12
|
+
}
|
|
13
|
+
export interface ITenantHrEmployee {
|
|
14
|
+
_id: string;
|
|
15
|
+
uid: string;
|
|
16
|
+
tenant_id: string;
|
|
17
|
+
staff_auth_code: string | null;
|
|
18
|
+
email: string | null;
|
|
19
|
+
email_verified: boolean;
|
|
20
|
+
display_name: string | null;
|
|
21
|
+
image_url: string | null;
|
|
22
|
+
is_disabled: boolean;
|
|
23
|
+
phone_number: string;
|
|
24
|
+
phone_number_verified: boolean;
|
|
25
|
+
role: USER_ROLES_ENUM;
|
|
26
|
+
operational_hours?: IItemSpecialHour[] | null;
|
|
27
|
+
address?: string | null;
|
|
28
|
+
emergency_contact: ITenantHrEmergencyContact | null;
|
|
29
|
+
cnic_number?: string | null;
|
|
30
|
+
position_id: string | null;
|
|
31
|
+
join_date: Date;
|
|
32
|
+
employment_status: HR_EMPLOYMENT_STATUS_ENUM;
|
|
33
|
+
salary_per_hour: number;
|
|
34
|
+
docs: Record<HR_EMPLOYEE_DOCUMENT_TYPE_ENUM, ITenantHrEmployeeDocument>;
|
|
35
|
+
notes?: string | null;
|
|
36
|
+
createdAt: Date;
|
|
37
|
+
updatedAt: Date;
|
|
38
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DAY_INDEX_ENUM, HR_SHIFT_STATUS_ENUM, HR_SHIFT_TYPE_ENUM } from '../../constants';
|
|
2
|
+
export interface ITenantHrShiftSchedule {
|
|
3
|
+
_id: string;
|
|
4
|
+
tenant_id: string;
|
|
5
|
+
employee_id: string;
|
|
6
|
+
day_indexes: DAY_INDEX_ENUM[];
|
|
7
|
+
start_time: number;
|
|
8
|
+
end_time: number;
|
|
9
|
+
position?: string | null;
|
|
10
|
+
type: HR_SHIFT_TYPE_ENUM;
|
|
11
|
+
status: HR_SHIFT_STATUS_ENUM;
|
|
12
|
+
notes?: string | null;
|
|
13
|
+
template_id?: string | null;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date | null;
|
|
16
|
+
}
|