@managesome/eposmatic-toolkit 0.2.776 → 0.2.777

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.
@@ -1237,3 +1237,20 @@ export declare enum HR_POLICY_STATUS_ENUM {
1237
1237
  ARCHIVED = "ARCHIVED"
1238
1238
  }
1239
1239
  export declare const ALL_HR_POLICY_STATUS_NAMES: HR_POLICY_STATUS_ENUM[];
1240
+ export declare enum HR_LEAVE_TYPE_ENUM {
1241
+ ANNUAL = "ANNUAL",
1242
+ SICK = "SICK",
1243
+ CASUAL = "CASUAL",
1244
+ EMERGENCY = "EMERGENCY",
1245
+ MATERNITY = "MATERNITY",
1246
+ PATERNITY = "PATERNITY"
1247
+ }
1248
+ export declare const ALL_HR_LEAVE_TYPE_NAMES: HR_LEAVE_TYPE_ENUM[];
1249
+ export declare enum HR_LEAVE_STATUS_ENUM {
1250
+ PENDING = "PENDING",
1251
+ APPROVED = "APPROVED",
1252
+ REJECTED = "REJECTED",
1253
+ CANCELLED = "CANCELLED"
1254
+ }
1255
+ export declare const ALL_HR_LEAVE_STATUS_NAMES: HR_LEAVE_STATUS_ENUM[];
1256
+ export declare const DEFAULT_HR_LEAVE_ALLOWANCE: Record<HR_LEAVE_TYPE_ENUM, number>;
@@ -5,7 +5,7 @@ exports.ALL_EMAIL_DOCUMENT_KINDS = exports.EMAIL_DOCUMENT_KIND_ENUM = exports.AL
5
5
  exports.PRINTER_INTERFACE_ENUM = exports.RECEIPT_WIDTHS = exports.ALL_NUM_OF_COLUMNS = exports.NUM_OF_COLUMNS_ENUM = exports.SPLIT_SYNC_SOURCE_ENUM = exports.ALL_SPLIT_BILL_TYPES = exports.SPLIT_BILL_TYPE_ENUM = exports.ALL_RIDER_FEE_TYPES = exports.RIDER_FEE_TYPE_ENUM = exports.ALL_DELIVERY_AREAS_SEARCH_TYPES = exports.DELIVERY_AREAS_SEARCH_TYPE_ENUM = exports.ALL_WEB_AUTH_TYPES = exports.WEB_AUTH_TYPE_ENUM = exports.KITCHEN_RECEIPT_TYPE_ENUM = exports.PRINTER_EVENT_TYPE_ENUM = exports.SORT_TYPE_ENUM = exports.WHITELISTED_API_SMS_COUNTRY_CODES = exports.BLACKLISTED_SMS_COUNTRY_CODES = exports.ALL_OTP_TYPES = exports.OTP_TYPE_ENUM = exports.ALL_TAX_INVOICE_PROVIDERS = exports.TAX_INVOICE_PROVIDER_ENUM = exports.ALL_RESERVATION_STATUS_TYPES = exports.RESERVATION_STATUS_ENUM = exports.TENANT_AMOUNT_DUE_TYPE_ENUM = exports.ALL_KITCHEN_DOCKET_FONT_TYPES = exports.KITCHEN_DOCKET_FONT_TYPE_ENUM = exports.ALL_SORT_ORDER_BY_TYPES = exports.SORT_ORDER_BY_ENUM = exports.RECEIPT_IMAGE_TYPE_ENUM = exports.ALL_RECEIPT_TYPES = exports.RECEIPT_TYPE_ENUM = exports.ALL_PRINTING_PREFERENCES = exports.PRINTING_PREFERENCE_ENUM = exports.ALL_PRINTER_BRAND_TYPES = exports.PRINTER_BRAND_TYPE_ENUM = exports.ALL_ORDER_ITEM_TYPES = exports.ORDER_ITEM_TYPE_ENUM = exports.ALL_PLATFORM_PROVIDER_IDS = exports.PLATFORM_PROVIDER_IDS_ENUM = exports.ALL_MARKETING_RECEIPIENT_TYPES = exports.MARKETING_RECEIPIENT_ENUM = exports.ALL_MARKETING_TYPES = exports.MARKETING_TYPE_ENUM = exports.ALL_TOKEN_TYPES = exports.TOKEN_TYPE_ENUM = exports.ALL_EMAIL_STATUS = exports.EMAIL_STATUS_ENUM = exports.ALL_COMMUNICATION_CHANNELS = exports.COMMUNICATION_CHANNEL_ENUM = void 0;
