1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package fr.paris.lutece.plugins.appointment.web.dto;
35
36 import java.time.LocalDateTime;
37 import java.time.LocalTime;
38 import java.util.ArrayList;
39 import java.util.Collection;
40 import java.util.HashMap;
41 import java.util.List;
42 import java.util.Locale;
43 import java.util.Map;
44
45 import fr.paris.lutece.plugins.appointment.business.appointment.Appointment;
46 import fr.paris.lutece.plugins.genericattributes.business.Response;
47 import fr.paris.lutece.plugins.workflowcore.business.action.Action;
48 import fr.paris.lutece.plugins.workflowcore.business.state.State;
49 import fr.paris.lutece.portal.service.i18n.I18nService;
50
51
52
53
54
55
56
57 public final class AppointmentDTO extends Appointment
58 {
59
60 private static final String PROPERTY_EMPTY_FIELD_FIRST_NAME = "appointment.validation.appointment.FirstName.notEmpty";
61 private static final String PROPERTY_EMPTY_FIELD_LAST_NAME = "appointment.validation.appointment.LastName.notEmpty";
62 private static final String PROPERTY_UNVAILABLE_EMAIL = "appointment.validation.appointment.Email.email";
63 private static final String PROPERTY_MESSAGE_EMPTY_EMAIL = "appointment.validation.appointment.Email.notEmpty";
64 private static final String PROPERTY_EMPTY_CONFIRM_EMAIL = "appointment.validation.appointment.EmailConfirmation.email";
65 private static final String PROPERTY_UNVAILABLE_CONFIRM_EMAIL = "appointment.message.error.confirmEmail";
66 private static final String PROPERTY_EMPTY_NB_SEATS = "appointment.validation.appointment.NbBookedSeat.notEmpty";
67 private static final String PROPERTY_UNVAILABLE_NB_SEATS = "appointment.validation.appointment.NbBookedSeat.error";
68 private static final String PROPERTY_MAX_APPOINTMENT_PERIODE = "appointment.message.error.MaxAppointmentPeriode";
69 private static final String PROPERTY_MAX_APPOINTMENT_PERIODE_BACK = "appointment.info.appointment.emailerror";
70 private static final String PROPERTY_NB_DAY_BETWEEN_TWO_APPOINTMENTS = "appointment.validation.appointment.NbMinDaysBetweenTwoAppointments.error";
71 public static final String PROPERTY_APPOINTMENT_STATUS_UNRESERVED = "appointment.message.labelStatusUnreserved";
72 public static final String PROPERTY_APPOINTMENT_STATUS_RESERVED = "appointment.message.labelStatusReserved";
73
74
75
76
77 private static final long serialVersionUID = 703930649594406505L;
78
79
80
81
82 private String _strDateOfTheAppointment;
83
84
85
86
87 private String _strAdminUser;
88
89
90
91
92 private LocalDateTime _startingDateTime;
93
94
95
96
97 private LocalDateTime _endingDateTime;
98
99
100
101
102 private LocalTime _startingTime;
103
104
105
106
107 private LocalTime _endingTime;
108
109
110
111
112 private transient State _state;
113
114
115
116
117 private int _nIdForm;
118
119
120
121
122 private int _nNbBookedSeats = 1;
123
124
125
126
127 private int _nNbMaxPotentialBookedSeats;
128
129
130
131
132 private Map<Integer, List<Response>> _mapResponsesByIdEntry = new HashMap<>( );
133
134
135
136
137 private List<Response> _listResponse;
138
139
140
141
142 private transient Collection<Action> _listWorkflowActions;
143
144
145
146 private boolean _bIsSaved;
147
148
149
150 private boolean _bOverbookingAllowed;
151
152
153
154
155 private String _strEmailConfirm;
156
157
158
159
160
161
162 public String getAdminUser( )
163 {
164 return _strAdminUser;
165 }
166
167
168
169
170
171
172
173 public void setAdminUser( String strAdminUser )
174 {
175 this._strAdminUser = strAdminUser;
176 }
177
178
179
180
181
182
183 public State getState( )
184 {
185 return _state;
186 }
187
188
189
190
191
192
193
194 public void setState( State state )
195 {
196 this._state = state;
197 }
198
199
200
201
202
203
204 public LocalDateTime getStartingDateTime( )
205 {
206 return _startingDateTime;
207 }
208
209
210
211
212
213
214
215 public void setStartingDateTime( LocalDateTime startingDateTime )
216 {
217 this._startingDateTime = startingDateTime;
218 }
219
220
221
222
223
224
225 public LocalDateTime getEndingDateTime( )
226 {
227 return _endingDateTime;
228 }
229
230
231
232
233
234
235
236 public void setEndingDateTime( LocalDateTime endingDateTime )
237 {
238 this._endingDateTime = endingDateTime;
239 }
240
241
242
243
244
245
246 public LocalTime getStartingTime( )
247 {
248 return _startingTime;
249 }
250
251
252
253
254
255
256
257 public void setStartingTime( LocalTime startingTime )
258 {
259 this._startingTime = startingTime;
260 }
261
262
263
264
265
266
267 public LocalTime getEndingTime( )
268 {
269 return _endingTime;
270 }
271
272
273
274
275
276
277
278 public void setEndingTime( LocalTime endingTime )
279 {
280 this._endingTime = endingTime;
281 }
282
283
284
285
286
287
288 public String getDateOfTheAppointment( )
289 {
290 return _strDateOfTheAppointment;
291 }
292
293
294
295
296
297
298
299 public void setDateOfTheAppointment( String strDateOfTheAppointment )
300 {
301 this._strDateOfTheAppointment = strDateOfTheAppointment;
302 }
303
304
305
306
307
308
309 public List<Response> getListResponse( )
310 {
311 return _listResponse;
312 }
313
314
315
316
317
318
319
320 public void setListResponse( List<Response> listResponse )
321 {
322 this._listResponse = listResponse;
323 }
324
325
326
327
328
329
330 public int getIdForm( )
331 {
332 return _nIdForm;
333 }
334
335
336
337
338
339
340
341 public void setIdForm( int nIdForm )
342 {
343 this._nIdForm = nIdForm;
344 }
345
346
347
348
349
350
351 public int getNbBookedSeats( )
352 {
353 return _nNbBookedSeats;
354 }
355
356
357
358
359
360
361
362 public void setNbBookedSeats( int nNumberOfPlacesReserved )
363 {
364 this._nNbBookedSeats = nNumberOfPlacesReserved;
365 }
366
367
368
369
370
371
372 public int getNbMaxPotentialBookedSeats( )
373 {
374 return _nNbMaxPotentialBookedSeats;
375 }
376
377
378
379
380
381
382
383 public void setNbMaxPotentialBookedSeats( int nNbMaxPotentialBookedSeats )
384 {
385 this._nNbMaxPotentialBookedSeats = nNbMaxPotentialBookedSeats;
386 }
387
388
389
390
391
392
393 public Collection<Action> getListWorkflowActions( )
394 {
395 return _listWorkflowActions;
396 }
397
398
399
400
401
402
403 public void setListWorkflowActions( Collection<Action> listWorkflowActions )
404 {
405 this._listWorkflowActions = listWorkflowActions;
406 }
407
408
409
410
411
412
413 public Map<Integer, List<Response>> getMapResponsesByIdEntry( )
414 {
415 return _mapResponsesByIdEntry;
416 }
417
418
419
420
421
422
423
424 public void setMapResponsesByIdEntry( Map<Integer, List<Response>> mapResponsesByIdEntry )
425 {
426 this._mapResponsesByIdEntry = mapResponsesByIdEntry;
427 }
428
429 public void clearMapResponsesByIdEntry( )
430 {
431 this._mapResponsesByIdEntry.clear( );
432 }
433
434
435
436
437
438
439 public boolean getIsSaved( )
440 {
441 return _bIsSaved;
442 }
443
444
445
446
447
448
449
450 public void setIsSaved( boolean bIsSaved )
451 {
452 _bIsSaved = bIsSaved;
453 }
454
455
456
457
458
459
460 public boolean getOverbookingAllowed( )
461 {
462 return _bOverbookingAllowed;
463 }
464
465
466
467
468
469
470
471 public void setOverbookingAllowed( boolean bOverbookingAllowed )
472 {
473 _bOverbookingAllowed = bOverbookingAllowed;
474 }
475
476
477
478
479
480
481 public String getEmailConfirm() {
482 return _strEmailConfirm;
483 }
484
485
486
487
488
489
490
491 public void setConfirmEmail(String strEmailConfirm) {
492 this._strEmailConfirm = strEmailConfirm;
493 }
494
495
496
497
498
499
500
501
502 public static List<String> getAllErrors( Locale locale )
503 {
504 List<String> listAllErrors = new ArrayList<>( );
505 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_EMPTY_FIELD_LAST_NAME, locale ) );
506 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_EMPTY_FIELD_FIRST_NAME, locale ) );
507 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_UNVAILABLE_EMAIL, locale ) );
508 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_MESSAGE_EMPTY_EMAIL, locale ) );
509 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_EMPTY_CONFIRM_EMAIL, locale ) );
510 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_UNVAILABLE_CONFIRM_EMAIL, locale ) );
511 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_EMPTY_NB_SEATS, locale ) );
512 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_UNVAILABLE_NB_SEATS, locale ) );
513 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_MAX_APPOINTMENT_PERIODE, locale ) );
514 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_MAX_APPOINTMENT_PERIODE_BACK, locale ) );
515 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_NB_DAY_BETWEEN_TWO_APPOINTMENTS, locale ) );
516 return listAllErrors;
517 }
518
519 }