fix partey tags

This commit is contained in:
2021-10-28 13:20:22 +02:00
parent 67a66e3cb9
commit cd05e008ae
28 changed files with 336 additions and 183 deletions
@@ -79,6 +79,11 @@ public class BorrowItemManager implements UserDataProvider {
return borrowItemRepository.findById(id).orElse(null);
}
/**
* Apply slots.
*
* @param borrowItem the borrow item
*/
public void applySlots(BorrowItem borrowItem) {
if (borrowItem != null) {
switch (borrowItem.getAvailability()) {
@@ -103,11 +108,11 @@ public class BorrowItemManager implements UserDataProvider {
/**
* Gets the.
*
* @param page the page
* @param size the size
* @param sortBy the sort by
* @param page the page
* @param size the size
* @param sortBy the sort by
* @param descending the descending
* @param search the search
* @param search the search
* @return the page
*/
public Page<BorrowItem> get(int page, int size, String sortBy, boolean descending,
@@ -127,12 +132,12 @@ public class BorrowItemManager implements UserDataProvider {
/**
* Gets the for user.
*
* @param userId the user id
* @param page the page
* @param size the size
* @param sortBy the sort by
* @param userId the user id
* @param page the page
* @param size the size
* @param sortBy the sort by
* @param descending the descending
* @param search the search
* @param search the search
* @return the for user
*/
public Page<BorrowItem> getForUser(Long userId, int page, int size, String sortBy,
@@ -68,10 +68,10 @@ public class BorrowRequestManager implements UserDataProvider {
/**
* Gets the for user.
*
* @param userId the user id
* @param page the page
* @param size the size
* @param sortBy the sort by
* @param userId the user id
* @param page the page
* @param size the size
* @param sortBy the sort by
* @param descending the descending
* @return the for user
*/
@@ -82,15 +82,15 @@ public class BorrowRequestManager implements UserDataProvider {
}
/**
* Gets the for user and stauts.
* Gets the for user and status.
*
* @param userId the user id
* @param status the status
* @param page the page
* @param size the size
* @param sortBy the sort by
* @param userId the user id
* @param status the status
* @param page the page
* @param size the size
* @param sortBy the sort by
* @param descending the descending
* @return the for user and stauts
* @return the for user and status
*/
public Page<BorrowRequest> getForUserAndStatus(Long userId, BorrowRequestStatus status,
int page, int size, String sortBy, boolean descending) {
@@ -103,10 +103,10 @@ public class BorrowRequestManager implements UserDataProvider {
/**
* Gets the for owner.
*
* @param userId the user id
* @param page the page
* @param size the size
* @param sortBy the sort by
* @param userId the user id
* @param page the page
* @param size the size
* @param sortBy the sort by
* @param descending the descending
* @return the for owner
*/
@@ -119,11 +119,11 @@ public class BorrowRequestManager implements UserDataProvider {
/**
* Gets the for owner and status.
*
* @param userId the user id
* @param status the status
* @param page the page
* @param size the size
* @param sortBy the sort by
* @param userId the user id
* @param status the status
* @param page the page
* @param size the size
* @param sortBy the sort by
* @param descending the descending
* @return the for owner and status
*/
@@ -165,7 +165,7 @@ public class BorrowRequestManager implements UserDataProvider {
* Creates the code.
*
* @param borrowRequest the borrow request
* @param issuer the issuer
* @param issuer the issuer
* @return the signed JWT
* @throws JOSEException the JOSE exception
*/
@@ -222,7 +222,7 @@ public class BorrowRequestManager implements UserDataProvider {
*
* @param jwt the jwt
* @return true, if successful
* @throws JOSEException the JOSE exception
* @throws JOSEException the JOSE exception
* @throws ParseException the parse exception
*/
public boolean verify(SignedJWT jwt) throws JOSEException, ParseException {
@@ -46,11 +46,12 @@ public class BorrowItemController extends BaseController {
/**
* Gets the borrow items.
*
* @param pageParameter the page parameter
* @param sizeParameter the size parameter
* @param sortParameter the sort parameter
* @param descParameter the desc parameter
* @param pageParameter the page parameter
* @param sizeParameter the size parameter
* @param sortParameter the sort parameter
* @param descParameter the desc parameter
* @param searchParameter the search parameter
* @param ownerParameter the owner parameter
* @return the borrow items
*/
@PreAuthorize("isAuthenticated()")
@@ -95,9 +96,10 @@ public class BorrowItemController extends BaseController {
}
/**
* Delete borrow item.
* Gets the borrow item.
*
* @param id the id
* @return the borrow item
*/
@PreAuthorize("isAuthenticated()")
@GetMapping("/{id}")
@@ -70,6 +70,7 @@ public class BorrowRequestController extends BaseController {
* @param sizeParameter the size parameter
* @param sortParameter the sort parameter
* @param descParameter the desc parameter
* @param ownerParameter the owner parameter
* @return the borrow requests
*/
@PreAuthorize("isAuthenticated()")
@@ -211,7 +212,7 @@ public class BorrowRequestController extends BaseController {
/**
* Gets the code.
*
* @param id the id
* @param id the id
* @param request the request
* @return the code
*/
@@ -249,8 +250,8 @@ public class BorrowRequestController extends BaseController {
* Verfiy.
*
* @param serialized the serialized
* @param request the request
* @param response the response
* @param request the request
* @param response the response
* @return the object
*/
@PostMapping("verify")
@@ -239,6 +239,8 @@ public class BorrowItem implements UserData {
}
/**
* Gets the availability.
*
* @return the availability
*/
public BorrowItemAvailability getAvailability() {
@@ -246,13 +248,17 @@ public class BorrowItem implements UserData {
}
/**
* @param availability the availability to set
* Sets the availability.
*
* @param availability the new availability
*/
public void setAvailability(BorrowItemAvailability availability) {
this.availability = availability;
}
/**
* Gets the slots.
*
* @return the slots
*/
public List<? extends BorrowItemSlot> getSlots() {
@@ -260,7 +266,9 @@ public class BorrowItem implements UserData {
}
/**
* @param slots the slots to set
* Sets the slots.
*
* @param slots the new slots
*/
public void setSlots(List<? extends BorrowItemSlot> slots) {
this.slots = slots;
@@ -22,6 +22,8 @@ public class BorrowItemManualSlot extends BorrowItemSlot {
private Instant end;
/**
* Gets the start.
*
* @return the start
*/
public Instant getStart() {
@@ -29,13 +31,17 @@ public class BorrowItemManualSlot extends BorrowItemSlot {
}
/**
* @param start the start to set
* Sets the start.
*
* @param start the new start
*/
public void setStart(Instant start) {
this.start = start;
}
/**
* Gets the end.
*
* @return the end
*/
public Instant getEnd() {
@@ -43,7 +49,9 @@ public class BorrowItemManualSlot extends BorrowItemSlot {
}
/**
* @param end the end to set
* Sets the end.
*
* @param end the new end
*/
public void setEnd(Instant end) {
this.end = end;
@@ -31,56 +31,72 @@ public class BorrowItemPeriodSlot extends BorrowItemSlot {
private LocalTime endTime;
/**
* @return the startDay
* Gets the start day.
*
* @return the start day
*/
public DayOfWeek getStartDay() {
return startDay;
}
/**
* @param startDay the startDay to set
* Sets the start day.
*
* @param startDay the new start day
*/
public void setStartDay(DayOfWeek startDay) {
this.startDay = startDay;
}
/**
* @return the startTime
* Gets the start time.
*
* @return the start time
*/
public LocalTime getStartTime() {
return startTime;
}
/**
* @param startTime the startTime to set
* Sets the start time.
*
* @param startTime the new start time
*/
public void setStartTime(LocalTime startTime) {
this.startTime = startTime;
}
/**
* @return the endDay
* Gets the end day.
*
* @return the end day
*/
public DayOfWeek getEndDay() {
return endDay;
}
/**
* @param endDay the endDay to set
* Sets the end day.
*
* @param endDay the new end day
*/
public void setEndDay(DayOfWeek endDay) {
this.endDay = endDay;
}
/**
* @return the endTime
* Gets the end time.
*
* @return the end time
*/
public LocalTime getEndTime() {
return endTime;
}
/**
* @param endTime the endTime to set
* Sets the end time.
*
* @param endTime the new end time
*/
public void setEndTime(LocalTime endTime) {
this.endTime = endTime;
@@ -36,6 +36,8 @@ public abstract class BorrowItemSlot {
private Long item;
/**
* Gets the id.
*
* @return the id
*/
public Long getId() {
@@ -43,13 +45,17 @@ public abstract class BorrowItemSlot {
}
/**
* @param id the id to set
* Sets the id.
*
* @param id the new id
*/
public void setId(Long id) {
this.id = id;
}
/**
* Gets the item.
*
* @return the item
*/
public Long getItem() {
@@ -57,7 +63,9 @@ public abstract class BorrowItemSlot {
}
/**
* @param item the item to set
* Sets the item.
*
* @param item the new item
*/
public void setItem(Long item) {
this.item = item;
@@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository;
import de.bstly.we.borrow.model.BorrowItemManualSlot;
/**
* The Interface BorrowItemRepository.
* The Interface BorrowItemManualSlotRepository.
*/
@Repository
public interface BorrowItemManualSlotRepository extends JpaRepository<BorrowItemManualSlot, Long>,
@@ -10,7 +10,7 @@ import org.springframework.stereotype.Repository;
import de.bstly.we.borrow.model.BorrowItemPeriodSlot;
/**
* The Interface BorrowItemRepository.
* The Interface BorrowItemPeriodSlotRepository.
*/
@Repository
public interface BorrowItemPeriodSlotRepository extends JpaRepository<BorrowItemPeriodSlot, Long>,
@@ -10,7 +10,7 @@ import org.springframework.data.repository.NoRepositoryBean;
import de.bstly.we.borrow.model.BorrowItemSlot;
/**
* The Interface BorrowItemRepository.
* The Interface BorrowItemSlotRepository.
*/
@NoRepositoryBean
public interface BorrowItemSlotRepository
@@ -24,9 +24,8 @@ public interface BorrowRequestRepository
/**
* Find all by owner.
*
* @param owner the owner
* @param pageable the pageable
* @return the page
* @param owner the owner
* @return the iterable
*/
@Query("SELECT request FROM BorrowRequest request INNER JOIN BorrowItem item ON request.item = item.id WHERE item.owner = :owner")
Iterable<BorrowRequest> findAllByOwner(@Param("owner") Long owner);
@@ -34,7 +33,7 @@ public interface BorrowRequestRepository
/**
* Find all by owner.
*
* @param owner the owner
* @param owner the owner
* @param pageable the pageable
* @return the page
*/
@@ -44,8 +43,8 @@ public interface BorrowRequestRepository
/**
* Find all by owner and status.
*
* @param owner the owner
* @param status the status
* @param owner the owner
* @param status the status
* @param pageable the pageable
* @return the page
*/