content: package com.hexagonaldemo.ticketapi.adapters.ticket.jpa.entity;
  
  import com.hexagonaldemo.ticketapi.common.entity.AbstractEntity;
  import com.hexagonaldemo.ticketapi.ticket.model.Ticket;
  import lombok.Getter;
  import lombok.Setter;
  import org.hibernate.annotations.Where;
  
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.Table;
  import java.math.BigDecimal;
  import java.time.LocalDateTime;
  
  @Getter
  @Setter
  @Entity
  @Table(name = "ticket")
  @Where(clause = "status <> -1")
  public class TicketEntity extends AbstractEntity {
  
      @Column(nullable = false)
      private BigDecimal price;
  
      @Column(nullable = false)
      private Integer count;
  
      @Column(nullable = false)
      private LocalDateTime reserveDate;
  
      @Column(nullable = false)
      private Long accountId;
  
      @Column(nullable = false)
      private Long meetupId;
  
      public Ticket toModel() {
          return Ticket.builder()
                  .id(super.getId())
                  .accountId(accountId)
                  .meetupId(meetupId)
                  .reserveDate(reserveDate)
                  .price(price)
                  .count(count)
                  .build();
      }
  }