Index: sources/app/src/main/java/parkup/services/ParkingZoneService.java
===================================================================
--- sources/app/src/main/java/parkup/services/ParkingZoneService.java	(revision 9dd526f0ddf9a23ad37dd4c977f761ff959f5913)
+++ sources/app/src/main/java/parkup/services/ParkingZoneService.java	(revision df4089c7ef898fde56a92f138b1af0174628ad75)
@@ -3,5 +3,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import parkup.data.ParkingZoneAdminView;
 import parkup.data.ParkingZoneLocation;
+import parkup.data.WorkerDemo;
 import parkup.entities.ParkingSpace;
 import parkup.entities.ParkingZone;
@@ -17,4 +19,5 @@
 import java.util.Objects;
 import java.util.Optional;
+import java.util.stream.Collectors;
 
 @Service
@@ -36,16 +39,16 @@
         List<ParkingZone> parkingZones= parkingZoneRepository.findAll();
         for(ParkingZone pz:parkingZones){
-            setTransientVariables(pz.getId());
+            setTransientVariables(pz);
         }
         return parkingZones;
     }
 
-    public ParkingZone findById(int parkingZoneId) {
+    public ParkingZoneAdminView findById(int parkingZoneId) {
         Optional<ParkingZone> parkingZone = Optional.ofNullable(this.parkingZoneRepository.findByPzId(parkingZoneId));
         if (!parkingZone.isPresent()) {
             throw new IllegalStateException("ParkingZone does not exist");
         }
-        setTransientVariables(parkingZone.get().getId());
-        return parkingZone.get();
+        setTransientVariables(parkingZone.get());
+        return new ParkingZoneAdminView(parkingZone.get(),getResponsibleWorkers(parkingZoneId));
     }
 
@@ -83,7 +86,7 @@
     //TODO proveri dali ima odgovorni i dokolku ima dali postojat vo bazata
     @Transactional
-    public ParkingZone updateParkingZone(int parkingZoneId, String pzName, int price,
+    public ParkingZoneAdminView updateParkingZone(int parkingZoneId, String pzName, int price,
                                          String location, int from, int to, String color,
-                                         List<ParkingSpace> parkingSpaces, ParkingZoneLocation parkingZoneLocation, List<Integer> odgovorniLica) {
+                                         List<ParkingSpace> parkingSpaces, ParkingZoneLocation parkingZoneLocation, List<WorkerDemo> responsibleWorkers) {
 
         //TODO prati niza od objekti ParkingSpaces i prati objekt ParkingZoneLocation
@@ -124,22 +127,14 @@
 
                 if (!parkingSpaces.isEmpty()) {
+                    List<String> psNamesInZone=parkingZoneNov.getParkingSpaces().stream().map(ParkingSpace::getPsName).collect(Collectors.toList());
+                    List<ParkingSpace> psToAdd=parkingSpaces.stream().filter(ps->!psNamesInZone.contains(ps.getPsName())).collect(Collectors.toList());
+                    for(ParkingSpace ps:psToAdd){
+                        parkingZoneNov.getParkingSpaces().add(ps);
+                    }
+                }
+                if (!responsibleWorkers.isEmpty()) {
                     ParkingZone parkingZone = parkingZoneRepository.findByPzId(parkingZoneId);
-//                    for(ParkingSpace space :parkingZone.getParkingSpaces()){
-//                        if(!parkingSpaces.contains(space)){
-//                            for(ParkingSession session: parkingSessionRepository.findByParkingZonePzName(pzName)){
-//                                if(session.getParkingSpace().getPsId()==space.getPsId())
-//                                    throw new IllegalStateException("Vlegov vo iffot");
-//                            }
-//                        }
-//                    }
-                    //TODO: treba da se opravi 
-                    parkingZone.setParkingSpaces(null);
-                    List<ParkingSpace> spacesToAdd = new ArrayList<>(parkingSpaces);
-                    parkingZone.setParkingSpaces(spacesToAdd);
-                }
-                if (!odgovorniLica.isEmpty()) {
-                    ParkingZone parkingZone = parkingZoneRepository.findByPzId(parkingZoneId);
-                    for (Integer vrabotenId : odgovorniLica) {
-                        Worker workerToAdd = workerRepository.findByWorkerId(vrabotenId);
+                    for (Integer workerId : responsibleWorkers.stream().map(WorkerDemo::getWorkerId).collect(Collectors.toList())) {
+                        Worker workerToAdd = workerRepository.findByWorkerId(workerId);
                         if(workerToAdd !=null)
                         workerToAdd.getParkingZones().add(parkingZone);
@@ -147,6 +142,6 @@
                 }
 
-
-                return parkingZoneNov;
+                setTransientVariables(parkingZoneNov);
+                return new ParkingZoneAdminView(parkingZoneNov,getResponsibleWorkers(parkingZoneId));
             } else {
                 throw new IllegalStateException("There ParkingZone does not exist");
@@ -159,4 +154,6 @@
             Optional<ParkingZone> parkingZoneOpt = Optional.ofNullable(parkingZoneRepository.findByPzId(parkingZoneId));
             if (parkingZoneOpt.isPresent()) {
+                parkingZoneOpt.get().setParkingSpaces(null);
+                parkingZoneOpt.get().setParkingZoneLocation(null);
                 parkingZoneRepository.deleteByPzId(parkingZoneId);
             } else {
@@ -174,7 +171,11 @@
             return parkingZone.getParkingSpaces().size();
         }
-        public void setTransientVariables(int pzId){
-            calculateCapacity(pzId);
-            calculateTakenSpaces(pzId);
+        public void setTransientVariables(ParkingZone pz){
+            pz.setCapacity(calculateCapacity(pz.getId()));
+            pz.setTakenSpaces(calculateTakenSpaces(pz.getId()));
+        }
+        public List<WorkerDemo> getResponsibleWorkers(int pzId){
+            ParkingZone parkingZone =parkingZoneRepository.findByPzId(pzId);
+            return workerRepository.findAll().stream().filter(w->w.getParkingZones().contains(parkingZone)).map(WorkerDemo::new).collect(Collectors.toList());
         }
     }
