package beilv.common.constant;

import lombok.*;
import org.apache.ibatis.type.Alias;

import java.math.BigDecimal;
import java.math.RoundingMode;

@Setter
@Getter
@NoArgsConstructor
@ToString
@Alias("PriceOptions")
public class PriceOptions {
    private BigDecimal originalPrice;
    private BigDecimal memberPrice;

    public PriceOptions(BigDecimal originalPrice, BigDecimal coefficient) {
        this.originalPrice = originalPrice;
        this.memberPrice = originalPrice.multiply(coefficient).setScale(2, RoundingMode.HALF_UP);
    }
}
