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.grubusiness.business.customer;
35
36 import java.io.Serializable;
37 import java.util.Collection;
38 import java.util.HashMap;
39 import java.util.Map;
40
41 import javax.validation.constraints.Email;
42 import javax.validation.constraints.NotEmpty;
43 import javax.validation.constraints.Size;
44
45 import com.fasterxml.jackson.annotation.JsonIgnore;
46 import com.fasterxml.jackson.annotation.JsonProperty;
47 import com.fasterxml.jackson.annotation.JsonRootName;
48
49
50
51
52
53 @JsonRootName( value = "customer" )
54 public class Customer implements Serializable
55 {
56
57 private static final long serialVersionUID = 1L;
58
59
60 private String _strId;
61
62
63 private int _nIdTitle;
64
65
66 @NotEmpty( message = "#i18n{gru.validation.customer.Firstname.notEmpty}" )
67 @Size( max = 50, message = "#i18n{gru.validation.customer.Firstname.size}" )
68 private String _strFirstname;
69
70
71 @NotEmpty( message = "#i18n{gru.validation.customer.Lastname.notEmpty}" )
72 @Size( max = 50, message = "#i18n{gru.validation.customer.Lastname.size}" )
73 private String _strLastname;
74
75
76 @Size( max = 50, message = "#i18n{gru.validation.customer.Familyname.size}" )
77 private String _strFamilyname;
78
79
80 private boolean _bHasAccount;
81
82
83 @Size( max = 50, message = "#i18n{gru.validation.customer.AccountLogin.size}" )
84 private String _strAccountLogin;
85
86
87 @Size( max = 56, message = "#i18n{gru.validation.customer.AccountGuid.size}" )
88 private String _strConnectionId;
89
90
91 @Size( max = 50, message = "#i18n{gru.validation.customer.AccountCuid.size}" )
92 private String _strCustomerId;
93
94
95 @Email( message = "#i18n{portal.validation.message.email}" )
96 @Size( max = 255, message = "#i18n{gru.validation.customer.Email.size}" )
97 private String _strEmail;
98
99
100 private boolean _bIsEmailVerified;
101
102
103 @Size( max = 50, message = "#i18n{gru.validation.customer.FixedPhoneNumber.size}" )
104 private String _strFixedPhoneNumber;
105
106
107 @Size( max = 50, message = "#i18n{gru.validation.customer.MobilePhone.size}" )
108 private String _strMobilePhone;
109
110
111 private boolean _bIsMobilePhoneVerified;
112
113
114 @NotEmpty( message = "#i18n{gru.validation.customer.ExtrasAttributes.notEmpty}" )
115 private String _strExtrasAttributes;
116
117
118 private String _strBirthDate;
119
120 private final Map<String, String> _mapAttributes;
121
122
123
124
125 public Customer( )
126 {
127 _mapAttributes = new HashMap<>( );
128 }
129
130
131
132
133
134
135 @JsonProperty( "id" )
136 public String getId( )
137 {
138 return _strId;
139 }
140
141
142
143
144
145
146
147 @JsonProperty( "id" )
148 public void setId( String strId )
149 {
150 _strId = strId;
151 }
152
153
154
155
156
157
158 @JsonIgnore
159 public int getIdTitle( )
160 {
161 return _nIdTitle;
162 }
163
164
165
166
167
168
169
170 public void setIdTitle( int nIdTitle )
171 {
172 _nIdTitle = nIdTitle;
173 }
174
175
176
177
178
179
180 public String getFirstname( )
181 {
182 return _strFirstname;
183 }
184
185
186
187
188
189
190
191 public void setFirstname( String strFirstname )
192 {
193 _strFirstname = strFirstname;
194 }
195
196
197
198
199
200
201 public String getLastname( )
202 {
203 return _strLastname;
204 }
205
206
207
208
209
210
211
212 public void setLastname( String strLastname )
213 {
214 _strLastname = strLastname;
215 }
216
217
218
219
220
221
222 public String getFamilyname( )
223 {
224 return _strFamilyname;
225 }
226
227
228
229
230
231
232
233 public void setFamilyname( String strFamilyname )
234 {
235 _strFamilyname = strFamilyname;
236 }
237
238
239
240
241
242
243 @JsonIgnore
244 public boolean getHasAccount( )
245 {
246 return _bHasAccount;
247 }
248
249
250
251
252
253
254
255 public void setHasAccount( boolean bHasAccount )
256 {
257 _bHasAccount = bHasAccount;
258 }
259
260
261
262
263
264
265 @JsonIgnore
266 public String getAccountLogin( )
267 {
268 return _strAccountLogin;
269 }
270
271
272
273
274
275
276
277 public void setAccountLogin( String strAccountLogin )
278 {
279 _strAccountLogin = strAccountLogin;
280 }
281
282
283
284
285
286
287 @JsonProperty( "connection_id" )
288 public String getConnectionId( )
289 {
290 return _strConnectionId;
291 }
292
293
294
295
296
297
298
299 @JsonProperty( "connection_id" )
300 public void setConnectionId( String strConnectionId )
301 {
302 _strConnectionId = strConnectionId;
303 }
304
305
306
307
308
309
310 @JsonProperty( "customer_id" )
311 public String getCustomerId( )
312 {
313 return _strCustomerId;
314 }
315
316
317
318
319
320
321
322 @JsonProperty( "customer_id" )
323 public void setCustomerId( String strCustomerId )
324 {
325 _strCustomerId = strCustomerId;
326 }
327
328
329
330
331
332
333 @JsonProperty( "email" )
334 public String getEmail( )
335 {
336 return _strEmail;
337 }
338
339
340
341
342
343
344
345 @JsonProperty( "email" )
346 public void setEmail( String strEmail )
347 {
348 _strEmail = strEmail;
349 }
350
351
352
353
354
355
356 @JsonIgnore
357 public boolean getIsEmailVerified( )
358 {
359 return _bIsEmailVerified;
360 }
361
362
363
364
365
366
367
368 public void setIsEmailVerified( boolean bIsEmailVerified )
369 {
370 _bIsEmailVerified = bIsEmailVerified;
371 }
372
373
374
375
376
377
378 public String getMobilePhone( )
379 {
380 return _strMobilePhone;
381 }
382
383
384
385
386
387
388
389 public void setMobilePhone( String strMobilePhone )
390 {
391 _strMobilePhone = strMobilePhone;
392 }
393
394
395
396
397
398
399 public String getFixedPhoneNumber( )
400 {
401 return _strFixedPhoneNumber;
402 }
403
404
405
406
407
408
409
410 public void setFixedPhoneNumber( String strFixedPhoneNumber )
411 {
412 _strFixedPhoneNumber = strFixedPhoneNumber;
413 }
414
415
416
417
418
419
420 @JsonIgnore
421 public boolean getIsMobilePhoneVerified( )
422 {
423 return _bIsMobilePhoneVerified;
424 }
425
426
427
428
429
430
431
432 public void setIsMobilePhoneVerified( boolean bIsMobilePhoneVerified )
433 {
434 _bIsMobilePhoneVerified = bIsMobilePhoneVerified;
435 }
436
437
438
439
440
441
442 @JsonIgnore
443 public String getExtrasAttributes( )
444 {
445 return _strExtrasAttributes;
446 }
447
448
449
450
451
452
453
454 public void setExtrasAttributes( String strExtrasAttributes )
455 {
456 _strExtrasAttributes = strExtrasAttributes;
457 }
458
459
460
461
462
463
464 public String getBirthDate( )
465 {
466 return _strBirthDate;
467 }
468
469
470
471
472
473
474
475 public void setBirthDate( String strBirthDate )
476 {
477 _strBirthDate = strBirthDate;
478 }
479
480
481
482
483
484
485
486
487
488 public void addAttributes( String strName, String strValue )
489 {
490 _mapAttributes.put( strName, strValue );
491 }
492
493
494
495
496
497
498
499
500 public String getAttribute( String strName )
501 {
502 return _mapAttributes.get( strName );
503 }
504
505
506
507
508
509
510 public Collection<String> getAttributeNames( )
511 {
512 return _mapAttributes.keySet( );
513 }
514 }