package org.dromara.mall.trade.domain.bo;

import io.github.linpeilie.annotations.AutoMapper;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.mall.trade.domain.MallOrderCoupon;

/**
 * 订单优惠券使用记录业务对象 mall_order_coupon
 *
 * @author pengles
 */
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = MallOrderCoupon.class, reverseConvertGenerate = false)
public class MallOrderCouponBo extends BaseEntity {

    /**
     * ID
     */
    private Long id;

    /**
     * 订单ID
     */
    @NotNull(message = "订单ID不能为空")
    private Long orderId;

    /**
     * 订单号
     */
    private String orderNo;

    /**
     * 优惠券ID
     */
    @NotNull(message = "优惠券ID不能为空")
    private Long couponId;

    /**
     * 用户优惠券ID
     */
    @NotNull(message = "用户优惠券ID不能为空")
    private Long couponUserId;

    /**
     * 优惠金额(分)
     */
    @NotNull(message = "优惠金额不能为空")
    @Min(value = 0, message = "优惠金额不能为负数")
    private Integer discountAmount;

}
