public final class TimeSlotService extends Object
Modifier and Type | Method and Description |
---|---|
static void |
createListTimeSlot(List<TimeSlot> listTimeSlotToCreate)
Create in database the slots given
|
static TimeSlot |
createTimeSlot(TimeSlot timeSlot)
Create a time slot in db
|
static void |
deleteListTimeSlot(List<TimeSlot> listTimeSlot)
Delete in database time slots
|
static void |
deleteTimeSlot(TimeSlot timeSlot)
Delete in database time slot
|
static List<TimeSlot> |
findListTimeSlotAfterThisTimeSlot(TimeSlot timeSlot)
Find the next time slots of a given time slot
|
static List<TimeSlot> |
findListTimeSlotByWorkingDay(int nIdWorkingDay)
Find the time slots of a working day
|
static TimeSlot |
findTimeSlotById(int nIdTimeSlot)
Find a timeSlot with its primary key
|
static List<TimeSlot> |
generateListTimeSlot(int nIdWorkingDay,
LocalTime startingTime,
LocalTime endingTime,
int nDuration,
int nMaxCapacity,
boolean forceTimeSlotCreationWithMinTime)
Build a list of timeSlot Object from a starting time to an endingTime
|
static TimeSlot |
generateTimeSlot(int nIdWorkingDay,
LocalTime startingTime,
LocalTime endingTime,
boolean isOpen,
int nMaxCapacity)
Build a timeSlot with all its values
|
static List<TimeSlot> |
getListTimeSlotOfAListOfWorkingDay(List<WorkingDay> listWorkingDay,
LocalDate dateInWeek)
Get the time slots of a list of working days
|
static List<TimeSlot> |
getNextTimeSlotsInAListOfTimeSlotAfterALocalTime(List<TimeSlot> listTimeSlot,
LocalTime time)
Return an ordered and filtered list of time slots after a given time
|
static TimeSlot |
getTimeSlotInListOfTimeSlotWithStartingTime(List<TimeSlot> listTimeSlot,
LocalTime timeToSearch)
Returns the time slot in a list of time slot with the given starting time
|
static TimeSlot |
saveTimeSlot(TimeSlot timeSlot)
Save a time slot
|
static TimeSlot |
updateTimeSlot(TimeSlot timeSlot)
Update a time slot
|
static void |
updateTimeSlot(TimeSlot timeSlot,
boolean bEndingTimeHasChanged,
LocalTime previousEndingTime,
boolean bShifSlot)
Update a timeSLot in database
|
public static List<TimeSlot> generateListTimeSlot(int nIdWorkingDay, LocalTime startingTime, LocalTime endingTime, int nDuration, int nMaxCapacity, boolean forceTimeSlotCreationWithMinTime)
nIdWorkingDay
- the workingDay IdstartingTime
- the starting timeendingTime
- the ending timenDuration
- the duration of the slotnMaxCapacity
- the maximum capacity of the slotpublic static TimeSlot saveTimeSlot(TimeSlot timeSlot)
timeSlot
- the time slot to savepublic static TimeSlot createTimeSlot(TimeSlot timeSlot)
timeSlot
- the time slot to createpublic static TimeSlot generateTimeSlot(int nIdWorkingDay, LocalTime startingTime, LocalTime endingTime, boolean isOpen, int nMaxCapacity)
nIdWorkingDay
- the workingDay IdstartingTime
- the starting timeendingTime
- the ending timeisOpen
- true if the slot is opennMaxCapacity
- the maximum capacity of the slotpublic static List<TimeSlot> findListTimeSlotByWorkingDay(int nIdWorkingDay)
nIdWorkingDay
- the working day Idpublic static TimeSlot findTimeSlotById(int nIdTimeSlot)
nIdTimeSlot
- the timeSlot Idpublic static void updateTimeSlot(TimeSlot timeSlot, boolean bEndingTimeHasChanged, LocalTime previousEndingTime, boolean bShifSlot)
timeSlot
- the timeSlot to updatebEndingTimeHasChanged
- if the ending time has changed, need to regenerate and update all the next time slotspreviousEndingTime
- the previous ending time of the current time slotbShifSlot
- true if the user has decided to shift the next slotspublic static TimeSlot updateTimeSlot(TimeSlot timeSlot)
timeSlot
- the time slot to updatepublic static void createListTimeSlot(List<TimeSlot> listTimeSlotToCreate)
listSlotToCreate
- the list of slots to create in databasepublic static List<TimeSlot> findListTimeSlotAfterThisTimeSlot(TimeSlot timeSlot)
timeSlot
- the time slotpublic static void deleteListTimeSlot(List<TimeSlot> listTimeSlot)
listTimeSlot
- the list of time slots to deletepublic static void deleteTimeSlot(TimeSlot timeSlot)
timeSlot
- the time slot to deletepublic static List<TimeSlot> getListTimeSlotOfAListOfWorkingDay(List<WorkingDay> listWorkingDay, LocalDate dateInWeek)
listWorkingDay
- the list of the working daysdateInWeek
- the date in the weekpublic static List<TimeSlot> getNextTimeSlotsInAListOfTimeSlotAfterALocalTime(List<TimeSlot> listTimeSlot, LocalTime time)
listTimeSlot
- the list of time slot to sort and filtertime
- the timepublic static TimeSlot getTimeSlotInListOfTimeSlotWithStartingTime(List<TimeSlot> listTimeSlot, LocalTime timeToSearch)
listTimeSlot
- the list of time slotstimeToSearch
- the starting time to searchCopyright © 2020 City of Paris. All rights reserved.