ATTV1 实现考勤统一入口与企微同步
这个提交包含在:
@@ -2,6 +2,7 @@ const NOTIFICATION_DOMAIN_SCOPES = Object.freeze({
|
||||
workflow: 'workflow',
|
||||
reimbursement: 'reimbursement',
|
||||
leave: 'leave',
|
||||
attendance: 'attendance',
|
||||
procurement: 'procurement',
|
||||
travel: 'travel',
|
||||
asset: 'asset',
|
||||
@@ -18,6 +19,8 @@ const NOTIFICATION_TYPES = Object.freeze({
|
||||
reimbursementPaid: 'reimbursement.paid',
|
||||
leaveApproved: 'leave.approved',
|
||||
leaveRejected: 'leave.rejected',
|
||||
attendanceCorrectionApproved: 'attendance_correction.approved',
|
||||
attendanceCorrectionRejected: 'attendance_correction.rejected',
|
||||
purchaseRequestApproved: 'purchase_request.approved',
|
||||
purchaseRequestRejected: 'purchase_request.rejected',
|
||||
travelRequestApproved: 'travel_request.approved',
|
||||
@@ -38,6 +41,8 @@ const IM_SUPPORTED_NOTIFICATION_TYPES = Object.freeze([
|
||||
NOTIFICATION_TYPES.reimbursementPaid,
|
||||
NOTIFICATION_TYPES.leaveApproved,
|
||||
NOTIFICATION_TYPES.leaveRejected,
|
||||
NOTIFICATION_TYPES.attendanceCorrectionApproved,
|
||||
NOTIFICATION_TYPES.attendanceCorrectionRejected,
|
||||
NOTIFICATION_TYPES.purchaseRequestApproved,
|
||||
NOTIFICATION_TYPES.purchaseRequestRejected,
|
||||
NOTIFICATION_TYPES.travelRequestApproved,
|
||||
@@ -58,6 +63,8 @@ const NOTIFICATION_TYPE_TO_DOMAIN_SCOPE = Object.freeze({
|
||||
[NOTIFICATION_TYPES.reimbursementPaid]: NOTIFICATION_DOMAIN_SCOPES.reimbursement,
|
||||
[NOTIFICATION_TYPES.leaveApproved]: NOTIFICATION_DOMAIN_SCOPES.leave,
|
||||
[NOTIFICATION_TYPES.leaveRejected]: NOTIFICATION_DOMAIN_SCOPES.leave,
|
||||
[NOTIFICATION_TYPES.attendanceCorrectionApproved]: NOTIFICATION_DOMAIN_SCOPES.attendance,
|
||||
[NOTIFICATION_TYPES.attendanceCorrectionRejected]: NOTIFICATION_DOMAIN_SCOPES.attendance,
|
||||
[NOTIFICATION_TYPES.purchaseRequestApproved]: NOTIFICATION_DOMAIN_SCOPES.procurement,
|
||||
[NOTIFICATION_TYPES.purchaseRequestRejected]: NOTIFICATION_DOMAIN_SCOPES.procurement,
|
||||
[NOTIFICATION_TYPES.travelRequestApproved]: NOTIFICATION_DOMAIN_SCOPES.travel,
|
||||
@@ -72,6 +79,7 @@ const TARGET_TYPE_TO_DOMAIN_SCOPE = Object.freeze({
|
||||
workflow_task: NOTIFICATION_DOMAIN_SCOPES.workflow,
|
||||
reimbursement_form: NOTIFICATION_DOMAIN_SCOPES.reimbursement,
|
||||
leave_request: NOTIFICATION_DOMAIN_SCOPES.leave,
|
||||
attendance_correction: NOTIFICATION_DOMAIN_SCOPES.attendance,
|
||||
purchase_request: NOTIFICATION_DOMAIN_SCOPES.procurement,
|
||||
travel_request: NOTIFICATION_DOMAIN_SCOPES.travel,
|
||||
asset_card: NOTIFICATION_DOMAIN_SCOPES.asset,
|
||||
|
||||
@@ -16,6 +16,12 @@ const LEAVE_SELF_SERVICE_PERMISSIONS = [
|
||||
"leave.submit",
|
||||
];
|
||||
|
||||
const ATTENDANCE_SELF_SERVICE_PERMISSIONS = [
|
||||
"attendance.create",
|
||||
"attendance.view_own",
|
||||
"attendance.submit",
|
||||
];
|
||||
|
||||
const PROCUREMENT_SELF_SERVICE_PERMISSIONS = [
|
||||
"procurement.create",
|
||||
"procurement.view_own",
|
||||
@@ -37,6 +43,7 @@ const MASTERDATA_MANAGE_PERMISSIONS = ["masterdata.manage"];
|
||||
const EMPLOYEE_BASE_PERMISSIONS = [
|
||||
...EXPENSE_SELF_SERVICE_PERMISSIONS,
|
||||
...LEAVE_SELF_SERVICE_PERMISSIONS,
|
||||
...ATTENDANCE_SELF_SERVICE_PERMISSIONS,
|
||||
...TRAVEL_SELF_SERVICE_PERMISSIONS,
|
||||
...PROJECT_SELF_SERVICE_PERMISSIONS,
|
||||
];
|
||||
@@ -72,6 +79,24 @@ const ENTITY_PERMISSION_MAP = {
|
||||
approve: "leave.approve",
|
||||
manage: "leave.manage",
|
||||
},
|
||||
attendance_correction: {
|
||||
create: "attendance.create",
|
||||
view_own: "attendance.view_own",
|
||||
view_all: "attendance.view_all",
|
||||
submit: "attendance.submit",
|
||||
approve: "attendance.approve",
|
||||
manage: "attendance.manage",
|
||||
sync: "attendance.sync",
|
||||
},
|
||||
attendance: {
|
||||
create: "attendance.create",
|
||||
view_own: "attendance.view_own",
|
||||
view_all: "attendance.view_all",
|
||||
submit: "attendance.submit",
|
||||
approve: "attendance.approve",
|
||||
manage: "attendance.manage",
|
||||
sync: "attendance.sync",
|
||||
},
|
||||
purchase_request: {
|
||||
create: "procurement.create",
|
||||
view_own: "procurement.view_own",
|
||||
@@ -125,6 +150,8 @@ const ROLE_PERMISSIONS = {
|
||||
"expense.view_all",
|
||||
"leave.approve",
|
||||
"leave.view_all",
|
||||
"attendance.approve",
|
||||
"attendance.view_all",
|
||||
"procurement.approve",
|
||||
"procurement.view_all",
|
||||
"travel.approve",
|
||||
@@ -145,6 +172,8 @@ const ROLE_PERMISSIONS = {
|
||||
"expense.view_all",
|
||||
"leave.approve",
|
||||
"leave.view_all",
|
||||
"attendance.approve",
|
||||
"attendance.view_all",
|
||||
"procurement.approve",
|
||||
"procurement.view_all",
|
||||
"travel.approve",
|
||||
@@ -168,6 +197,7 @@ const ROLE_PERMISSIONS = {
|
||||
"travel.view_all",
|
||||
"travel.payment.manage",
|
||||
"asset.view_all",
|
||||
"attendance.view_all",
|
||||
],
|
||||
finance_mgr: [
|
||||
...EMPLOYEE_BASE_PERMISSIONS,
|
||||
@@ -198,6 +228,9 @@ const ROLE_PERMISSIONS = {
|
||||
"payment.batch.manage",
|
||||
"risk.review.manage",
|
||||
"project.view_all",
|
||||
"attendance.view_all",
|
||||
"attendance.manage",
|
||||
"attendance.sync",
|
||||
],
|
||||
administration: [
|
||||
"expense.proxy_submit",
|
||||
@@ -212,11 +245,18 @@ const ROLE_PERMISSIONS = {
|
||||
"asset.transfer",
|
||||
"project.view_all",
|
||||
"project.manage",
|
||||
"attendance.view_all",
|
||||
"attendance.manage",
|
||||
],
|
||||
hr: [
|
||||
...LEAVE_SELF_SERVICE_PERMISSIONS,
|
||||
...ATTENDANCE_SELF_SERVICE_PERMISSIONS,
|
||||
"leave.view_all",
|
||||
"leave.manage",
|
||||
"attendance.approve",
|
||||
"attendance.view_all",
|
||||
"attendance.manage",
|
||||
"attendance.sync",
|
||||
"system.users",
|
||||
"system.users_sensitive",
|
||||
"expense.view_all",
|
||||
|
||||
在新工单中引用
屏蔽一个用户