Index: src/main/java/mk/ukim/finki/busngo/BusNGoApplication.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/BusNGoApplication.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ src/main/java/mk/ukim/finki/busngo/BusNGoApplication.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -3,4 +3,7 @@
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.context.annotation.Bean;
+import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
+import org.springframework.security.crypto.password.PasswordEncoder;
 
 @SpringBootApplication
@@ -10,4 +13,8 @@
         SpringApplication.run(BusNGoApplication.class, args);
     }
+    @Bean
+    PasswordEncoder passwordEncoder(){
+        return new BCryptPasswordEncoder(10);
+    }
 
 }
Index: src/main/java/mk/ukim/finki/busngo/config/CustomUsernamePasswordAuthenticationProvider.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/config/CustomUsernamePasswordAuthenticationProvider.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/config/CustomUsernamePasswordAuthenticationProvider.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,46 @@
+package mk.ukim.finki.busngo.config;
+
+import mk.ukim.finki.busngo.service.KorisnikService;
+import org.springframework.security.authentication.AuthenticationProvider;
+import org.springframework.security.authentication.BadCredentialsException;
+import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.core.AuthenticationException;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.stereotype.Component;
+
+@Component
+public class CustomUsernamePasswordAuthenticationProvider implements AuthenticationProvider {
+
+    private final KorisnikService userService;
+    private final PasswordEncoder passwordEncoder;
+
+    public CustomUsernamePasswordAuthenticationProvider(KorisnikService userService, PasswordEncoder passwordEncoder) {
+        this.userService = userService;
+        this.passwordEncoder = passwordEncoder;
+    }
+
+    @Override
+    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
+        String username = authentication.getName();
+        String password = authentication.getCredentials().toString();
+
+        if (username.isEmpty() || password.isEmpty()) {
+            throw new BadCredentialsException("Empty credentials!");
+        }
+
+        UserDetails userDetails = this.userService.loadUserByEmail(username);
+
+        if (!passwordEncoder.matches(password, userDetails.getPassword())) {
+            throw new BadCredentialsException("Password is incorrect!");
+        }
+        return new UsernamePasswordAuthenticationToken(userDetails, userDetails.getPassword(), userDetails.getAuthorities());
+    }
+
+    @Override
+    public boolean supports(Class<?> aClass) {
+        return aClass.equals(UsernamePasswordAuthenticationToken.class);
+    }
+
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,73 @@
+package mk.ukim.finki.busngo.config;
+
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.security.authentication.AuthenticationManager;
+import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
+import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity;
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
+import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
+import org.springframework.security.core.userdetails.User;
+import org.springframework.security.core.userdetails.UserDetails;
+import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.crypto.password.PasswordEncoder;
+import org.springframework.security.provisioning.InMemoryUserDetailsManager;
+import org.springframework.security.web.SecurityFilterChain;
+
+
+@Configuration
+@EnableWebSecurity
+@EnableMethodSecurity
+public class WebSecurityConfig {
+
+    private final PasswordEncoder passwordEncoder;
+    private final CustomUsernamePasswordAuthenticationProvider authProvider;
+
+    public WebSecurityConfig(PasswordEncoder passwordEncoder, CustomUsernamePasswordAuthenticationProvider authProvider) {
+        this.passwordEncoder = passwordEncoder;
+        this.authProvider = authProvider;
+    }
+
+    @Bean
+    public SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception  {
+
+        http
+                .csrf(AbstractHttpConfigurer::disable)
+                .authorizeHttpRequests( (requests) -> requests
+                        .requestMatchers("/", "/home", "/assets/**", "/register")
+                        .permitAll()
+                        .requestMatchers("/admin/**").hasRole("ADMIN")
+                        .anyRequest()
+                        .authenticated()
+                )
+                .formLogin((form) -> form
+                        .loginPage("/login")
+                        .permitAll()
+                        .failureUrl("/login?error=BadCredentials")
+                        .defaultSuccessUrl("/", true)
+                )
+                .logout((logout) -> logout
+                        .logoutUrl("/logout")
+                        .clearAuthentication(true)
+                        .invalidateHttpSession(true)
+                        .deleteCookies("JSESSIONID")
+                        .logoutSuccessUrl("/login")
+                )
+                .exceptionHandling((ex) -> ex
+                        .accessDeniedPage("/access_denied")
+                );
+
+        return http.build();
+    }
+
+
+
+    @Bean
+    public AuthenticationManager authManager(HttpSecurity http) throws Exception {
+        AuthenticationManagerBuilder authenticationManagerBuilder =
+                http.getSharedObject(AuthenticationManagerBuilder.class);
+        authenticationManagerBuilder.authenticationProvider(authProvider);
+        return authenticationManagerBuilder.build();
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/Avtobus.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Avtobus.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,67 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.util.Collection;
-import java.util.Objects;
-
-@Entity
-public class Avtobus {
-    private String aRegistracija;
-    private String aSeriskiBroj;
-    private Short aBrojSedista;
-    private Collection<Instancanalinija> instancanalinijasByARegistracija;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "a_registracija", nullable = false, length = 8)
-    public String getaRegistracija() {
-        return aRegistracija;
-    }
-
-    public void setaRegistracija(String aRegistracija) {
-        this.aRegistracija = aRegistracija;
-    }
-
-    @Basic
-    @Column(name = "a_seriski_broj", nullable = false)
-    public String getaSeriskiBroj() {
-        return aSeriskiBroj;
-    }
-
-    public void setaSeriskiBroj(String aSeriskiBroj) {
-        this.aSeriskiBroj = aSeriskiBroj;
-    }
-
-    @Basic
-    @Column(name = "a_broj_sedista", nullable = true)
-    public Short getaBrojSedista() {
-        return aBrojSedista;
-    }
-
-    public void setaBrojSedista(Short aBrojSedista) {
-        this.aBrojSedista = aBrojSedista;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Avtobus avtobus = (Avtobus) o;
-        return Objects.equals(aRegistracija, avtobus.aRegistracija) && Objects.equals(aSeriskiBroj, avtobus.aSeriskiBroj) && Objects.equals(aBrojSedista, avtobus.aBrojSedista);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(aRegistracija, aSeriskiBroj, aBrojSedista);
-    }
-
-    @OneToMany(mappedBy = "avtobusByARegistracija")
-    public Collection<Instancanalinija> getInstancanalinijasByARegistracija() {
-        return instancanalinijasByARegistracija;
-    }
-
-    public void setInstancanalinijasByARegistracija(Collection<Instancanalinija> instancanalinijasByARegistracija) {
-        this.instancanalinijasByARegistracija = instancanalinijasByARegistracija;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Bilet.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Bilet.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,114 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-import mk.ukim.finki.busngo.model.enums.BILET_STATUS;
-
-import java.sql.Timestamp;
-import java.util.Collection;
-import java.util.Objects;
-
-@Entity
-public class Bilet {
-    private Long bId;
-    private Timestamp bDatumNaKupuvanje;
-    private BILET_STATUS bStatus;
-    private Long patnikKId;
-    private Long tbId;
-    private Korisnik korisnikByPatnikKId;
-    private Tipbilet tipbiletByTbId;
-    private Collection<Vozenje> vozenjesByBId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "b_id", nullable = false)
-    public Long getbId() {
-        return bId;
-    }
-
-    public void setbId(Long bId) {
-        this.bId = bId;
-    }
-
-    @Basic
-    @Column(name = "b_datum_na_kupuvanje", nullable = false)
-    public Timestamp getbDatumNaKupuvanje() {
-        return bDatumNaKupuvanje;
-    }
-
-    public void setbDatumNaKupuvanje(Timestamp bDatumNaKupuvanje) {
-        this.bDatumNaKupuvanje = bDatumNaKupuvanje;
-    }
-
-    @Basic
-    @Column(name = "b_status", nullable = false)
-    @Enumerated(EnumType.STRING)
-    public BILET_STATUS getbStatus() {
-        return bStatus;
-    }
-
-    public void setbStatus(BILET_STATUS bStatus) {
-        this.bStatus = bStatus;
-    }
-
-    @Basic
-    @Column(name = "patnik_k_id", nullable = true)
-    public Long getPatnikKId() {
-        return patnikKId;
-    }
-
-    public void setPatnikKId(Long patnikKId) {
-        this.patnikKId = patnikKId;
-    }
-
-    @Basic
-    @Column(name = "tb_id", nullable = true)
-    public Long getTbId() {
-        return tbId;
-    }
-
-    public void setTbId(Long tbId) {
-        this.tbId = tbId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Bilet bilet = (Bilet) o;
-        return Objects.equals(bId, bilet.bId) && Objects.equals(bDatumNaKupuvanje, bilet.bDatumNaKupuvanje) && Objects.equals(bStatus, bilet.bStatus) && Objects.equals(patnikKId, bilet.patnikKId) && Objects.equals(tbId, bilet.tbId);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(bId, bDatumNaKupuvanje, bStatus, patnikKId, tbId);
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "patnik_k_id", referencedColumnName = "k_id")
-    public Korisnik getKorisnikByPatnikKId() {
-        return korisnikByPatnikKId;
-    }
-
-    public void setKorisnikByPatnikKId(Korisnik korisnikByPatnikKId) {
-        this.korisnikByPatnikKId = korisnikByPatnikKId;
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "tb_id", referencedColumnName = "tb_id")
-    public Tipbilet getTipbiletByTbId() {
-        return tipbiletByTbId;
-    }
-
-    public void setTipbiletByTbId(Tipbilet tipbiletByTbId) {
-        this.tipbiletByTbId = tipbiletByTbId;
-    }
-
-    @OneToMany(mappedBy = "biletByBId")
-    public Collection<Vozenje> getVozenjesByBId() {
-        return vozenjesByBId;
-    }
-
-    public void setVozenjesByBId(Collection<Vozenje> vozenjesByBId) {
-        this.vozenjesByBId = vozenjesByBId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Instancanalinija.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Instancanalinija.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,144 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.sql.Timestamp;
-import java.util.Collection;
-import java.util.Objects;
-
-@Entity
-public class Instancanalinija {
-    private Long inlId;
-    private Timestamp inlDatumStart;
-    private Timestamp inlDatumEnd;
-    private Long vozacKId;
-    private String aRegistracija;
-    private Integer liId;
-    private Korisnik korisnikByVozacKId;
-    private Avtobus avtobusByARegistracija;
-    private Linija linijaByLiId;
-    private Collection<Vozenje> vozenjesByInlId;
-    private Collection<Kontroli> kontrolisByInlId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "inl_id", nullable = false)
-    public Long getInlId() {
-        return inlId;
-    }
-
-    public void setInlId(Long inlId) {
-        this.inlId = inlId;
-    }
-
-    @Basic
-    @Column(name = "inl_datum_start", nullable = false)
-    public Timestamp getInlDatumStart() {
-        return inlDatumStart;
-    }
-
-    public void setInlDatumStart(Timestamp inlDatumStart) {
-        this.inlDatumStart = inlDatumStart;
-    }
-
-    @Basic
-    @Column(name = "inl_datum_end", nullable = true)
-    public Timestamp getInlDatumEnd() {
-        return inlDatumEnd;
-    }
-
-    public void setInlDatumEnd(Timestamp inlDatumEnd) {
-        this.inlDatumEnd = inlDatumEnd;
-    }
-
-    @Basic
-    @Column(name = "vozac_k_id", nullable = false)
-    public Long getVozacKId() {
-        return vozacKId;
-    }
-
-    public void setVozacKId(Long vozacKId) {
-        this.vozacKId = vozacKId;
-    }
-
-    @Basic
-    @Column(name = "a_registracija", nullable = true, length = 8)
-    public String getaRegistracija() {
-        return aRegistracija;
-    }
-
-    public void setaRegistracija(String aRegistracija) {
-        this.aRegistracija = aRegistracija;
-    }
-
-    @Basic
-    @Column(name = "li_id", nullable = false)
-    public Integer getLiId() {
-        return liId;
-    }
-
-    public void setLiId(Integer liId) {
-        this.liId = liId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Instancanalinija that = (Instancanalinija) o;
-        return Objects.equals(inlId, that.inlId) && Objects.equals(inlDatumStart, that.inlDatumStart) && Objects.equals(inlDatumEnd, that.inlDatumEnd) && Objects.equals(vozacKId, that.vozacKId) && Objects.equals(aRegistracija, that.aRegistracija) && Objects.equals(liId, that.liId);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(inlId, inlDatumStart, inlDatumEnd, vozacKId, aRegistracija, liId);
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "vozac_k_id", referencedColumnName = "k_id", nullable = false)
-    public Korisnik getKorisnikByVozacKId() {
-        return korisnikByVozacKId;
-    }
-
-    public void setKorisnikByVozacKId(Korisnik korisnikByVozacKId) {
-        this.korisnikByVozacKId = korisnikByVozacKId;
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "a_registracija", referencedColumnName = "a_registracija")
-    public Avtobus getAvtobusByARegistracija() {
-        return avtobusByARegistracija;
-    }
-
-    public void setAvtobusByARegistracija(Avtobus avtobusByARegistracija) {
-        this.avtobusByARegistracija = avtobusByARegistracija;
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "li_id", referencedColumnName = "li_id", nullable = false)
-    public Linija getLinijaByLiId() {
-        return linijaByLiId;
-    }
-
-    public void setLinijaByLiId(Linija linijaByLiId) {
-        this.linijaByLiId = linijaByLiId;
-    }
-
-    @OneToMany(mappedBy = "instancanalinijaByInlId")
-    public Collection<Vozenje> getVozenjesByInlId() {
-        return vozenjesByInlId;
-    }
-
-    public void setVozenjesByInlId(Collection<Vozenje> vozenjesByInlId) {
-        this.vozenjesByInlId = vozenjesByInlId;
-    }
-
-    @OneToMany(mappedBy = "instancanalinijaByInlId")
-    public Collection<Kontroli> getKontrolisByInlId() {
-        return kontrolisByInlId;
-    }
-
-    public void setKontrolisByInlId(Collection<Kontroli> kontrolisByInlId) {
-        this.kontrolisByInlId = kontrolisByInlId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Kazna.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Kazna.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,154 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.sql.Timestamp;
-import java.util.Objects;
-
-@Entity
-public class Kazna {
-    private Long kzId;
-    private Double kzIznos;
-    private Boolean kzPlateno;
-    private Timestamp kzDatum;
-    private Timestamp kzDatumPlateno;
-    private String kzDokument;
-    private Long kondukterKId;
-    private Long kontrolaId;
-    private Korisnik korisnikByKondukterKId;
-    private Kontroli kontroliByKontrolaId;
-    private Kaznazaneregistriran kaznazaneregistriranByKzId;
-    private Kaznazaregistriran kaznazaregistriranByKzId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "kz_id", nullable = false)
-    public Long getKzId() {
-        return kzId;
-    }
-
-    public void setKzId(Long kzId) {
-        this.kzId = kzId;
-    }
-
-    @Basic
-    @Column(name = "kz_iznos", nullable = false, precision = 0)
-    public Double getKzIznos() {
-        return kzIznos;
-    }
-
-    public void setKzIznos(Double kzIznos) {
-        this.kzIznos = kzIznos;
-    }
-
-    @Basic
-    @Column(name = "kz_plateno", nullable = false)
-    public Boolean getKzPlateno() {
-        return kzPlateno;
-    }
-
-    public void setKzPlateno(Boolean kzPlateno) {
-        this.kzPlateno = kzPlateno;
-    }
-
-    @Basic
-    @Column(name = "kz_datum", nullable = false)
-    public Timestamp getKzDatum() {
-        return kzDatum;
-    }
-
-    public void setKzDatum(Timestamp kzDatum) {
-        this.kzDatum = kzDatum;
-    }
-
-    @Basic
-    @Column(name = "kz_datum_plateno", nullable = true)
-    public Timestamp getKzDatumPlateno() {
-        return kzDatumPlateno;
-    }
-
-    public void setKzDatumPlateno(Timestamp kzDatumPlateno) {
-        this.kzDatumPlateno = kzDatumPlateno;
-    }
-
-    @Basic
-    @Column(name = "kz_dokument", nullable = false)
-    public String getKzDokument() {
-        return kzDokument;
-    }
-
-    public void setKzDokument(String kzDokument) {
-        this.kzDokument = kzDokument;
-    }
-
-    @Basic
-    @Column(name = "kondukter_k_id", nullable = true)
-    public Long getKondukterKId() {
-        return kondukterKId;
-    }
-
-    public void setKondukterKId(Long kondukterKId) {
-        this.kondukterKId = kondukterKId;
-    }
-
-    @Basic
-    @Column(name = "kontrola_id", nullable = true)
-    public Long getKontrolaId() {
-        return kontrolaId;
-    }
-
-    public void setKontrolaId(Long kontrolaId) {
-        this.kontrolaId = kontrolaId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Kazna kazna = (Kazna) o;
-        return Objects.equals(kzId, kazna.kzId) && Objects.equals(kzIznos, kazna.kzIznos) && Objects.equals(kzPlateno, kazna.kzPlateno) && Objects.equals(kzDatum, kazna.kzDatum) && Objects.equals(kzDatumPlateno, kazna.kzDatumPlateno) && Objects.equals(kzDokument, kazna.kzDokument) && Objects.equals(kondukterKId, kazna.kondukterKId) && Objects.equals(kontrolaId, kazna.kontrolaId);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(kzId, kzIznos, kzPlateno, kzDatum, kzDatumPlateno, kzDokument, kondukterKId, kontrolaId);
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "kondukter_k_id", referencedColumnName = "k_id")
-    public Korisnik getKorisnikByKondukterKId() {
-        return korisnikByKondukterKId;
-    }
-
-    public void setKorisnikByKondukterKId(Korisnik korisnikByKondukterKId) {
-        this.korisnikByKondukterKId = korisnikByKondukterKId;
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "kontrola_id", referencedColumnName = "kontrola_id")
-    public Kontroli getKontroliByKontrolaId() {
-        return kontroliByKontrolaId;
-    }
-
-    public void setKontroliByKontrolaId(Kontroli kontroliByKontrolaId) {
-        this.kontroliByKontrolaId = kontroliByKontrolaId;
-    }
-
-    @OneToOne(mappedBy = "kaznaByKzId")
-    public Kaznazaneregistriran getKaznazaneregistriranByKzId() {
-        return kaznazaneregistriranByKzId;
-    }
-
-    public void setKaznazaneregistriranByKzId(Kaznazaneregistriran kaznazaneregistriranByKzId) {
-        this.kaznazaneregistriranByKzId = kaznazaneregistriranByKzId;
-    }
-
-    @OneToOne(mappedBy = "kaznaByKzId")
-    public Kaznazaregistriran getKaznazaregistriranByKzId() {
-        return kaznazaregistriranByKzId;
-    }
-
-    public void setKaznazaregistriranByKzId(Kaznazaregistriran kaznazaregistriranByKzId) {
-        this.kaznazaregistriranByKzId = kaznazaregistriranByKzId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Kaznazaneregistriran.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Kaznazaneregistriran.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,78 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.util.Objects;
-
-@Entity
-public class Kaznazaneregistriran {
-    private Long kzId;
-    private Object kznTelefon;
-    private Object kznIme;
-    private Object kznAdresa;
-    private Kazna kaznaByKzId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "kz_id", nullable = false)
-    public Long getKzId() {
-        return kzId;
-    }
-
-    public void setKzId(Long kzId) {
-        this.kzId = kzId;
-    }
-
-    @Basic
-    @Column(name = "kzn_telefon", nullable = true)
-    public Object getKznTelefon() {
-        return kznTelefon;
-    }
-
-    public void setKznTelefon(Object kznTelefon) {
-        this.kznTelefon = kznTelefon;
-    }
-
-    @Basic
-    @Column(name = "kzn_ime", nullable = false)
-    public Object getKznIme() {
-        return kznIme;
-    }
-
-    public void setKznIme(Object kznIme) {
-        this.kznIme = kznIme;
-    }
-
-    @Basic
-    @Column(name = "kzn_adresa", nullable = false)
-    public Object getKznAdresa() {
-        return kznAdresa;
-    }
-
-    public void setKznAdresa(Object kznAdresa) {
-        this.kznAdresa = kznAdresa;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Kaznazaneregistriran that = (Kaznazaneregistriran) o;
-        return Objects.equals(kzId, that.kzId) && Objects.equals(kznTelefon, that.kznTelefon) && Objects.equals(kznIme, that.kznIme) && Objects.equals(kznAdresa, that.kznAdresa);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(kzId, kznTelefon, kznIme, kznAdresa);
-    }
-
-    @OneToOne
-    @JoinColumn(name = "kz_id", referencedColumnName = "kz_id", nullable = false)
-    public Kazna getKaznaByKzId() {
-        return kaznaByKzId;
-    }
-
-    public void setKaznaByKzId(Kazna kaznaByKzId) {
-        this.kaznaByKzId = kaznaByKzId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Kaznazaregistriran.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Kaznazaregistriran.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,67 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.util.Objects;
-
-@Entity
-public class Kaznazaregistriran {
-    private Long kzId;
-    private Long patnikKId;
-    private Kazna kaznaByKzId;
-    private Korisnik korisnikByPatnikKId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "kz_id", nullable = false)
-    public Long getKzId() {
-        return kzId;
-    }
-
-    public void setKzId(Long kzId) {
-        this.kzId = kzId;
-    }
-
-    @Basic
-    @Column(name = "patnik_k_id", nullable = true)
-    public Long getPatnikKId() {
-        return patnikKId;
-    }
-
-    public void setPatnikKId(Long patnikKId) {
-        this.patnikKId = patnikKId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Kaznazaregistriran that = (Kaznazaregistriran) o;
-        return Objects.equals(kzId, that.kzId) && Objects.equals(patnikKId, that.patnikKId);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(kzId, patnikKId);
-    }
-
-    @OneToOne
-    @JoinColumn(name = "kz_id", referencedColumnName = "kz_id", nullable = false)
-    public Kazna getKaznaByKzId() {
-        return kaznaByKzId;
-    }
-
-    public void setKaznaByKzId(Kazna kaznaByKzId) {
-        this.kaznaByKzId = kaznaByKzId;
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "patnik_k_id", referencedColumnName = "k_id")
-    public Korisnik getKorisnikByPatnikKId() {
-        return korisnikByPatnikKId;
-    }
-
-    public void setKorisnikByPatnikKId(Korisnik korisnikByPatnikKId) {
-        this.korisnikByPatnikKId = korisnikByPatnikKId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Kondukter.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Kondukter.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,45 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.util.Objects;
-
-@Entity
-public class Kondukter {
-    private Long kId;
-    private Korisnik korisnikByKId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "k_id", nullable = false)
-    public Long getkId() {
-        return kId;
-    }
-
-    public void setkId(Long kId) {
-        this.kId = kId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Kondukter kondukter = (Kondukter) o;
-        return Objects.equals(kId, kondukter.kId);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(kId);
-    }
-
-    @OneToOne
-    @JoinColumn(name = "k_id", referencedColumnName = "k_id", nullable = false)
-    public Korisnik getKorisnikByKId() {
-        return korisnikByKId;
-    }
-
-    public void setKorisnikByKId(Korisnik korisnikByKId) {
-        this.korisnikByKId = korisnikByKId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Kontroli.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Kontroli.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,101 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.sql.Timestamp;
-import java.util.Collection;
-import java.util.Objects;
-
-@Entity
-public class Kontroli {
-    private Long kontrolaId;
-    private Timestamp kontrolaDatum;
-    private Long kondukterKId;
-    private Long inlId;
-    private Korisnik korisnikByKondukterKId;
-    private Instancanalinija instancanalinijaByInlId;
-    private Collection<Kazna> kaznasByKontrolaId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "kontrola_id", nullable = false)
-    public Long getKontrolaId() {
-        return kontrolaId;
-    }
-
-    public void setKontrolaId(Long kontrolaId) {
-        this.kontrolaId = kontrolaId;
-    }
-
-    @Basic
-    @Column(name = "kontrola_datum", nullable = false)
-    public Timestamp getKontrolaDatum() {
-        return kontrolaDatum;
-    }
-
-    public void setKontrolaDatum(Timestamp kontrolaDatum) {
-        this.kontrolaDatum = kontrolaDatum;
-    }
-
-    @Basic
-    @Column(name = "kondukter_k_id", nullable = true)
-    public Long getKondukterKId() {
-        return kondukterKId;
-    }
-
-    public void setKondukterKId(Long kondukterKId) {
-        this.kondukterKId = kondukterKId;
-    }
-
-    @Basic
-    @Column(name = "inl_id", nullable = true)
-    public Long getInlId() {
-        return inlId;
-    }
-
-    public void setInlId(Long inlId) {
-        this.inlId = inlId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Kontroli kontroli = (Kontroli) o;
-        return Objects.equals(kontrolaId, kontroli.kontrolaId) && Objects.equals(kontrolaDatum, kontroli.kontrolaDatum) && Objects.equals(kondukterKId, kontroli.kondukterKId) && Objects.equals(inlId, kontroli.inlId);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(kontrolaId, kontrolaDatum, kondukterKId, inlId);
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "kondukter_k_id", referencedColumnName = "k_id")
-    public Korisnik getKorisnikByKondukterKId() {
-        return korisnikByKondukterKId;
-    }
-
-    public void setKorisnikByKondukterKId(Korisnik korisnikByKondukterKId) {
-        this.korisnikByKondukterKId = korisnikByKondukterKId;
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "inl_id", referencedColumnName = "inl_id")
-    public Instancanalinija getInstancanalinijaByInlId() {
-        return instancanalinijaByInlId;
-    }
-
-    public void setInstancanalinijaByInlId(Instancanalinija instancanalinijaByInlId) {
-        this.instancanalinijaByInlId = instancanalinijaByInlId;
-    }
-
-    @OneToMany(mappedBy = "kontroliByKontrolaId")
-    public Collection<Kazna> getKaznasByKontrolaId() {
-        return kaznasByKontrolaId;
-    }
-
-    public void setKaznasByKontrolaId(Collection<Kazna> kaznasByKontrolaId) {
-        this.kaznasByKontrolaId = kaznasByKontrolaId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Korisnik.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Korisnik.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,202 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.util.Collection;
-import java.util.Objects;
-
-@Entity
-public class Korisnik {
-    private Long kId;
-    private String kIme;
-    private String kAdresa;
-    private String kTelefon;
-    private String kEmail;
-    private String kEmbg;
-    private Boolean kIsAdmin;
-    private String kLozinka;
-    private Patnik patnikByKId;
-    private Vraboten vrabotenByKId;
-    private Kondukter kondukterByKId;
-    private Vozac vozacByKId;
-    private Collection<Bilet> biletsByKId;
-    private Collection<Vozenje> vozenjesByKId;
-    private Collection<Kontroli> kontrolisByKId;
-    private Collection<Kazna> kaznasByKId;
-    private Collection<Kaznazaregistriran> kaznazaregistriransByKId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "k_id", nullable = false)
-    public Long getkId() {
-        return kId;
-    }
-
-    public void setkId(Long kId) {
-        this.kId = kId;
-    }
-
-    @Basic
-    @Column(name = "k_ime", nullable = false)
-    public String getkIme() {
-        return kIme;
-    }
-
-    public void setkIme(String kIme) {
-        this.kIme = kIme;
-    }
-
-    @Basic
-    @Column(name = "k_adresa", nullable = true)
-    public String getkAdresa() {
-        return kAdresa;
-    }
-
-    public void setkAdresa(String kAdresa) {
-        this.kAdresa = kAdresa;
-    }
-
-    @Basic
-    @Column(name = "k_telefon", nullable = false)
-    public String getkTelefon() {
-        return kTelefon;
-    }
-
-    public void setkTelefon(String kTelefon) {
-        this.kTelefon = kTelefon;
-    }
-
-    @Basic
-    @Column(name = "k_email", nullable = false)
-    public String getkEmail() {
-        return kEmail;
-    }
-
-    public void setkEmail(String kEmail) {
-        this.kEmail = kEmail;
-    }
-
-    @Basic
-    @Column(name = "k_embg", nullable = true, length = 13)
-    public String getkEmbg() {
-        return kEmbg;
-    }
-
-    public void setkEmbg(String kEmbg) {
-        this.kEmbg = kEmbg;
-    }
-
-    @Basic
-    @Column(name = "k_is_admin", nullable = false)
-    public Boolean getkIsAdmin() {
-        return kIsAdmin;
-    }
-
-    public void setkIsAdmin(Boolean kIsAdmin) {
-        this.kIsAdmin = kIsAdmin;
-    }
-
-    @Basic
-    @Column(name = "k_lozinka", nullable = false)
-    public String getkLozinka() {
-        return kLozinka;
-    }
-
-    public void setkLozinka(String kLozinka) {
-        this.kLozinka = kLozinka;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Korisnik korisnik = (Korisnik) o;
-        return Objects.equals(kId, korisnik.kId) && Objects.equals(kIme, korisnik.kIme) && Objects.equals(kAdresa, korisnik.kAdresa) && Objects.equals(kTelefon, korisnik.kTelefon) && Objects.equals(kEmail, korisnik.kEmail) && Objects.equals(kEmbg, korisnik.kEmbg) && Objects.equals(kIsAdmin, korisnik.kIsAdmin) && Objects.equals(kLozinka, korisnik.kLozinka);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(kId, kIme, kAdresa, kTelefon, kEmail, kEmbg, kIsAdmin, kLozinka);
-    }
-
-    @OneToOne(mappedBy = "korisnikByKId")
-    public Patnik getPatnikByKId() {
-        return patnikByKId;
-    }
-
-    public void setPatnikByKId(Patnik patnikByKId) {
-        this.patnikByKId = patnikByKId;
-    }
-
-    @OneToOne(mappedBy = "korisnikByKId")
-    public Vraboten getVrabotenByKId() {
-        return vrabotenByKId;
-    }
-
-    public void setVrabotenByKId(Vraboten vrabotenByKId) {
-        this.vrabotenByKId = vrabotenByKId;
-    }
-
-    @OneToOne(mappedBy = "korisnikByKId")
-    public Kondukter getKondukterByKId() {
-        return kondukterByKId;
-    }
-
-    public void setKondukterByKId(Kondukter kondukterByKId) {
-        this.kondukterByKId = kondukterByKId;
-    }
-
-    @OneToOne(mappedBy = "korisnikByKId")
-    public Vozac getVozacByKId() {
-        return vozacByKId;
-    }
-
-    public void setVozacByKId(Vozac vozacByKId) {
-        this.vozacByKId = vozacByKId;
-    }
-
-    @OneToMany(mappedBy = "korisnikByPatnikKId")
-    public Collection<Bilet> getBiletsByKId() {
-        return biletsByKId;
-    }
-
-    public void setBiletsByKId(Collection<Bilet> biletsByKId) {
-        this.biletsByKId = biletsByKId;
-    }
-
-    @OneToMany(mappedBy = "korisnikByPatnikKId")
-    public Collection<Vozenje> getVozenjesByKId() {
-        return vozenjesByKId;
-    }
-
-    public void setVozenjesByKId(Collection<Vozenje> vozenjesByKId) {
-        this.vozenjesByKId = vozenjesByKId;
-    }
-
-    @OneToMany(mappedBy = "korisnikByKondukterKId")
-    public Collection<Kontroli> getKontrolisByKId() {
-        return kontrolisByKId;
-    }
-
-    public void setKontrolisByKId(Collection<Kontroli> kontrolisByKId) {
-        this.kontrolisByKId = kontrolisByKId;
-    }
-
-    @OneToMany(mappedBy = "korisnikByKondukterKId")
-    public Collection<Kazna> getKaznasByKId() {
-        return kaznasByKId;
-    }
-
-    public void setKaznasByKId(Collection<Kazna> kaznasByKId) {
-        this.kaznasByKId = kaznasByKId;
-    }
-
-    @OneToMany(mappedBy = "korisnikByPatnikKId")
-    public Collection<Kaznazaregistriran> getKaznazaregistriransByKId() {
-        return kaznazaregistriransByKId;
-    }
-
-    public void setKaznazaregistriransByKId(Collection<Kaznazaregistriran> kaznazaregistriransByKId) {
-        this.kaznazaregistriransByKId = kaznazaregistriransByKId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Linija.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Linija.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,78 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Objects;
-
-@Entity
-public class Linija {
-    private Integer liId;
-    private String liIme;
-    private String liPravec;
-    private List<Postojkanalinija> postojkanalinijasByLiId;
-    private List<Instancanalinija> instancanalinijasByLiId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "li_id", nullable = false)
-    public Integer getLiId() {
-        return liId;
-    }
-
-    public void setLiId(Integer liId) {
-        this.liId = liId;
-    }
-
-    @Basic
-    @Column(name = "li_ime", nullable = false)
-    public String getLiIme() {
-        return liIme;
-    }
-
-    public void setLiIme(String liIme) {
-        this.liIme = liIme;
-    }
-
-    @Basic
-    @Column(name = "li_pravec", nullable = false)
-    public String getLiPravec() {
-        return liPravec;
-    }
-
-    public void setLiPravec(String liPravec) {
-        this.liPravec = liPravec;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Linija linija = (Linija) o;
-        return Objects.equals(liId, linija.liId) && Objects.equals(liIme, linija.liIme) && Objects.equals(liPravec, linija.liPravec);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(liId, liIme, liPravec);
-    }
-
-    @OneToMany(mappedBy = "linijaByLiId")
-    public List<Postojkanalinija> getPostojkanalinijasByLiId() {
-        return postojkanalinijasByLiId;
-    }
-
-    public void setPostojkanalinijasByLiId(List<Postojkanalinija> postojkanalinijasByLiId) {
-        this.postojkanalinijasByLiId = postojkanalinijasByLiId;
-    }
-
-    @OneToMany(mappedBy = "linijaByLiId")
-    public List<Instancanalinija> getInstancanalinijasByLiId() {
-        return instancanalinijasByLiId;
-    }
-
-    public void setInstancanalinijasByLiId(List<Instancanalinija> instancanalinijasByLiId) {
-        this.instancanalinijasByLiId = instancanalinijasByLiId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Mesto.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Mesto.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,79 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Objects;
-
-@Entity
-public class Mesto {
-    private Integer mId;
-    private String mGrad;
-    private String mOpstina;
-    private String mUlica;
-    private List<Postojka> postojkasByMId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "m_id", nullable = false)
-    public Integer getmId() {
-        return mId;
-    }
-
-    public void setmId(Integer mId) {
-        this.mId = mId;
-    }
-
-    @Basic
-    @Column(name = "m_grad", nullable = false)
-    public String getmGrad() {
-        return mGrad;
-    }
-
-    public void setmGrad(String mGrad) {
-        this.mGrad = mGrad;
-    }
-
-    @Basic
-    @Column(name = "m_opstina", nullable = false)
-    public String getmOpstina() {
-        return mOpstina;
-    }
-
-    public void setmOpstina(String mOpstina) {
-        this.mOpstina = mOpstina;
-    }
-
-    @Basic
-    @Column(name = "m_ulica", nullable = false)
-    public String getmUlica() {
-        return mUlica;
-    }
-
-    public void setmUlica(String mUlica) {
-        this.mUlica = mUlica;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Mesto mesto = (Mesto) o;
-        return Objects.equals(mId, mesto.mId) && Objects.equals(mGrad, mesto.mGrad) && Objects.equals(mOpstina, mesto.mOpstina) && Objects.equals(mUlica, mesto.mUlica);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(mId, mGrad, mOpstina, mUlica);
-    }
-
-    @OneToMany(mappedBy = "mestoByMId")
-    public List<Postojka> getPostojkasByMId() {
-        return postojkasByMId;
-    }
-
-    public void setPostojkasByMId(List<Postojka> postojkasByMId) {
-        this.postojkasByMId = postojkasByMId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Patnik.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Patnik.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,45 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.util.Objects;
-
-@Entity
-public class Patnik {
-    private Long kId;
-    private Korisnik korisnikByKId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "k_id", nullable = false)
-    public Long getkId() {
-        return kId;
-    }
-
-    public void setkId(Long kId) {
-        this.kId = kId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Patnik patnik = (Patnik) o;
-        return Objects.equals(kId, patnik.kId);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(kId);
-    }
-
-    @OneToOne
-    @JoinColumn(name = "k_id", referencedColumnName = "k_id", nullable = false)
-    public Korisnik getKorisnikByKId() {
-        return korisnikByKId;
-    }
-
-    public void setKorisnikByKId(Korisnik korisnikByKId) {
-        this.korisnikByKId = korisnikByKId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Postojka.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Postojka.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,79 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.util.Collection;
-import java.util.List;
-import java.util.Objects;
-
-@Entity
-public class Postojka {
-    private Integer pId;
-    private String pIme;
-    private Integer mId;
-    private Mesto mestoByMId;
-    private List<Postojkanalinija> postojkanalinijasByPId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "p_id", nullable = false)
-    public Integer getpId() {
-        return pId;
-    }
-
-    public void setpId(Integer pId) {
-        this.pId = pId;
-    }
-
-    @Basic
-    @Column(name = "p_ime", nullable = false)
-    public String getpIme() {
-        return pIme;
-    }
-
-    public void setpIme(String pIme) {
-        this.pIme = pIme;
-    }
-
-    @Basic
-    @Column(name = "m_id", nullable = true)
-    public Integer getmId() {
-        return mId;
-    }
-
-    public void setmId(Integer mId) {
-        this.mId = mId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Postojka postojka = (Postojka) o;
-        return Objects.equals(pId, postojka.pId) && Objects.equals(pIme, postojka.pIme) && Objects.equals(mId, postojka.mId);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(pId, pIme, mId);
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "m_id", referencedColumnName = "m_id")
-    public Mesto getMestoByMId() {
-        return mestoByMId;
-    }
-
-    public void setMestoByMId(Mesto mestoByMId) {
-        this.mestoByMId = mestoByMId;
-    }
-
-    @OneToMany(mappedBy = "postojkaByPId")
-    public List<Postojkanalinija> getPostojkanalinijasByPId() {
-        return postojkanalinijasByPId;
-    }
-
-    public void setPostojkanalinijasByPId(List<Postojkanalinija> postojkanalinijasByPId) {
-        this.postojkanalinijasByPId = postojkanalinijasByPId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Postojkanalinija.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Postojkanalinija.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,100 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.util.Collection;
-import java.util.Objects;
-
-@Entity
-public class Postojkanalinija {
-    private Long pnlId;
-    private Short pnlRedenBroj;
-    private Integer liId;
-    private Integer pId;
-    private Linija linijaByLiId;
-    private Postojka postojkaByPId;
-    private Collection<Vozenje> vozenjesByPnlId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "pnl_id", nullable = false)
-    public Long getPnlId() {
-        return pnlId;
-    }
-
-    public void setPnlId(Long pnlId) {
-        this.pnlId = pnlId;
-    }
-
-    @Basic
-    @Column(name = "pnl_reden_broj", nullable = false)
-    public Short getPnlRedenBroj() {
-        return pnlRedenBroj;
-    }
-
-    public void setPnlRedenBroj(Short pnlRedenBroj) {
-        this.pnlRedenBroj = pnlRedenBroj;
-    }
-
-    @Basic
-    @Column(name = "li_id", nullable = false)
-    public Integer getLiId() {
-        return liId;
-    }
-
-    public void setLiId(Integer liId) {
-        this.liId = liId;
-    }
-
-    @Basic
-    @Column(name = "p_id", nullable = false)
-    public Integer getpId() {
-        return pId;
-    }
-
-    public void setpId(Integer pId) {
-        this.pId = pId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Postojkanalinija that = (Postojkanalinija) o;
-        return Objects.equals(pnlId, that.pnlId) && Objects.equals(pnlRedenBroj, that.pnlRedenBroj) && Objects.equals(liId, that.liId) && Objects.equals(pId, that.pId);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(pnlId, pnlRedenBroj, liId, pId);
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "li_id", referencedColumnName = "li_id", nullable = false)
-    public Linija getLinijaByLiId() {
-        return linijaByLiId;
-    }
-
-    public void setLinijaByLiId(Linija linijaByLiId) {
-        this.linijaByLiId = linijaByLiId;
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "p_id", referencedColumnName = "p_id", nullable = false)
-    public Postojka getPostojkaByPId() {
-        return postojkaByPId;
-    }
-
-    public void setPostojkaByPId(Postojka postojkaByPId) {
-        this.postojkaByPId = postojkaByPId;
-    }
-
-    @OneToMany(mappedBy = "postojkanalinijaByKacuvaPnlId")
-    public Collection<Vozenje> getVozenjesByPnlId() {
-        return vozenjesByPnlId;
-    }
-
-    public void setVozenjesByPnlId(Collection<Vozenje> vozenjesByPnlId) {
-        this.vozenjesByPnlId = vozenjesByPnlId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/SeSimnuvaNa.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/SeSimnuvaNa.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,52 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.Entity;
-import jakarta.persistence.GeneratedValue;
-import jakarta.persistence.GenerationType;
-import jakarta.persistence.Id;
-
-import java.util.Objects;
-
-@Entity
-@jakarta.persistence.Table(name = "se_simnuva_na", schema = "project", catalog = "db_202324z_va_prj_busngo")
-@jakarta.persistence.IdClass(mk.ukim.finki.busngo.model.SeSimnuvaNaPK.class)
-public class SeSimnuvaNa {
-    private Long pnlId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @jakarta.persistence.Column(name = "pnl_id", nullable = false)
-    public Long getPnlId() {
-        return pnlId;
-    }
-
-    public void setPnlId(Long pnlId) {
-        this.pnlId = pnlId;
-    }
-
-    private Long vozenjeId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @jakarta.persistence.Column(name = "vozenje_id", nullable = false)
-    public Long getVozenjeId() {
-        return vozenjeId;
-    }
-
-    public void setVozenjeId(Long vozenjeId) {
-        this.vozenjeId = vozenjeId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        SeSimnuvaNa that = (SeSimnuvaNa) o;
-        return Objects.equals(pnlId, that.pnlId) && Objects.equals(vozenjeId, that.vozenjeId);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(pnlId, vozenjeId);
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/SeSimnuvaNaPK.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/SeSimnuvaNaPK.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,6 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import java.io.Serializable;
-
-public class SeSimnuvaNaPK implements Serializable {
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Tipbilet.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Tipbilet.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,67 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.util.Collection;
-import java.util.Objects;
-
-@Entity
-public class Tipbilet {
-    private Integer tbId;
-    private Long tbTrajnost;
-    private String tbIme;
-    private Collection<Bilet> biletsByTbId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "tb_id", nullable = false)
-    public Integer getTbId() {
-        return tbId;
-    }
-
-    public void setTbId(Integer tbId) {
-        this.tbId = tbId;
-    }
-
-    @Basic
-    @Column(name = "tb_trajnost", nullable = false)
-    public Long getTbTrajnost() {
-        return tbTrajnost;
-    }
-
-    public void setTbTrajnost(Long tbTrajnost) {
-        this.tbTrajnost = tbTrajnost;
-    }
-
-    @Basic
-    @Column(name = "tb_ime", nullable = false)
-    public String getTbIme() {
-        return tbIme;
-    }
-
-    public void setTbIme(String tbIme) {
-        this.tbIme = tbIme;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Tipbilet tipbilet = (Tipbilet) o;
-        return Objects.equals(tbId, tipbilet.tbId) && Objects.equals(tbTrajnost, tipbilet.tbTrajnost) && Objects.equals(tbIme, tipbilet.tbIme);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(tbId, tbTrajnost, tbIme);
-    }
-
-    @OneToMany(mappedBy = "tipbiletByTbId")
-    public Collection<Bilet> getBiletsByTbId() {
-        return biletsByTbId;
-    }
-
-    public void setBiletsByTbId(Collection<Bilet> biletsByTbId) {
-        this.biletsByTbId = biletsByTbId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Vozac.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Vozac.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,45 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.util.Objects;
-
-@Entity
-public class Vozac {
-    private Long kId;
-    private Korisnik korisnikByKId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "k_id", nullable = false)
-    public Long getkId() {
-        return kId;
-    }
-
-    public void setkId(Long kId) {
-        this.kId = kId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Vozac vozac = (Vozac) o;
-        return Objects.equals(kId, vozac.kId);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(kId);
-    }
-
-    @OneToOne
-    @JoinColumn(name = "k_id", referencedColumnName = "k_id", nullable = false)
-    public Korisnik getKorisnikByKId() {
-        return korisnikByKId;
-    }
-
-    public void setKorisnikByKId(Korisnik korisnikByKId) {
-        this.korisnikByKId = korisnikByKId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Vozenje.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Vozenje.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,158 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-import mk.ukim.finki.busngo.model.enums.VOZENJE_STATUS;
-
-import java.sql.Timestamp;
-import java.util.Objects;
-
-@Entity
-public class Vozenje {
-    private Long vozenjeId;
-    private Timestamp vozenjeStart;
-    private Timestamp vozenjeEnd;
-    private VOZENJE_STATUS vozenjeStatus;
-    private Long patnikKId;
-    private Long kacuvaPnlId;
-    private Long inlId;
-    private Long bId;
-    private Korisnik korisnikByPatnikKId;
-    private Postojkanalinija postojkanalinijaByKacuvaPnlId;
-    private Instancanalinija instancanalinijaByInlId;
-    private Bilet biletByBId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "vozenje_id", nullable = false)
-    public Long getVozenjeId() {
-        return vozenjeId;
-    }
-
-    public void setVozenjeId(Long vozenjeId) {
-        this.vozenjeId = vozenjeId;
-    }
-
-    @Basic
-    @Column(name = "vozenje_start", nullable = false)
-    public Timestamp getVozenjeStart() {
-        return vozenjeStart;
-    }
-
-    public void setVozenjeStart(Timestamp vozenjeStart) {
-        this.vozenjeStart = vozenjeStart;
-    }
-
-    @Basic
-    @Column(name = "vozenje_end", nullable = true)
-    public Timestamp getVozenjeEnd() {
-        return vozenjeEnd;
-    }
-
-    public void setVozenjeEnd(Timestamp vozenjeEnd) {
-        this.vozenjeEnd = vozenjeEnd;
-    }
-
-    @Basic
-    @Column(name = "vozenje_status", nullable = false)
-    @Enumerated(EnumType.STRING)
-    public VOZENJE_STATUS getVozenjeStatus() {
-        return vozenjeStatus;
-    }
-
-    public void setVozenjeStatus(VOZENJE_STATUS vozenjeStatus) {
-        this.vozenjeStatus = vozenjeStatus;
-    }
-
-    @Basic
-    @Column(name = "patnik_k_id", nullable = true)
-    public Long getPatnikKId() {
-        return patnikKId;
-    }
-
-    public void setPatnikKId(Long patnikKId) {
-        this.patnikKId = patnikKId;
-    }
-
-    @Basic
-    @Column(name = "kacuva_pnl_id", nullable = false)
-    public Long getKacuvaPnlId() {
-        return kacuvaPnlId;
-    }
-
-    public void setKacuvaPnlId(Long kacuvaPnlId) {
-        this.kacuvaPnlId = kacuvaPnlId;
-    }
-
-    @Basic
-    @Column(name = "inl_id", nullable = false)
-    public Long getInlId() {
-        return inlId;
-    }
-
-    public void setInlId(Long inlId) {
-        this.inlId = inlId;
-    }
-
-    @Basic
-    @Column(name = "b_id", nullable = false)
-    public Long getbId() {
-        return bId;
-    }
-
-    public void setbId(Long bId) {
-        this.bId = bId;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Vozenje vozenje = (Vozenje) o;
-        return Objects.equals(vozenjeId, vozenje.vozenjeId) && Objects.equals(vozenjeStart, vozenje.vozenjeStart) && Objects.equals(vozenjeEnd, vozenje.vozenjeEnd) && Objects.equals(vozenjeStatus, vozenje.vozenjeStatus) && Objects.equals(patnikKId, vozenje.patnikKId) && Objects.equals(kacuvaPnlId, vozenje.kacuvaPnlId) && Objects.equals(inlId, vozenje.inlId) && Objects.equals(bId, vozenje.bId);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(vozenjeId, vozenjeStart, vozenjeEnd, vozenjeStatus, patnikKId, kacuvaPnlId, inlId, bId);
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "patnik_k_id", referencedColumnName = "k_id")
-    public Korisnik getKorisnikByPatnikKId() {
-        return korisnikByPatnikKId;
-    }
-
-    public void setKorisnikByPatnikKId(Korisnik korisnikByPatnikKId) {
-        this.korisnikByPatnikKId = korisnikByPatnikKId;
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "kacuva_pnl_id", referencedColumnName = "pnl_id", nullable = false)
-    public Postojkanalinija getPostojkanalinijaByKacuvaPnlId() {
-        return postojkanalinijaByKacuvaPnlId;
-    }
-
-    public void setPostojkanalinijaByKacuvaPnlId(Postojkanalinija postojkanalinijaByKacuvaPnlId) {
-        this.postojkanalinijaByKacuvaPnlId = postojkanalinijaByKacuvaPnlId;
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "inl_id", referencedColumnName = "inl_id", nullable = false)
-    public Instancanalinija getInstancanalinijaByInlId() {
-        return instancanalinijaByInlId;
-    }
-
-    public void setInstancanalinijaByInlId(Instancanalinija instancanalinijaByInlId) {
-        this.instancanalinijaByInlId = instancanalinijaByInlId;
-    }
-
-    @ManyToOne
-    @JoinColumn(name = "b_id", referencedColumnName = "b_id", nullable = false)
-    public Bilet getBiletByBId() {
-        return biletByBId;
-    }
-
-    public void setBiletByBId(Bilet biletByBId) {
-        this.biletByBId = biletByBId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/Vraboten.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/Vraboten.java	(revision 24c39f958d6dc4a916ce04381e57b26a8163a342)
+++ 	(revision )
@@ -1,79 +1,0 @@
-package mk.ukim.finki.busngo.model;
-
-import jakarta.persistence.*;
-
-import java.sql.Date;
-import java.util.Objects;
-
-@Entity
-public class Vraboten{
-    private Long kId;
-    private Double vPlata;
-    private Date vDatumNaVrabotuvanje;
-    private Date vDatumPrekinVrabotuvanje;
-    private Korisnik korisnikByKId;
-
-    @GeneratedValue(strategy = GenerationType.IDENTITY)
-    @Id
-    @Column(name = "k_id", nullable = false)
-    public Long getkId() {
-        return kId;
-    }
-
-    public void setkId(Long kId) {
-        this.kId = kId;
-    }
-
-    @Basic
-    @Column(name = "v_plata", nullable = false, precision = 0)
-    public Double getvPlata() {
-        return vPlata;
-    }
-
-    public void setvPlata(Double vPlata) {
-        this.vPlata = vPlata;
-    }
-
-    @Basic
-    @Column(name = "v_datum_na_vrabotuvanje", nullable = false)
-    public Date getvDatumNaVrabotuvanje() {
-        return vDatumNaVrabotuvanje;
-    }
-
-    public void setvDatumNaVrabotuvanje(Date vDatumNaVrabotuvanje) {
-        this.vDatumNaVrabotuvanje = vDatumNaVrabotuvanje;
-    }
-
-    @Basic
-    @Column(name = "v_datum_prekin_vrabotuvanje", nullable = true)
-    public Date getvDatumPrekinVrabotuvanje() {
-        return vDatumPrekinVrabotuvanje;
-    }
-
-    public void setvDatumPrekinVrabotuvanje(Date vDatumPrekinVrabotuvanje) {
-        this.vDatumPrekinVrabotuvanje = vDatumPrekinVrabotuvanje;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (this == o) return true;
-        if (o == null || getClass() != o.getClass()) return false;
-        Vraboten vraboten = (Vraboten) o;
-        return Objects.equals(kId, vraboten.kId) && Objects.equals(vPlata, vraboten.vPlata) && Objects.equals(vDatumNaVrabotuvanje, vraboten.vDatumNaVrabotuvanje) && Objects.equals(vDatumPrekinVrabotuvanje, vraboten.vDatumPrekinVrabotuvanje);
-    }
-
-    @Override
-    public int hashCode() {
-        return Objects.hash(kId, vPlata, vDatumNaVrabotuvanje, vDatumPrekinVrabotuvanje);
-    }
-
-    @OneToOne
-    @JoinColumn(name = "k_id", referencedColumnName = "k_id", nullable = false)
-    public Korisnik getKorisnikByKId() {
-        return korisnikByKId;
-    }
-
-    public void setKorisnikByKId(Korisnik korisnikByKId) {
-        this.korisnikByKId = korisnikByKId;
-    }
-}
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Avtobus.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Avtobus.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Avtobus.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,24 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+import java.util.List;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Avtobus {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @Column(name = "a_registracija")
+    private String aRegistracija;
+    @Basic
+    @Column(name = "a_seriski_broj")
+    private String aSeriskiBroj;
+    @Basic
+    @Column(name = "a_broj_sedista")
+    private Short aBrojSedista;
+    @OneToMany(mappedBy = "avtobusByARegistracija")
+    private List<Instancanalinija> instancanalinijaList;
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,35 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+import mk.ukim.finki.busngo.model.enums.BILET_STATUS;
+import org.hibernate.annotations.Type;
+
+import java.sql.Timestamp;
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Bilet {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @Column(name = "b_id")
+    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;
+    @ManyToOne
+    @JoinColumn(name = "tb_id", referencedColumnName = "tb_id")
+    private Tipbilet tipbiletByTbId;
+//    @OneToMany(mappedBy = "biletByBId")
+//    private List<Vozenje> vozenjesByBId;
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,37 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+import java.sql.Timestamp;
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Instancanalinija {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @Column(name = "inl_id")
+    private Long inlId;
+    @Basic
+    @Column(name = "inl_datum_start")
+    private Timestamp inlDatumStart;
+    @Basic
+    @Column(name = "inl_datum_end")
+    private Timestamp inlDatumEnd;
+    @ManyToOne
+    @JoinColumn(name = "vozac_k_id", referencedColumnName = "k_id", nullable = false)
+    private Korisnik korisnikByVozacKId;
+    @ManyToOne
+    @JoinColumn(name = "a_registracija", referencedColumnName = "a_registracija")
+    private Avtobus avtobusByARegistracija;
+    @ManyToOne
+    @JoinColumn(name = "li_id", referencedColumnName = "li_id", nullable = false)
+    private Linija linijaByLiId;
+    @OneToMany(mappedBy = "instancanalinijaByInlId")
+    private List<Kontroli> kontrolisByInlId;
+    @OneToMany(mappedBy = "instancanalinijaByInlId")
+    private List<Vozenje> vozenjesByInlId;
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,41 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+import java.sql.Timestamp;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Kazna {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @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;
+    @ManyToOne
+    @JoinColumn(name = "kontrola_id", referencedColumnName = "kontrola_id")
+    private Kontroli kontroliByKontrolaId;
+    @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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,27 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+import java.util.Objects;
+
+@Data
+@Entity
+public class Kaznazaneregistriran {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @Column(name = "kz_id")
+    private Long kzId;
+    @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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,21 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+import java.util.Objects;
+
+@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;
+    @ManyToOne
+    @JoinColumn(name = "patnik_k_id", referencedColumnName = "k_id")
+    private Korisnik 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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,19 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+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;
+
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,30 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+import java.sql.Timestamp;
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Kontroli {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @Column(name = "kontrola_id")
+    private Long kontrolaId;
+    @Basic
+    @Column(name = "kontrola_datum")
+    private Timestamp kontrolaDatum;
+    @OneToMany(mappedBy = "kontroliByKontrolaId")
+    private List<Kazna> kaznasByKontrolaId;
+    @ManyToOne
+    @JoinColumn(name = "kondukter_k_id", referencedColumnName = "k_id")
+    private Korisnik korisnikByKondukterKId;
+    @ManyToOne
+    @JoinColumn(name = "inl_id", referencedColumnName = "inl_id")
+    private Instancanalinija instancanalinijaByInlId;
+
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,105 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+import mk.ukim.finki.busngo.model.enums.Role;
+import org.springframework.security.core.GrantedAuthority;
+import org.springframework.security.core.userdetails.UserDetails;
+
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Korisnik implements UserDetails {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @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;
+//    private boolean isAccountNonExpired = true;
+//    private boolean isAccountNonLocked = true;
+//    private boolean isCredentialsNonExpired =  true;
+//    private boolean isEnabled = true;
+
+
+    @Override
+    public Collection<? extends GrantedAuthority> getAuthorities() {
+        return kIsAdmin ? Collections.singletonList(Role.ROLE_ADMIN) : Collections.singletonList(Role.ROLE_USER);
+    }
+
+    @Override
+    public String getPassword() {
+        return kLozinka;
+    }
+
+    @Override
+    public String getUsername() {
+        return kEmail;
+    }
+
+    @Override
+    public boolean isAccountNonExpired() {
+        return true;
+    }
+
+    @Override
+    public boolean isAccountNonLocked() {
+        return true;
+    }
+
+    @Override
+    public boolean isCredentialsNonExpired() {
+        return true;
+    }
+
+    @Override
+    public boolean isEnabled() {
+        return true;
+    }
+
+
+//    @OneToMany(mappedBy = "korisnikByVozacKId")
+//    private List<Instancanalinija> instancanalinijasByKId;
+//    @OneToMany(mappedBy = "korisnikByKondukterKId")
+//    private List<Kazna> kaznasByKId;
+//    @OneToMany(mappedBy = "korisnikByPatnikKId")
+//    private List<Kaznazaregistriran> kaznazaregistriransByKId;
+//    @OneToOne(mappedBy = "korisnikByKId")
+//    private Kondukter kondukterByKId;
+//    @OneToMany(mappedBy = "korisnikByKondukterKId")
+//    private List<Kontroli> kontrolisByKId;
+//    @OneToOne(mappedBy = "korisnikByKId")
+//    private Patnik patnikByKId;
+//    @OneToOne(mappedBy = "korisnikByKId")
+//    private Vozac vozacByKId;
+//    @OneToMany(mappedBy = "korisnikByPatnikKId")
+//    private List<Vozenje> vozenjesByKId;
+//    @OneToOne(mappedBy = "korisnikByKId")
+//    private Vraboten vrabotenByKId;
+}
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Linija.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Linija.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Linija.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,29 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+import java.lang.invoke.CallSite;
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Linija {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @Column(name = "li_id")
+    private Integer liId;
+    @Basic
+    @Column(name = "li_ime")
+    private String liIme;
+    @Basic
+    @Column(name = "li_pravec")
+    private String liPravec;
+    @OneToMany(mappedBy = "linijaByLiId")
+    private List<Instancanalinija> instancanalinijasByLiId;
+    @OneToMany(mappedBy = "linijaByLiId")
+    private List<Postojkanalinija> postojkanalinijasByLiId;
+
+}
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Mesto.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Mesto.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Mesto.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,28 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Mesto {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @Column(name = "m_id")
+    private Integer mId;
+    @Basic
+    @Column(name = "m_grad")
+    private String mGrad;
+    @Basic
+    @Column(name = "m_opstina")
+    private String mOpstina;
+    @Basic
+    @Column(name = "m_ulica")
+    private String mUlica;
+    @OneToMany(mappedBy = "mestoByMId")
+    private List<Postojka> postojkasByMId;
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,18 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+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;
+}
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Postojka.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Postojka.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Postojka.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,26 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Postojka {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @Column(name = "p_id")
+    private Integer pId;
+    @Basic
+    @Column(name = "p_ime")
+    private String pIme;
+    @ManyToOne
+    @JoinColumn(name = "m_id", referencedColumnName = "m_id")
+    private Mesto mestoByMId;
+    @OneToMany(mappedBy = "postojkaByPId")
+    private List<Postojkanalinija> postojkanalinijasByPId;
+
+}
Index: src/main/java/mk/ukim/finki/busngo/model/entities/Postojkanalinija.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/Postojkanalinija.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/Postojkanalinija.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,28 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Postojkanalinija {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @Column(name = "pnl_id")
+    private Long pnlId;
+    @Basic
+    @Column(name = "pnl_reden_broj")
+    private Short pnlRedenBroj;
+    @ManyToOne
+    @JoinColumn(name = "li_id", referencedColumnName = "li_id", nullable = false)
+    private Linija linijaByLiId;
+    @ManyToOne
+    @JoinColumn(name = "p_id", referencedColumnName = "p_id", nullable = false)
+    private Postojka postojkaByPId;
+    @OneToMany(mappedBy = "postojkanalinijaByKacuvaPnlId")
+    private List<Vozenje> vozenjesByPnlId;
+}
Index: src/main/java/mk/ukim/finki/busngo/model/entities/SeSimnuvaNa.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/SeSimnuvaNa.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/SeSimnuvaNa.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,17 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+import java.util.Objects;
+
+@Data
+@Entity
+//@jakarta.persistence.Table(name = "se_simnuva_na", schema = "project", catalog = "db_202324z_va_prj_busngo")
+//@jakarta.persistence.IdClass(mk.ukim.finki.busngo.model.entities.SeSimnuvaNaPK.class)
+public class SeSimnuvaNa {
+    @EmbeddedId
+    private SeSimnuvaNaPK id;
+
+
+}
Index: src/main/java/mk/ukim/finki/busngo/model/entities/SeSimnuvaNaPK.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/entities/SeSimnuvaNaPK.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/entities/SeSimnuvaNaPK.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,13 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.Embeddable;
+import lombok.Data;
+
+import java.io.Serializable;
+
+@Data
+@Embeddable
+public class SeSimnuvaNaPK implements Serializable {
+    private Long vozenjeId;
+    private Long pnlId;
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,27 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Tipbilet {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @Column(name = "tb_id", columnDefinition = "serial")
+    private Long tbId;
+    @Basic
+    @Column(name = "tb_trajnost")
+    private Long tbTrajnost;
+    @Basic
+    @Column(name = "tb_ime")
+    private String tbIme;
+    @OneToMany(mappedBy = "tipbiletByTbId")
+    private List<Bilet> biletsByTbId;
+
+
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,19 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+
+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;
+
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,40 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+import mk.ukim.finki.busngo.model.enums.VOZENJE_STATUS;
+
+import java.sql.Timestamp;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Vozenje {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @Column(name = "vozenje_id")
+    private Long vozenjeId;
+    @Basic
+    @Column(name = "vozenje_start")
+    private Timestamp vozenjeStart;
+    @Basic
+    @Column(name = "vozenje_end")
+    private Timestamp vozenjeEnd;
+    @Basic
+    @Column(name = "vozenje_status")
+    @Enumerated(EnumType.STRING)
+    private VOZENJE_STATUS vozenjeStatus;
+    @ManyToOne
+    @JoinColumn(name = "patnik_k_id", referencedColumnName = "k_id")
+    private Korisnik korisnikByPatnikKId;
+    @ManyToOne
+    @JoinColumn(name = "kacuva_pnl_id", referencedColumnName = "pnl_id", nullable = false)
+    private Postojkanalinija postojkanalinijaByKacuvaPnlId;
+    @ManyToOne
+    @JoinColumn(name = "inl_id", referencedColumnName = "inl_id", nullable = false)
+    private Instancanalinija instancanalinijaByInlId;
+    @ManyToOne
+    @JoinColumn(name = "b_id", referencedColumnName = "b_id", nullable = false)
+    private Bilet biletByBId;
+
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,30 @@
+package mk.ukim.finki.busngo.model.entities;
+
+import jakarta.persistence.*;
+import lombok.Data;
+import lombok.Getter;
+
+import java.sql.Date;
+import java.util.Objects;
+
+@Data
+@Entity
+public class Vraboten {
+    @GeneratedValue(strategy = GenerationType.IDENTITY)
+    @Id
+    @Column(name = "k_id")
+    private Long kId;
+    @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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,15 @@
+package mk.ukim.finki.busngo.model.enums;
+
+
+import org.springframework.security.core.GrantedAuthority;
+
+public enum Role implements GrantedAuthority {
+    ROLE_USER,
+    ROLE_ADMIN;
+
+
+    @Override
+    public String getAuthority() {
+        return name();
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidCredentialsException.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidCredentialsException.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidCredentialsException.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class InvalidCredentialsException extends RuntimeException{
+    public InvalidCredentialsException() {
+        super("The credentials entered are invalid!");
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidPatnikIdException.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidPatnikIdException.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidPatnikIdException.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class InvalidPatnikIdException extends RuntimeException{
+    public InvalidPatnikIdException() {
+        super("The given patnik id does not exist!");
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidTipBiletIdException.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidTipBiletIdException.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidTipBiletIdException.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class InvalidTipBiletIdException extends RuntimeException{
+    public InvalidTipBiletIdException() {
+        super("Invalid tipbilet id!");
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidUserId.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidUserId.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/InvalidUserId.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class InvalidUserId extends RuntimeException{
+    public InvalidUserId() {
+        super("The iven user id does not exist!");
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/model/exceptions/UserAlreadyExistsException.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/model/exceptions/UserAlreadyExistsException.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/model/exceptions/UserAlreadyExistsException.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,7 @@
+package mk.ukim.finki.busngo.model.exceptions;
+
+public class UserAlreadyExistsException extends RuntimeException{
+    public UserAlreadyExistsException(String message) {
+        super(message);
+    }
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,15 @@
+package mk.ukim.finki.busngo.repository;
+
+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.enums.BILET_STATUS;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+import java.util.List;
+
+
+public interface BiletRepository extends JpaRepository<Bilet, Long> {
+//    List<Bilet> findAllByKorisnikByPatnikKIdAndBStatus(Korisnik korisnik, BILET_STATUS status);
+//    List<Bilet> findAllByKorisnikByPatnikKId(Korisnik korisnik);
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,15 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Korisnik;
+import org.aspectj.apache.bcel.classfile.Module;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+
+import java.util.Optional;
+
+public interface KorisnikRepository extends JpaRepository<Korisnik, Long> {
+    @Query("SELECT k FROM Korisnik k WHERE k.kEmail = ?1 and k.kLozinka = ?2")
+    Optional<Korisnik> findByKEmailAndKLozinka(String kEmail, String kLozinka);
+    @Query("SELECT k FROM Korisnik k WHERE k.kEmail = ?1")
+    Optional<Korisnik> findByKEmail(String kEmail);
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,9 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Patnik;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+public interface PatnikRepository extends JpaRepository<Patnik, Long> {
+
+}
Index: src/main/java/mk/ukim/finki/busngo/repository/TipBIletRepository.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/repository/TipBIletRepository.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/repository/TipBIletRepository.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,8 @@
+package mk.ukim.finki.busngo.repository;
+
+import mk.ukim.finki.busngo.model.entities.Tipbilet;
+import org.springframework.data.jpa.repository.JpaRepository;
+
+public interface TipBIletRepository extends JpaRepository<Tipbilet, Long> {
+
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,9 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Korisnik;
+
+public interface AuthService {
+    Korisnik login(String email, String password);
+    Korisnik register(String ime, String email, String password, String confirmPassword, String address, String telefon);
+
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,15 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Bilet;
+import mk.ukim.finki.busngo.model.enums.BILET_STATUS;
+
+import java.time.LocalDateTime;
+import java.util.List;
+
+public interface BiletService {
+    List<Bilet> listAll();
+    List<Bilet> findAllByPatnikId(Long id);
+    List<Bilet> findAllByPatnikIdAndStatus(Long id, BILET_STATUS status);
+
+    Bilet buy(Long tipbilet, LocalDateTime now, BILET_STATUS biletStatus, String name);
+}
Index: src/main/java/mk/ukim/finki/busngo/service/KorisnikService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/KorisnikService.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/service/KorisnikService.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,12 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Korisnik;
+
+
+import java.util.List;
+
+public interface KorisnikService {
+    List<Korisnik> listAll();
+    Korisnik findById(Long id);
+    Korisnik loadUserByEmail(String email);
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,12 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Bilet;
+import mk.ukim.finki.busngo.model.entities.Patnik;
+
+import java.util.List;
+
+public interface PatnikService {
+    List<Patnik> listAll();
+    Patnik findById(Long id);
+
+}
Index: src/main/java/mk/ukim/finki/busngo/service/TipBiletService.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/TipBiletService.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/service/TipBiletService.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,9 @@
+package mk.ukim.finki.busngo.service;
+
+import mk.ukim.finki.busngo.model.entities.Tipbilet;
+
+import java.util.List;
+
+public interface TipBiletService {
+    List<Tipbilet> listAll();
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,56 @@
+package mk.ukim.finki.busngo.service.impl;
+
+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.repository.KorisnikRepository;
+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 PasswordEncoder passwordEncoder;
+
+    public AuthServiceImpl(KorisnikRepository korisnikRepository, PasswordEncoder passwordEncoder) {
+        this.korisnikRepository = korisnikRepository;
+        this.passwordEncoder = passwordEncoder;
+    }
+
+    @Override
+    public Korisnik login(String email, String password) {
+        if(email == null || password == null || email.isEmpty() || password.isEmpty())
+            throw new InvalidCredentialsException();
+        return korisnikRepository.findByKEmailAndKLozinka(email, password).orElseThrow(InvalidCredentialsException::new);
+    }
+
+    @Override
+    public Korisnik register(String ime, String email, String password, String confirmPassword, String address, String telefon) {
+        if (email == null || password == null || email.isEmpty() || password.isEmpty()) {
+            throw new InvalidCredentialsException();
+        }
+
+        if (!password.equals(confirmPassword)) {
+            throw new InvalidCredentialsException();
+        }
+
+        if(this.korisnikRepository.findByKEmail(email).isPresent()) {
+            throw new UserAlreadyExistsException(email);
+        }
+
+        Korisnik korisnik = new Korisnik();
+        korisnik.setKIme(ime);
+        korisnik.setKAdresa(address);
+        korisnik.setKLozinka(passwordEncoder.encode(password));
+        korisnik.setKEmail(email);
+        korisnik.setKTelefon(telefon);
+        korisnik.setKIsAdmin(false);
+
+        return korisnikRepository.save(korisnik);
+    }
+
+
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,62 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.Bilet;
+import mk.ukim.finki.busngo.model.entities.Korisnik;
+import mk.ukim.finki.busngo.model.entities.Tipbilet;
+import mk.ukim.finki.busngo.model.enums.BILET_STATUS;
+import mk.ukim.finki.busngo.model.exceptions.InvalidTipBiletIdException;
+import mk.ukim.finki.busngo.repository.BiletRepository;
+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.stereotype.Service;
+
+import java.sql.Timestamp;
+import java.time.LocalDateTime;
+import java.util.ArrayList;
+import java.util.List;
+
+@Service
+public class BiletServiceImpl implements BiletService {
+    private final BiletRepository biletRepository;
+    private final KorisnikService korisnikService;
+    private final TipBIletRepository tipBIletRepository;
+    private final PatnikService patnikService;
+
+    public BiletServiceImpl(BiletRepository biletRepository, KorisnikService korisnikService, TipBIletRepository tipBIletRepository, PatnikService patnikService) {
+        this.biletRepository = biletRepository;
+        this.korisnikService = korisnikService;
+        this.tipBIletRepository = tipBIletRepository;
+        this.patnikService = patnikService;
+    }
+
+    @Override
+    public List<Bilet> listAll() {
+        return biletRepository.findAll();
+    }
+
+    @Override
+    public List<Bilet> findAllByPatnikId(Long id) {
+        Korisnik korisnik = korisnikService.findById(id);
+        return new ArrayList<>();
+    }
+
+    @Override
+    public List<Bilet> findAllByPatnikIdAndStatus(Long id, BILET_STATUS status) {
+        Korisnik korisnik = korisnikService.findById(id);
+        return new ArrayList<>();
+    }
+
+    @Override
+    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);
+        Bilet bilet = new Bilet();
+        bilet.setBStatus(biletStatus);
+        bilet.setTipbiletByTbId(tipbilet1);
+        bilet.setBDatumNaKupuvanje(Timestamp.valueOf(now));
+        bilet.setKorisnikByPatnikKId(korisnik);
+        return biletRepository.save(bilet);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/KorisnikServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/KorisnikServiceImpl.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/KorisnikServiceImpl.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,34 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.Korisnik;
+import mk.ukim.finki.busngo.model.exceptions.InvalidUserId;
+import mk.ukim.finki.busngo.repository.KorisnikRepository;
+import mk.ukim.finki.busngo.service.KorisnikService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class KorisnikServiceImpl implements KorisnikService {
+    private final KorisnikRepository korisnikRepository;
+
+    public KorisnikServiceImpl(KorisnikRepository korisnikRepository) {
+        this.korisnikRepository = korisnikRepository;
+    }
+
+
+    @Override
+    public List<Korisnik> listAll() {
+        return korisnikRepository.findAll();
+    }
+
+    @Override
+    public Korisnik findById(Long id) {
+        return korisnikRepository.findById(id).orElseThrow(InvalidUserId::new);
+    }
+
+    @Override
+    public Korisnik loadUserByEmail(String email) {
+        return korisnikRepository.findByKEmail(email).orElseThrow(InvalidUserId::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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,28 @@
+package mk.ukim.finki.busngo.service.impl;
+
+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.PatnikService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class PatnikServiceImpl implements PatnikService {
+    private final PatnikRepository patnikRepository;
+
+    public PatnikServiceImpl(PatnikRepository patnikRepository) {
+        this.patnikRepository = patnikRepository;
+    }
+
+    @Override
+    public List<Patnik> listAll() {
+        return patnikRepository.findAll();
+    }
+
+    @Override
+    public Patnik findById(Long id) {
+        return patnikRepository.findById(id).orElseThrow(InvalidPatnikIdException::new);
+    }
+}
Index: src/main/java/mk/ukim/finki/busngo/service/impl/TipBiletServiceImpl.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/service/impl/TipBiletServiceImpl.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/service/impl/TipBiletServiceImpl.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,22 @@
+package mk.ukim.finki.busngo.service.impl;
+
+import mk.ukim.finki.busngo.model.entities.Tipbilet;
+import mk.ukim.finki.busngo.repository.TipBIletRepository;
+import mk.ukim.finki.busngo.service.TipBiletService;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class TipBiletServiceImpl implements TipBiletService {
+    private final TipBIletRepository tipBIletRepository;
+
+    public TipBiletServiceImpl(TipBIletRepository tipBIletRepository) {
+        this.tipBIletRepository = tipBIletRepository;
+    }
+
+    @Override
+    public List<Tipbilet> listAll() {
+        return tipBIletRepository.findAll();
+    }
+}
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,52 @@
+package mk.ukim.finki.busngo.web;
+
+import mk.ukim.finki.busngo.model.enums.BILET_STATUS;
+import mk.ukim.finki.busngo.service.AuthService;
+import mk.ukim.finki.busngo.service.BiletService;
+import mk.ukim.finki.busngo.service.TipBiletService;
+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.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+import java.time.LocalDateTime;
+
+@Controller
+@RequestMapping("/bilet")
+public class BiletController {
+    private final BiletService biletService;
+    private final TipBiletService tipBiletService;
+    private final AuthService authService;
+
+    public BiletController(BiletService biletService, TipBiletService tipBiletService, AuthService authService) {
+        this.biletService = biletService;
+        this.tipBiletService = tipBiletService;
+        this.authService = authService;
+    }
+
+    @GetMapping()
+    public String getAllBileti(@RequestParam(required = false) Long id,
+                               @RequestParam(required = false) BILET_STATUS status,
+                               Model model){
+        model.addAttribute("bodyContent", "listBileti");
+        model.addAttribute("bileti", biletService.listAll());
+        return "master-template";
+    }
+
+    @GetMapping("/kupi")
+    public String getKupiPage(Model model){
+        model.addAttribute("bodyContent", "kupiBilet");
+        model.addAttribute("tipbileti", tipBiletService.listAll());
+        return "master-template";
+    }
+
+    @PostMapping("/kupi")
+    public String kupiBilet(@RequestParam Long tipbilet, Authentication authentication){
+        biletService.buy(tipbilet, LocalDateTime.now(), BILET_STATUS.INACTIVE, authentication.getName());
+        return "redirect:/bilet";
+    }
+
+}
Index: src/main/java/mk/ukim/finki/busngo/web/LoginController.java
===================================================================
--- src/main/java/mk/ukim/finki/busngo/web/LoginController.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
+++ src/main/java/mk/ukim/finki/busngo/web/LoginController.java	(revision b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,47 @@
+package mk.ukim.finki.busngo.web;
+
+import jakarta.servlet.http.HttpServletRequest;
+import mk.ukim.finki.busngo.model.entities.Korisnik;
+import mk.ukim.finki.busngo.model.exceptions.InvalidCredentialsException;
+import mk.ukim.finki.busngo.service.AuthService;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+@RequestMapping("/login")
+public class LoginController {
+
+    private final AuthService authService;
+
+    public LoginController(AuthService authService) {
+        this.authService = authService;
+    }
+
+    @GetMapping
+    public String getLoginPage(Model model) {
+        model.addAttribute("bodyContent", "login");
+        return "master-template";
+    }
+
+    @PostMapping
+    public String login(HttpServletRequest request, Model model) {
+        Korisnik user = null;
+
+        try {
+            user = authService.login(request.getParameter("username"), request.getParameter("password"));
+        } catch (InvalidCredentialsException exception) {
+            model.addAttribute("bodyContent", "login");
+            model.addAttribute("hasError", true);
+            model.addAttribute("error", exception.getMessage());
+            return "master-template";
+        }
+
+        request.getSession().setAttribute("user", user);
+        return "redirect:/home";
+    }
+
+}
+
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 b101b69e1e4156497c29fa60f501b18007efeab7)
@@ -0,0 +1,53 @@
+package mk.ukim.finki.busngo.web;
+
+import mk.ukim.finki.busngo.model.enums.Role;
+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 org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@Controller
+@RequestMapping("/register")
+public class RegisterController {
+    private final AuthService authService;
+    private final KorisnikService korisnikService;
+
+    public RegisterController(AuthService authService, KorisnikService korisnikService) {
+        this.authService = authService;
+        this.korisnikService = korisnikService;
+    }
+
+    @GetMapping
+    public String getRegisterPage(@RequestParam(required = false) String error, Model model) {
+        if(error != null && !error.isEmpty()) {
+            model.addAttribute("hasError", true);
+            model.addAttribute("error", error);
+        }
+
+        model.addAttribute("bodyContent", "register");
+        return "master-template";
+    }
+
+    @PostMapping
+    public String register(@RequestParam String name,
+                           @RequestParam String email,
+                           @RequestParam String password,
+                           @RequestParam String confirmPassword,
+                           @RequestParam String address,
+                           @RequestParam String phone
+    ) {
+        try{
+            this.authService.register(name, email, password, confirmPassword, address, phone);
+            return "redirect:/login";
+        } catch (InvalidCredentialsException | UserAlreadyExistsException exception) {
+            return "redirect:/register?error=" + exception.getMessage();
+        }
+    }
+
+}