6
6
  exports.ALL_ONLINE_ORDERING_DESIGN_TYPES = exports.ONLINE_ORDERING_DESIGN_TYPE_ENUM = exports.ALL_NOTIFICATION_PROVIDERS = exports.NOTIFICATION_PROVIDER_ENUM = exports.ALL_ORDER_COMPLETION_TYPES = exports.ORDER_COMPLETION_TYPE_ENUM = exports.ITEM_COMPARISON_FIELD_ENUM = exports.VOID_ITEM_STAFF_REPORT_ENUM = exports.ALL_DISCOUNT_APPLICABILITY_TYPES = exports.DISCOUNT_APPLICABILITY_ENUM = exports.ALL_DISCOUNT_TYPES = exports.DISCOUNT_TYPE_ENUM = exports.EMAIL_TEMPLATES_TYPE_ENUM = exports.ALL_ALERT_NOTIFICATIONS_TYPES = exports.ALERT_NOTIFICATIONS_TYPE_ENUM = exports.ALL_WALLET_TRANSACTION_STATUS = exports.WALLET_TRANSACTION_STATUS_ENUM = exports.ALL_WALLET_TRANSACTION_CATEGORIES = exports.WALLET_TRANSACTION_CATEGORY_ENUM = exports.ALL_WALLET_TRANSACTION_TYPES = exports.WALLET_TRANSACTION_TYPE_ENUM = exports.ALL_DELIVERY_STATUS = exports.DELIVERY_STATUS_ENUM = exports.ALL_INVENTORY_ITEM_TYPES = exports.INVENTORY_ITEM_TYPE_ENUM = exports.ALL_RATING_TYPES = exports.RATING_TYPE_ENUM = exports.ALL_SUBSCRIPTION_STATUS = exports.SUBSCRIPTION_STATUS_ENUM = exports.ALL_VOID_PURCHASE_ORDER_ITEM_TYPES = exports.VOID_PURCHASE_ORDER_ITEM_TYPE_ENUM = exports.ALL_VOID_ORDER_ITEM_TYPES = exports.VOID_ORDER_ITEM_TYPE_ENUM = exports.COMPARISON_REPORT_TYPE_ENUM = exports.ALL_MULTI_TENANT_WEBSITE_TYPES = exports.MULTI_TENANT_WEBSITE_TYPE_ENUM = exports.ALL_ITEM_TRANSACTION_TYPES = exports.ITEM_TRANSACTION_TYPE_ENUM = exports.INVENTORY_OUTBOUND_TRANSACTIONS = exports.INVENTORY_INBOUND_TRANSACTIONS = exports.ALL_INVENTORY_TRANSACTION_CATEGORIES = exports.INVENTORY_TRANSACTION_CATEGORY_ENUM = exports.ALL_INVENTORY_TRANSACTION_TYPES = exports.INVENTORY_TRANSACTION_TYPE_ENUM = exports.ALL_GST_TYPES = exports.GST_TYPE_ENUM = exports.ALL_EXPENSE_REACCURING_TYPES = exports.EXPENSE_REACCURING_TYPE_ENUM = exports.PAYMENT_EXTENSION_ENUM = exports.ALL_PRINTER_INTERFACES = void 0;
