@managesome/eposmatic-toolkit 0.4.22 → 0.4.23

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.
@@ -34,10 +34,6 @@ export const MATERIALIZED_RIDER_DAILY_REPORTS_COLLECTION_INDEXES = {
34
34
  _id: { _id: 1 },
35
35
  rider_id__local_date: { rider_id: 1, local_date: 1 },
36
36
  };
37
- MaterializedRiderDailyReportSchema.index(MATERIALIZED_RIDER_DAILY_REPORTS_COLLECTION_INDEXES.rider_id__local_date, {
38
- unique: true,
39
- name: 'rider_id__local_date',
40
- });
41
37
  export const MATERIALIZED_RIDER_DAILY_REPORTS_INDEX_OPTIONS = [
42
38
  {
43
39
  key: MATERIALIZED_RIDER_DAILY_REPORTS_COLLECTION_INDEXES.rider_id__local_date,
@@ -54,6 +54,11 @@ export const TenantHrAttendanceRecordSchema = new Schema({
54
54
  required: true,
55
55
  match: /^\d{4}-\d{2}-\d{2}$/,
56
56
  },
57
+ schedule_id: {
58
+ type: String,
59
+ required: true,
60
+ ref: 'tenant_hr_shift_schedules',
61
+ },
57
62
  clock_time: {
58
63
  type: [hrClockTimeSchema],
59
64
  default: [],
@@ -76,10 +81,6 @@ export const TenantHrAttendanceRecordSchema = new Schema({
76
81
  enum: ALL_HR_ATTENDANCE_STATUS_NAMES,
77
82
  default: HR_ATTENDANCE_STATUS_ENUM.PRESENT,
78
83
  },
79
- notes: {
80
- type: String,
81
- default: null,
82
- },
83
84
  createdAt: {
84
85
  type: Schema.Types.Date,
85
86
  required: true,
@@ -96,6 +97,4 @@ export const TenantHrAttendanceRecordSchema = new Schema({
96
97
  versionKey: false,
97
98
  minimize: false,
98
99
  });
99
- TenantHrAttendanceRecordSchema.index({ tenant_id: 1, employee_id: 1, attendance_date: 1 }, { unique: true });
100
- TenantHrAttendanceRecordSchema.index({ tenant_id: 1, attendance_date: 1 });
101
100
  export const TENANT_HR_ATTENDANCE_RECORDS_COLLECTION_NAME = 'tenant_hr_attendance_records';
@@ -60,7 +60,7 @@ export const TenantHrShiftScheduleSchema = new Schema({
60
60
  type: String,
61
61
  default: null,
62
62
  },
63
- template_id: {
63
+ shift_id: {
64
64
  type: String,
65
65
  default: null,
66
66
  ref: 'tenant_hr_shifts',
@@ -37,10 +37,6 @@ exports.MATERIALIZED_RIDER_DAILY_REPORTS_COLLECTION_INDEXES = {
37
37
  _id: { _id: 1 },
38
38
  rider_id__local_date: { rider_id: 1, local_date: 1 },
39
39
  };
40
- exports.MaterializedRiderDailyReportSchema.index(exports.MATERIALIZED_RIDER_DAILY_REPORTS_COLLECTION_INDEXES.rider_id__local_date, {
41
- unique: true,
42
- name: 'rider_id__local_date',
43
- });
44
40
  exports.MATERIALIZED_RIDER_DAILY_REPORTS_INDEX_OPTIONS = [
45
41
  {
46
42
  key: exports.MATERIALIZED_RIDER_DAILY_REPORTS_COLLECTION_INDEXES.rider_id__local_date,
@@ -13,7 +13,6 @@ export declare const TenantHrAttendanceRecordSchema: Schema<any, import("mongoos
13
13
  updatedAt: NativeDate;
14
14
  tenant_id: string;
15
15
  status: HR_ATTENDANCE_STATUS_ENUM;
16
- notes: string;
17
16
  employee_id: string;
18
17
  break_time: import("mongoose").Types.DocumentArray<{
19
18
  start_time: number;
@@ -26,6 +25,7 @@ export declare const TenantHrAttendanceRecordSchema: Schema<any, import("mongoos
26
25
  end_time: number;
27
26
  }>;
28
27
  attendance_date: string;
28
+ schedule_id: string;
29
29
  clock_time: import("mongoose").Types.DocumentArray<{
30
30
  type: import("../../constants").HR_CLOCK_TIME_TYPE_ENUM;
31
31
  method: import("../../constants").HR_CHECK_IN_METHOD_ENUM;
@@ -50,7 +50,6 @@ export declare const TenantHrAttendanceRecordSchema: Schema<any, import("mongoos
50
50
  updatedAt: NativeDate;
51
51
  tenant_id: string;
52
52
  status: HR_ATTENDANCE_STATUS_ENUM;
53
- notes: string;
54
53
  employee_id: string;
55
54
  break_time: import("mongoose").Types.DocumentArray<{
56
55
  start_time: number;
@@ -63,6 +62,7 @@ export declare const TenantHrAttendanceRecordSchema: Schema<any, import("mongoos
63
62
  end_time: number;
64
63
  }>;
65
64
  attendance_date: string;
65
+ schedule_id: string;
66
66
  clock_time: import("mongoose").Types.DocumentArray<{
67
67
  type: import("../../constants").HR_CLOCK_TIME_TYPE_ENUM;
68
68
  method: import("../../constants").HR_CHECK_IN_METHOD_ENUM;
@@ -87,7 +87,6 @@ export declare const TenantHrAttendanceRecordSchema: Schema<any, import("mongoos
87
87
  updatedAt: NativeDate;
88
88
  tenant_id: string;
89
89
  status: HR_ATTENDANCE_STATUS_ENUM;
90
- notes: string;
91
90
  employee_id: string;
92
91
  break_time: import("mongoose").Types.DocumentArray<{
93
92
  start_time: number;
@@ -100,6 +99,7 @@ export declare const TenantHrAttendanceRecordSchema: Schema<any, import("mongoos
100
99
  end_time: number;
101
100
  }>;
102
101
  attendance_date: string;
102
+ schedule_id: string;
103
103
  clock_time: import("mongoose").Types.DocumentArray<{
104
104
  type: import("../../constants").HR_CLOCK_TIME_TYPE_ENUM;
105
105
  method: import("../../constants").HR_CHECK_IN_METHOD_ENUM;
@@ -57,6 +57,11 @@ exports.TenantHrAttendanceRecordSchema = new mongoose_1.Schema({
57
57
  required: true,
58
58
  match: /^\d{4}-\d{2}-\d{2}$/,
59
59
  },
60
+ schedule_id: {
61
+ type: String,
62
+ required: true,
63
+ ref: 'tenant_hr_shift_schedules',
64
+ },
60
65
  clock_time: {
61
66
  type: [hrClockTimeSchema],
62
67
  default: [],
@@ -79,10 +84,6 @@ exports.TenantHrAttendanceRecordSchema = new mongoose_1.Schema({
79
84
  enum: constants_1.ALL_HR_ATTENDANCE_STATUS_NAMES,
80
85
  default: constants_1.HR_ATTENDANCE_STATUS_ENUM.PRESENT,
81
86
  },
82
- notes: {
83
- type: String,
84
- default: null,
85
- },
86
87
  createdAt: {
87
88
  type: mongoose_1.Schema.Types.Date,
88
89
  required: true,
@@ -99,6 +100,4 @@ exports.TenantHrAttendanceRecordSchema = new mongoose_1.Schema({
99
100
  versionKey: false,
100
101
  minimize: false,
101
102
  });
102
- exports.TenantHrAttendanceRecordSchema.index({ tenant_id: 1, employee_id: 1, attendance_date: 1 }, { unique: true });
103
- exports.TenantHrAttendanceRecordSchema.index({ tenant_id: 1, attendance_date: 1 });
104
103
  exports.TENANT_HR_ATTENDANCE_RECORDS_COLLECTION_NAME = 'tenant_hr_attendance_records';
@@ -22,7 +22,7 @@ export declare const TenantHrShiftScheduleSchema: Schema<any, import("mongoose")
22
22
  day_indexes: string[];
23
23
  notes: string;
24
24
  employee_id: string;
25
- template_id: string;
25
+ shift_id: string;
26
26
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
27
27
  createdAt: NativeDate;
28
28
  updatedAt: NativeDate;
@@ -41,7 +41,7 @@ export declare const TenantHrShiftScheduleSchema: Schema<any, import("mongoose")
41
41
  day_indexes: string[];
42
42
  notes: string;
43
43
  employee_id: string;
44
- template_id: string;
44
+ shift_id: string;
45
45
  }>> & import("mongoose").FlatRecord<{
46
46
  createdAt: NativeDate;
47
47
  updatedAt: NativeDate;
@@ -60,7 +60,7 @@ export declare const TenantHrShiftScheduleSchema: Schema<any, import("mongoose")
60
60
  day_indexes: string[];
61
61
  notes: string;
62
62
  employee_id: string;
63
- template_id: string;
63
+ shift_id: string;
64
64
  }> & Required<{
65
65
  _id: import("mongoose").Types.ObjectId;
66
66
  }> & {
@@ -63,7 +63,7 @@ exports.TenantHrShiftScheduleSchema = new mongoose_1.Schema({
63
63
  type: String,
64
64
  default: null,
65
65
  },
66
- template_id: {
66
+ shift_id: {
67
67
  type: String,
68
68
  default: null,
69
69
  ref: 'tenant_hr_shifts',
@@ -13,12 +13,12 @@ export interface ITenantHrAttendanceRecord {
13
13
  tenant_id: string;
14
14
  employee_id: string;
15
15
  attendance_date: string;
16
+ schedule_id: string;
16
17
  clock_time: ITenantHrClockTime[];
17
18
  break_time: ITenantHrBreakTime[];
18
19
  total_break_time: number;
19
20
  total_worked_time: number;
20
21
  status: HR_ATTENDANCE_STATUS_ENUM;
21
- notes?: string | null;
22
22
  createdAt: Date;
23
23
  updatedAt: Date | null;
24
24
  }
@@ -12,7 +12,7 @@ export interface ITenantHrShiftSchedule {
12
12
  type: HR_SHIFT_TYPE_ENUM;
13
13
  status: HR_SHIFT_STATUS_ENUM;
14
14
  notes?: string | null;
15
- template_id?: string | null;
15
+ shift_id?: string | null;
16
16
  createdAt: Date;
17
17
  updatedAt: Date | null;
18
18
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@managesome/eposmatic-toolkit",
3
- "version": "0.4.22",
3
+ "version": "0.4.23",
4
4
  "description": "A Toolkit Library for Eposmatic",
5
5
  "main": "lib/index.js",
6
6
  "module": "esm/index.js",