public final class WeekDefinitionService extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
assignWeekDefinition(int nIdForm,
WeekDefinition newWeek)
Assign a week to the calendar
|
static WeekDefinition |
createWeekDefinition(int nIdReservationRule,
LocalDate dateOfApply,
LocalDate endingDateOfApply)
Create a week definition in database
|
static void |
fillInWeekDefinition(WeekDefinition weekDefinition,
int nIdReservationRule,
LocalDate dateOfApply,
LocalDate endingDateOfApply)
Fill the week definition object with the given parameters
|
static fr.paris.lutece.util.ReferenceList |
findAllDateOfWeekDefinition(int nIdForm)
Build a reference list of all the week definitions of a form
|
static HashMap<LocalDate,WeekDefinition> |
findAllWeekDefinition(int nIdForm)
Find all the week definition of a form
|
static List<WeekDefinition> |
findByReservationRule(int nIdReservationRule)
Get the week definitions of a form for reservation rule
|
static List<WeekDefinition> |
findListWeekDefinition(int nIdForm)
Fin all the week definition of a form
|
static WeekDefinition |
findNextWeekDefinition(int nIdForm,
LocalDate previousDateOfApply)
Return, if it exists, the next week definition after a given date
|
static List<WeekDefinition> |
findWeekDefinitionByDateOfApply(int nIdForm,
LocalDate startingDate,
LocalDate endingDate)
Find a week definition of a form by date of apply
|
static WeekDefinition |
findWeekDefinitionById(int nIdWeekDefinition)
Find a week definition by its primary key and set its working days
|
static WeekDefinition |
findWeekDefinitionByIdFormAndClosestToDateOfApply(int nIdForm,
LocalDate dateOfApply)
Find a week definition of a form and a date of apply
|
static WeekDefinition |
findWeekDefinitionByIdFormAndDateOfApply(int nIdForm,
LocalDate dateOfApply)
Find the weekdefinition of a form on a specific date
|
static WeekDefinition |
findWeekDefinitionLightById(int nIdWeekDefinition)
Find a week definition with its primary key
|
static LocalTime |
getMaxEndingTimeOfAListOfWeekDefinition(List<ReservationRule> listReservationRules)
Return the max ending time of a list of week definitions
|
static LocalTime |
getMaxEndingTimeOfAWeekDefinition(ReservationRule reservationRule)
Get the max ending time of a week definition
|
static int |
getMinDurationTimeSlotOfAListOfWeekDefinition(List<ReservationRule> listReservationRules)
Get the min duration of a time slot of a list of week definition
|
static int |
getMinDurationTimeSlotOfAWeekDefinition(ReservationRule reservationRule)
Get the min duration of a time slot of a week definition
|
static LocalTime |
getMinStartingTimeOfAListOfWeekDefinition(List<ReservationRule> listReservationRules)
Return the min starting time of a list of week definitions
|
static LocalTime |
getMinStartingTimeOfAWeekDefinition(ReservationRule reservationRule)
Return the min starting time of a week definition
|
static Set<Integer> |
getOpenDaysOfWeek(List<ReservationRule> listReservationRules)
Get the set of the open days of all the week definitons
|
static Set<String> |
getSetDaysOfWeekOfAListOfWeekDefinitionForFullCalendar(List<ReservationRule> listReservationRules)
Get the working days integer enum values of a list of week definitions
|
static void |
removeWeekDefinition(WeekDefinition weekDefinition)
Remove the weekdefinition (and by cascade the working days and the time slots)
|
static WeekDefinition |
saveWeekDefinition(WeekDefinition weekDefinition)
Save a week definition
|
public static WeekDefinition createWeekDefinition(int nIdReservationRule, LocalDate dateOfApply, LocalDate endingDateOfApply)
nIdReservationRule - the nIdReservationRuledateOfApply - the date of the week definitionpublic static void removeWeekDefinition(WeekDefinition weekDefinition)
nIdWeekDefinition - the id of the week definition to deletepublic static WeekDefinition saveWeekDefinition(WeekDefinition weekDefinition)
weekDefinition - the week definition to savepublic static void fillInWeekDefinition(WeekDefinition weekDefinition, int nIdReservationRule, LocalDate dateOfApply, LocalDate endingDateOfApply)
weekDefinition - the week definition to fill innIdForm - the form iddateOfApply - the date of the week definitionpublic static List<WeekDefinition> findListWeekDefinition(int nIdForm)
nIdForm - the form Idpublic static List<WeekDefinition> findWeekDefinitionByDateOfApply(int nIdForm, LocalDate startingDate, LocalDate endingDate)
nIdForm - the id formstartingDate - the starting dateendingDate - the ending datepublic static WeekDefinition findWeekDefinitionByIdFormAndClosestToDateOfApply(int nIdForm, LocalDate dateOfApply)
nIdForm - the form IddateOfApply - the date of apply of the week definitionpublic static WeekDefinition findWeekDefinitionByIdFormAndDateOfApply(int nIdForm, LocalDate dateOfApply)
nIdForm - the form IddateOfApply - the date of the weekdefinitionpublic static WeekDefinition findNextWeekDefinition(int nIdForm, LocalDate previousDateOfApply)
nIdForm - the form idpreviousDateOfApply - the previous date of the previous week definitionpublic static WeekDefinition findWeekDefinitionLightById(int nIdWeekDefinition)
nIdWeekDefinition - the week definition idpublic static WeekDefinition findWeekDefinitionById(int nIdWeekDefinition)
nIdWeekDefinition - the week definition idpublic static fr.paris.lutece.util.ReferenceList findAllDateOfWeekDefinition(int nIdForm)
nIdForm - the form Idpublic static HashMap<LocalDate,WeekDefinition> findAllWeekDefinition(int nIdForm)
nIdForm - the form idpublic static LocalTime getMinStartingTimeOfAListOfWeekDefinition(List<ReservationRule> listReservationRules)
listWeekDefinition - the list of week definitionspublic static LocalTime getMinStartingTimeOfAWeekDefinition(ReservationRule reservationRule)
weekDefinition - the week definitionpublic static LocalTime getMaxEndingTimeOfAListOfWeekDefinition(List<ReservationRule> listReservationRules)
listWeekDefinition - the list of week definitionspublic static LocalTime getMaxEndingTimeOfAWeekDefinition(ReservationRule reservationRule)
weekDefinition - the week definitionpublic static int getMinDurationTimeSlotOfAListOfWeekDefinition(List<ReservationRule> listReservationRules)
listWeekDefinition - the list of the week definitionspublic static int getMinDurationTimeSlotOfAWeekDefinition(ReservationRule reservationRule)
weekDefinition - the week definitionpublic static Set<String> getSetDaysOfWeekOfAListOfWeekDefinitionForFullCalendar(List<ReservationRule> listReservationRules)
listWeekDefinition - the list of week definitionspublic static Set<Integer> getOpenDaysOfWeek(List<ReservationRule> listReservationRules)
listWeekDefinition - the list of week definitionspublic static List<WeekDefinition> findByReservationRule(int nIdReservationRule)
nIdReservationRule - public static void assignWeekDefinition(int nIdForm,
WeekDefinition newWeek)
nIdForm - the id fromnewWeek - the week to assignCopyright © 2021 City of Paris. All rights reserved.