// 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"
)

// EventV2CorehrJobChangeUpdatedV1 在异动审批状态变更、异动生效时都会触发该事件, 审批结果产生的场景包括撤销、审批通过、审批拒绝。
//
// doc: https://open.feishu.cn/document/uAjLw4CM/ukTMukTMukTM/reference/corehr-v1/job_change/events/updated
// new doc: https://open.feishu.cn/document/server-docs/corehr-v1/job_change/updated
func (r *EventCallbackService) HandlerEventV2CorehrJobChangeUpdatedV1(f EventV2CorehrJobChangeUpdatedV1Handler) {
	r.cli.eventHandler.eventV2CorehrJobChangeUpdatedV1Handler = f
}

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

// EventV2CorehrJobChangeUpdatedV1 ...
type EventV2CorehrJobChangeUpdatedV1 struct {
	EmploymentID                   string                                       `json:"employment_id,omitempty"`                     // 雇员ID
	TargetUserID                   *EventV2CorehrJobChangeUpdatedV1TargetUserID `json:"target_user_id,omitempty"`                    // 用户 ID
	JobChangeID                    string                                       `json:"job_change_id,omitempty"`                     // 异动记录 id
	TransferMode                   int64                                        `json:"transfer_mode,omitempty"`                     // 异动属性/方式, 可选值有: 1: 直接异动: 无需审批的异动, 操作后异动状态为「无需审批」, 2: 发起异动: 需要走异动流程
	TransferTypeUniqueIdentifier   string                                       `json:"transfer_type_unique_identifier,omitempty"`   // 异动类型唯一标识
	TransferReasonUniqueIdentifier string                                       `json:"transfer_reason_unique_identifier,omitempty"` // 异动原因唯一标识
	ProcessID                      string                                       `json:"process_id,omitempty"`                        // 异动发起后的审批流程 id, 如果是直接异动, 则无需要审批流程id
	EffectiveDate                  string                                       `json:"effective_date,omitempty"`                    // 异动生效日期
	Status                         int64                                        `json:"status,omitempty"`                            // 异动状态, 可选值有: 1: 异动发起 = 审批中状态, 2: 已撤销, 3: 已拒绝, 4: 审批通过, 5: 已生效（到了生效日期后就生效）, 6: 无需审批
	TransferKey                    string                                       `json:"transfer_key,omitempty"`                      // 异动记录标识符
}

// EventV2CorehrJobChangeUpdatedV1TargetUserID ...
type EventV2CorehrJobChangeUpdatedV1TargetUserID 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
}
