-
-
Notifications
You must be signed in to change notification settings - Fork 356
/
Copy pathLinkedGroup.java
78 lines (71 loc) · 2.35 KB
/
LinkedGroup.java
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/**
* This file is part of alf.io.
*
* alf.io is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* alf.io is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with alf.io. If not, see <http://www.gnu.org/licenses/>.
*/
package alfio.model.group;
import ch.digitalfondue.npjt.ConstructorAnnotationRowMapper.Column;
import lombok.Getter;
@Getter
public class LinkedGroup {
/**
* Link type
*/
public enum Type {
/**
* Allow exactly one ticket per group member
*/
ONCE_PER_VALUE,
/**
* Allow a limited quantity ( 1 < n < ∞)
*/
LIMITED_QUANTITY,
/**
* No limit
*/
UNLIMITED
}
public enum MatchType {
/**
* The given email address *must* match the group member's email address exactly
*/
FULL,
/**
* Try to find a FULL match; if not successful, try to match email domain (everything after '@')
*/
EMAIL_DOMAIN
}
private final int id;
private final int groupId;
private final Integer eventId;
private final Integer ticketCategoryId;
private final Type type;
private final MatchType matchType;
private final Integer maxAllocation;
public LinkedGroup(@Column("id") int id,
@Column("a_group_id_fk") int groupId,
@Column("event_id_fk") Integer eventId,
@Column("ticket_category_id_fk") Integer ticketCategoryId,
@Column("type") Type type,
@Column("match_type") MatchType matchType,
@Column("max_allocation") Integer maxAllocation) {
this.id = id;
this.groupId = groupId;
this.eventId = eventId;
this.ticketCategoryId = ticketCategoryId;
this.type = type;
this.matchType = matchType;
this.maxAllocation = maxAllocation;
}
}