7
7
  exports.ALL_HR_CHECK_IN_METHOD_NAMES = exports.HR_CHECK_IN_METHOD_ENUM = exports.ALL_HR_ATTENDANCE_STATUS_NAMES = exports.HR_ATTENDANCE_STATUS_ENUM = exports.ALL_HR_EMPLOYMENT_STATUS_NAMES = exports.HR_EMPLOYMENT_STATUS_ENUM = exports.ALL_INTERNAL_CUSTOMER_PAYMENT_METHOD_NAMES = exports.INTERNAL_CUSTOMER_PAYMENT_METHOD_ENUM = exports.ALL_INTERNAL_CUSTOMER_SUBSCRIPTION_SERVICE_NAMES = exports.INTERNAL_CUSTOMER_SUBSCRIPTION_SERVICE_ENUM = exports.ALL_INTERNAL_CUSTOMER_SUBSCRIPTION_PLAN_NAMES = exports.INTERNAL_CUSTOMER_SUBSCRIPTION_PLAN_ENUM = exports.ALL_INTERNAL_CUSTOMER_BILLING_CYCLE_NAMES = exports.INTERNAL_CUSTOMER_BILLING_CYCLE_ENUM = exports.ALL_INTERNAL_CUSTOMER_TYPE_NAMES = exports.INTERNAL_CUSTOMER_TYPE_ENUM = exports.ALL_INTERNAL_INVOICE_TYPE_NAMES = exports.INTERNAL_INVOICE_TYPE_ENUM = exports.ALL_INTERNAL_INVOICE_STATUS_NAMES = exports.INTERNAL_INVOICE_STATUS_ENUM = exports.ALL_SUBSCRIPTION_HARDWARE_NAMES = exports.SUBSCRIPTION_HARDWARE_ENUM = exports.ALL_CUSTOMER_TARGET_MODES = exports.CUSTOMER_TARGET_MODE_ENUM = exports.ALL_WALLET_ASSIGNMENT_BEHAVIORS = exports.WALLET_ASSIGNMENT_BEHAVIOR_ENUM = exports.ALL_WALLET_ASSET_TYPES = exports.WALLET_ASSET_TYPE_ENUM = exports.ALL_RECEIPT_QR_CODE_TYPES = exports.RECEIPT_QR_CODE_TYPE_ENUM = exports.ALL_INTERNAL_LEAD_STATUS = exports.INTERNAL_LEAD_STATUS_ENUM = exports.ALL_INTERNAL_LEAD_SOURCES = exports.INTERNAL_LEAD_SOURCE_ENUM = exports.ALL_CASH_DRAWER_STATUS = exports.CASH_DRAWER_STATUS_ENUM = exports.ALL_CASH_IN_HAND_TRANSACTION_CATEGORIES = exports.CASH_IN_HAND_TRANSACTION_CATEGORY_ENUM = exports.ALL_CASH_IN_HAND_TRANSACTION_TYPES = exports.CASH_IN_HAND_TRANSACTION_TYPE_ENUM = exports.ALL_CASH_IN_OUT_REFS = exports.CASH_IN_OUT_REF_ENUM = exports.ALL_CASH_IN_OUT_TYPES = exports.CASH_IN_OUT_TYPE_ENUM = exports.ALL_POS_SHIFT_STATUS = exports.POS_SHIFT_STATUS_ENUM = exports.ALL_POS_DAY_STATUS = exports.POS_DAY_STATUS_ENUM = exports.ALL_MODIFIER_OPTION_REF_TYPES = exports.MODIFIER_OPTION_REF_TYPE_ENUM = void 0;
