content: package com.alkl1m.taskmanager.entity;
  
  import jakarta.persistence.*;
  import lombok.Data;
  import lombok.NoArgsConstructor;
  
  import java.util.Calendar;
  import java.util.Date;
  @Entity
  @Data
  @NoArgsConstructor
  @Table(schema = "taskmanager", name="t_verification_token")
  public class VerificationToken {
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long token_id;
      @Column(name="c_token")
      private String token;
      @Column(name="c_expiration_time")
      private Date expirationTime;
      private static final int EXPIRATION_TIME = 5;
  
      @OneToOne
      @JoinColumn(name = "c_user_id")
      private User user;
  
      public VerificationToken(String token, User user) {
          super();
          this.token = token;
          this.user = user;
          this.expirationTime = this.getTokenExpirationTime();
      }
  
      public Date getTokenExpirationTime() {
          Calendar calendar = Calendar.getInstance();
          calendar.setTimeInMillis(new Date().getTime());
          calendar.add(Calendar.MINUTE, EXPIRATION_TIME);
          return new Date(calendar.getTime().getTime());
      }
  }
  