package com.cpop.mall.business.entity;

import com.cpop.core.base.entity.BaseEntity;
import com.cpop.core.base.entity.BaseInsertListener;
import com.cpop.core.base.entity.BaseUpdateListener;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import java.io.Serializable;
import java.math.BigDecimal;

import lombok.*;
import lombok.experimental.Accessors;

/**
 * 商城-商品-规格记录 实体类。
 *
 * @author DB
 * @since 2023-10-23
 */
@Data
@EqualsAndHashCode(callSuper=false)
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@Table(value = "cp_mall_product_record", onInsert = BaseInsertListener.class, onUpdate = BaseUpdateListener.class, mapperGenerateEnable = false)
public class ProductRecord extends BaseEntity implements Serializable {

    /**
     * 主键
     */
    @Id
    private String id;

    /**
     * 商品id
     */
    private String productId;

    /**
     * 规格集合
     */
    private String recordNames;

    /**
     * 数量(库存)
     */
    private Integer recordNum;

    /**
     * 记录消耗金额
     */
    private BigDecimal recordPrice;

    /**
     * 记录消耗积分
     */
    private Integer recordPoints;

    /**
     * 乐观锁标识
     */
    @Column(version = true)
    private Integer version;

    /**
     * 逻辑删除（0否1是）
     */
    @Column(isLogicDelete = true)
    private Boolean isDelete;

}
