16
16
*/
17
17
package alfio .model ;
18
18
19
+ import alfio .util .Json ;
20
+ import ch .digitalfondue .npjt .ConstructorAnnotationRowMapper .Column ;
21
+ import lombok .Getter ;
22
+
23
+ import java .util .Date ;
24
+ import java .util .List ;
25
+ import java .util .Map ;
26
+
27
+ @ Getter
19
28
public class Audit {
20
29
21
30
public enum EntityType {
@@ -25,4 +34,33 @@ public enum EntityType {
25
34
public enum EventType {
26
35
RESERVATION_CREATE , RESERVATION_COMPLETE , CANCEL_RESERVATION_EXPIRED , CANCEL_RESERVATION , UPDATE_EVENT , CANCEL_TICKET , REFUND , UPDATE_TICKET
27
36
}
37
+
38
+ private final String reservationId ;
39
+ private final EventType eventType ;
40
+ private final Date eventTime ;
41
+ private final EntityType entityType ;
42
+ private final String entityId ;
43
+ private final List <Map <String , Object >> modifications ;
44
+ private final String username ;
45
+ private final String firstName ;
46
+ private final String lastName ;
47
+ private final String email ;
48
+
49
+
50
+ public Audit (@ Column ("reservation_id" ) String reservationId , @ Column ("event_type" ) EventType eventType ,
51
+ @ Column ("event_time" ) Date eventTime , @ Column ("entity_type" ) EntityType entityType ,
52
+ @ Column ("entity_id" ) String entityId , @ Column ("modifications" ) String modifications ,
53
+ @ Column ("username" ) String username , @ Column ("first_name" ) String firstName ,
54
+ @ Column ("last_name" ) String lastName , @ Column ("email_address" ) String email ) {
55
+ this .reservationId = reservationId ;
56
+ this .eventType = eventType ;
57
+ this .eventTime = eventTime ;
58
+ this .entityType = entityType ;
59
+ this .entityId = entityId ;
60
+ this .modifications = modifications == null ? null : Json .fromJson (modifications , List .class );
61
+ this .username = username ;
62
+ this .firstName = firstName ;
63
+ this .lastName = lastName ;
64
+ this .email = email ;
65
+ }
28
66
}
0 commit comments