Index: src/main/java/mk/ukim/finki/busngo/BusNGoApplication.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/BusNGoApplication.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/BusNGoApplication.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -11,4 +11,6 @@
 
     public static void main(String[] args) {
+
+
         SpringApplication.run(BusNGoApplication.class, args);
     }
Index: src/main/java/mk/ukim/finki/busngo/config/WebSecurityConfig.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/config/WebSecurityConfig.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/config/WebSecurityConfig.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -46,5 +46,5 @@
                         .permitAll()
                         .failureUrl("/login?error=BadCredentials")
-                        .defaultSuccessUrl("/", true)
+                        .defaultSuccessUrl("/bilet", true)
                 )
                 .logout((logout) -> logout
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Bilet.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Bilet.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Bilet.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -17,15 +17,19 @@
     @Id
     @Column(name = "b_id")
-    private Long bId;
+    private Long BId;
+
     @Basic
     @Column(name = "b_datum_na_kupuvanje")
     private Timestamp bDatumNaKupuvanje;
+
     @Basic
     @Column(name = "b_status", columnDefinition = "string_kratok")
     @Enumerated(EnumType.STRING)
     private BILET_STATUS bStatus;
+
     @ManyToOne
     @JoinColumn(name = "patnik_k_id", referencedColumnName = "k_id")
-    private Korisnik korisnikByPatnikKId;
+    private Patnik korisnikByPatnikKId;
+
     @ManyToOne
     @JoinColumn(name = "tb_id", referencedColumnName = "tb_id")
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Instancanalinija.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Instancanalinija.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Instancanalinija.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -24,5 +24,5 @@
     @ManyToOne
     @JoinColumn(name = "vozac_k_id", referencedColumnName = "k_id", nullable = false)
-    private Korisnik korisnikByVozacKId;
+    private Vozac korisnikByVozacKId;
     @ManyToOne
     @JoinColumn(name = "a_registracija", referencedColumnName = "a_registracija")
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Kazna.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Kazna.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Kazna.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -9,4 +9,5 @@
 @Data
 @Entity
+@Inheritance(strategy = InheritanceType.JOINED)
 public class Kazna {
     @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -14,28 +15,37 @@
     @Column(name = "kz_id")
     private Long kzId;
+
     @Basic
     @Column(name = "kz_iznos")
     private Double kzIznos;
+
     @Basic
     @Column(name = "kz_plateno")
     private Boolean kzPlateno;
+
     @Basic
     @Column(name = "kz_datum")
     private Timestamp kzDatum;
+
     @Basic
     @Column(name = "kz_datum_plateno")
     private Timestamp kzDatumPlateno;
+
     @Basic
     @Column(name = "kz_dokument")
     private String kzDokument;
+
     @ManyToOne
     @JoinColumn(name = "kondukter_k_id", referencedColumnName = "k_id")
-    private Korisnik korisnikByKondukterKId;
+    private Kondukter korisnikByKondukterKId;
+
     @ManyToOne
     @JoinColumn(name = "kontrola_id", referencedColumnName = "kontrola_id")
     private Kontroli kontroliByKontrolaId;
-    @OneToOne(mappedBy = "kaznaByKzId")
-    private Kaznazaneregistriran kaznazaneregistriranByKzId;
-    @OneToOne(mappedBy = "kaznaByKzId")
-    private Kaznazaregistriran kaznazaregistriranByKzId;
+
+//    @OneToOne(mappedBy = "kaznaByKzId")
+//    private Kaznazaneregistriran kaznazaneregistriranByKzId;
+//
+//    @OneToOne(mappedBy = "kaznaByKzId")
+//    private Kaznazaregistriran kaznazaregistriranByKzId;
 }
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Kaznazaneregistriran.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Kaznazaneregistriran.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Kaznazaneregistriran.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -8,20 +8,15 @@
 @Data
 @Entity
-public class Kaznazaneregistriran {
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "kz_id")
-    private Long kzId;
+public class Kaznazaneregistriran extends Kazna {
     @Basic
     @Column(name = "kzn_telefon")
     private String kznTelefon;
+
     @Basic
     @Column(name = "kzn_ime")
     private String kznIme;
+
     @Basic
     @Column(name = "kzn_adresa")
     private String kznAdresa;
-    @OneToOne
-    @JoinColumn(name = "kz_id", referencedColumnName = "kz_id", nullable = false)
-    private Kazna kaznaByKzId;
 }
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Kaznazaregistriran.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Kaznazaregistriran.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Kaznazaregistriran.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -8,14 +8,7 @@
 @Data
 @Entity
-public class Kaznazaregistriran {
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "kz_id")
-    private Long kzId;
-    @OneToOne
-    @JoinColumn(name = "kz_id", referencedColumnName = "kz_id", nullable = false)
-    private Kazna kaznaByKzId;
+public class Kaznazaregistriran extends Kazna{
     @ManyToOne
     @JoinColumn(name = "patnik_k_id", referencedColumnName = "k_id")
-    private Korisnik korisnikByPatnikKId;
+    private Patnik korisnikByPatnikKId;
 }
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Kondukter.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Kondukter.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Kondukter.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -4,16 +4,14 @@
 import lombok.Data;
 
+import java.util.List;
 import java.util.Objects;
 
 @Data
 @Entity
-public class Kondukter {
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "k_id")
-    private Long kId;
-    @OneToOne
-    @JoinColumn(name = "k_id", referencedColumnName = "k_id", nullable = false)
-    private Korisnik korisnikByKId;
+public class Kondukter extends Vraboten{
+    @OneToMany(mappedBy = "korisnikByKondukterKId")
+    private List<Kazna> kaznasByKId;
+    @OneToMany(mappedBy = "korisnikByKondukterKId")
+    private List<Kontroli> kontrolisByKId;
 
 }
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Kontroli.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Kontroli.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Kontroli.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -23,5 +23,5 @@
     @ManyToOne
     @JoinColumn(name = "kondukter_k_id", referencedColumnName = "k_id")
-    private Korisnik korisnikByKondukterKId;
+    private Kondukter korisnikByKondukterKId;
     @ManyToOne
     @JoinColumn(name = "inl_id", referencedColumnName = "inl_id")
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Korisnik.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Korisnik.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Korisnik.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -15,4 +15,5 @@
 @Data
 @Entity
+@Inheritance(strategy = InheritanceType.JOINED)
 public class Korisnik implements UserDetails {
     @GeneratedValue(strategy = GenerationType.IDENTITY)
@@ -20,27 +21,35 @@
     @Column(name = "k_id")
     private Long kId;
+
     @Basic
     @Column(name = "k_ime")
     private String kIme;
+
     @Basic
     @Column(name = "k_adresa")
     private String kAdresa;
+
     @Basic
     @Column(name = "k_telefon")
     private String kTelefon;
+
     @Basic
     @Column(name = "k_email")
     private String kEmail;
+
     @Basic
     @Column(name = "k_embg")
     private String kEmbg;
+
     @Basic
     @Column(name = "k_is_admin")
     private Boolean kIsAdmin;
+
     @Basic
     @Column(name = "k_lozinka")
     private String kLozinka;
-    @OneToMany(mappedBy = "korisnikByPatnikKId")
-    private List<Bilet> biletsByKId;
+
+//    @OneToMany(mappedBy = "korisnikByPatnikKId")
+//    private List<Bilet> biletsByKId;
 //    private boolean isAccountNonExpired = true;
 //    private boolean isAccountNonLocked = true;
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Patnik.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Patnik.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Patnik.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -4,15 +4,17 @@
 import lombok.Data;
 
+import java.util.List;
 import java.util.Objects;
 
 @Data
 @Entity
-public class Patnik {
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "k_id")
-    private Long kId;
-    @OneToOne
-    @JoinColumn(name = "k_id", referencedColumnName = "k_id", nullable = false)
-    private Korisnik korisnikByKId;
+public class Patnik extends Korisnik {
+    @OneToMany(mappedBy = "korisnikByPatnikKId")
+    private List<Bilet> biletsByKId;
+
+    @OneToMany(mappedBy = "korisnikByPatnikKId")
+    private List<Kaznazaregistriran> kaznazaregistriransByKId;
+
+    @OneToMany(mappedBy = "korisnikByPatnikKId")
+    private List<Vozenje> vozenjesByKId;
 }
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Tipbilet.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Tipbilet.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Tipbilet.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -19,4 +19,7 @@
     private Long tbTrajnost;
     @Basic
+    @Column(name = "tb_cena")
+    private Float tbCena;
+    @Basic
     @Column(name = "tb_ime")
     private String tbIme;
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Vozac.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Vozac.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Vozac.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -4,16 +4,12 @@
 import lombok.Data;
 
+import java.util.List;
 import java.util.Objects;
 
 @Data
 @Entity
-public class Vozac {
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "k_id")
-    private Long kId;
-    @OneToOne
-    @JoinColumn(name = "k_id", referencedColumnName = "k_id", nullable = false)
-    private Korisnik korisnikByKId;
+public class Vozac extends Vraboten {
+    @OneToMany(mappedBy = "korisnikByVozacKId")
+    private List<Instancanalinija> instancanalinijasByKId;
 
 }
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Vozenje.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Vozenje.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Vozenje.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -27,5 +27,5 @@
     @ManyToOne
     @JoinColumn(name = "patnik_k_id", referencedColumnName = "k_id")
-    private Korisnik korisnikByPatnikKId;
+    private Patnik korisnikByPatnikKId;
     @ManyToOne
     @JoinColumn(name = "kacuva_pnl_id", referencedColumnName = "pnl_id", nullable = false)
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Vraboten.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Vraboten.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Vraboten.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -10,21 +10,16 @@
 @Data
 @Entity
-public class Vraboten {
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "k_id")
-    private Long kId;
+public class Vraboten extends Korisnik {
     @Basic
     @Column(name = "v_plata")
     private Double vPlata;
+
     @Basic
     @Column(name = "v_datum_na_vrabotuvanje")
     private Date vDatumNaVrabotuvanje;
+
     @Basic
     @Column(name = "v_datum_prekin_vrabotuvanje")
     private Date vDatumPrekinVrabotuvanje;
-    @OneToOne
-    @JoinColumn(name = "k_id", referencedColumnName = "k_id", nullable = false)
-    private Korisnik korisnikByKId;
 
 }
Index: src/main/java/mk/ukim/finki/busngo/model/enums/Role.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/enums/Role.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/enums/Role.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -6,4 +6,7 @@
 public enum Role implements GrantedAuthority {
     ROLE_USER,
+    ROLE_PASSENGER,
+    ROLE_DRIVER,
+    ROLE_CONDUCTOR,
     ROLE_ADMIN;
 
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidAvtobusRegistracijaException.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidAvtobusRegistracijaException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidAvtobusRegistracijaException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class InvalidAvtobusRegistracijaException extends RuntimeException{
+    public InvalidAvtobusRegistracijaException() {
+        super("Invalid avtobus registracija!");
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidBiletIdException.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidBiletIdException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidBiletIdException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class InvalidBiletIdException extends RuntimeException{
+    public InvalidBiletIdException() {
+        super("Invalid bilet id!");
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidInstancaNaLinijaIdException.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidInstancaNaLinijaIdException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidInstancaNaLinijaIdException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class InvalidInstancaNaLinijaIdException extends RuntimeException{
+    public InvalidInstancaNaLinijaIdException() {
+        super("Invalid instanca na linija id!");
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidLinijaIdException.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidLinijaIdException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidLinijaIdException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class InvalidLinijaIdException extends RuntimeException{
+    public InvalidLinijaIdException() {
+        super("Invalid linija id!");
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidPostojkaNaLinijaIdException.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidPostojkaNaLinijaIdException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidPostojkaNaLinijaIdException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class InvalidPostojkaNaLinijaIdException extends RuntimeException {
+    public InvalidPostojkaNaLinijaIdException() {
+        super("Invalid postoja na linija id!");
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidVozacIdException.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidVozacIdException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidVozacIdException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class InvalidVozacIdException extends RuntimeException{
+    public InvalidVozacIdException() {
+        super("Invalid vozac id!");
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidVozenjeIdException.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidVozenjeIdException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidVozenjeIdException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class InvalidVozenjeIdException extends RuntimeException{
+    public InvalidVozenjeIdException() {
+        super("Inavlid vozenje id!");
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/UserShouldNotBeTicketedException.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/UserShouldNotBeTicketedException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/UserShouldNotBeTicketedException.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class UserShouldNotBeTicketedException extends RuntimeException{
+    public UserShouldNotBeTicketedException(String message) {
+        super(message);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/repository/AvtobusRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/AvtobusRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/repository/AvtobusRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,12 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Avtobus;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+
+import java.util.Optional;
+
+public interface AvtobusRepository extends JpaRepository<Avtobus, Long> {
+    @Query("select a from Avtobus a where a.aRegistracija = ?1")
+    Optional<Avtobus> findByARegistracija(String registracija);
+}
Index: src/main/java/mk/ukim/finki/busngo/repository/BiletRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/BiletRepository.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/repository/BiletRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -8,4 +8,5 @@
 
 import java.util.List;
+import java.util.Optional;
 
 
@@ -13,3 +14,4 @@
 //    List<Bilet> findAllByKorisnikByPatnikKIdAndBStatus(Korisnik korisnik, BILET_STATUS status);
 //    List<Bilet> findAllByKorisnikByPatnikKId(Korisnik korisnik);
+    Optional<Bilet> findByBIdAndAndKorisnikByPatnikKId(Long bid, Patnik patnik);
 }
Index: src/main/java/mk/ukim/finki/busngo/repository/InstancaNaLinijaRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/InstancaNaLinijaRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/repository/InstancaNaLinijaRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,13 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Instancanalinija;
+import mk.ukim.finki.busngo.model.entities.Linija;
+import mk.ukim.finki.busngo.service.LinijaService;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+import java.util.List;
+
+public interface InstancaNaLinijaRepository extends JpaRepository<Instancanalinija, Long> {
+    List<Instancanalinija> findAllByLinijaByLiIdAndInlDatumEndIsNull(Linija linija);
+    List<Instancanalinija> findAllByInlDatumEndIsNull();
+}
Index: src/main/java/mk/ukim/finki/busngo/repository/KaznaRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/KaznaRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/repository/KaznaRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,13 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Kazna;
+import mk.ukim.finki.busngo.model.entities.Kontroli;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.repository.NoRepositoryBean;
+
+import java.util.List;
+
+
+public interface KaznaRepository extends JpaRepository<Kazna, Long> {
+    List<Kazna> findAllByKontroliByKontrolaId(Kontroli kontroli);
+}
Index: src/main/java/mk/ukim/finki/busngo/repository/KaznaZaNeregistriranRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/KaznaZaNeregistriranRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/repository/KaznaZaNeregistriranRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Kaznazaneregistriran;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface KaznaZaNeregistriranRepository extends JpaRepository<Kaznazaneregistriran, Long> {
+}
Index: src/main/java/mk/ukim/finki/busngo/repository/KaznaZaRegistriranRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/KaznaZaRegistriranRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/repository/KaznaZaRegistriranRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,11 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Kaznazaregistriran;
+import mk.ukim.finki.busngo.model.entities.Patnik;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+import java.util.List;
+
+public interface KaznaZaRegistriranRepository extends JpaRepository<Kaznazaregistriran, Long> {
+    List<Kaznazaregistriran> findAllByKorisnikByPatnikKId(Patnik patnik);
+}
Index: src/main/java/mk/ukim/finki/busngo/repository/KondukterRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/KondukterRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/repository/KondukterRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,13 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Kondukter;
+import mk.ukim.finki.busngo.model.entities.Patnik;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+
+import java.util.Optional;
+
+public interface KondukterRepository extends JpaRepository<Kondukter, Long> {
+    @Query("SELECT p from Kondukter p where p.kEmail = ?1")
+    Optional<Kondukter> findByKEmail(String email);
+}
Index: src/main/java/mk/ukim/finki/busngo/repository/KontrolaRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/KontrolaRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/repository/KontrolaRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,11 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Instancanalinija;
+import mk.ukim.finki.busngo.model.entities.Kontroli;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+import java.util.List;
+
+public interface KontrolaRepository extends JpaRepository<Kontroli, Long> {
+    List<Kontroli> findAllByInstancanalinijaByInlId(Instancanalinija inl);
+}
Index: src/main/java/mk/ukim/finki/busngo/repository/KorisnikRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/KorisnikRepository.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/repository/KorisnikRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -5,6 +5,8 @@
 import org.springframework.data.jpa.repository.JpaRepository;
 import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.NoRepositoryBean;
 
 import java.util.Optional;
+
 
 public interface KorisnikRepository extends JpaRepository<Korisnik, Long> {
Index: src/main/java/mk/ukim/finki/busngo/repository/LinijaRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/LinijaRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/repository/LinijaRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Linija;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface LinijaRepository extends JpaRepository<Linija, Long> {
+}
Index: src/main/java/mk/ukim/finki/busngo/repository/PatnikRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/PatnikRepository.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/repository/PatnikRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -3,7 +3,12 @@
 import mk.ukim.finki.busngo.model.entities.Patnik;
 import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+import java.util.Optional;
+
 public interface PatnikRepository extends JpaRepository<Patnik, Long> {
-
+    @Query("SELECT p from Patnik p where p.kEmail = ?1")
+    Optional<Patnik> findByKEmail(String email);
 }
Index: src/main/java/mk/ukim/finki/busngo/repository/PostojkaNaLinijaRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/PostojkaNaLinijaRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/repository/PostojkaNaLinijaRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,14 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Linija;
+import mk.ukim.finki.busngo.model.entities.Postojkanalinija;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.query.Jpa21Utils;
+
+import java.util.List;
+import java.util.Optional;
+
+public interface PostojkaNaLinijaRepository extends JpaRepository<Postojkanalinija, Long> {
+    List<Postojkanalinija> findAllByLinijaByLiId(Linija linija);
+    List<Postojkanalinija> findAllByLinijaByLiIdAndPnlRedenBrojGreaterThan(Linija linija, Short redenBroj);
+}
Index: src/main/java/mk/ukim/finki/busngo/repository/VozacRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/VozacRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/repository/VozacRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,14 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Patnik;
+import mk.ukim.finki.busngo.model.entities.Vozac;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+
+import java.util.Optional;
+
+public interface VozacRepository extends JpaRepository<Vozac, Long> {
+
+    @Query("SELECT v from Vozac v where v.kEmail = ?1")
+    Optional<Vozac> findByKEmail(String email);
+}
Index: src/main/java/mk/ukim/finki/busngo/repository/VozenjeRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/VozenjeRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/repository/VozenjeRepository.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,11 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Patnik;
+import mk.ukim.finki.busngo.model.entities.Vozenje;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+import java.util.List;
+
+public interface VozenjeRepository extends JpaRepository<Vozenje, Long> {
+    List<Vozenje> findAllByKorisnikByPatnikKId(Patnik patnik);
+}
Index: src/main/java/mk/ukim/finki/busngo/service/AuthService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/AuthService.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/service/AuthService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -5,5 +5,5 @@
 public interface AuthService {
     Korisnik login(String email, String password);
-    Korisnik register(String ime, String email, String password, String confirmPassword, String address, String telefon);
+    Korisnik registerPatnik(String ime, String email, String password, String confirmPassword, String address, String telefon);
 
 }
Index: src/main/java/mk/ukim/finki/busngo/service/AvtobusService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/AvtobusService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/AvtobusService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,12 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Avtobus;
+import mk.ukim.finki.busngo.repository.AvtobusRepository;
+
+import java.util.List;
+
+public interface AvtobusService {
+    List<Avtobus> findAll();
+
+    Avtobus findById(String aRegistracija);
+}
Index: src/main/java/mk/ukim/finki/busngo/service/BiletService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/BiletService.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/service/BiletService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -2,4 +2,5 @@
 
 import mk.ukim.finki.busngo.model.entities.Bilet;
+import mk.ukim.finki.busngo.model.entities.Patnik;
 import mk.ukim.finki.busngo.model.enums.BILET_STATUS;
 
@@ -13,3 +14,13 @@
 
     Bilet buy(Long tipbilet, LocalDateTime now, BILET_STATUS biletStatus, String name);
+
+    List<Bilet> findAllByPatnikEmail(String email);
+    Bilet findBybIdAndPatnikEmail(Long bId, String email);
+
+    Bilet activate(Long bId);
+    Bilet findById(Long bId);
+    Bilet finish(Long bId);
+
+    boolean checkExpiration(Long bId);
+//    void encode();
 }
Index: src/main/java/mk/ukim/finki/busngo/service/InstancaNaLinijaService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/InstancaNaLinijaService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/InstancaNaLinijaService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,17 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Instancanalinija;
+
+import javax.swing.event.ListDataEvent;
+import java.time.LocalDateTime;
+import java.util.List;
+
+public interface InstancaNaLinijaService {
+    List<Instancanalinija> findAll();
+    Instancanalinija findById(Long inlId);
+    Instancanalinija start(Long liId, String a_registracija, String email);
+    Instancanalinija end(Long inlId);
+    List<Instancanalinija> findAllActive();
+
+    List<Instancanalinija> findByPnlId(Long pnlId);
+}
Index: src/main/java/mk/ukim/finki/busngo/service/KaznaService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/KaznaService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/KaznaService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,10 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Kazna;
+
+import java.util.List;
+
+public interface KaznaService {
+    List<Kazna> findAll();
+    List<Kazna> findAllByKontrolaId(Long kontrolaId);
+}
Index: src/main/java/mk/ukim/finki/busngo/service/KaznaZaNeregistriranService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/KaznaZaNeregistriranService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/KaznaZaNeregistriranService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,20 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Kaznazaneregistriran;
+import mk.ukim.finki.busngo.model.entities.Kaznazaregistriran;
+import org.springframework.security.core.Authentication;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.util.List;
+
+public interface KaznaZaNeregistriranService {
+    List<Kaznazaneregistriran> findAll();
+    Kaznazaneregistriran findById(Long id);
+    Kaznazaneregistriran create(Long kontrolaId,
+                                 String dokument,
+                                Double iznos,
+                                 String telefon,
+                                 String ime,
+                                 String adresa,
+                                String email);
+}
Index: src/main/java/mk/ukim/finki/busngo/service/KaznaZaRegistriranService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/KaznaZaRegistriranService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/KaznaZaRegistriranService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,12 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Kaznazaregistriran;
+import mk.ukim.finki.busngo.model.exceptions.UserShouldNotBeTicketedException;
+
+import java.util.List;
+
+public interface KaznaZaRegistriranService {
+    List<Kaznazaregistriran> findAllByPatnik(String email);
+
+    Kaznazaregistriran create(Long kontrolaId, String dokument, Double iznos, Long patnik, String email) throws UserShouldNotBeTicketedException;
+}
Index: src/main/java/mk/ukim/finki/busngo/service/KondukterService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/KondukterService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/KondukterService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,10 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Kondukter;
+
+import java.util.List;
+
+public interface KondukterService {
+    List<Kondukter> findAll();
+    Kondukter findByEmail(String email);
+}
Index: src/main/java/mk/ukim/finki/busngo/service/KontrolaService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/KontrolaService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/KontrolaService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,14 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Kontroli;
+
+import java.util.List;
+
+public interface KontrolaService {
+    List<Kontroli> findAll();
+    Kontroli create(Long inlId, String email);
+
+    Kontroli findById(Long kontrolaId);
+
+    List<Kontroli> findAllByInl(Long inlId);
+}
Index: src/main/java/mk/ukim/finki/busngo/service/LinijaService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/LinijaService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/LinijaService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,11 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Linija;
+
+import java.util.List;
+
+public interface LinijaService {
+    List<Linija> findAll();
+
+    Linija findById(Long liId);
+}
Index: src/main/java/mk/ukim/finki/busngo/service/PatnikService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/PatnikService.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/service/PatnikService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -2,4 +2,5 @@
 
 import mk.ukim.finki.busngo.model.entities.Bilet;
+import mk.ukim.finki.busngo.model.entities.Korisnik;
 import mk.ukim.finki.busngo.model.entities.Patnik;
 
@@ -9,4 +10,7 @@
     List<Patnik> listAll();
     Patnik findById(Long id);
+    Patnik loadUserByEmail(String email);
+
+    Patnik save(Korisnik korisnik);
 
 }
Index: src/main/java/mk/ukim/finki/busngo/service/PostojkaNaLinijaService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/PostojkaNaLinijaService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/PostojkaNaLinijaService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,12 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Postojkanalinija;
+
+import java.util.List;
+
+public interface PostojkaNaLinijaService {
+    List<Postojkanalinija> findAll();
+    Postojkanalinija findById(Long id);
+    List<Postojkanalinija> findByLinija(Long liId);
+    List<Postojkanalinija> findByLinijaAfterRedenBroj(Long liId, Short redenBroj);
+}
Index: src/main/java/mk/ukim/finki/busngo/service/VozacService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/VozacService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/VozacService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,11 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Vozac;
+import mk.ukim.finki.busngo.repository.VozacRepository;
+
+import java.util.List;
+
+public interface VozacService {
+    List<Vozac> findAll();
+    Vozac findByEmail(String email);
+}
Index: src/main/java/mk/ukim/finki/busngo/service/VozenjeService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/VozenjeService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/VozenjeService.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,12 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Vozenje;
+
+import java.util.List;
+
+public interface VozenjeService {
+    List<Vozenje> findVozenjaByPatnik(String email);
+    Vozenje start(String email, Long bId, Long pnlId, Long inlId);
+    Vozenje end(Long vozenjeId, Long pnlId);
+    Vozenje findById(Long id);
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/AuthServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/AuthServiceImpl.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/AuthServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -2,20 +2,22 @@
 
 import mk.ukim.finki.busngo.model.entities.Korisnik;
+import mk.ukim.finki.busngo.model.entities.Patnik;
 import mk.ukim.finki.busngo.model.exceptions.InvalidCredentialsException;
 import mk.ukim.finki.busngo.model.exceptions.UserAlreadyExistsException;
 import mk.ukim.finki.busngo.repository.KorisnikRepository;
+import mk.ukim.finki.busngo.repository.PatnikRepository;
 import mk.ukim.finki.busngo.service.AuthService;
 import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
-
 @Service
 public class AuthServiceImpl implements AuthService {
     private final KorisnikRepository korisnikRepository;
+    private final PatnikRepository patnikRepository;
     private final PasswordEncoder passwordEncoder;
 
-    public AuthServiceImpl(KorisnikRepository korisnikRepository, PasswordEncoder passwordEncoder) {
+    public AuthServiceImpl(KorisnikRepository korisnikRepository, PatnikRepository patnikRepository, PasswordEncoder passwordEncoder) {
         this.korisnikRepository = korisnikRepository;
+        this.patnikRepository = patnikRepository;
         this.passwordEncoder = passwordEncoder;
     }
@@ -29,5 +31,5 @@
 
     @Override
-    public Korisnik register(String ime, String email, String password, String confirmPassword, String address, String telefon) {
+    public Korisnik registerPatnik(String ime, String email, String password, String confirmPassword, String address, String telefon) {
         if (email == null || password == null || email.isEmpty() || password.isEmpty()) {
             throw new InvalidCredentialsException();
@@ -42,5 +44,5 @@
         }
 
-        Korisnik korisnik = new Korisnik();
+        Patnik korisnik = new Patnik();
         korisnik.setKIme(ime);
         korisnik.setKAdresa(address);
@@ -50,5 +52,6 @@
         korisnik.setKIsAdmin(false);
 
-        return korisnikRepository.save(korisnik);
+
+        return patnikRepository.save(korisnik);
     }
 
Index: src/main/java/mk/ukim/finki/busngo/service/impl/AvtobusServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/AvtobusServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/AvtobusServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,28 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.Avtobus;
+import mk.ukim.finki.busngo.model.exceptions.InvalidAvtobusRegistracijaException;
+import mk.ukim.finki.busngo.repository.AvtobusRepository;
+import mk.ukim.finki.busngo.service.AvtobusService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class AvtobusServiceImpl implements AvtobusService {
+    private final AvtobusRepository avtobusRepository;
+
+    public AvtobusServiceImpl(AvtobusRepository avtobusRepository) {
+        this.avtobusRepository = avtobusRepository;
+    }
+
+    @Override
+    public List<Avtobus> findAll() {
+        return avtobusRepository.findAll();
+    }
+
+    @Override
+    public Avtobus findById(String aRegistracija) {
+        return avtobusRepository.findByARegistracija(aRegistracija).orElseThrow(InvalidAvtobusRegistracijaException::new);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/BiletServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/BiletServiceImpl.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/BiletServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -3,12 +3,16 @@
 import mk.ukim.finki.busngo.model.entities.Bilet;
 import mk.ukim.finki.busngo.model.entities.Korisnik;
+import mk.ukim.finki.busngo.model.entities.Patnik;
 import mk.ukim.finki.busngo.model.entities.Tipbilet;
 import mk.ukim.finki.busngo.model.enums.BILET_STATUS;
+import mk.ukim.finki.busngo.model.exceptions.InvalidBiletIdException;
 import mk.ukim.finki.busngo.model.exceptions.InvalidTipBiletIdException;
 import mk.ukim.finki.busngo.repository.BiletRepository;
+import mk.ukim.finki.busngo.repository.KorisnikRepository;
 import mk.ukim.finki.busngo.repository.TipBIletRepository;
 import mk.ukim.finki.busngo.service.BiletService;
 import mk.ukim.finki.busngo.service.KorisnikService;
 import mk.ukim.finki.busngo.service.PatnikService;
+import org.springframework.security.crypto.password.PasswordEncoder;
 import org.springframework.stereotype.Service;
 
@@ -24,10 +28,14 @@
     private final TipBIletRepository tipBIletRepository;
     private final PatnikService patnikService;
+    private final PasswordEncoder passwordEncoder;
+    private final KorisnikRepository korisnikRepository;
 
-    public BiletServiceImpl(BiletRepository biletRepository, KorisnikService korisnikService, TipBIletRepository tipBIletRepository, PatnikService patnikService) {
+    public BiletServiceImpl(BiletRepository biletRepository, KorisnikService korisnikService, TipBIletRepository tipBIletRepository, PatnikService patnikService, PasswordEncoder passwordEncoder, KorisnikRepository korisnikRepository) {
         this.biletRepository = biletRepository;
         this.korisnikService = korisnikService;
         this.tipBIletRepository = tipBIletRepository;
         this.patnikService = patnikService;
+        this.passwordEncoder = passwordEncoder;
+        this.korisnikRepository = korisnikRepository;
     }
 
@@ -39,6 +47,6 @@
     @Override
     public List<Bilet> findAllByPatnikId(Long id) {
-        Korisnik korisnik = korisnikService.findById(id);
-        return new ArrayList<>();
+        Patnik patnik = patnikService.findById(id);
+        return patnik.getBiletsByKId();
     }
 
@@ -52,5 +60,5 @@
     public Bilet buy(Long tipbilet, LocalDateTime now, BILET_STATUS biletStatus, String name) {
         Tipbilet tipbilet1 = tipBIletRepository.findById(tipbilet).orElseThrow(InvalidTipBiletIdException::new);
-        Korisnik korisnik = korisnikService.loadUserByEmail(name);
+        Patnik korisnik = patnikService.loadUserByEmail(name);
         Bilet bilet = new Bilet();
         bilet.setBStatus(biletStatus);
@@ -60,3 +68,58 @@
         return biletRepository.save(bilet);
     }
+
+    @Override
+    public List<Bilet> findAllByPatnikEmail(String email) {
+        Patnik patnik = patnikService.loadUserByEmail(email);
+        return patnik.getBiletsByKId();
+    }
+
+    @Override
+    public Bilet findBybIdAndPatnikEmail(Long bId, String email) {
+        Patnik patnik = patnikService.loadUserByEmail(email);
+        return biletRepository.findByBIdAndAndKorisnikByPatnikKId(bId, patnik).orElseThrow(InvalidBiletIdException::new);
+    }
+
+    @Override
+    public Bilet activate(Long bId) {
+        Bilet bilet = this.findById(bId);
+        bilet.setBStatus(BILET_STATUS.ACTIVE);
+        return biletRepository.save(bilet);
+    }
+
+    @Override
+    public Bilet findById(Long bId) {
+        return biletRepository.findById(bId).orElseThrow(RuntimeException::new);
+    }
+
+    @Override
+    public Bilet finish(Long bId) {
+        Bilet bilet = this.findById(bId);
+        bilet.setBStatus(BILET_STATUS.EXPIRED);
+        return biletRepository.save(bilet);
+    }
+
+    @Override
+    public boolean checkExpiration(Long bId) {
+        Bilet bilet = this.findById(bId);
+        LocalDateTime timeBought = bilet.getBDatumNaKupuvanje().toLocalDateTime();
+
+        if(timeBought.plusSeconds(bilet.getTipbiletByTbId().getTbTrajnost()).isBefore(LocalDateTime.now())){
+            bilet.setBStatus(BILET_STATUS.EXPIRED);
+            biletRepository.save(bilet);
+            return true;
+        }
+
+        return false;
+    }
+
+//    @Override
+//    public void encode(){
+//        List<Korisnik> all = korisnikRepository.findAll();
+//        all.forEach(p -> p.setKLozinka(passwordEncoder.encode(p.getKLozinka())));
+//        korisnikRepository.saveAll(all);
+//        System.out.println("DONE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+//    }
+
+
 }
Index: src/main/java/mk/ukim/finki/busngo/service/impl/InstancaNaLinijaServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/InstancaNaLinijaServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/InstancaNaLinijaServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,71 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.*;
+import mk.ukim.finki.busngo.model.exceptions.InvalidInstancaNaLinijaIdException;
+import mk.ukim.finki.busngo.repository.InstancaNaLinijaRepository;
+import mk.ukim.finki.busngo.service.*;
+import org.springframework.stereotype.Service;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Service
+public class InstancaNaLinijaServiceImpl implements InstancaNaLinijaService{
+    private final InstancaNaLinijaRepository instancaNaLinijaRepository;
+    private final VozacService vozacService;
+    private final AvtobusService avtobusService;
+    private final LinijaService linijaService;
+    private final PostojkaNaLinijaService postojkaNaLinijaService;
+
+    public InstancaNaLinijaServiceImpl(InstancaNaLinijaRepository instancaNaLinijaRepository, VozacService vozacService, AvtobusService avtobusService, LinijaService linijaService, PostojkaNaLinijaService postojkaNaLinijaService) {
+        this.instancaNaLinijaRepository = instancaNaLinijaRepository;
+        this.vozacService = vozacService;
+        this.avtobusService = avtobusService;
+        this.linijaService = linijaService;
+        this.postojkaNaLinijaService = postojkaNaLinijaService;
+    }
+
+    @Override
+    public List<Instancanalinija> findAll() {
+        return instancaNaLinijaRepository.findAll();
+    }
+
+    @Override
+    public Instancanalinija findById(Long inlId) {
+        return instancaNaLinijaRepository.findById(inlId).orElseThrow(InvalidInstancaNaLinijaIdException::new);
+    }
+
+    @Override
+    public Instancanalinija start(Long liId, String a_registracija, String email) {
+        Linija linija = linijaService.findById(liId);
+        Avtobus avtobus = avtobusService.findById(a_registracija);
+        Vozac vozac = vozacService.findByEmail(email);
+        Instancanalinija instancanalinija = new Instancanalinija();
+        instancanalinija.setLinijaByLiId(linija);
+        instancanalinija.setAvtobusByARegistracija(avtobus);
+        instancanalinija.setKorisnikByVozacKId(vozac);
+        instancanalinija.setInlDatumStart(Timestamp.valueOf(LocalDateTime.now()));
+
+        return instancaNaLinijaRepository.save(instancanalinija);
+    }
+
+    @Override
+    public Instancanalinija end(Long inlId) {
+        Instancanalinija instancanalinija = this.findById(inlId);
+        instancanalinija.setInlDatumEnd(Timestamp.valueOf(LocalDateTime.now()));
+        return instancaNaLinijaRepository.save(instancanalinija);
+    }
+
+    @Override
+    public List<Instancanalinija> findAllActive() {
+        return instancaNaLinijaRepository.findAllByInlDatumEndIsNull();
+    }
+
+    @Override
+    public List<Instancanalinija> findByPnlId(Long pnlId) {
+        Postojkanalinija postojkanalinija = postojkaNaLinijaService.findById(pnlId);
+        Linija linijaByLiId = postojkanalinija.getLinijaByLiId();
+        return instancaNaLinijaRepository.findAllByLinijaByLiIdAndInlDatumEndIsNull(linijaByLiId);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/KaznaServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/KaznaServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/KaznaServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,32 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.Kazna;
+import mk.ukim.finki.busngo.model.entities.Kontroli;
+import mk.ukim.finki.busngo.repository.KaznaRepository;
+import mk.ukim.finki.busngo.service.KaznaService;
+import mk.ukim.finki.busngo.service.KontrolaService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class KaznaServiceImpl implements KaznaService {
+    private final KaznaRepository kaznaRepository;
+    private final KontrolaService kontrolaService;
+
+    public KaznaServiceImpl(KaznaRepository kaznaRepository, KontrolaService kontrolaService) {
+        this.kaznaRepository = kaznaRepository;
+        this.kontrolaService = kontrolaService;
+    }
+
+    @Override
+    public List<Kazna> findAll() {
+        return kaznaRepository.findAll();
+    }
+
+    @Override
+    public List<Kazna> findAllByKontrolaId(Long kontrolaId) {
+        Kontroli kontroli = kontrolaService.findById(kontrolaId);
+        return kaznaRepository.findAllByKontroliByKontrolaId(kontroli);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/KaznaZaNeregistriranServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/KaznaZaNeregistriranServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/KaznaZaNeregistriranServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,53 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.Kaznazaneregistriran;
+import mk.ukim.finki.busngo.model.entities.Kondukter;
+import mk.ukim.finki.busngo.model.entities.Kontroli;
+import mk.ukim.finki.busngo.repository.KaznaZaNeregistriranRepository;
+import mk.ukim.finki.busngo.service.KaznaZaNeregistriranService;
+import mk.ukim.finki.busngo.service.KondukterService;
+import mk.ukim.finki.busngo.service.KontrolaService;
+import org.springframework.stereotype.Service;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.util.List;
+@Service
+public class KaznaZaNeregistriranServiceImpl implements KaznaZaNeregistriranService {
+    private final KaznaZaNeregistriranRepository kaznaZaNeregistriranRepository;
+    private final KontrolaService kontrolaService;
+    private final KondukterService kondukterService;
+
+    public KaznaZaNeregistriranServiceImpl(KaznaZaNeregistriranRepository kaznaZaNeregistriranRepository, KontrolaService kontrolaService, KondukterService kondukterService) {
+        this.kaznaZaNeregistriranRepository = kaznaZaNeregistriranRepository;
+        this.kontrolaService = kontrolaService;
+        this.kondukterService = kondukterService;
+    }
+
+    @Override
+    public List<Kaznazaneregistriran> findAll() {
+        return kaznaZaNeregistriranRepository.findAll();
+    }
+
+    @Override
+    public Kaznazaneregistriran findById(Long id) {
+        return kaznaZaNeregistriranRepository.findById(id).orElseThrow(RuntimeException::new);
+    }
+
+    @Override
+    public Kaznazaneregistriran create(Long kontrolaId, String dokument, Double iznos, String telefon, String ime, String adresa, String email) {
+        Kondukter byEmail = kondukterService.findByEmail(email);
+        Kontroli kontroli = kontrolaService.findById(kontrolaId);
+        Kaznazaneregistriran kaznazaneregistriran = new Kaznazaneregistriran();
+        kaznazaneregistriran.setKznAdresa(adresa);
+        kaznazaneregistriran.setKznIme(ime);
+        kaznazaneregistriran.setKznTelefon(telefon);
+        kaznazaneregistriran.setKzDatum(Timestamp.valueOf(LocalDateTime.now()));
+        kaznazaneregistriran.setKontroliByKontrolaId(kontroli);
+        kaznazaneregistriran.setKorisnikByKondukterKId(byEmail);
+        kaznazaneregistriran.setKzIznos(iznos);
+        kaznazaneregistriran.setKzDokument(dokument);
+        kaznazaneregistriran.setKzPlateno(false);
+        return kaznaZaNeregistriranRepository.save(kaznazaneregistriran);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/KaznaZaRegistriranServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/KaznaZaRegistriranServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/KaznaZaRegistriranServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,61 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.*;
+import mk.ukim.finki.busngo.model.exceptions.UserShouldNotBeTicketedException;
+import mk.ukim.finki.busngo.repository.KaznaZaRegistriranRepository;
+import mk.ukim.finki.busngo.service.KaznaZaRegistriranService;
+import mk.ukim.finki.busngo.service.KondukterService;
+import mk.ukim.finki.busngo.service.KontrolaService;
+import mk.ukim.finki.busngo.service.PatnikService;
+import org.springframework.stereotype.Service;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.util.List;
+import java.util.stream.Collectors;
+
+@Service
+public class KaznaZaRegistriranServiceImpl implements KaznaZaRegistriranService {
+    private final PatnikService patnikService;
+    private final KaznaZaRegistriranRepository kaznaZaRegistriranRepository;
+    private final KontrolaService kontrolaService;
+    private final KondukterService kondukterService;
+
+    public KaznaZaRegistriranServiceImpl(PatnikService patnikService, KaznaZaRegistriranRepository kaznaZaRegistriranRepository, KontrolaService kontrolaService, KondukterService kondukterService) {
+        this.patnikService = patnikService;
+        this.kaznaZaRegistriranRepository = kaznaZaRegistriranRepository;
+        this.kontrolaService = kontrolaService;
+        this.kondukterService = kondukterService;
+    }
+
+    @Override
+    public List<Kaznazaregistriran> findAllByPatnik(String email) {
+        Patnik patnik = patnikService.loadUserByEmail(email);
+        return kaznaZaRegistriranRepository.findAllByKorisnikByPatnikKId(patnik);
+    }
+
+    @Override
+    public Kaznazaregistriran create(Long kontrolaId, String dokument, Double iznos, Long patnik, String email) {
+        Kontroli kontroli = kontrolaService.findById(kontrolaId);
+        Kondukter kondukter = kondukterService.findByEmail(email);
+        Patnik patnik1 = patnikService.findById(patnik);
+        Kaznazaregistriran kaznazaregistriran = new Kaznazaregistriran();
+        kaznazaregistriran.setKzDatum(Timestamp.valueOf(LocalDateTime.now()));
+        kaznazaregistriran.setKzDokument(dokument);
+        kaznazaregistriran.setKzIznos(iznos);
+        kaznazaregistriran.setKzPlateno(false);
+        kaznazaregistriran.setKontroliByKontrolaId(kontroli);
+        kaznazaregistriran.setKorisnikByPatnikKId(patnik1);
+        kaznazaregistriran.setKorisnikByKondukterKId(kondukter);
+        List<Vozenje> vozenjeList = patnik1.getVozenjesByKId().stream()
+                .filter(v -> v.getInstancanalinijaByInlId().getInlId().equals(kontroli.getInstancanalinijaByInlId().getInlId()))
+                .toList();
+        if(vozenjeList.isEmpty())
+            return kaznaZaRegistriranRepository.save(kaznazaregistriran);
+
+        throw new UserShouldNotBeTicketedException(String.format("Patnik with id: %d and email: %s has valid vozenje for the %d instance!",
+                patnik1.getKId(),
+                patnik1.getKEmail(),
+                kontroli.getInstancanalinijaByInlId().getInlId()));
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/KondukterServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/KondukterServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/KondukterServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,28 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.Kondukter;
+import mk.ukim.finki.busngo.model.exceptions.InvalidUserId;
+import mk.ukim.finki.busngo.repository.KondukterRepository;
+import mk.ukim.finki.busngo.service.KondukterService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class KondukterServiceImpl implements KondukterService {
+    private final KondukterRepository kondukterRepository;
+
+    public KondukterServiceImpl(KondukterRepository kondukterRepository) {
+        this.kondukterRepository = kondukterRepository;
+    }
+
+    @Override
+    public List<Kondukter> findAll() {
+        return kondukterRepository.findAll();
+    }
+
+    @Override
+    public Kondukter findByEmail(String email) {
+        return kondukterRepository.findByKEmail(email).orElseThrow(InvalidUserId::new);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/KontrolaServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/KontrolaServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/KontrolaServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,55 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.Instancanalinija;
+import mk.ukim.finki.busngo.model.entities.Kondukter;
+import mk.ukim.finki.busngo.model.entities.Kontroli;
+import mk.ukim.finki.busngo.repository.KontrolaRepository;
+import mk.ukim.finki.busngo.service.InstancaNaLinijaService;
+import mk.ukim.finki.busngo.service.KondukterService;
+import mk.ukim.finki.busngo.service.KontrolaService;
+import org.springframework.stereotype.Service;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Service
+public class KontrolaServiceImpl implements KontrolaService {
+    private final KontrolaRepository kontrolaRepository;
+    private final KondukterService kondukterService;
+    private final InstancaNaLinijaService instancaNaLinijaService;
+
+    public KontrolaServiceImpl(KontrolaRepository kontrolaRepository, KondukterService kondukterService, InstancaNaLinijaService instancaNaLinijaService) {
+        this.kontrolaRepository = kontrolaRepository;
+        this.kondukterService = kondukterService;
+        this.instancaNaLinijaService = instancaNaLinijaService;
+    }
+
+    @Override
+    public List<Kontroli> findAll() {
+        return kontrolaRepository.findAll();
+    }
+
+    @Override
+    public Kontroli create(Long inlId, String email) {
+        Kondukter kondukter = kondukterService.findByEmail(email);
+        Instancanalinija instancanalinija = instancaNaLinijaService.findById(inlId);
+        Kontroli kontroli = new Kontroli();
+        kontroli.setKontrolaDatum(Timestamp.valueOf(LocalDateTime.now()));
+        kontroli.setKorisnikByKondukterKId(kondukter);
+        kontroli.setInstancanalinijaByInlId(instancanalinija);
+
+        return kontrolaRepository.save(kontroli);
+    }
+
+    @Override
+    public Kontroli findById(Long kontrolaId) {
+        return kontrolaRepository.findById(kontrolaId).orElseThrow(RuntimeException::new);
+    }
+
+    @Override
+    public List<Kontroli> findAllByInl(Long inlId) {
+        Instancanalinija instancanalinija = instancaNaLinijaService.findById(inlId);
+        return kontrolaRepository.findAllByInstancanalinijaByInlId(instancanalinija);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/LinijaServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/LinijaServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/LinijaServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,29 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.Linija;
+import mk.ukim.finki.busngo.model.exceptions.InvalidLinijaIdException;
+import mk.ukim.finki.busngo.repository.LinijaRepository;
+import mk.ukim.finki.busngo.service.LinijaService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class LinijaServiceImpl implements LinijaService {
+
+    private final LinijaRepository linijaRepository;
+
+    public LinijaServiceImpl(LinijaRepository linijaRepository) {
+        this.linijaRepository = linijaRepository;
+    }
+
+    @Override
+    public List<Linija> findAll() {
+        return linijaRepository.findAll();
+    }
+
+    @Override
+    public Linija findById(Long liId) {
+        return linijaRepository.findById(liId).orElseThrow(InvalidLinijaIdException::new);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/PatnikServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/PatnikServiceImpl.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/PatnikServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -1,10 +1,14 @@
 package mk.ukim.finki.busngo.service.impl;
 
+import mk.ukim.finki.busngo.model.entities.Instancanalinija;
+import mk.ukim.finki.busngo.model.entities.Korisnik;
 import mk.ukim.finki.busngo.model.entities.Patnik;
 import mk.ukim.finki.busngo.model.exceptions.InvalidPatnikIdException;
 import mk.ukim.finki.busngo.repository.PatnikRepository;
+import mk.ukim.finki.busngo.service.InstancaNaLinijaService;
 import mk.ukim.finki.busngo.service.PatnikService;
 import org.springframework.stereotype.Service;
 
+import java.util.Collections;
 import java.util.List;
 
@@ -12,12 +16,14 @@
 public class PatnikServiceImpl implements PatnikService {
     private final PatnikRepository patnikRepository;
+    private final InstancaNaLinijaService instancaNaLinijaService;
 
-    public PatnikServiceImpl(PatnikRepository patnikRepository) {
+    public PatnikServiceImpl(PatnikRepository patnikRepository, InstancaNaLinijaService instancaNaLinijaService) {
         this.patnikRepository = patnikRepository;
+        this.instancaNaLinijaService = instancaNaLinijaService;
     }
 
     @Override
     public List<Patnik> listAll() {
-        return patnikRepository.findAll();
+        return  patnikRepository.findAll();
     }
 
@@ -26,3 +32,24 @@
         return patnikRepository.findById(id).orElseThrow(InvalidPatnikIdException::new);
     }
+
+    @Override
+    public Patnik loadUserByEmail(String email) {
+        return patnikRepository.findByKEmail(email).orElseThrow(InvalidPatnikIdException::new);
+    }
+
+    @Override
+    public Patnik save(Korisnik korisnik) {
+        Patnik patnik = new Patnik();
+        patnik.setKId(korisnik.getKId());
+        patnik.setKEmail(korisnik.getKEmail());
+        patnik.setKAdresa(korisnik.getKAdresa());
+        patnik.setKIme(korisnik.getKIme());
+        patnik.setKTelefon(korisnik.getKTelefon());
+        patnik.setKIsAdmin(korisnik.getKIsAdmin());
+        patnik.setKLozinka(korisnik.getKLozinka());
+
+        return patnikRepository.save((Patnik) korisnik);
+    }
+
+
 }
Index: src/main/java/mk/ukim/finki/busngo/service/impl/PostojkaNaLinijaServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/PostojkaNaLinijaServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/PostojkaNaLinijaServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,44 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.Linija;
+import mk.ukim.finki.busngo.model.entities.Postojkanalinija;
+import mk.ukim.finki.busngo.model.exceptions.InvalidPostojkaNaLinijaIdException;
+import mk.ukim.finki.busngo.repository.PostojkaNaLinijaRepository;
+import mk.ukim.finki.busngo.service.LinijaService;
+import mk.ukim.finki.busngo.service.PostojkaNaLinijaService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class PostojkaNaLinijaServiceImpl implements PostojkaNaLinijaService {
+    private final PostojkaNaLinijaRepository postojkaNaLinijaRepository;
+    private final LinijaService linijaService;
+
+    public PostojkaNaLinijaServiceImpl(PostojkaNaLinijaRepository postojkaNaLinijaRepository, LinijaService linijaService) {
+        this.postojkaNaLinijaRepository = postojkaNaLinijaRepository;
+        this.linijaService = linijaService;
+    }
+
+    @Override
+    public List<Postojkanalinija> findAll() {
+        return postojkaNaLinijaRepository.findAll();
+    }
+
+    @Override
+    public Postojkanalinija findById(Long id) {
+        return postojkaNaLinijaRepository.findById(id).orElseThrow(InvalidPostojkaNaLinijaIdException::new);
+    }
+
+    @Override
+    public List<Postojkanalinija> findByLinija(Long liId) {
+        Linija linija = linijaService.findById(liId);
+        return postojkaNaLinijaRepository.findAllByLinijaByLiId(linija);
+    }
+
+    @Override
+    public List<Postojkanalinija> findByLinijaAfterRedenBroj(Long liId, Short redenBroj) {
+        Linija linija = linijaService.findById(liId);
+        return postojkaNaLinijaRepository.findAllByLinijaByLiIdAndPnlRedenBrojGreaterThan(linija, redenBroj);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/VozacServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/VozacServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/VozacServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,28 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.Vozac;
+import mk.ukim.finki.busngo.model.exceptions.InvalidVozacIdException;
+import mk.ukim.finki.busngo.repository.VozacRepository;
+import mk.ukim.finki.busngo.service.VozacService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class VozacServiceImpl implements VozacService {
+    private final VozacRepository vozacRepository;
+
+    public VozacServiceImpl(VozacRepository vozacRepository) {
+        this.vozacRepository = vozacRepository;
+    }
+
+    @Override
+    public List<Vozac> findAll() {
+        return vozacRepository.findAll();
+    }
+
+    @Override
+    public Vozac findByEmail(String email) {
+        return vozacRepository.findByKEmail(email).orElseThrow(InvalidVozacIdException::new);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/VozenjeServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/VozenjeServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/VozenjeServiceImpl.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,75 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.*;
+import mk.ukim.finki.busngo.model.enums.BILET_STATUS;
+import mk.ukim.finki.busngo.model.enums.VOZENJE_STATUS;
+import mk.ukim.finki.busngo.model.exceptions.InvalidVozenjeIdException;
+import mk.ukim.finki.busngo.repository.VozenjeRepository;
+import mk.ukim.finki.busngo.service.*;
+import org.springframework.stereotype.Service;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.util.List;
+
+@Service
+public class VozenjeServiceImpl  implements VozenjeService {
+    private final VozenjeRepository vozenjeRepository;
+    private final PatnikService patnikService;
+    private final BiletService biletService;
+    private final PostojkaNaLinijaService postojkaNaLinijaService;
+    private final InstancaNaLinijaService instancaNaLinijaService;
+
+    public VozenjeServiceImpl(VozenjeRepository vozenjeRepository, PatnikService patnikService, BiletService biletService, PostojkaNaLinijaService postojkaNaLinijaService, InstancaNaLinijaService instancaNaLinijaService) {
+        this.vozenjeRepository = vozenjeRepository;
+        this.patnikService = patnikService;
+        this.biletService = biletService;
+        this.postojkaNaLinijaService = postojkaNaLinijaService;
+        this.instancaNaLinijaService = instancaNaLinijaService;
+    }
+
+    @Override
+    public List<Vozenje> findVozenjaByPatnik(String email) {
+        Patnik patnik = patnikService.loadUserByEmail(email);
+        return vozenjeRepository.findAllByKorisnikByPatnikKId(patnik);
+    }
+
+    @Override
+    public Vozenje start(String email, Long bId, Long pnlId, Long inlId) {
+        Patnik patnik = patnikService.loadUserByEmail(email);
+        Bilet bilet = biletService.findBybIdAndPatnikEmail(bId, email);
+        Postojkanalinija postojkanalinija = postojkaNaLinijaService.findById(pnlId);
+        Instancanalinija instancanalinija = instancaNaLinijaService.findById(inlId);
+
+        Vozenje vozenje = new Vozenje();
+        vozenje.setVozenjeStart(Timestamp.valueOf(LocalDateTime.now()));
+        vozenje.setVozenjeStatus(VOZENJE_STATUS.ACTIVE);
+        vozenje.setInstancanalinijaByInlId(instancanalinija);
+        vozenje.setKorisnikByPatnikKId(patnik);
+        vozenje.setPostojkanalinijaByKacuvaPnlId(postojkanalinija);
+
+        if(bilet.getBStatus().equals(BILET_STATUS.INACTIVE))
+            bilet = biletService.activate(bId);
+        else if(biletService.checkExpiration(bId))
+            throw new RuntimeException("Bilet is expired!");
+        else if(bilet.getBStatus().equals(BILET_STATUS.EXPIRED))
+            throw new RuntimeException("Bilet is expired!");
+
+        vozenje.setBiletByBId(bilet);
+        return vozenjeRepository.save(vozenje);
+    }
+
+    @Override
+    public Vozenje end(Long vozenjeId, Long pnlId) {
+        // TODO : Relacija se simnuva na pnlId
+        Vozenje vozenje = this.findById(vozenjeId);
+        vozenje.setVozenjeEnd(Timestamp.valueOf(LocalDateTime.now()));
+        vozenje.setVozenjeStatus(VOZENJE_STATUS.FINISHED);
+        return vozenjeRepository.save(vozenje);
+    }
+
+    @Override
+    public Vozenje findById(Long id) {
+        return vozenjeRepository.findById(id).orElseThrow(InvalidVozenjeIdException::new);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/web/BiletController.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/web/BiletController.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/web/BiletController.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -1,7 +1,10 @@
 package mk.ukim.finki.busngo.web;
 
+import mk.ukim.finki.busngo.model.entities.Patnik;
 import mk.ukim.finki.busngo.model.enums.BILET_STATUS;
+import mk.ukim.finki.busngo.model.exceptions.InvalidPatnikIdException;
 import mk.ukim.finki.busngo.service.AuthService;
 import mk.ukim.finki.busngo.service.BiletService;
+import mk.ukim.finki.busngo.service.PatnikService;
 import mk.ukim.finki.busngo.service.TipBiletService;
 import org.springframework.security.core.Authentication;
@@ -21,9 +24,11 @@
     private final TipBiletService tipBiletService;
     private final AuthService authService;
+    private final PatnikService patnikService;
 
-    public BiletController(BiletService biletService, TipBiletService tipBiletService, AuthService authService) {
+    public BiletController(BiletService biletService, TipBiletService tipBiletService, AuthService authService, PatnikService patnikService) {
         this.biletService = biletService;
         this.tipBiletService = tipBiletService;
         this.authService = authService;
+        this.patnikService = patnikService;
     }
 
@@ -31,7 +36,18 @@
     public String getAllBileti(@RequestParam(required = false) Long id,
                                @RequestParam(required = false) BILET_STATUS status,
-                               Model model){
+                               Model model,
+                               Authentication authentication){
         model.addAttribute("bodyContent", "listBileti");
-        model.addAttribute("bileti", biletService.listAll());
+        Patnik patnik = null;
+        try{
+            model.addAttribute("bileti", biletService.findAllByPatnikEmail(authentication.getName()));
+        }
+        catch (InvalidPatnikIdException e){
+            model.addAttribute("bodyContent", "listBileti");
+            model.addAttribute("hasError", true);
+            model.addAttribute("error", e.getMessage());
+            return "master-template";
+        }
+
         return "master-template";
     }
@@ -50,3 +66,9 @@
     }
 
+//    @GetMapping("/encode")
+//    public String encode(){
+//        biletService.encode();
+//        return "redirect:/bilet";
+//    }
+
 }
Index: src/main/java/mk/ukim/finki/busngo/web/InstancaNaLinijaController.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/web/InstancaNaLinijaController.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/web/InstancaNaLinijaController.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,77 @@
+package mk.ukim.finki.busngo.web;
+
+import mk.ukim.finki.busngo.model.entities.Avtobus;
+import mk.ukim.finki.busngo.model.entities.Instancanalinija;
+import mk.ukim.finki.busngo.model.entities.Linija;
+import mk.ukim.finki.busngo.service.AvtobusService;
+import mk.ukim.finki.busngo.service.InstancaNaLinijaService;
+import mk.ukim.finki.busngo.service.KontrolaService;
+import mk.ukim.finki.busngo.service.LinijaService;
+import org.springframework.security.core.Authentication;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@Controller
+@RequestMapping("instanca-na-linija")
+public class InstancaNaLinijaController {
+    private final InstancaNaLinijaService instancaNaLinijaService;
+    private final LinijaService linijaService;
+    private final AvtobusService avtobusService;
+    private final KontrolaService kontrolaService;
+
+    public InstancaNaLinijaController(InstancaNaLinijaService instancaNaLinijaService, LinijaService linijaService, AvtobusService avtobusService, KontrolaService kontrolaService) {
+        this.instancaNaLinijaService = instancaNaLinijaService;
+        this.linijaService = linijaService;
+        this.avtobusService = avtobusService;
+        this.kontrolaService = kontrolaService;
+    }
+
+    @GetMapping()
+    public String getList(Model model){
+        model.addAttribute("bodyContent", "listInstanci");
+        model.addAttribute("inls", instancaNaLinijaService.findAllActive());
+
+        return "master-template";
+    }
+    @GetMapping("/start")
+    public String getStartPage(Model model){
+        List<Linija> linijaList = linijaService.findAll();
+        List<Avtobus> avtobusList = avtobusService.findAll();
+        model.addAttribute("avtobusi", avtobusList);
+        model.addAttribute("linii", linijaList);
+        model.addAttribute("bodyContent", "startInstanca");
+
+        return "master-template";
+    }
+
+    @PostMapping("/start")
+    public String startInstanca(@RequestParam String aRegistracija,
+                                @RequestParam Long liId,
+                                Model model,
+                                Authentication authentication){
+        Instancanalinija start = instancaNaLinijaService.start(liId, aRegistracija, authentication.getName());
+//        model.addAttribute("inl", start);
+//        model.addAttribute("bodyContent", "inlShow");
+
+        return "redirect:/instanca-na-linija/" + start.getInlId();
+    }
+
+    @GetMapping("/{inlId}")
+    public String getInlShow(@PathVariable Long inlId,
+                             Model model){
+        model.addAttribute("inl", instancaNaLinijaService.findById(inlId));
+        model.addAttribute("kontroli", kontrolaService.findAllByInl(inlId));
+        model.addAttribute("bodyContent", "inlShow");
+
+        return "master-template";
+    }
+
+    @PostMapping("/{inlId}/end")
+    public String endInstanca(@PathVariable Long inlId){
+        Instancanalinija ended = instancaNaLinijaService.end(inlId);
+        return "redirect:/instanca-na-linija/" + ended.getInlId();
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/web/KaznaController.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/web/KaznaController.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/web/KaznaController.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,39 @@
+package mk.ukim.finki.busngo.web;
+
+import mk.ukim.finki.busngo.model.entities.Patnik;
+import mk.ukim.finki.busngo.model.exceptions.InvalidPatnikIdException;
+import mk.ukim.finki.busngo.service.KaznaZaRegistriranService;
+import mk.ukim.finki.busngo.service.VozenjeService;
+import org.springframework.security.core.Authentication;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+@RequestMapping("/kazna")
+public class KaznaController {
+    private final KaznaZaRegistriranService kaznaZaRegistriranService;
+
+    public KaznaController(KaznaZaRegistriranService kaznaZaRegistriranService) {
+        this.kaznaZaRegistriranService = kaznaZaRegistriranService;
+    }
+
+    @GetMapping()
+    public String getKaznaPage(Model model,
+                                 Authentication authentication){
+        model.addAttribute("bodyContent", "listKazni");
+        Patnik patnik = null;
+        try{
+            model.addAttribute("kazni", kaznaZaRegistriranService.findAllByPatnik(authentication.getName()));
+        }
+        catch (InvalidPatnikIdException e){
+            model.addAttribute("bodyContent", "listBileti");
+            model.addAttribute("hasError", true);
+            model.addAttribute("error", e.getMessage());
+            return "master-template";
+        }
+
+        return "master-template";
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/web/KontrolaController.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/web/KontrolaController.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/web/KontrolaController.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,85 @@
+package mk.ukim.finki.busngo.web;
+
+import mk.ukim.finki.busngo.model.entities.Kontroli;
+import mk.ukim.finki.busngo.model.exceptions.UserShouldNotBeTicketedException;
+import mk.ukim.finki.busngo.service.*;
+import org.springframework.security.core.Authentication;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+@Controller
+@RequestMapping("/kontrola")
+public class KontrolaController {
+
+    private final KontrolaService kontrolaService;
+    private final KaznaZaRegistriranService kaznaZaRegistriranService;
+    private final KaznaZaNeregistriranService kaznaZaNeregistriranService;
+    private final KaznaService kaznaService;
+    private final PatnikService patnikService;
+    private final VozacService vozacService;
+    private final InstancaNaLinijaService instancaNaLinijaService;
+
+    public KontrolaController(KontrolaService kontrolaService, KaznaZaRegistriranService kaznaZaRegistriranService, KaznaZaNeregistriranService kaznaZaNeregistriranService, KaznaService kaznaService, PatnikService patnikService, VozacService vozacService, InstancaNaLinijaService instancaNaLinijaService) {
+        this.kontrolaService = kontrolaService;
+        this.kaznaZaRegistriranService = kaznaZaRegistriranService;
+        this.kaznaZaNeregistriranService = kaznaZaNeregistriranService;
+        this.kaznaService = kaznaService;
+        this.patnikService = patnikService;
+        this.vozacService = vozacService;
+        this.instancaNaLinijaService = instancaNaLinijaService;
+    }
+
+    @GetMapping("/{kontrolaId}")
+    public String get(@PathVariable Long kontrolaId,
+                      Model model){
+        model.addAttribute("bodyContent", "kontrola");
+        Kontroli kontroli = kontrolaService.findById(kontrolaId);
+
+        model.addAttribute("kontrola", kontroli);
+        model.addAttribute("kazni", kaznaService.findAllByKontrolaId(kontrolaId));
+        model.addAttribute("patnici", patnikService.listAll());
+        return "master-template";
+    }
+    @GetMapping("/start-for/{inlId}")
+    public String getStartPage(@PathVariable Long inlId,
+                               Model model,
+                               Authentication authentication){
+        model.addAttribute("bodyContent", "kontrola");
+        Kontroli kontroli = kontrolaService.create(inlId, authentication.getName());
+
+        model.addAttribute("kontrola", kontroli);
+        return "redirect:/kontrola/" + kontroli.getKontrolaId();
+    }
+
+    @PostMapping("/{kontrolaId}/kazni-registriran")
+    public String kazniRegistriran(@PathVariable Long kontrolaId,
+                                   @RequestParam String dokument,
+                                   @RequestParam Double iznos,
+                                   @RequestParam Long patnik,
+                                   Authentication authentication){
+        try {
+
+            kaznaZaRegistriranService.create(kontrolaId, dokument, iznos, patnik, authentication.getName());
+        }
+        catch (UserShouldNotBeTicketedException exception){
+            return "redirect:/kontrola/" + kontrolaId;
+        }
+
+        return "redirect:/kontrola/" + kontrolaId;
+    }
+
+    @PostMapping("/{kontrolaId}/kazni-neregistriran")
+    public String kazniNeregistriran(@PathVariable Long kontrolaId,
+                                   @RequestParam String dokument,
+                                   @RequestParam Double iznos,
+                                   @RequestParam String telefon,
+                                   @RequestParam String ime,
+                                   @RequestParam String adresa,
+                                   Authentication authentication){
+
+        kaznaZaNeregistriranService.create(kontrolaId, dokument, iznos, telefon, ime, adresa, authentication.getName());
+
+        return "redirect:/kontrola/" + kontrolaId;
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/web/RegisterController.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/web/RegisterController.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/web/RegisterController.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -1,9 +1,10 @@
 package mk.ukim.finki.busngo.web;
 
-import mk.ukim.finki.busngo.model.enums.Role;
+import mk.ukim.finki.busngo.model.entities.Korisnik;
 import mk.ukim.finki.busngo.model.exceptions.InvalidCredentialsException;
 import mk.ukim.finki.busngo.model.exceptions.UserAlreadyExistsException;
 import mk.ukim.finki.busngo.service.AuthService;
 import mk.ukim.finki.busngo.service.KorisnikService;
+import mk.ukim.finki.busngo.service.PatnikService;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -18,8 +19,10 @@
     private final AuthService authService;
     private final KorisnikService korisnikService;
+    private final PatnikService patnikService;
 
-    public RegisterController(AuthService authService, KorisnikService korisnikService) {
+    public RegisterController(AuthService authService, KorisnikService korisnikService, PatnikService patnikService) {
         this.authService = authService;
         this.korisnikService = korisnikService;
+        this.patnikService = patnikService;
     }
 
@@ -44,5 +47,6 @@
     ) {
         try{
-            this.authService.register(name, email, password, confirmPassword, address, phone);
+            Korisnik korisnik = this.authService.registerPatnik(name, email, password, confirmPassword, address, phone);
+            this.patnikService.save(korisnik);
             return "redirect:/login";
         } catch (InvalidCredentialsException | UserAlreadyExistsException exception) {
@@ -51,3 +55,13 @@
     }
 
+//    @PostMapping
+//    public String registerVraboten(@RequestParam String name,
+//                                   @RequestParam String email,
+//                                   @RequestParam String password,
+//                                   @RequestParam String confirmPassword,
+//                                   @RequestParam String address,
+//                                   @RequestParam String phone){
+//
+//    }
+
 }
Index: src/main/java/mk/ukim/finki/busngo/web/VozenjeController.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/web/VozenjeController.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/java/mk/ukim/finki/busngo/web/VozenjeController.java	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,123 @@
+package mk.ukim.finki.busngo.web;
+
+import mk.ukim.finki.busngo.model.entities.Linija;
+import mk.ukim.finki.busngo.model.entities.Patnik;
+import mk.ukim.finki.busngo.model.entities.Vozenje;
+import mk.ukim.finki.busngo.model.exceptions.InvalidPatnikIdException;
+import mk.ukim.finki.busngo.model.exceptions.InvalidPostojkaNaLinijaIdException;
+import mk.ukim.finki.busngo.service.*;
+import org.springframework.security.core.Authentication;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.*;
+
+@Controller
+@RequestMapping("/vozenje")
+public class VozenjeController {
+    private final VozenjeService vozenjeService;
+    private final PostojkaNaLinijaService postojkaNaLinijaService;
+    private final InstancaNaLinijaService instancaNaLinijaService;
+    private final BiletService biletService;
+
+    public VozenjeController(VozenjeService vozenjeService, PostojkaNaLinijaService postojkaNaLinijaService, InstancaNaLinijaService instancaNaLinijaService, BiletService biletService) {
+        this.vozenjeService = vozenjeService;
+        this.postojkaNaLinijaService = postojkaNaLinijaService;
+        this.instancaNaLinijaService = instancaNaLinijaService;
+        this.biletService = biletService;
+    }
+
+    @GetMapping()
+    public String getVozenjePage(Model model,
+                                 Authentication authentication){
+        model.addAttribute("bodyContent", "listVozenja");
+        Patnik patnik = null;
+        try{
+            model.addAttribute("vozenja", vozenjeService.findVozenjaByPatnik(authentication.getName()));
+        }
+        catch (InvalidPatnikIdException e){
+            model.addAttribute("bodyContent", "listBileti");
+            model.addAttribute("hasError", true);
+            model.addAttribute("error", e.getMessage());
+            return "master-template";
+        }
+
+        return "master-template";
+    }
+
+//    @GetMapping("/start")
+//    public String getStartVozenjePagePostojkaPage(Model model){
+//        model.addAttribute("postojki", postojkaNaLinijaService.findAll());
+//        model.addAttribute("bodyContent", "choosePostojka");
+//
+//        return "master-template";
+//    }
+    @GetMapping("/start")
+    public String getStartVozenjePageAll(@RequestParam(required = false) Long pnlId,
+                                         Model model,
+                                         Authentication authentication){
+        try{
+            if(pnlId != null){
+                model.addAttribute("postojka", postojkaNaLinijaService.findById(pnlId));
+                model.addAttribute("instanci", instancaNaLinijaService.findByPnlId(pnlId));
+            }
+            model.addAttribute("postojki", postojkaNaLinijaService.findAll());
+
+            model.addAttribute("bileti", biletService.findAllByPatnikEmail(authentication.getName()));
+            model.addAttribute("bodyContent", "startVozenje");
+        }
+        catch (InvalidPostojkaNaLinijaIdException | InvalidPatnikIdException exception){
+            model.addAttribute("bodyContent", "listBileti");
+            model.addAttribute("hasError", true);
+            model.addAttribute("error", exception.getMessage());
+            return "master-template";
+        }
+
+        return "master-template";
+    }
+
+    @PostMapping("/start")
+    public String startVozenje(@RequestParam Long pnlId,
+                               @RequestParam Long inlId,
+                               @RequestParam Long bId,
+                               Authentication authentication,
+                               Model model){
+        try{
+            vozenjeService
+                    .start(authentication.getName(), bId, pnlId, inlId);
+        }
+        catch (RuntimeException e){
+            System.out.println(e.getMessage());
+            model.addAttribute("bodyContent", "listBileti");
+            model.addAttribute("hasError", true);
+            model.addAttribute("error", e.getMessage());
+            return "master-template";
+        }
+
+        return "redirect:/vozenje";
+    }
+
+    @GetMapping("/{vozenjeId}/end")
+    public String getEndVozenje(@PathVariable Long vozenjeId,
+                                Model model){
+        Vozenje vozenje = vozenjeService.findById(vozenjeId);
+        model.addAttribute("vozenje", vozenjeService.findById(vozenjeId));
+        model.addAttribute("pnls",
+                postojkaNaLinijaService
+                        .findByLinijaAfterRedenBroj(Long.valueOf(vozenje
+                                .getInstancanalinijaByInlId()
+                                .getLinijaByLiId()
+                                .getLiId()),
+                                vozenje.getPostojkanalinijaByKacuvaPnlId().getPnlRedenBroj()));
+
+        model.addAttribute("bodyContent", "endVozenje");
+
+        return "master-template";
+    }
+
+    @PostMapping("/{vozenjeId}/end")
+    public String endVozenje(@PathVariable Long vozenjeId,
+                             @RequestParam Long pnlEndId){
+        Vozenje end = vozenjeService.end(vozenjeId, pnlEndId);
+        return "redirect:/vozenje";
+    }
+}
Index: src/main/resources/application.properties
===================================================================
--- src/main/resources/application.properties	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/resources/application.properties	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -1,4 +1,4 @@
 #
-spring.datasource.url=jdbc:postgresql://localhost:9090/db_202324z_va_prj_busngo
+spring.datasource.url=jdbc:postgresql://localhost:8089/db_202324z_va_prj_busngo
 spring.datasource.username=db_202324z_va_prj_busngo_owner
 spring.datasource.password=d9f924580e7
@@ -7,10 +7,11 @@
 
 spring.datasource.hikari.connection-timeout=20000
-spring.datasource.hikari.maximum-pool-size=25
+spring.datasource.hikari.maximum-pool-size=5
 
 #spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
 spring.jpa.properties.hibernate.jdbc.non_contextual_creation=true
-spring.jpa.properties.hibernate.default_schema=project 
+spring.jpa.properties.hibernate.default_schema=project
 
 spring.jpa.hibernate.ddl-auto=validate
 spring.jpa.show-sql=true
+
Index: src/main/resources/templates/choosePostojka.html
===================================================================
--- src/main/resources/templates/choosePostojka.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/resources/templates/choosePostojka.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,17 @@
+<div class="container" xmlns:th="http://www.thymeleaf.org">
+    <form class="form-signin mt-xl-5" method="get" action="/vozenje/choose-postojka">
+        <h2 class="form-signin-heading">Odberete postojka na koja se naogjate</h2>
+        <p>
+            <label for="pnlId" class="sr-only">Postojka</label>
+            <select class="form-control" name="pnlId" id="pnlId">
+                <option class="form-control" th:each="postojka : ${postojki}" th:text="${postojka.postojkaByPId.pIme}" th:value="${postojka.pnlId}" ></option>
+            </select>
+
+
+        </p>
+        <div class="col-md-3">
+            <button id="submit" class="btn btn-lg btn-primary btn-block" type="submit">Odberi</button>
+        </div>
+    </form>
+</div>
+
Index: src/main/resources/templates/endVozenje.html
===================================================================
--- src/main/resources/templates/endVozenje.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/resources/templates/endVozenje.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,62 @@
+<div class="container" xmlns:th="http://www.thymeleaf.org">
+    <form class="form-signin mt-xl-5" method="post" th:action="@{'/vozenje/{id}/end'(id=${vozenje.vozenjeId})}">
+        <h2 class="form-signin-heading">Start vozenje</h2>
+
+        <p>
+            <label for="pnlId" class="sr-only">Postojka</label>
+            <select   class="form-control" name="pnlId" id="pnlId">
+                <option class="form-control"
+                        th:text="${vozenje.postojkanalinijaByKacuvaPnlId.postojkaByPId.pIme}"
+                        selected
+                        disabled
+                        th:value="${vozenje.postojkanalinijaByKacuvaPnlId.pnlId} "  ></option>
+<!--                        th:selected="${postojka!= null && postojka.pnlId == pos.pnlId} ? 'true' : 'false' " -->
+<!--                        th:disabled="${postojka!= null && postojka.pnlId != pos.pnlId} ? 'true' : 'false' "  -->
+
+            </select>
+        </p>
+
+        <p >
+            <label for="instanca" class="sr-only">Instanca</label>
+            <select id="instanca" name="inlId" class="form-control">
+                <option
+                        selected
+                        disabled
+                        th:value="${vozenje.instancanalinijaByInlId.inlId}"
+                        th:text="${vozenje.instancanalinijaByInlId.linijaByLiId.liIme} + ' - ' + ${vozenje.instancanalinijaByInlId.linijaByLiId.liPravec}"></option>
+            </select>
+        </p>
+
+        <p >
+            <label for="bilet" class="sr-only">Bilet</label>
+            <select id="bilet" name="bId" class="form-control">
+                <option
+                        selected
+                        disabled
+                        th:value="${vozenje.biletByBId.bId}"
+                        th:text="${vozenje.biletByBId.tipbiletByTbId.tbIme} + ' - ' + ${vozenje.biletByBId.bStatus.name()}"></option>
+            </select>
+        </p>
+
+        <p>
+            <label for="pnlEndId" class="sr-only">Postojka Simnuvanje</label>
+            <select   class="form-control" name="pnlEndId" id="pnlEndId">
+                <option class="form-control"
+                        th:each="pos : ${pnls}"
+                        th:text="${pos.postojkaByPId.pIme}"
+                        th:value="${pos.pnlId} "  ></option>
+
+
+            </select>
+        </p>
+
+        <div th:if="${param.error}" th:text="${param.error}" class="text-danger"></div>
+
+        <div class="row">
+            <div class="col-md-3">
+                <button id="submit" class="btn btn-lg btn-primary btn-block" type="submit">End</button>
+            </div>
+        </div>
+    </form>
+</div>
+
Index: src/main/resources/templates/fragments/header.html
===================================================================
--- src/main/resources/templates/fragments/header.html	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/resources/templates/fragments/header.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -14,8 +14,11 @@
           </li>
           <li class="nav-item m-auto">
-            <a class="nav-link active" href="/categories">Categories</a>
+            <a class="nav-link active" href="/vozenje">Vozenja</a>
           </li>
           <li class="nav-item m-auto">
-            <a class="nav-link active" href="/manufacturers">Manufacturers</a>
+            <a class="nav-link active" href="/kazna">Kazni</a>
+          </li>
+          <li class="nav-item m-auto">
+            <a class="nav-link active" href="/instanca-na-linija">Instanci</a>
           </li>
         </ul>
@@ -58,4 +61,9 @@
             </a>
           </li>
+          <li class="nav-item" sec:authorize="hasRole('ROLE_ADMIN')">
+            <a class="btn btn-light btn-sm ml-3" href="/admin">
+               Admin Menu
+            </a>
+          </li>
         </ul>
       </div>
Index: src/main/resources/templates/inlShow.html
===================================================================
--- src/main/resources/templates/inlShow.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/resources/templates/inlShow.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,115 @@
+<div class="container" xmlns:th="http://www.thymeleaf.org">
+    <form class="form-signin mt-xl-5" method="post" th:action="@{'/instanca-na-linija/{id}/end'(id=${inl.inlId})}">
+        <h2 class="form-signin-heading">Instanca na linija</h2>
+
+        <p>
+            <label for="aRegistracija" class="sr-only">Avtobus</label>
+            <input type="text"
+                   class="form-controll"
+                   th:value="${inl.avtobusByARegistracija.aRegistracija} "
+                   disabled
+                   name="aRegistracija"
+                   id="aRegistracija"
+            >
+        </p>
+
+        <p>
+            <label for="liId" class="sr-only">Linija</label>
+            <select id="liId" name="liId" class="form-control">
+                <option th:value="${inl.linijaByLiId.liId}"
+                        th:text="${inl.linijaByLiId.liIme} + ' - ' + ${inl.linijaByLiId.liPravec}"
+                        selected
+                        disabled></option>
+            </select>
+
+
+        </p>
+
+
+        <div th:if="${param.error}" th:text="${param.error}" class="text-danger"></div>
+
+        <div class="row">
+            <div class="col-md-3">
+                <button th:disabled="${inl.inlDatumEnd != null} ? 'true' : 'false'"
+                        id="submit"
+                        class="btn btn-lg btn-primary btn-block"
+                        type="submit"
+                        th:text="${inl.inlDatumEnd != null} ? 'Already ended' : 'End'"></button>
+            </div>
+        </div>
+    </form>
+
+    <div xmlns:th="http://www.thymeleaf.org">
+
+        <div class="container mb-4">
+            <div class="row">
+                <div class="col-12" >
+                    <div class="table-responsive">
+                        <table class="table table-striped">
+                            <thead>
+                            <tr>
+                                <th scope="col">#</th>
+                                <th scope="col">Timestamp</th>
+                                <th scope="col">Kondukter</th>
+                                <th scope="col"></th>
+                                <th scope="col"></th>
+                                <th scope="col"></th>
+                            </tr>
+                            </thead>
+                            <tbody>
+                            <tr th:each="kontrola : ${kontroli}" class="product">
+                                <td >
+                                    <a th:text="${kontrola.kontrolaId}" th:href="@{'/kontrola/{id}'(id= ${kontrola.kontrolaId})}"></a>
+                                </td>
+                                <td th:text="${kontrola.kontrolaDatum}"></td>
+                                <td th:text="${kontrola.korisnikByKondukterKId.kIme}"></td>
+
+                                <td class="text-right">
+                                    <!--                                <th:block sec:authorize="hasRole('ROLE_ADMIN')">-->
+                                    <!--                                    <form th:action="@{'/products/delete/{id}' (id=${vozenje.vozenjeId})}"-->
+                                    <!--                                          th:method="DELETE">-->
+                                    <!--                                        <button type="submit"-->
+                                    <!--                                                class="btn btn-sm btn-danger delete-product">-->
+                                    <!--                                            <i class="fas fa-trash-alt"></i> Delete-->
+                                    <!--                                        </button>-->
+                                    <!--                                    </form>-->
+                                    <!--                                </th:block>-->
+                                </td>
+                                <td>
+                                    <!--                                <th:block sec:authorize="hasRole('ROLE_ADMIN')">-->
+                                    <!--                                    <a th:href="@{'/products/edit-form/{id}' (id=${vozenje.vozenjeId})}"-->
+                                    <!--                                       class="btn btn-sm btn-info edit-product">-->
+                                    <!--                                        <i class="fas fa-edit"></i> Edit-->
+                                    <!--                                    </a>-->
+                                    <!--                                </th:block>-->
+                                </td>
+                                <td>
+<!--                                    <form th:action="@{'/kontrola/start-for/{id}'(id=${inl.inlId})}"-->
+<!--                                          th:method="GET">-->
+<!--                                        <button type="submit" class="btn btn-sm btn-success add-to-cart">-->
+<!--                                            <i class="fas fa-shopping-cart"></i> Kontrola-->
+<!--                                        </button>-->
+<!--                                    </form>-->
+                                </td>
+                            </tr>
+                            </tbody>
+                        </table>
+                    </div>
+                </div>
+                <div class="col mb-3">
+                    <div class="row">
+                        <div class="col-sm-12 col-md-12">
+                            <a href="/instanca-na-linija/start" class="btn btn-block btn-dark add-product-btn">
+                                Start instanca
+                            </a>
+                        </div>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+
+
+
+</div>
+
Index: src/main/resources/templates/kontrola.html
===================================================================
--- src/main/resources/templates/kontrola.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/resources/templates/kontrola.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,152 @@
+<div xmlns:th="http://www.thymeleaf.org">
+    <section class="jumbotron text-center">
+        <div class="container">
+            <h1 class="jumbotron-heading">WEB PROGRAMMING SHOP</h1>
+            <h3 class="jumbotron-heading">All products</h3>
+        </div>
+    </section>
+
+
+    <form class="form-signin mt-xl-5" method="post" th:action="@{'/kontrola/{id}/kazni-neregistriran'(id=${kontrola.kontrolaId})}">
+        <h2 class="form-signin-heading">Kazna za neregirstiran</h2>
+
+        <p>
+            <label for="dokument" class="sr-only">Email</label>
+            <input class="form-control" name="dokument" id="dokument" type="text">
+        </p>
+
+
+        <p>
+            <label for="telefon" class="sr-only">Telefon</label>
+            <input class="form-control" name="telefon" id="telefon" type="text">
+        </p>
+
+        <p>
+            <label for="ime" class="sr-only">Ime</label>
+            <input class="form-control" name="ime" id="ime" type="text">
+        </p>
+
+        <p>
+            <label for="adresa" class="sr-only">Adresa</label>
+            <input class="form-control" name="adresa" id="adresa" type="text">
+        </p>
+
+
+        <p>
+            <label for="iznos" class="sr-only">Iznos</label>
+            <input class="form-control" name="iznos" id="iznos" type="number">
+        </p>
+
+
+        <div th:if="${param.error}" th:text="${param.error}" class="text-danger"></div>
+
+        <div class="row">
+            <div class="col-md-3">
+                <button id="submit" class="btn btn-lg btn-primary btn-block" type="submit">Kazni</button>
+            </div>
+        </div>
+    </form>
+
+
+    <form class="form-signin mt-xl-5" method="post" th:action="@{'/kontrola/{id}/kazni-registriran'(id=${kontrola.kontrolaId})}">
+        <h2 class="form-signin-heading">Kazna za regirstiran</h2>
+
+        <p>
+            <label for="dk" class="sr-only">Dokument</label>
+            <input class="form-control" name="dokument" id="dk" type="text">
+        </p>
+
+        <p>
+            <label for="iz" class="sr-only">Iznos</label>
+            <input class="form-control" name="iznos" id="iz" type="number">
+        </p>
+
+        <p>
+            <label for="patnik" class="sr-only">Patnik</label>
+            <select id="patnik" name="patnik" class="form-control">
+                <option th:each="patnik : ${patnici}"
+                        th:value="${patnik.kId}"
+                        th:text="${patnik.kIme} + ' - ' + ${patnik.kEmail}">
+
+                </option>
+            </select>
+        </p>
+
+
+        <div th:if="${param.error}" th:text="${param.error}" class="text-danger"></div>
+
+        <div class="row">
+            <div class="col-md-3">
+                <button id="sub" class="btn btn-lg btn-primary btn-block" type="submit">Kazni</button>
+            </div>
+        </div>
+    </form>
+
+
+
+
+
+
+
+
+    <div class="container mb-4">
+        <div class="row">
+            <div class="col-12" >
+                <div class="table-responsive">
+                    <table class="table table-striped">
+                        <thead>
+                        <tr>
+                            <th scope="col">#</th>
+                            <th scope="col">Iznos</th>
+                            <th scope="col">Plateno</th>
+                            <th scope="col">Dokument</th>
+                            <th scope="col"></th>
+                            <th scope="col"></th>
+                            <th scope="col"></th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <tr th:each="kazna : ${kazni}" class="product">
+                            <td th:text="${kazna.kzId}"></td>
+                            <td th:text="${kazna.kzIznos}"></td>
+                            <td th:text="${kazna.kzPlateno}"></td>
+                            <td th:text="${kazna.kzDokument}"></td>
+
+                            <td class="text-right">
+                                <th:block sec:authorize="hasRole('ROLE_ADMIN')">
+                                    <form th:action="@{'/products/delete/{id}' (id=${kazna.kzId})}"
+                                          th:method="DELETE">
+                                        <button type="submit"
+                                                class="btn btn-sm btn-danger delete-product">
+                                            <i class="fas fa-trash-alt"></i> Delete
+                                        </button>
+                                    </form>
+                                </th:block>
+                            </td>
+                            <td>
+                                <th:block sec:authorize="hasRole('ROLE_ADMIN')">
+                                    <a th:href="@{'/products/edit-form/{id}' (id=${kazna.kzId})}"
+                                       class="btn btn-sm btn-info edit-product">
+                                        <i class="fas fa-edit"></i> Edit
+                                    </a>
+                                </th:block>
+                            </td>
+                            <td>
+                                <form th:action="@{'/shopping-cart/add-product/{id}' (id=${kazna.kzId})}"
+                                      th:method="POST">
+                                    <button type="submit" class="btn btn-sm btn-success add-to-cart">
+                                        <i class="fas fa-shopping-cart"></i> Add to cart
+                                    </button>
+                                </form>
+                            </td>
+                        </tr>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+
+        </div>
+    </div>
+</div>
+
+
Index: src/main/resources/templates/listInstanci.html
===================================================================
--- src/main/resources/templates/listInstanci.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/resources/templates/listInstanci.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,85 @@
+<div xmlns:th="http://www.thymeleaf.org">
+    <section class="jumbotron text-center">
+        <div class="container">
+            <h1 class="jumbotron-heading">WEB PROGRAMMING SHOP</h1>
+            <h3 class="jumbotron-heading">All products</h3>
+        </div>
+    </section>
+
+    <div class="container mb-4">
+        <div class="row">
+            <div class="col-12" >
+                <div class="table-responsive">
+                    <table class="table table-striped">
+                        <thead>
+                        <tr>
+                            <th scope="col">#</th>
+                            <th scope="col">Vozac</th>
+                            <th scope="col">Avtobus</th>
+                            <th scope="col">Linija</th>
+                            <th scope="col">Pravec</th>
+                            <th scope="col">Start date</th>
+                            <th scope="col">End date</th>
+                            <th scope="col"></th>
+                            <th scope="col"></th>
+                            <th scope="col"></th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <tr th:each="inl : ${inls}" class="product">
+                            <td >
+                                <a th:text="${inl.inlId}" th:href="@{'/instanca-na-linija/{id}'(id= ${inl.inlId})}"></a>
+                            </td>
+                            <td th:text="${inl.korisnikByVozacKId.kIme}"></td>
+                            <td th:text="${inl.avtobusByARegistracija.aRegistracija}"></td>
+                            <td th:text="${inl.linijaByLiId.liIme}"></td>
+                            <td th:text="${inl.linijaByLiId.liPravec}"></td>
+                            <td th:text="${inl.inlDatumStart.toString()}"></td>
+                            <td th:text="${inl.inlDatumEnd != null} ? ${inl.inlDatumEnd.toString()} : 'Still active'"></td>
+
+                            <td class="text-right">
+<!--                                <th:block sec:authorize="hasRole('ROLE_ADMIN')">-->
+<!--                                    <form th:action="@{'/products/delete/{id}' (id=${vozenje.vozenjeId})}"-->
+<!--                                          th:method="DELETE">-->
+<!--                                        <button type="submit"-->
+<!--                                                class="btn btn-sm btn-danger delete-product">-->
+<!--                                            <i class="fas fa-trash-alt"></i> Delete-->
+<!--                                        </button>-->
+<!--                                    </form>-->
+<!--                                </th:block>-->
+                            </td>
+                            <td>
+<!--                                <th:block sec:authorize="hasRole('ROLE_ADMIN')">-->
+<!--                                    <a th:href="@{'/products/edit-form/{id}' (id=${vozenje.vozenjeId})}"-->
+<!--                                       class="btn btn-sm btn-info edit-product">-->
+<!--                                        <i class="fas fa-edit"></i> Edit-->
+<!--                                    </a>-->
+<!--                                </th:block>-->
+                            </td>
+                            <td>
+                                <form th:action="@{'/kontrola/start-for/{id}'(id=${inl.inlId})}"
+                                      th:method="GET">
+                                    <button type="submit" class="btn btn-sm btn-success add-to-cart">
+                                        <i class="fas fa-shopping-cart"></i> Kontrola
+                                    </button>
+                                </form>
+                            </td>
+                        </tr>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <div class="col mb-3">
+                <div class="row">
+                    <div class="col-sm-12 col-md-12">
+                        <a href="/instanca-na-linija/start" class="btn btn-block btn-dark add-product-btn">
+                            Start instanca
+                        </a>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+
Index: src/main/resources/templates/listKazni.html
===================================================================
--- src/main/resources/templates/listKazni.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/resources/templates/listKazni.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,77 @@
+<div xmlns:th="http://www.thymeleaf.org">
+    <section class="jumbotron text-center">
+        <div class="container">
+            <h1 class="jumbotron-heading">WEB PROGRAMMING SHOP</h1>
+            <h3 class="jumbotron-heading">All products</h3>
+        </div>
+    </section>
+
+    <div class="container mb-4">
+        <div class="row">
+            <div class="col-12" >
+                <div class="table-responsive">
+                    <table class="table table-striped">
+                        <thead>
+                        <tr>
+                            <th scope="col">#</th>
+                            <th scope="col">Iznos</th>
+                            <th scope="col">Plateno</th>
+                            <th scope="col">Dokument</th>
+                            <th scope="col"></th>
+                            <th scope="col"></th>
+                            <th scope="col"></th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <tr th:each="kazna : ${kazni}" class="product">
+                            <td th:text="${kazna.kzId}"></td>
+                            <td th:text="${kazna.kzIznos}"></td>
+                            <td th:text="${kazna.kzPlateno}"></td>
+                            <td th:text="${kazna.kzDokument}"></td>
+
+                            <td class="text-right">
+                                <th:block sec:authorize="hasRole('ROLE_ADMIN')">
+                                    <form th:action="@{'/products/delete/{id}' (id=${kazna.kzId})}"
+                                          th:method="DELETE">
+                                        <button type="submit"
+                                                class="btn btn-sm btn-danger delete-product">
+                                            <i class="fas fa-trash-alt"></i> Delete
+                                        </button>
+                                    </form>
+                                </th:block>
+                            </td>
+                            <td>
+                                <th:block sec:authorize="hasRole('ROLE_ADMIN')">
+                                    <a th:href="@{'/products/edit-form/{id}' (id=${kazna.kzId})}"
+                                       class="btn btn-sm btn-info edit-product">
+                                        <i class="fas fa-edit"></i> Edit
+                                    </a>
+                                </th:block>
+                            </td>
+                            <td>
+                                <form th:action="@{'/shopping-cart/add-product/{id}' (id=${kazna.kzId})}"
+                                      th:method="POST">
+                                    <button type="submit" class="btn btn-sm btn-success add-to-cart">
+                                        <i class="fas fa-shopping-cart"></i> Add to cart
+                                    </button>
+                                </form>
+                            </td>
+                        </tr>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <div class="col mb-3">
+                <div class="row">
+                    <div class="col-sm-12 col-md-12">
+                        <a href="/bilet/kupi" class="btn btn-block btn-dark add-product-btn">
+                            Kupi bilet
+                        </a>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+
Index: src/main/resources/templates/listVozenja.html
===================================================================
--- src/main/resources/templates/listVozenja.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/resources/templates/listVozenja.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,79 @@
+<div xmlns:th="http://www.thymeleaf.org">
+    <section class="jumbotron text-center">
+        <div class="container">
+            <h1 class="jumbotron-heading">WEB PROGRAMMING SHOP</h1>
+            <h3 class="jumbotron-heading">All products</h3>
+        </div>
+    </section>
+
+    <div class="container mb-4">
+        <div class="row">
+            <div class="col-12" >
+                <div class="table-responsive">
+                    <table class="table table-striped">
+                        <thead>
+                        <tr>
+                            <th scope="col">#</th>
+                            <th scope="col">Status</th>
+                            <th scope="col">Korisnik Ime</th>
+                            <th scope="col">Bilet Id</th>
+                            <th scope="col">Tip Bilet</th>
+                            <th scope="col"></th>
+                            <th scope="col"></th>
+                            <th scope="col"></th>
+                        </tr>
+                        </thead>
+                        <tbody>
+                        <tr th:each="vozenje : ${vozenja}" class="product">
+                            <td th:text="${vozenje.vozenjeId}"></td>
+                            <td th:text="${vozenje.vozenjeStatus.name()}"></td>
+                            <td th:text="${vozenje.korisnikByPatnikKId.kIme}"></td>
+                            <td th:text="${vozenje.biletByBId.bId}"></td>
+                            <td th:text="${vozenje.biletByBId.tipbiletByTbId.tbIme}"></td>
+
+                            <td class="text-right">
+                                <th:block sec:authorize="hasRole('ROLE_ADMIN')">
+                                    <form th:action="@{'/products/delete/{id}' (id=${vozenje.vozenjeId})}"
+                                          th:method="DELETE">
+                                        <button type="submit"
+                                                class="btn btn-sm btn-danger delete-product">
+                                            <i class="fas fa-trash-alt"></i> Delete
+                                        </button>
+                                    </form>
+                                </th:block>
+                            </td>
+                            <td>
+                                <th:block sec:authorize="hasRole('ROLE_ADMIN')">
+                                    <a th:href="@{'/products/edit-form/{id}' (id=${vozenje.vozenjeId})}"
+                                       class="btn btn-sm btn-info edit-product">
+                                        <i class="fas fa-edit"></i> Edit
+                                    </a>
+                                </th:block>
+                            </td>
+                            <td>
+                                <form th:action="@{'/vozenje/{vozenjeId}/end'(vozenjeId=${vozenje.vozenjeId})}"
+                                      th:method="GET">
+                                    <button type="submit" class="btn btn-sm btn-success add-to-cart">
+                                        <i class="fas fa-shopping-cart"></i> End vozenje
+                                    </button>
+                                </form>
+                            </td>
+                        </tr>
+                        </tbody>
+                    </table>
+                </div>
+            </div>
+            <div class="col mb-3">
+                <div class="row">
+                    <div class="col-sm-12 col-md-12">
+                        <a href="/vozenje/start" class="btn btn-block btn-dark add-product-btn">
+                            Start vozenje
+                        </a>
+                    </div>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+
Index: src/main/resources/templates/startInstanca.html
===================================================================
--- src/main/resources/templates/startInstanca.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/resources/templates/startInstanca.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,29 @@
+<div class="container" xmlns:th="http://www.thymeleaf.org">
+    <form class="form-signin mt-xl-5" method="post" action="/instanca-na-linija/start">
+        <h2 class="form-signin-heading">Start instanca na linija</h2>
+
+        <p>
+            <label for="aRegistracija" class="sr-only">Avtobus</label>
+            <select   class="form-control" name="aRegistracija" id="aRegistracija">
+                <option class="form-control" th:each="avtobus : ${avtobusi}" th:text="${avtobus.aRegistracija}"  th:value="${avtobus.aRegistracija} "  ></option>
+            </select>
+        </p>
+
+        <p>
+            <label for="liId" class="sr-only">Password</label>
+            <select id="liId" name="liId" class="form-control">
+                <option th:each="linija : ${linii}" th:value="${linija.liId}" th:text="${linija.liIme} + ' - ' + ${linija.liPravec}"></option>
+            </select>
+        </p>
+
+
+        <div th:if="${param.error}" th:text="${param.error}" class="text-danger"></div>
+
+        <div class="row">
+            <div class="col-md-3">
+                <button id="submit" class="btn btn-lg btn-primary btn-block" type="submit">Start</button>
+            </div>
+        </div>
+    </form>
+</div>
+
Index: src/main/resources/templates/startVozenje.html
===================================================================
--- src/main/resources/templates/startVozenje.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
+++ src/main/resources/templates/startVozenje.html	(revision bde8b1381c72e66b4414f8010493f3f189b15c03)
@@ -0,0 +1,35 @@
+<div class="container" xmlns:th="http://www.thymeleaf.org">
+    <form class="form-signin mt-xl-5" th:method="${postojka} != null ? 'post' : 'get'" action="/vozenje/start">
+        <h2 class="form-signin-heading">Start vozenje</h2>
+
+        <p>
+            <label for="pnlId" class="sr-only">Postojka</label>
+            <select   class="form-control" name="pnlId" id="pnlId">
+                <option class="form-control" th:each="pos : ${postojki}" th:text="${pos.postojkaByPId.pIme}" th:selected="${postojka!= null && postojka.pnlId == pos.pnlId} ? 'true' : 'false' " th:disabled="${postojka!= null && postojka.pnlId != pos.pnlId} ? 'true' : 'false' "  th:value="${pos.pnlId} "  ></option>
+            </select>
+        </p>
+
+        <p th:hidden="${instanci} == null">
+            <label for="instanca" class="sr-only">Password</label>
+            <select id="instanca" name="inlId" class="form-control">
+                <option th:each="instanca : ${instanci}" th:value="${instanca.inlId}" th:text="${instanca.linijaByLiId.liIme} + ' - ' + ${instanca.linijaByLiId.liPravec}"></option>
+            </select>
+        </p>
+
+        <p th:hidden="${instanci} == null">
+            <label for="bilet" class="sr-only">Password</label>
+            <select id="bilet" name="bId" class="form-control">
+                <option th:each="bilet : ${bileti}" th:value="${bilet.bId}" th:text="${bilet.tipbiletByTbId.tbIme} + ' - ' + ${bilet.bStatus.name()}"></option>
+            </select>
+        </p>
+
+        <div th:if="${param.error}" th:text="${param.error}" class="text-danger"></div>
+
+        <div class="row">
+            <div class="col-md-3">
+                <button id="submit" class="btn btn-lg btn-primary btn-block" type="submit">Start</button>
+            </div>
+        </div>
+    </form>
+</div>
+
