@empleado-juan/commons 1.0.2 → 1.0.3
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/types/events.d.ts +62 -0
- package/dist/types/events.d.ts.map +1 -1
- package/dist/types/events.js +5 -0
- package/package.json +7 -2
- package/src/types/events.ts +67 -0
package/dist/types/events.d.ts
CHANGED
|
@@ -54,9 +54,69 @@ export interface ScheduleCreatedEvent {
|
|
|
54
54
|
isActive: boolean;
|
|
55
55
|
data: any;
|
|
56
56
|
}
|
|
57
|
+
export interface AttendanceDiscardedEvent {
|
|
58
|
+
id: string;
|
|
59
|
+
clientId: string;
|
|
60
|
+
employeeId: string;
|
|
61
|
+
branchId: string;
|
|
62
|
+
status: 'DISCARDED';
|
|
63
|
+
discardedAt: string;
|
|
64
|
+
discardedById?: string;
|
|
65
|
+
discardReason?: string;
|
|
66
|
+
data: any;
|
|
67
|
+
}
|
|
68
|
+
export interface AttendanceRestoredEvent {
|
|
69
|
+
id: string;
|
|
70
|
+
clientId: string;
|
|
71
|
+
employeeId: string;
|
|
72
|
+
branchId: string;
|
|
73
|
+
status: 'ACTIVE';
|
|
74
|
+
data: any;
|
|
75
|
+
}
|
|
76
|
+
export interface AttendanceDeletedEvent {
|
|
77
|
+
id: string;
|
|
78
|
+
clientId: string;
|
|
79
|
+
employeeId: string;
|
|
80
|
+
branchId: string;
|
|
81
|
+
}
|
|
82
|
+
export interface IncidenceStatusChangedEvent {
|
|
83
|
+
id: string;
|
|
84
|
+
clientId: string;
|
|
85
|
+
employeeId: string;
|
|
86
|
+
branchId: string;
|
|
87
|
+
category: string;
|
|
88
|
+
type: string;
|
|
89
|
+
status: string;
|
|
90
|
+
previousStatus: string;
|
|
91
|
+
resolution?: string;
|
|
92
|
+
resolvedAt?: string;
|
|
93
|
+
resolvedBy?: string;
|
|
94
|
+
date: string;
|
|
95
|
+
data: any;
|
|
96
|
+
}
|
|
97
|
+
export interface PayrollRunFinalizedEvent {
|
|
98
|
+
id: string;
|
|
99
|
+
clientId: string;
|
|
100
|
+
payrollGroupId: string;
|
|
101
|
+
periodYear: number;
|
|
102
|
+
periodNumber: number;
|
|
103
|
+
status: string;
|
|
104
|
+
employeeCount: number;
|
|
105
|
+
totalGrossCents: number;
|
|
106
|
+
totalDeductionsCents: number;
|
|
107
|
+
totalNetCents: number;
|
|
108
|
+
totalEmployerCents: number;
|
|
109
|
+
approvedBy?: string;
|
|
110
|
+
approvedAt?: string;
|
|
111
|
+
paidAt?: string;
|
|
112
|
+
data: any;
|
|
113
|
+
}
|
|
57
114
|
export declare const EVENT_TOPICS: {
|
|
58
115
|
readonly ATTENDANCE_CREATED: "attendance-created";
|
|
59
116
|
readonly ATTENDANCE_UPDATED: "attendance-updated";
|
|
117
|
+
readonly ATTENDANCE_DISCARDED: "attendance-discarded";
|
|
118
|
+
readonly ATTENDANCE_RESTORED: "attendance-restored";
|
|
119
|
+
readonly ATTENDANCE_DELETED: "attendance-deleted";
|
|
60
120
|
readonly EMPLOYEE_CREATED: "employee-created";
|
|
61
121
|
readonly EMPLOYEE_UPDATED: "employee-updated";
|
|
62
122
|
readonly EMPLOYEE_DELETED: "employee-deleted";
|
|
@@ -64,6 +124,8 @@ export declare const EVENT_TOPICS: {
|
|
|
64
124
|
readonly COMPENSATION_UPDATED: "compensation-updated";
|
|
65
125
|
readonly SCHEDULE_CREATED: "schedule-created";
|
|
66
126
|
readonly SCHEDULE_UPDATED: "schedule-updated";
|
|
127
|
+
readonly INCIDENCE_STATUS_CHANGED: "incidence-status-changed";
|
|
128
|
+
readonly PAYROLL_RUN_FINALIZED: "payroll-run-finalized";
|
|
67
129
|
};
|
|
68
130
|
export type EventTopic = typeof EVENT_TOPICS[keyof typeof EVENT_TOPICS];
|
|
69
131
|
//# sourceMappingURL=events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/types/events.ts"],"names":[],"mappings":"AAAA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AAO,YAAY,CAAC,CAAC"}
|
package/dist/types/events.js
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
export const EVENT_TOPICS = {
|
|
7
7
|
ATTENDANCE_CREATED: 'attendance-created',
|
|
8
8
|
ATTENDANCE_UPDATED: 'attendance-updated',
|
|
9
|
+
ATTENDANCE_DISCARDED: 'attendance-discarded',
|
|
10
|
+
ATTENDANCE_RESTORED: 'attendance-restored',
|
|
11
|
+
ATTENDANCE_DELETED: 'attendance-deleted',
|
|
9
12
|
EMPLOYEE_CREATED: 'employee-created',
|
|
10
13
|
EMPLOYEE_UPDATED: 'employee-updated',
|
|
11
14
|
EMPLOYEE_DELETED: 'employee-deleted',
|
|
@@ -13,4 +16,6 @@ export const EVENT_TOPICS = {
|
|
|
13
16
|
COMPENSATION_UPDATED: 'compensation-updated',
|
|
14
17
|
SCHEDULE_CREATED: 'schedule-created',
|
|
15
18
|
SCHEDULE_UPDATED: 'schedule-updated',
|
|
19
|
+
INCIDENCE_STATUS_CHANGED: 'incidence-status-changed',
|
|
20
|
+
PAYROLL_RUN_FINALIZED: 'payroll-run-finalized',
|
|
16
21
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empleado-juan/commons",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Shared code between frontend and backend services",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
"dev": "tsc --watch",
|
|
11
11
|
"clean": "rm -rf dist"
|
|
12
12
|
},
|
|
13
|
-
"keywords": [
|
|
13
|
+
"keywords": [
|
|
14
|
+
"shared",
|
|
15
|
+
"types",
|
|
16
|
+
"enums",
|
|
17
|
+
"validators"
|
|
18
|
+
],
|
|
14
19
|
"author": "Empleado Juan Team",
|
|
15
20
|
"license": "MIT",
|
|
16
21
|
"dependencies": {
|
package/src/types/events.ts
CHANGED
|
@@ -60,10 +60,75 @@ export interface ScheduleCreatedEvent {
|
|
|
60
60
|
data: any;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
export interface AttendanceDiscardedEvent {
|
|
64
|
+
id: string;
|
|
65
|
+
clientId: string;
|
|
66
|
+
employeeId: string;
|
|
67
|
+
branchId: string;
|
|
68
|
+
status: 'DISCARDED';
|
|
69
|
+
discardedAt: string;
|
|
70
|
+
discardedById?: string;
|
|
71
|
+
discardReason?: string;
|
|
72
|
+
data: any;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface AttendanceRestoredEvent {
|
|
76
|
+
id: string;
|
|
77
|
+
clientId: string;
|
|
78
|
+
employeeId: string;
|
|
79
|
+
branchId: string;
|
|
80
|
+
status: 'ACTIVE';
|
|
81
|
+
data: any;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface AttendanceDeletedEvent {
|
|
85
|
+
id: string;
|
|
86
|
+
clientId: string;
|
|
87
|
+
employeeId: string;
|
|
88
|
+
branchId: string;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface IncidenceStatusChangedEvent {
|
|
92
|
+
id: string;
|
|
93
|
+
clientId: string;
|
|
94
|
+
employeeId: string;
|
|
95
|
+
branchId: string;
|
|
96
|
+
category: string;
|
|
97
|
+
type: string;
|
|
98
|
+
status: string;
|
|
99
|
+
previousStatus: string;
|
|
100
|
+
resolution?: string;
|
|
101
|
+
resolvedAt?: string;
|
|
102
|
+
resolvedBy?: string;
|
|
103
|
+
date: string;
|
|
104
|
+
data: any;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export interface PayrollRunFinalizedEvent {
|
|
108
|
+
id: string;
|
|
109
|
+
clientId: string;
|
|
110
|
+
payrollGroupId: string;
|
|
111
|
+
periodYear: number;
|
|
112
|
+
periodNumber: number;
|
|
113
|
+
status: string;
|
|
114
|
+
employeeCount: number;
|
|
115
|
+
totalGrossCents: number;
|
|
116
|
+
totalDeductionsCents: number;
|
|
117
|
+
totalNetCents: number;
|
|
118
|
+
totalEmployerCents: number;
|
|
119
|
+
approvedBy?: string;
|
|
120
|
+
approvedAt?: string;
|
|
121
|
+
paidAt?: string;
|
|
122
|
+
data: any;
|
|
123
|
+
}
|
|
124
|
+
|
|
63
125
|
// Event topic names
|
|
64
126
|
export const EVENT_TOPICS = {
|
|
65
127
|
ATTENDANCE_CREATED: 'attendance-created',
|
|
66
128
|
ATTENDANCE_UPDATED: 'attendance-updated',
|
|
129
|
+
ATTENDANCE_DISCARDED: 'attendance-discarded',
|
|
130
|
+
ATTENDANCE_RESTORED: 'attendance-restored',
|
|
131
|
+
ATTENDANCE_DELETED: 'attendance-deleted',
|
|
67
132
|
EMPLOYEE_CREATED: 'employee-created',
|
|
68
133
|
EMPLOYEE_UPDATED: 'employee-updated',
|
|
69
134
|
EMPLOYEE_DELETED: 'employee-deleted',
|
|
@@ -71,6 +136,8 @@ export const EVENT_TOPICS = {
|
|
|
71
136
|
COMPENSATION_UPDATED: 'compensation-updated',
|
|
72
137
|
SCHEDULE_CREATED: 'schedule-created',
|
|
73
138
|
SCHEDULE_UPDATED: 'schedule-updated',
|
|
139
|
+
INCIDENCE_STATUS_CHANGED: 'incidence-status-changed',
|
|
140
|
+
PAYROLL_RUN_FINALIZED: 'payroll-run-finalized',
|
|
74
141
|
} as const;
|
|
75
142
|
|
|
76
143
|
export type EventTopic = typeof EVENT_TOPICS[keyof typeof EVENT_TOPICS];
|