Skip to content

Commit

Permalink
Backend/reservation/s02 (#37)
Browse files Browse the repository at this point in the history
* update Reservation

	- updateReservation(Reservaton reservation) added.

Issues: [n/a]
Signed-off-by: Kuzu <[email protected]>

* Moving Reservation

	- moveFromReservationToMeineHardware(Reservation reservation).

* Reservation update

* fix MeineHardwareView not realoading grid
show grids in dashboard only if storageadmin or fieldtechnician
add hashing on registration
fix exception when lastlogedin is null
fix UserManagementview not reloading on usercreation
fix activate/deactivate button.
add block login on if user is deactivated
make all users in data.sql activated

known issues: If user is deactivated login screen shows wrong message.

Signed-off-by: Aleksandar Zivkovic <[email protected]>

* fix Bean not being reinitialized after user creation

Signed-off-by: Aleksandar Zivkovic <[email protected]>

* fix duplicate grid columns

Signed-off-by: Aleksandar Zivkovic <[email protected]>

* Moving Reservation

	- moveFromReservationToMeineHardware(Reservation reservation).

* Reservation update

* Id problem solved

---------

Signed-off-by: Kuzu <[email protected]>
Signed-off-by: Aleksandar Zivkovic <[email protected]>
Co-authored-by: Aleksandar Zivkovic <[email protected]>
  • Loading branch information
Serberx and anywaywayany authored Feb 28, 2024
1 parent 2d4eef8 commit 88bf0a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class ServiceReservation{
@Autowired
private final ServiceStorageObjectHistory serviceStorageObjectHistory;


@Transactional
public Reservation saveReservationByObject(Reservation reservation){
if(reservation != null){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public StorageObject saveStorageObject(StorageObject storageObject){
if(storageObject.getReservation() != null){
if(storageObject.getReservation()
.getReservedFrom() != null){
throw new ReservationException("User already set to STO!");
throw new ReservationException(("Storageobject is reserved by '%s'.".formatted(storageObject.getStoredAtUser().getProfile().getUsername())));
}
}
}
Expand Down Expand Up @@ -738,8 +738,8 @@ public Stream<Reservation> findStorageObjectByUserId(Long id,

public void moveFromReservationToMeineHardware(Reservation reservation){
if(reservation != null){
if(reservation.getReservedFrom() == authenticatedUser.getUser()
.get()){
if(reservation.getReservedFrom().getId() == authenticatedUser.getUser()
.get().getId()){
if(reservation.getId() != null && repositoryReservation.existsById(reservation.getId())){
Reservation reservationById = repositoryReservation.findById(reservation.getId())
.get();
Expand Down

0 comments on commit 88bf0a8

Please sign in to comment.