8
- exports.ALL_HR_POLICY_STATUS_NAMES = exports.HR_POLICY_STATUS_ENUM = exports.ALL_HR_DOCUMENT_STATUS_NAMES = exports.HR_DOCUMENT_STATUS_ENUM = exports.ALL_HR_DOCUMENT_TYPE_NAMES = exports.HR_DOCUMENT_TYPE_ENUM = exports.ALL_HR_PAYMENT_METHOD_NAMES = exports.HR_PAYMENT_METHOD_ENUM = exports.ALL_HR_PAYROLL_STATUS_NAMES = exports.HR_PAYROLL_STATUS_ENUM = exports.ALL_HR_PAY_TYPE_NAMES = exports.HR_PAY_TYPE_ENUM = exports.ALL_HR_EMPLOYEE_DOCUMENT_TYPES = exports.HR_EMPLOYEE_DOCUMENT_TYPE_ENUM = exports.ALL_HR_SHIFT_STATUS_NAMES = exports.HR_SHIFT_STATUS_ENUM = exports.ALL_HR_SHIFT_TYPE_NAMES = exports.HR_SHIFT_TYPE_ENUM = exports.ALL_HR_BIOMETRIC_ENROLLMENT_TYPE_NAMES = exports.HR_BIOMETRIC_ENROLLMENT_TYPE_ENUM = void 0;
8
+ exports.DEFAULT_HR_LEAVE_ALLOWANCE = exports.ALL_HR_LEAVE_STATUS_NAMES = exports.HR_LEAVE_STATUS_ENUM = exports.ALL_HR_LEAVE_TYPE_NAMES = exports.HR_LEAVE_TYPE_ENUM = exports.ALL_HR_POLICY_STATUS_NAMES = exports.HR_POLICY_STATUS_ENUM = exports.ALL_HR_DOCUMENT_STATUS_NAMES = exports.HR_DOCUMENT_STATUS_ENUM = exports.ALL_HR_DOCUMENT_TYPE_NAMES = exports.HR_DOCUMENT_TYPE_ENUM = exports.ALL_HR_PAYMENT_METHOD_NAMES = exports.HR_PAYMENT_METHOD_ENUM = exports.ALL_HR_PAYROLL_STATUS_NAMES = exports.HR_PAYROLL_STATUS_ENUM = exports.ALL_HR_PAY_TYPE_NAMES = exports.HR_PAY_TYPE_ENUM = exports.ALL_HR_EMPLOYEE_DOCUMENT_TYPES = exports.HR_EMPLOYEE_DOCUMENT_TYPE_ENUM = exports.ALL_HR_SHIFT_STATUS_NAMES = exports.HR_SHIFT_STATUS_ENUM = exports.ALL_HR_SHIFT_TYPE_NAMES = exports.HR_SHIFT_TYPE_ENUM = exports.ALL_HR_BIOMETRIC_ENROLLMENT_TYPE_NAMES = exports.HR_BIOMETRIC_ENROLLMENT_TYPE_ENUM = void 0;
9
9
  var ORDER_FROM_ENUM;
10
10
  (function (ORDER_FROM_ENUM) {
11
11
  ORDER_FROM_ENUM["WEB"] = "WEB";
@@ -1940,3 +1940,29 @@ var HR_POLICY_STATUS_ENUM;
1940
1940
  HR_POLICY_STATUS_ENUM["ARCHIVED"] = "ARCHIVED";
1941
1941
  })(HR_POLICY_STATUS_ENUM || (exports.HR_POLICY_STATUS_ENUM = HR_POLICY_STATUS_ENUM = {}));
1942
1942
  exports.ALL_HR_POLICY_STATUS_NAMES = Object.values(HR_POLICY_STATUS_ENUM);
1943
+ var HR_LEAVE_TYPE_ENUM;
1944
+ (function (HR_LEAVE_TYPE_ENUM) {
1945
+ HR_LEAVE_TYPE_ENUM["ANNUAL"] = "ANNUAL";
1946
+ HR_LEAVE_TYPE_ENUM["SICK"] = "SICK";
1947
+ HR_LEAVE_TYPE_ENUM["CASUAL"] = "CASUAL";
1948
+ HR_LEAVE_TYPE_ENUM["EMERGENCY"] = "EMERGENCY";
1949
+ HR_LEAVE_TYPE_ENUM["MATERNITY"] = "MATERNITY";
1950
+ HR_LEAVE_TYPE_ENUM["PATERNITY"] = "PATERNITY";
1951
+ })(HR_LEAVE_TYPE_ENUM || (exports.HR_LEAVE_TYPE_ENUM = HR_LEAVE_TYPE_ENUM = {}));
1952
+ exports.ALL_HR_LEAVE_TYPE_NAMES = Object.values(HR_LEAVE_TYPE_ENUM);
1953
+ var HR_LEAVE_STATUS_ENUM;
1954
+ (function (HR_LEAVE_STATUS_ENUM) {
1955
+ HR_LEAVE_STATUS_ENUM["PENDING"] = "PENDING";
1956
+ HR_LEAVE_STATUS_ENUM["APPROVED"] = "APPROVED";
1957
+ HR_LEAVE_STATUS_ENUM["REJECTED"] = "REJECTED";
1958
+ HR_LEAVE_STATUS_ENUM["CANCELLED"] = "CANCELLED";
1959
+ })(HR_LEAVE_STATUS_ENUM || (exports.HR_LEAVE_STATUS_ENUM = HR_LEAVE_STATUS_ENUM = {}));
1960
+ exports.ALL_HR_LEAVE_STATUS_NAMES = Object.values(HR_LEAVE_STATUS_ENUM);
1961
+ exports.DEFAULT_HR_LEAVE_ALLOWANCE = {
1962
+ ANNUAL: 21,
1963
+ SICK: 10,
1964
+ CASUAL: 7,
1965
+ EMERGENCY: 5,
1966
+ MATERNITY: 90,
1967
+ PATERNITY: 14,
1968
+ };
@@ -1,3 +1,4 @@
1
+ import { HR_LEAVE_TYPE_ENUM } from '../../constants';
1
2
  import { ITenantHrEmployee, ITenantHrPayroll } from '../../schemas';
