package com.izouma.jiashanxia.domain;

import com.izouma.jiashanxia.enums.OrderInfoStatus;
import com.izouma.jiashanxia.enums.PayMethod;
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.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Entity
@ApiModel(value = "订单")
public class OrderInfo extends BaseEntity {

    private Long userId;

    @ApiModelProperty(value = "支付方式")
    private PayMethod payMethod;

    @ApiModelProperty(value = "支付时间")
    private LocalDateTime paidAt;

    @Enumerated(EnumType.STRING)
    @ApiModelProperty(value = "订单状态")
    private OrderInfoStatus status;

    @ApiModelProperty(value = "订单号")
    private String orderNumber;

    @ApiModelProperty(value = "交易单号")
    private String transactionId;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "充值套餐")
    private Long setMealId;

    @ApiModelProperty(value = "价钱")
    private BigDecimal price;

}
