Index: sources/app/src/main/java/parkup/configs/token/ConfirmationToken.java
===================================================================
--- sources/app/src/main/java/parkup/configs/token/ConfirmationToken.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/token/ConfirmationToken.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,105 @@
+package parkup.configs.token;
+
+import parkup.entities.Administrator;
+
+import javax.persistence.*;
+import java.time.LocalDateTime;
+
+@Entity
+public class ConfirmationToken {
+
+    @Id
+    @Column(name = "confirmation_token_id")
+    @SequenceGenerator(
+            name="confirmation_token_generator",
+            sequenceName = "confirmation_token_sequence",
+            allocationSize = 1,
+            initialValue = 900
+    )
+    @GeneratedValue(    //za postgres treba sequence da se namesti i ime na generator mi ga davamo kako od gore sto e
+            strategy = GenerationType.SEQUENCE,
+            generator = "confirmation_token_sequence_generator"
+    )
+    private int id;
+
+    @Column(nullable = false)
+    private String token;
+
+    @Column(nullable = false)
+    private LocalDateTime createdAt;
+
+    @Column(nullable = false)
+    private LocalDateTime expiresAt;
+
+    private LocalDateTime confirmedAt;
+
+    @ManyToOne
+    @JoinColumn(nullable = false, name = "administrator_id")
+    //many confirmation tokens to one administrator
+    private Administrator administrator;
+
+    public ConfirmationToken() {}
+
+    public ConfirmationToken(int id, String token, LocalDateTime createdAt, LocalDateTime expiresAt, Administrator administrator) {
+        this.id = id;
+        this.token = token;
+        this.createdAt = createdAt;
+        this.expiresAt = expiresAt;
+        this.administrator = administrator;
+    }
+
+    public ConfirmationToken(String token, LocalDateTime createdAt, LocalDateTime expiresAt, Administrator administrator) {
+        this.token = token;
+        this.createdAt = createdAt;
+        this.expiresAt = expiresAt;
+        this.administrator = administrator;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+    public LocalDateTime getCreatedAt() {
+        return createdAt;
+    }
+
+    public void setCreatedAt(LocalDateTime createdAt) {
+        this.createdAt = createdAt;
+    }
+
+    public LocalDateTime getExpiresAt() {
+        return expiresAt;
+    }
+
+    public void setExpiresAt(LocalDateTime expiresAt) {
+        this.expiresAt = expiresAt;
+    }
+
+    public LocalDateTime getConfirmedAt() {
+        return confirmedAt;
+    }
+
+    public void setConfirmedAt(LocalDateTime confirmedAt) {
+        this.confirmedAt = confirmedAt;
+    }
+
+    public Administrator getAdministrator() {
+        return administrator;
+    }
+
+    public void setAdministrator(Administrator administrator) {
+        this.administrator = administrator;
+    }
+}
Index: sources/app/src/main/java/parkup/configs/token/ConfirmationTokenRepository.java
===================================================================
--- sources/app/src/main/java/parkup/configs/token/ConfirmationTokenRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/token/ConfirmationTokenRepository.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,23 @@
+package parkup.configs.token;
+
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Modifying;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.stereotype.Repository;
+
+import javax.transaction.Transactional;
+import java.time.LocalDateTime;
+import java.util.Optional;
+
+@Repository
+public interface ConfirmationTokenRepository extends JpaRepository<ConfirmationToken,Integer> {
+
+    Optional<ConfirmationToken> findByToken(String token);
+
+    @Transactional
+    @Modifying
+    @Query("UPDATE ConfirmationToken c " +
+            "SET c.confirmedAt = ?2 " +
+            "WHERE c.token = ?1")
+    int updateConfirmedAt(String token, LocalDateTime confirmedAt);
+}
Index: sources/app/src/main/java/parkup/configs/token/ConfirmationTokenService.java
===================================================================
--- sources/app/src/main/java/parkup/configs/token/ConfirmationTokenService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
+++ sources/app/src/main/java/parkup/configs/token/ConfirmationTokenService.java	(revision ce6ad22249e902dea17e6ba473846ccebdd4330c)
@@ -0,0 +1,28 @@
+package parkup.configs.token;
+
+import org.springframework.stereotype.Service;
+
+import java.time.LocalDateTime;
+import java.util.Optional;
+
+@Service
+public class ConfirmationTokenService {
+
+    private final ConfirmationTokenRepository confirmationTokenRepository;
+
+    public ConfirmationTokenService(ConfirmationTokenRepository confirmationTokenRepository) {
+        this.confirmationTokenRepository = confirmationTokenRepository;
+    }
+
+    public void saveConfirmationToken(ConfirmationToken token){
+        confirmationTokenRepository.save(token);
+    }
+
+    public Optional<ConfirmationToken> getToken(String token) {
+        return confirmationTokenRepository.findByToken(token);
+    }
+
+    public int setConfirmedAt(String token) {
+        return confirmationTokenRepository.updateConfirmedAt(token, LocalDateTime.now());
+    }
+}
