package com.izouma.nineth.domain;

import com.izouma.nineth.annotations.Searchable;
import com.izouma.nineth.enums.FundChangeStatus;
import com.izouma.nineth.enums.FundChangeType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;


@Data
@Entity
@Table(indexes = {
        @Index(columnList = "userId"),
        @Index(columnList = "orderNo"),
})
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel("用户资金变动")
public class UserFundChangeLog extends BaseEntity {

    @ApiModelProperty("用户ID")
    private Long userId;

    @ApiModelProperty("用户资金账户ID")
    private Long userFundAccountId;

    @ApiModelProperty("订单编号")
    private String orderNo;

    @ApiModelProperty("变动金额")
    private BigDecimal amount;

    @ApiModelProperty("变动类型")
    @Enumerated(EnumType.STRING)
    private FundChangeType changeType;

    @ApiModelProperty("状态")
    @Enumerated(EnumType.STRING)
    private FundChangeStatus status;

    @ApiModelProperty("描述")
    private String description;

    @ApiModelProperty("下单时间")
    private LocalDateTime orderTime;

    @ApiModelProperty("完成时间")
    private LocalDateTime finishTime;





}
