Subversion Repositories SmartDukaan

Rev

Rev 31860 | Rev 33665 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
29515 tejbeer 1
package com.spice.profitmandi.dao.entity.dtr;
2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
 
6
import javax.persistence.Column;
7
import javax.persistence.Entity;
8
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
14
import javax.persistence.Transient;
15
 
16
import com.spice.profitmandi.dao.enumuration.inventory.ScratchedGift;
17
 
18
@Entity
31860 tejbeer 19
@Table(name = "dtr.scratch_offer")
29515 tejbeer 20
public class ScratchOffer implements Serializable {
21
 
22
	/**
23
	 * 
24
	 */
25
	private static final long serialVersionUID = 1L;
26
 
27
	@Id
28
	@Column(name = "id", unique = true, updatable = false)
29
	@GeneratedValue(strategy = GenerationType.IDENTITY)
30
	private int id;
31
 
32
	@Column(name = "invoice_number")
33
	private String invoiceNumber;
34
 
35
	@Column(name = "customer_id")
36
	private int customerId;
37
 
38
	@Column(name = "offer_name")
39
	@Enumerated(EnumType.STRING)
40
	private ScratchedGift offerName;
41
 
42
	@Column(name = "scratched")
43
	private boolean scratched;
44
 
45
	@Column(name = "created_timestamp")
46
	private LocalDateTime createdTimestamp;
47
 
48
	@Column(name = "unlocked_at")
49
	private LocalDateTime unlockedAt;
50
 
51
	@Column(name = "scracthed_at")
52
	private LocalDateTime scracthedAt;
53
 
54
	public LocalDateTime getScracthedAt() {
55
		return scracthedAt;
56
	}
57
 
58
	public void setScracthedAt(LocalDateTime scracthedAt) {
59
		this.scracthedAt = scracthedAt;
60
	}
61
 
62
	@Transient
63
	private boolean unlocked;
64
 
65
	@Transient
66
	private LocalDateTime expiredTimestamp;
67
 
32671 ranu 68
	@Transient
69
	private boolean expired;
70
 
71
	public boolean isExpired() {
72
		return expired;
73
	}
74
 
75
	public void setExpired(boolean expired) {
76
		this.expired = expired;
77
	}
78
 
29515 tejbeer 79
	public LocalDateTime getExpiredTimestamp() {
80
		return expiredTimestamp;
81
	}
82
 
83
	public void setExpiredTimestamp(LocalDateTime expiredTimestamp) {
84
		this.expiredTimestamp = expiredTimestamp;
85
	}
86
 
87
	public boolean isUnlocked() {
88
		return unlocked;
89
	}
90
 
91
	public void setUnlocked(boolean unlocked) {
92
		this.unlocked = unlocked;
93
	}
94
 
95
	public LocalDateTime getUnlockedAt() {
96
		return unlockedAt;
97
	}
98
 
99
	public void setUnlockedAt(LocalDateTime unlockedAt) {
100
		this.unlockedAt = unlockedAt;
101
	}
102
 
103
	public int getId() {
104
		return id;
105
	}
106
 
107
	public void setId(int id) {
108
		this.id = id;
109
	}
110
 
111
	public int getCustomerId() {
112
		return customerId;
113
	}
114
 
115
	public void setCustomerId(int customerId) {
116
		this.customerId = customerId;
117
	}
118
 
119
	public String getInvoiceNumber() {
120
		return invoiceNumber;
121
	}
122
 
123
	public void setInvoiceNumber(String invoiceNumber) {
124
		this.invoiceNumber = invoiceNumber;
125
	}
126
 
127
	public ScratchedGift getOfferName() {
128
		return offerName;
129
	}
130
 
131
	public void setOfferName(ScratchedGift offerName) {
132
		this.offerName = offerName;
133
	}
134
 
135
	public boolean isScratched() {
136
		return scratched;
137
	}
138
 
139
	public void setScratched(boolean scratched) {
140
		this.scratched = scratched;
141
	}
142
 
143
	public LocalDateTime getCreatedTimestamp() {
144
		return createdTimestamp;
145
	}
146
 
147
	public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
148
		this.createdTimestamp = createdTimestamp;
149
	}
150
 
151
	@Override
152
	public int hashCode() {
153
		final int prime = 31;
154
		int result = 1;
155
		result = prime * result + ((createdTimestamp == null) ? 0 : createdTimestamp.hashCode());
156
		result = prime * result + customerId;
157
		result = prime * result + ((expiredTimestamp == null) ? 0 : expiredTimestamp.hashCode());
158
		result = prime * result + id;
159
		result = prime * result + ((invoiceNumber == null) ? 0 : invoiceNumber.hashCode());
160
		result = prime * result + ((offerName == null) ? 0 : offerName.hashCode());
161
		result = prime * result + ((scracthedAt == null) ? 0 : scracthedAt.hashCode());
162
		result = prime * result + (scratched ? 1231 : 1237);
163
		result = prime * result + (unlocked ? 1231 : 1237);
164
		result = prime * result + ((unlockedAt == null) ? 0 : unlockedAt.hashCode());
165
		return result;
166
	}
167
 
168
	@Override
169
	public boolean equals(Object obj) {
170
		if (this == obj)
171
			return true;
172
		if (obj == null)
173
			return false;
174
		if (getClass() != obj.getClass())
175
			return false;
176
		ScratchOffer other = (ScratchOffer) obj;
177
		if (createdTimestamp == null) {
178
			if (other.createdTimestamp != null)
179
				return false;
180
		} else if (!createdTimestamp.equals(other.createdTimestamp))
181
			return false;
182
		if (customerId != other.customerId)
183
			return false;
184
		if (expiredTimestamp == null) {
185
			if (other.expiredTimestamp != null)
186
				return false;
187
		} else if (!expiredTimestamp.equals(other.expiredTimestamp))
188
			return false;
189
		if (id != other.id)
190
			return false;
191
		if (invoiceNumber == null) {
192
			if (other.invoiceNumber != null)
193
				return false;
194
		} else if (!invoiceNumber.equals(other.invoiceNumber))
195
			return false;
196
		if (offerName != other.offerName)
197
			return false;
198
		if (scracthedAt == null) {
199
			if (other.scracthedAt != null)
200
				return false;
201
		} else if (!scracthedAt.equals(other.scracthedAt))
202
			return false;
203
		if (scratched != other.scratched)
204
			return false;
205
		if (unlocked != other.unlocked)
206
			return false;
207
		if (unlockedAt == null) {
208
			if (other.unlockedAt != null)
209
				return false;
210
		} else if (!unlockedAt.equals(other.unlockedAt))
211
			return false;
212
		return true;
213
	}
214
 
215
	@Override
216
	public String toString() {
217
		return "ScratchOffer [id=" + id + ", invoiceNumber=" + invoiceNumber + ", customerId=" + customerId
218
				+ ", offerName=" + offerName + ", scratched=" + scratched + ", createdTimestamp=" + createdTimestamp
219
				+ ", unlockedAt=" + unlockedAt + ", scracthedAt=" + scracthedAt + ", unlocked=" + unlocked
220
				+ ", expiredTimestamp=" + expiredTimestamp + "]";
221
	}
222
 
223
}