reward_rule.go 1.0 KB
package domain

import "time"

//RewardStandard 奖惩规则
type RewardRule struct {
	Id           int    `json:"id"`        //奖惩规则id
	CompanyId    int    `json:"companyId"` //企业id
	OrgId        int    `json:"orgId"`     //组织ID
	RewardTag    string `json:"rewardTag"`
	RewardNum    int    `json:"rewardNum"`
	RewardAmount string `json:"rewardAmount"`
	FaultTag     string `json:"faultTag"`
	FaultNum     int    `json:"faultNum"`
	FaultAmount  string `json:"faultAmount"`
	Remark       string `json:"remark"`
	CreatedAt    time.Time
	UpdatedAt    time.Time
}

type RewardRuleRepository interface {
	Save(param *RewardRule) (*RewardRule, error)
	FindOne(queryOptions map[string]interface{}) (*RewardRule, error)
	Find(queryOptions map[string]interface{}) (int64, []*RewardRule, error)
}

func (m *RewardRule) ValidRewardTag() bool {
	switch m.FaultTag {
	case ">":
	default:
		return false
	}
	return true
}

func (m *RewardRule) ValidFaultTag() bool {
	switch m.FaultTag {
	case ">":
	default:
		return false
	}
	return true
}