2
3
  export interface IHrPayrollPriceFields {
3
4
  salary_per_hour?: number | null;
@@ -24,6 +25,7 @@ export interface IHrEmployeePriceFields {
24
25
  hr_working_days_per_month?: number | null;
25
26
  hr_hours_per_working_day?: number | null;
26
27
  hr_overtime_multiplier?: number | null;
28
+ leave_allowance?: Partial<Record<HR_LEAVE_TYPE_ENUM, number>> | null;
27
29
  }
28
30
  export declare function getHrEmployeeWithPrice<T extends IHrEmployeePriceFields>(employee: T, writeable?: boolean): T;
29
31
  export declare function getHrEmployeesFetchedData(data: ITenantHrEmployee[]): ITenantHrEmployee[];
@@ -38,6 +38,14 @@ function getHrEmployeeWithPrice(employee, writeable) {
38
38
  const convert = writeable ? price_conversion_1.convertDecimalToInt : price_conversion_1.convertIntToDecimal;
39
39
  return {
40
40
  ...employee,
41
+ ...(employee.leave_allowance
42
+ ? {
43
+ leave_allowance: Object.fromEntries(Object.entries(employee.leave_allowance).map(([leave_type, days]) => [
44
+ leave_type,
45
+ typeof days === 'number' ? convert(days) : days,
46
+ ])),
47
+ }
48
+ : {}),
41
49
  ...(employee.salary_per_hour != null ? { salary_per_hour: convert(employee.salary_per_hour) } : {}),
42
50
  ...(employee.monthly_salary != null ? { monthly_salary: convert(employee.monthly_salary) } : {}),
43
51
  ...(employee.hr_working_days_per_month != null
@@ -56,6 +56,7 @@ export * from './tenant_hr_biometric_enrollments';
56
56
  export * from './tenant_hr_departments';
57
57
  export * from './tenant_hr_documents';
58
58
  export * from './tenant_hr_employees';
59
+ export * from './tenant_hr_leave_requests';
59
60
  export * from './tenant_hr_payrolls';
60
61
  export * from './tenant_hr_policies';
61
62
  export * from './tenant_hr_positions';
@@ -72,6 +72,7 @@ __exportStar(require("./tenant_hr_biometric_enrollments"), exports);
72
72
  __exportStar(require("./tenant_hr_departments"), exports);
73
73
  __exportStar(require("./tenant_hr_documents"), exports);
74
74
  __exportStar(require("./tenant_hr_employees"), exports);
75
+ __exportStar(require("./tenant_hr_leave_requests"), exports);
75
76
  __exportStar(require("./tenant_hr_payrolls"), exports);
76
77
  __exportStar(require("./tenant_hr_policies"), exports);
77
78
  __exportStar(require("./tenant_hr_positions"), exports);
@@ -24,6 +24,7 @@ export declare const TenantHrEmployeeSchema: Schema<any, import("mongoose").Mode
24
24
  salary_per_hour: number;
25
25
  monthly_salary: number;
26
26
  pay_type: HR_PAY_TYPE_ENUM;
27
+ leave_allowance: Map<string, number>;
27
28
  hr_working_days_per_month: number;
28
29
  hr_hours_per_working_day: number;
29
30
  hr_overtime_multiplier: number;
@@ -349,6 +350,7 @@ export declare const TenantHrEmployeeSchema: Schema<any, import("mongoose").Mode
349
350
  salary_per_hour: number;
350
351
  monthly_salary: number;
351
352
  pay_type: HR_PAY_TYPE_ENUM;
353
+ leave_allowance: Map<string, number>;
352
354
  hr_working_days_per_month: number;
353
355
  hr_hours_per_working_day: number;
354
356
  hr_overtime_multiplier: number;
@@ -674,6 +676,7 @@ export declare const TenantHrEmployeeSchema: Schema<any, import("mongoose").Mode
674
676
  salary_per_hour: number;
675
677
  monthly_salary: number;
676
678
  pay_type: HR_PAY_TYPE_ENUM;
679
+ leave_allowance: Map<string, number>;
677
680
  hr_working_days_per_month: number;
678
681
  hr_hours_per_working_day: number;
679
682
  hr_overtime_multiplier: number;
@@ -142,6 +142,11 @@ exports.TenantHrEmployeeSchema = new mongoose_1.Schema({
142
142
  required: true,
143
143
  default: 0,
144
144
  },
145
+ leave_allowance: {
146
+ type: Map,
147
+ of: Number,
148
+ default: {},
149
+ },
145
150
  docs: {
146
151
  type: Map,
147
152
  of: hrEmployeeDocumentSchema,
@@ -0,0 +1,69 @@
1
+ import { Schema } from 'mongoose';
2
+ import { HR_LEAVE_STATUS_ENUM } from '../../constants';
3
+ export declare const TenantHrLeaveRequestSchema: 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
+ tenant_id: string;
13
+ reason: string;
14
+ createdAt: NativeDate;
15
+ updatedAt: NativeDate;
16
+ start_date: NativeDate;
17
+ end_date: NativeDate;
18
+ status: HR_LEAVE_STATUS_ENUM;
19
+ employee_id: string;
20
+ leave_type: import("../../constants").HR_LEAVE_TYPE_ENUM;
21
+ is_half_day: boolean;
22
+ total_days: number;
23
+ reviewed_by: string;
24
+ reviewed_at: NativeDate;
25
+ rejection_reason: string;
26
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
27
+ createdAt: NativeDate;
28
+ updatedAt: NativeDate;
29
+ } & {
30
+ _id: import("mongoose").Types.ObjectId;
31
+ tenant_id: string;
32
+ reason: string;
33
+ createdAt: NativeDate;
34
+ updatedAt: NativeDate;
35
+ start_date: NativeDate;
36
+ end_date: NativeDate;
37
+ status: HR_LEAVE_STATUS_ENUM;
38
+ employee_id: string;
39
+ leave_type: import("../../constants").HR_LEAVE_TYPE_ENUM;
40
+ is_half_day: boolean;
41
+ total_days: number;
42
+ reviewed_by: string;
43
+ reviewed_at: NativeDate;
44
+ rejection_reason: string;
45
+ }>> & import("mongoose").FlatRecord<{
46
+ createdAt: NativeDate;
47
+ updatedAt: NativeDate;
48
+ } & {
49
+ _id: import("mongoose").Types.ObjectId;
50
+ tenant_id: string;
51
+ reason: string;
52
+ createdAt: NativeDate;
53
+ updatedAt: NativeDate;
54
+ start_date: NativeDate;
55
+ end_date: NativeDate;
56
+ status: HR_LEAVE_STATUS_ENUM;
57
+ employee_id: string;
58
+ leave_type: import("../../constants").HR_LEAVE_TYPE_ENUM;
59
+ is_half_day: boolean;
60
+ total_days: number;
61
+ reviewed_by: string;
62
+ reviewed_at: NativeDate;
63
+ rejection_reason: string;
64
+ }> & Required<{
65
+ _id: import("mongoose").Types.ObjectId;
66
+ }> & {
67
+ __v: number;
68
+ }>;
69
+ export declare const TENANT_HR_LEAVE_REQUESTS_COLLECTION_NAME = "tenant_hr_leave_requests";
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TENANT_HR_LEAVE_REQUESTS_COLLECTION_NAME = exports.TenantHrLeaveRequestSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ const constants_1 = require("../../constants");
6
+ exports.TenantHrLeaveRequestSchema = 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
+ leave_type: {
25
+ type: String,
26
+ required: true,
27
+ enum: constants_1.ALL_HR_LEAVE_TYPE_NAMES,
28
+ },
29
+ start_date: {
30
+ type: mongoose_1.Schema.Types.Date,
31
+ required: true,
32
+ },
33
+ end_date: {
34
+ type: mongoose_1.Schema.Types.Date,
35
+ required: true,
36
+ },
37
+ is_half_day: {
38
+ type: Boolean,
39
+ default: false,
40
+ },
41
+ total_days: {
42
+ type: Number,
43
+ required: true,
44
+ },
45
+ reason: {
46
+ type: String,
47
+ required: true,
48
+ },
49
+ status: {
50
+ type: String,
51
+ required: true,
52
+ enum: constants_1.ALL_HR_LEAVE_STATUS_NAMES,
53
+ default: constants_1.HR_LEAVE_STATUS_ENUM.PENDING,
54
+ },
55
+ reviewed_by: {
56
+ type: String,
57
+ default: null,
58
+ },
59
+ reviewed_at: {
60
+ type: mongoose_1.Schema.Types.Date,
61
+ default: null,
62
+ },
63
+ rejection_reason: {
64
+ type: String,
65
+ default: null,
66
+ },
67
+ createdAt: {
68
+ type: mongoose_1.Schema.Types.Date,
69
+ required: true,
70
+ default: () => new Date(),
71
+ immutable: true,
72
+ },
73
+ updatedAt: {
74
+ type: mongoose_1.Schema.Types.Date,
75
+ required: true,
76
+ default: () => new Date(),
77
+ },
78
+ }, {
79
+ timestamps: true,
80
+ versionKey: false,
81
+ minimize: false,
82
+ });
83
+ exports.TENANT_HR_LEAVE_REQUESTS_COLLECTION_NAME = 'tenant_hr_leave_requests';
@@ -63,6 +63,7 @@ export * from './tenant_hr_biometric_enrollments';
63
63
  export * from './tenant_hr_departments';
64
64
  export * from './tenant_hr_documents';
65
65
  export * from './tenant_hr_employees';
66
+ export * from './tenant_hr_leave_requests';
66
67
  export * from './tenant_hr_payrolls';
67
68
  export * from './tenant_hr_policies';
68
69
  export * from './tenant_hr_positions';
@@ -79,6 +79,7 @@ __exportStar(require("./tenant_hr_biometric_enrollments"), exports);
79
79
  __exportStar(require("./tenant_hr_departments"), exports);
80
80
  __exportStar(require("./tenant_hr_documents"), exports);
81
81
  __exportStar(require("./tenant_hr_employees"), exports);
82
+ __exportStar(require("./tenant_hr_leave_requests"), exports);
82
83
  __exportStar(require("./tenant_hr_payrolls"), exports);
83
84
  __exportStar(require("./tenant_hr_policies"), exports);
84
85
  __exportStar(require("./tenant_hr_positions"), exports);
@@ -1,4 +1,4 @@
1
- import { HR_DOCUMENT_TYPE_ENUM, HR_EMPLOYMENT_STATUS_ENUM, HR_PAY_TYPE_ENUM } from '../../constants';
1
+ import { HR_DOCUMENT_TYPE_ENUM, HR_EMPLOYMENT_STATUS_ENUM, HR_LEAVE_TYPE_ENUM, HR_PAY_TYPE_ENUM } from '../../constants';
2
2
  import { IItemSpecialHour } from './common';
3
3
  export interface ITenantHrEmergencyContact {
4
4
  name: string;
@@ -35,6 +35,7 @@ export interface ITenantHrEmployee {
35
35
  hr_working_days_per_month: number;
36
36
  hr_hours_per_working_day: number;
37
37
  hr_overtime_multiplier: number;
38
+ leave_allowance?: Partial<Record<HR_LEAVE_TYPE_ENUM, number>>;
38
39
  docs: Record<HR_DOCUMENT_TYPE_ENUM, ITenantHrEmployeeDocument>;
39
40
  notes?: string | null;
40
41
  createdAt: Date;
@@ -0,0 +1,18 @@
1
+ import { HR_LEAVE_STATUS_ENUM, HR_LEAVE_TYPE_ENUM } from '../../constants';
2
+ export interface ITenantHrLeaveRequest {
3
+ _id: string;
4
+ tenant_id: string;
5
+ employee_id: string;
6
+ leave_type: HR_LEAVE_TYPE_ENUM;
7
+ start_date: Date;
8
+ end_date: Date;
9
+ is_half_day: boolean;
10
+ total_days: number;
11
+ reason: string;
12
+ status: HR_LEAVE_STATUS_ENUM;
13
+ reviewed_by?: string | null;
14
+ reviewed_at?: Date | null;
15
+ rejection_reason?: string | null;
16
+ createdAt: Date;
17
+ updatedAt: Date | null;
18
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.2.776",
3
+ "version": "0.2.777",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",