// Code generated by lark_sdk_gen. DO NOT EDIT.
/**
 * Copyright 2022 chyroc
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package lark

import (
	"context"
)

// EventV2CorehrOffboardingStatusUpdatedV2 发起离职或离职状态更新时, 触发该事件。
//
// 注: 发起「离职（无审批）」时, 会同时触发「离职发起」和「无需审批」两个状态变更的事件
// 与原事件[离职状态变更](https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/offboarding/events/updated)相比, 该事件更全且支持行鉴权。
//
// doc: https://open.larkoffice.com/document/uAjLw4CM/ukTMukTMukTM/corehr-v2/offboarding/events/status_updated
func (r *EventCallbackService) HandlerEventV2CorehrOffboardingStatusUpdatedV2(f EventV2CorehrOffboardingStatusUpdatedV2Handler) {
	r.cli.eventHandler.eventV2CorehrOffboardingStatusUpdatedV2Handler = f
}

// EventV2CorehrOffboardingStatusUpdatedV2Handler event EventV2CorehrOffboardingStatusUpdatedV2 handler
type EventV2CorehrOffboardingStatusUpdatedV2Handler func(ctx context.Context, cli *Lark, schema string, header *EventHeaderV2, event *EventV2CorehrOffboardingStatusUpdatedV2) (string, error)

// EventV2CorehrOffboardingStatusUpdatedV2 ...
type EventV2CorehrOffboardingStatusUpdatedV2 struct {
	EmploymentID  string                                               `json:"employment_id,omitempty"`  // 员工 ID
	TargetUserID  *EventV2CorehrOffboardingStatusUpdatedV2TargetUserID `json:"target_user_id,omitempty"` // 用户 ID
	OffboardingID string                                               `json:"offboarding_id,omitempty"` // 离职记录 ID
	ProcessID     string                                               `json:"process_id,omitempty"`     // 离职发起后的审批流程实例 ID
	Status        int64                                                `json:"status,omitempty"`         // 离职状态, 可选值有: 1: 离职发起/审批中, 2: 审批通过, 3: 已生效（生效日期后自动生效）, 4: 已拒绝, 5: 已撤销, 6: 无需审批
}

// EventV2CorehrOffboardingStatusUpdatedV2TargetUserID ...
type EventV2CorehrOffboardingStatusUpdatedV2TargetUserID struct {
	UnionID string `json:"union_id,omitempty"` // 用户的 union id
	UserID  string `json:"user_id,omitempty"`  // 用户的 user id, 字段权限要求: 获取用户 user ID
	OpenID  string `json:"open_id,omitempty"`  // 用户的 open id
}
