41 lines
1.2 KiB
Java
41 lines
1.2 KiB
Java
package zw.qantra.tm.domain.models;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
import jakarta.persistence.*;
|
|
import jakarta.validation.constraints.NotNull;
|
|
import lombok.*;
|
|
import org.hibernate.annotations.SQLRestriction;
|
|
|
|
import java.util.UUID;
|
|
|
|
@Entity
|
|
@Table(name = "recipient", indexes = {
|
|
@Index(name = "idx_recipient_account_workspace", columnList = "account, workspace_id"),
|
|
@Index(name = "idx_recipient_workspace_id", columnList = "workspace_id"),
|
|
@Index(name = "idx_recipient_phone", columnList = "phone_number"),
|
|
@Index(name = "idx_recipient_email", columnList = "email"),
|
|
})
|
|
@Getter
|
|
@Setter
|
|
@Builder
|
|
@AllArgsConstructor
|
|
@NoArgsConstructor
|
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
@SQLRestriction("deleted = false")
|
|
public class Recipient extends BaseEntity {
|
|
private String name;
|
|
private String email;
|
|
@Column(name = "phone_number")
|
|
private String phoneNumber;
|
|
private String address;
|
|
private String account;
|
|
private String initials;
|
|
@Column(name = "latest_provider_label")
|
|
private String latestProviderLabel;
|
|
@Column(name = "workspace_id")
|
|
private UUID workspaceId;
|
|
@Column(name = "user_id")
|
|
private String userId;
|
|
}
|