package com.izouma.immall.domain;

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.*;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel("邀请表")
public class Invitation extends BaseEntity {
    @ApiModelProperty("被邀请的用户ID")
    private Long userId;
    @ApiModelProperty("邀请人的手机号")
    private String phone;
    @ApiModelProperty("邀请人的邀请码")
    private String invitationCode;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "userId", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    private User user;

}
