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 private String _strFormattedDateAppointmentTaken;
161
162
163
164
165
166
167
168 public String getAdminUser( )
169 {
170 return _strAdminUser;
171 }
172
173
174
175
176
177
178
179 public void setAdminUser( String strAdminUser )
180 {
181 this._strAdminUser = strAdminUser;
182 }
183
184
185
186
187
188
189 public State getState( )
190 {
191 return _state;
192 }
193
194
195
196
197
198
199
200 public void setState( State state )
201 {
202 this._state = state;
203 }
204
205
206
207
208
209
210 public LocalDateTime getStartingDateTime( )
211 {
212 return _startingDateTime;
213 }
214
215
216
217
218
219
220
221 public void setStartingDateTime( LocalDateTime startingDateTime )
222 {
223 this._startingDateTime = startingDateTime;
224 }
225
226
227
228
229
230
231 public LocalDateTime getEndingDateTime( )
232 {
233 return _endingDateTime;
234 }
235
236
237
238
239
240
241
242 public void setEndingDateTime( LocalDateTime endingDateTime )
243 {
244 this._endingDateTime = endingDateTime;
245 }
246
247
248
249
250
251
252 public LocalTime getStartingTime( )
253 {
254 return _startingTime;
255 }
256
257
258
259
260
261
262
263 public void setStartingTime( LocalTime startingTime )
264 {
265 this._startingTime = startingTime;
266 }
267
268
269
270
271
272
273 public LocalTime getEndingTime( )
274 {
275 return _endingTime;
276 }
277
278
279
280
281
282
283
284 public void setEndingTime( LocalTime endingTime )
285 {
286 this._endingTime = endingTime;
287 }
288
289
290
291
292
293
294 public String getDateOfTheAppointment( )
295 {
296 return _strDateOfTheAppointment;
297 }
298
299
300
301
302
303
304
305 public void setDateOfTheAppointment( String strDateOfTheAppointment )
306 {
307 this._strDateOfTheAppointment = strDateOfTheAppointment;
308 }
309
310
311
312
313
314
315 public List<Response> getListResponse( )
316 {
317 return _listResponse;
318 }
319
320
321
322
323
324
325
326 public void setListResponse( List<Response> listResponse )
327 {
328 this._listResponse = listResponse;
329 }
330
331
332
333
334
335
336 public int getIdForm( )
337 {
338 return _nIdForm;
339 }
340
341
342
343
344
345
346
347 public void setIdForm( int nIdForm )
348 {
349 this._nIdForm = nIdForm;
350 }
351
352
353
354
355
356
357 public int getNbBookedSeats( )
358 {
359 return _nNbBookedSeats;
360 }
361
362
363
364
365
366
367
368 public void setNbBookedSeats( int nNumberOfPlacesReserved )
369 {
370 this._nNbBookedSeats = nNumberOfPlacesReserved;
371 }
372
373
374
375
376
377
378 public int getNbMaxPotentialBookedSeats( )
379 {
380 return _nNbMaxPotentialBookedSeats;
381 }
382
383
384
385
386
387
388
389 public void setNbMaxPotentialBookedSeats( int nNbMaxPotentialBookedSeats )
390 {
391 this._nNbMaxPotentialBookedSeats = nNbMaxPotentialBookedSeats;
392 }
393
394
395
396
397
398
399 public Collection<Action> getListWorkflowActions( )
400 {
401 return _listWorkflowActions;
402 }
403
404
405
406
407
408
409 public void setListWorkflowActions( Collection<Action> listWorkflowActions )
410 {
411 this._listWorkflowActions = listWorkflowActions;
412 }
413
414
415
416
417
418
419 public Map<Integer, List<Response>> getMapResponsesByIdEntry( )
420 {
421 return _mapResponsesByIdEntry;
422 }
423
424
425
426
427
428
429
430 public void setMapResponsesByIdEntry( Map<Integer, List<Response>> mapResponsesByIdEntry )
431 {
432 this._mapResponsesByIdEntry = mapResponsesByIdEntry;
433 }
434
435 public void clearMapResponsesByIdEntry( )
436 {
437 this._mapResponsesByIdEntry.clear( );
438 }
439
440
441
442
443
444
445 public boolean getIsSaved( )
446 {
447 return _bIsSaved;
448 }
449
450
451
452
453
454
455
456 public void setIsSaved( boolean bIsSaved )
457 {
458 _bIsSaved = bIsSaved;
459 }
460
461
462
463
464
465
466 public boolean getOverbookingAllowed( )
467 {
468 return _bOverbookingAllowed;
469 }
470
471
472
473
474
475
476
477 public void setOverbookingAllowed( boolean bOverbookingAllowed )
478 {
479 _bOverbookingAllowed = bOverbookingAllowed;
480 }
481
482
483
484
485
486
487 public String getEmailConfirm() {
488 return _strEmailConfirm;
489 }
490
491
492
493
494
495
496
497 public void setConfirmEmail(String strEmailConfirm) {
498 this._strEmailConfirm = strEmailConfirm;
499 }
500
501
502
503
504 public String getFormattedDateAppointmentTaken() {
505 return _strFormattedDateAppointmentTaken;
506 }
507
508
509
510
511
512
513 public void setFormattedDateAppointmentTaken(String strFormattedDateAppointmentTaken)
514 {
515 this._strFormattedDateAppointmentTaken = strFormattedDateAppointmentTaken;
516 }
517
518
519
520
521
522
523
524
525 public static List<String> getAllErrors( Locale locale )
526 {
527 List<String> listAllErrors = new ArrayList<>( );
528 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_EMPTY_FIELD_LAST_NAME, locale ) );
529 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_EMPTY_FIELD_FIRST_NAME, locale ) );
530 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_UNVAILABLE_EMAIL, locale ) );
531 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_MESSAGE_EMPTY_EMAIL, locale ) );
532 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_EMPTY_CONFIRM_EMAIL, locale ) );
533 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_UNVAILABLE_CONFIRM_EMAIL, locale ) );
534 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_EMPTY_NB_SEATS, locale ) );
535 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_UNVAILABLE_NB_SEATS, locale ) );
536 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_MAX_APPOINTMENT_PERIODE, locale ) );
537 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_MAX_APPOINTMENT_PERIODE_BACK, locale ) );
538 listAllErrors.add( I18nService.getLocalizedString( PROPERTY_NB_DAY_BETWEEN_TWO_APPOINTMENTS, locale ) );
539 return listAllErrors;
540 }
541
542 }