View Javadoc
1   /*
2    * Copyright (c) 2002-2018, Mairie de Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.appointment.business.rule;
35  
36  import java.io.Serializable;
37  
38  import javax.validation.constraints.Min;
39  
40  import fr.paris.lutece.plugins.appointment.business.AbstractDateConversion;
41  
42  /**
43   * Business class of the rules of the reservation
44   * 
45   * @author Laurent Payen
46   *
47   */
48  public class ReservationRule extends AbstractDateConversion implements Serializable
49  {
50  
51      /**
52       * Serial version UID
53       */
54      private static final long serialVersionUID = -5154752950203822668L;
55  
56      /**
57       * Id of the reservation rule.
58       */
59      private int _nIdReservationRule;
60  
61      /**
62       * Maximum capacity for a slot
63       */
64      @Min( value = 1, message = "#i18n{portal.validation.message.notEmpty}" )
65      private int _nMaxCapacityPerSlot = 1;
66  
67      /**
68       * Maximum number of people authorized for an appointment
69       */
70      @Min( value = 1, message = "#i18n{portal.validation.message.notEmpty}" )
71      private int _nMaxPeoplePerAppointment = 1;
72  
73      /**
74       * The Form Id the Reservation Rule belongs to (foreign key)
75       */
76      private int _nIdForm;
77  
78      /**
79       * Get the id of the rule of the reservation
80       * 
81       * @return the id of the rule of the reservation
82       */
83      public int getIdReservationRule( )
84      {
85          return _nIdReservationRule;
86      }
87  
88      /**
89       * Set the id of the rule of the reservation
90       * 
91       * @param nIdReservationRule
92       *            the id to set
93       */
94      public void setIdReservationRule( int nIdReservationRule )
95      {
96          this._nIdReservationRule = nIdReservationRule;
97      }
98  
99      /**
100      * Get the maximum capacity for a slot
101      * 
102      * @return the maximum capacity for a slot
103      */
104     public int getMaxCapacityPerSlot( )
105     {
106         return _nMaxCapacityPerSlot;
107     }
108 
109     /**
110      * Set the maximum capacity for a slot
111      * 
112      * @param nMaxCapacityPerSlot
113      *            the maximum capacity for a slot
114      */
115     public void setMaxCapacityPerSlot( int nMaxCapacityPerSlot )
116     {
117         this._nMaxCapacityPerSlot = nMaxCapacityPerSlot;
118     }
119 
120     /**
121      * Get the maximum number of people authorized for an appointment
122      * 
123      * @return the maximum number of people authorized for an appointment
124      */
125     public int getMaxPeoplePerAppointment( )
126     {
127         return _nMaxPeoplePerAppointment;
128     }
129 
130     /**
131      * Set the maximum number of people authorized for an appointment
132      * 
133      * @param nMaxPeoplePerAppointment
134      *            the maximum of people to set
135      */
136     public void setMaxPeoplePerAppointment( int nMaxPeoplePerAppointment )
137     {
138         this._nMaxPeoplePerAppointment = nMaxPeoplePerAppointment;
139     }
140 
141     /**
142      * Get the Form Id the Reservation Rule belongs to
143      * 
144      * @return the Form Id
145      */
146     public int getIdForm( )
147     {
148         return _nIdForm;
149     }
150 
151     /**
152      * Set the Form Id the Reservation Rule belongs to
153      * 
154      * @param nIdForm
155      *            the Form Id tp set
156      */
157     public void setIdForm( int nIdForm )
158     {
159         this._nIdForm = nIdForm;
160     }
161 
162 }