Ignore:
Timestamp:
02/18/24 22:01:54 (9 months ago)
Author:
ppaunovski <paunovskipavel@…>
Branches:
master
Children:
4251327
Parents:
bde8b13
Message:

All 3 main use cases implemented.

  1. Starting a commute
  2. Writing a ticket
  3. Starting an instance of a Bus Line
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/mk/ukim/finki/busngo/web/VozenjeController.java

    rbde8b13 re272096  
    44import mk.ukim.finki.busngo.model.entities.Patnik;
    55import mk.ukim.finki.busngo.model.entities.Vozenje;
     6import mk.ukim.finki.busngo.model.enums.VOZENJE_STATUS;
    67import mk.ukim.finki.busngo.model.exceptions.InvalidPatnikIdException;
    78import mk.ukim.finki.busngo.model.exceptions.InvalidPostojkaNaLinijaIdException;
     
    2930    @GetMapping()
    3031    public String getVozenjePage(Model model,
    31                                  Authentication authentication){
     32                                 Authentication authentication,
     33                                 @RequestParam(required = false) VOZENJE_STATUS status){
    3234        model.addAttribute("bodyContent", "listVozenja");
    3335        Patnik patnik = null;
    3436        try{
    35             model.addAttribute("vozenja", vozenjeService.findVozenjaByPatnik(authentication.getName()));
     37            if(status != null)
     38                model.addAttribute("vozenja", vozenjeService.findVozenjaByPatnikAndStatus(authentication.getName(), status));
     39            else
     40                model.addAttribute("vozenja", vozenjeService.findVozenjaByPatnikAndStatus(authentication.getName(), VOZENJE_STATUS.ACTIVE));
     41            model.addAttribute("vozStatus", VOZENJE_STATUS.values());
    3642        }
    3743        catch (InvalidPatnikIdException e){
Note: See TracChangeset for help on using the changeset viewer.