View Javadoc
1   /*
2    * Copyright (c) 2002-2022, City of 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.appointment;
35  
36  import java.util.List;
37  
38  import fr.paris.lutece.plugins.appointment.web.dto.AppointmentFilterDTO;
39  import fr.paris.lutece.portal.service.plugin.Plugin;
40  
41  /**
42   * Appointment DAO Interface
43   * 
44   * @author Laurent Payen
45   *
46   */
47  public interface IAppointmentDAO
48  {
49  
50      /**
51       * Insert a new record in the table
52       * 
53       * @param appointment
54       *            instance of the appointment object to insert
55       * @param plugin
56       *            the plugin
57       */
58      void insert( Appointment appointment, Plugin plugin );
59  
60      /**
61       * Update the record in the table
62       * 
63       * @param appointment
64       *            the reference of the appointment
65       * @param plugin
66       *            the plugin
67       */
68      void update( Appointment appointment, Plugin plugin );
69  
70      /**
71       * Update date appointment, update AppointmentSlot
72       * 
73       * @param appointment
74       *            the appointment
75       * @param plugin
76       *            the plugin
77       */
78      void updateAppointmentDate( Appointment appointment, Plugin plugin );
79  
80      /**
81       * Delete a record from the table
82       * 
83       * @param nIdAppointment
84       *            int identifier of the appointment to delete
85       * @param plugin
86       *            the plugin
87       */
88      void delete( int nIdAppointment, Plugin plugin );
89  
90      /**
91       * Load the data from the table
92       * 
93       * @param nIdAppointment
94       *            the identifier of the appointment
95       * @param plugin
96       *            the plugin
97       * @return the instance of the appointment
98       */
99      Appointment select( int nIdAppointment, Plugin plugin );
100 
101     /**
102      * Returns all the appointments of a user
103      * 
104      * @param nIdUser
105      *            the User Id
106      * @param plugin
107      *            the Plugin
108      * @return a list of the appointments of the user
109      */
110     List<Appointment> findByIdUser( int nIdUser, Plugin plugin );
111 
112     /**
113      * Returns all the appointments of a user by Guid
114      * 
115      * @param strGuidUser
116      *            the User Guid
117      * @param plugin
118      *            the Plugin
119      * @return a list of the appointments of the user by Guid
120      */
121     List<Appointment> findByGuidUser( String strGuidUser, Plugin plugin );
122 
123     /**
124      * Returns the appointments of a slot
125      * 
126      * @param nIdSlot
127      *            the Slot Id
128      * @param plugin
129      *            the plugin
130      * @return a list of the appointments
131      */
132     List<Appointment> findByIdSlot( int nIdSlot, Plugin plugin );
133 
134     /**
135      * Returns the list of appointments of a slot
136      * 
137      * @param listIdSlot
138      *            the list Slot Id
139      * @param plugin
140      *            the plugin
141      * @return a list of the appointments
142      */
143     List<Appointment> findByListIdSlot( List<Integer> listIdSlot, Plugin plugin );
144 
145     /**
146      * Returns the appointment with its reference
147      * 
148      * @param strReference
149      *            the appointment reference
150      * @param plugin
151      *            the plugin
152      * @return the appointment
153      */
154     Appointment findByReference( String strReference, Plugin plugin );
155 
156     /**
157      * Returns a list of all the appointment of a form
158      * 
159      * @param nIdForm
160      *            the form id
161      * @param plugin
162      *            the plugin
163      * @return a list of the appointments
164      */
165     List<Appointment> findByIdForm( int nIdForm, Plugin plugin );
166 
167     /**
168      * Returns a list of appointments matching the filter
169      * 
170      * @param appointmentFilter
171      *            the filter
172      * @param plugin
173      *            the plugin
174      * @return a list of appointments
175      */
176     List<Appointment> findByFilter( AppointmentFilterDTO appointmentFilter, Plugin plugin );
177 
178     /**
179      * Returns a list of appointments ids matching the filter
180      *
181      * @param appointmentFilter
182      *            the filter
183      * @param plugin
184      *            the plugin
185      * @return a list of appointments
186      */
187     List<Integer> findIdsByFilter( AppointmentFilterDTO appointmentFilter, Plugin plugin );
188 
189     /**
190      * Find a list of appointments by id category and mail
191      * 
192      * @param nIdCategory
193      *            the id category
194      * @param mail
195      *            the mail
196      * @param plugin
197      *            the plugin
198      * @return list of appointments
199      */
200     List<Appointment> findByCategoryAndMail( int nIdCategory, String mail, Plugin plugin );
201 
202     /**
203      * returns a list of all appointment ids.
204      * 
205      * @param plugin
206      * @return
207      */
208     List<Integer> selectAllAppointmentId( Plugin plugin );
209 }