Class ReservationRuleService
- java.lang.Object
-
- fr.paris.lutece.plugins.appointment.service.ReservationRuleService
-
public final class ReservationRuleService extends java.lang.ObjectService class for the reservation rule- Author:
- Laurent Payen
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcopyReservationRule(int nIdReservationRule)Make a copy of typical week, with all its valuesstatic ReservationRulecreateReservationRule(AppointmentFormDTO appointmentForm, int nIdForm)Create in database a reservation rule object from an appointmentForm DTOstatic intcreateTypicalWeek(AppointmentFormDTO appointmentForm)Create in database a reservation rule object from an appointmentForm DTOstatic voidfillInReservationRule(ReservationRule reservationRule, AppointmentFormDTO appointmentForm, int nIdForm)Fill the reservation rule object with the corresponding values of an appointmentForm DTOstatic fr.paris.lutece.util.ReferenceListfindAllReservationRule(int nIdForm)Build a reference list of all reservation rules of a formstatic java.util.Map<WeekDefinition,ReservationRule>findAllReservationRule(int nIdForm, java.util.Collection<WeekDefinition> listWeekDefinition)Find all the reservation rule of a formstatic java.util.List<ReservationRule>findListReservationRule(int nIdForm)Returns a list of the reservation rules of a formstatic java.util.List<ReservationRule>findListReservationRule(int nIdForm, java.util.Collection<WeekDefinition> listWeekDefinition)Returns a list of the reservation rules of a formstatic ReservationRulefindReservationRuleById(int nIdReservationRule)Find a reservation rule with its primary keystatic ReservationRulefindReservationRuleByIdFormAndClosestToDateOfApply(int nIdForm, java.time.LocalDate dateOfApply)Find in database a reservation rule of a form closest to a datestatic ReservationRulefindReservationRuleByIdFormAndDateOfApply(int nIdForm, java.time.LocalDate dateOfApply)Find the reservation rule of a form on a specific datestatic voidremoveReservationRule(int nIdReservationRule)Delete a reservation rule by its idstatic voidsaveReservationRule(ReservationRule reservationRule)save a reservation rulestatic voidupdateAdvancedParameters(AppointmentFormDTO appointmentForm)Update a form with the new values of an appointmentForm DTO Advanced Parameters (with a date of application) --> new Typical Weekstatic ReservationRuleupdateReservationRule(AppointmentFormDTO appointmentForm, int nIdForm)Update in database a reservation rule with the values of an appointmentForm DTO
-
-
-
Method Detail
-
createReservationRule
public static ReservationRule createReservationRule(AppointmentFormDTO appointmentForm, int nIdForm)
Create in database a reservation rule object from an appointmentForm DTO- Parameters:
appointmentForm- the appointmentForm DTOnIdForm- the form IddateOfApply- the date of the reservation rule- Returns:
- the Reservation Rule object created
-
createTypicalWeek
public static int createTypicalWeek(AppointmentFormDTO appointmentForm)
Create in database a reservation rule object from an appointmentForm DTO- Parameters:
appointmentForm- the appointmentForm DTO- Returns:
- the Reservation Rule id
-
copyReservationRule
public static int copyReservationRule(int nIdReservationRule)
Make a copy of typical week, with all its values- Parameters:
nIdReservationRule- the reservationRule Id to copy- Returns:
- the id of the reservation rule created
-
updateAdvancedParameters
public static void updateAdvancedParameters(AppointmentFormDTO appointmentForm)
Update a form with the new values of an appointmentForm DTO Advanced Parameters (with a date of application) --> new Typical Week- Parameters:
appointmentForm- the appointmentForm DTO
-
removeReservationRule
public static void removeReservationRule(int nIdReservationRule)
Delete a reservation rule by its id- Parameters:
reservationRule- the reservation rule to delete
-
saveReservationRule
public static void saveReservationRule(ReservationRule reservationRule)
save a reservation rule- Parameters:
reservationRule- the reservation rule to save
-
updateReservationRule
public static ReservationRule updateReservationRule(AppointmentFormDTO appointmentForm, int nIdForm)
Update in database a reservation rule with the values of an appointmentForm DTO- Parameters:
appointmentForm- the appointmentForm DTOnIdForm- the form Id- Returns:
- the reservation rule object updated
-
fillInReservationRule
public static void fillInReservationRule(ReservationRule reservationRule, AppointmentFormDTO appointmentForm, int nIdForm)
Fill the reservation rule object with the corresponding values of an appointmentForm DTO- Parameters:
reservationRule- the reservation rule object to fill inappointmentForm- the appointmentForm DTOnIdForm- the form Id
-
findReservationRuleByIdFormAndClosestToDateOfApply
public static ReservationRule findReservationRuleByIdFormAndClosestToDateOfApply(int nIdForm, java.time.LocalDate dateOfApply)
Find in database a reservation rule of a form closest to a date- Parameters:
nIdForm- the form IddateOfApply- the date- Returns:
- the reservation rule to apply at this date
-
findReservationRuleByIdFormAndDateOfApply
public static ReservationRule findReservationRuleByIdFormAndDateOfApply(int nIdForm, java.time.LocalDate dateOfApply)
Find the reservation rule of a form on a specific date- Parameters:
nIdForm- the form IddateOfApply- the date of the reservation rule- Returns:
- the reservation rule object
-
findReservationRuleById
public static ReservationRule findReservationRuleById(int nIdReservationRule)
Find a reservation rule with its primary key- Parameters:
nIdReservationRule- the reservation rule Id- Returns:
- the Reservation Rule Object
-
findAllReservationRule
public static fr.paris.lutece.util.ReferenceList findAllReservationRule(int nIdForm)
Build a reference list of all reservation rules of a form- Parameters:
nIdForm- the form Id- Returns:
- the reference list (id reservation rule / date of apply of the reservation rule)
-
findAllReservationRule
public static java.util.Map<WeekDefinition,ReservationRule> findAllReservationRule(int nIdForm, java.util.Collection<WeekDefinition> listWeekDefinition)
Find all the reservation rule of a form- Parameters:
nIdForm- the form Id- Returns:
- an HashMap with the date of apply in key and the reservation rule in value
-
findListReservationRule
public static java.util.List<ReservationRule> findListReservationRule(int nIdForm)
Returns a list of the reservation rules of a form- Parameters:
nIdForm- the form id- Returns:
- a list of reservation rules of the form
-
findListReservationRule
public static java.util.List<ReservationRule> findListReservationRule(int nIdForm, java.util.Collection<WeekDefinition> listWeekDefinition)
Returns a list of the reservation rules of a form- Parameters:
nIdForm- the form idlistWeekDefinition- the week definition list- Returns:
- a list of reservation rules of the form
-
-