package com.izouma.dingdong.domain;

import com.izouma.dingdong.enums.FlowType;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Where;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Entity
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Where(clause = "enabled = 1")
@ApiModel(value = "平台流水记录表")
public class PlatformFlow extends BaseEntity {

    private Long userId;

    @Enumerated(EnumType.STRING)
    private FlowType type;

    private BigDecimal amount;

    private String remark;

    /*
    是否货到付款
     */
    private Boolean isCash;

    private LocalDateTime time;

    @Column(nullable = false)
    @Builder.Default
    private Boolean enabled = true;
}
