reject_task_record.go 1.1 KB
package domain

import "time"

// 驳回任务记录
type RejectTaskRecord struct {
	// 驳回任务记录ID
	RejectTaskRecordId int64 `json:"rejectTaskRecordId"`
	// 任务
	Task *Task `json:"task"`
	// 操作人
	Operator *EmployeeInfo `json:"operator"`
	// 驳回理由
	RejectReason string `json:"rejectReason"`
	// 创建时间
	CreateTime time.Time `json:"createTime"`
}

type RejectTaskRecordRepository interface {
	Save(rejectTaskRecord *RejectTaskRecord) (*RejectTaskRecord, error)
	Remove(rejectTaskRecord *RejectTaskRecord) (*RejectTaskRecord, error)
	FindOne(queryOptions map[string]interface{}) (*RejectTaskRecord, error)
	Find(queryOptions map[string]interface{}) (int64, []*RejectTaskRecord, error)
}

func (rejectTaskRecord *RejectTaskRecord) Identify() interface{} {
	if rejectTaskRecord.RejectTaskRecordId == 0 {
		return nil
	}
	return rejectTaskRecord.RejectTaskRecordId
}

func (rejectTaskRecord *RejectTaskRecord) Update(data map[string]interface{}) error {
	if rejectReason, ok := data["rejectReason"]; ok && rejectReason != "" {
		rejectTaskRecord.RejectReason = rejectReason.(string)
	}
	return nil
}