package com.mosquito.project.domain;

import java.util.Objects;

// 代表奖励的简单类
public class Reward {
    private RewardType rewardType;
    private int points;
    private String couponBatchId;

    public Reward(int points) {
        this.rewardType = RewardType.POINTS;
        this.points = points;
    }

    public Reward(String couponBatchId) {
        this.rewardType = RewardType.COUPON;
        this.couponBatchId = couponBatchId;
    }

    public RewardType getRewardType() {
        return rewardType;
    }

    public int getPoints() {
        return points;
    }

    public String getCouponBatchId() {
        return couponBatchId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Reward reward = (Reward) o;
        return points == reward.points && rewardType == reward.rewardType && Objects.equals(couponBatchId, reward.couponBatchId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(rewardType, points, couponBatchId);
    }
}
