Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
22653 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
2
 
3
import java.io.Serializable;
23339 ashik.ali 4
import java.time.LocalDateTime;
22653 ashik.ali 5
 
6
import javax.persistence.Column;
7
import javax.persistence.Entity;
27377 amit.gupta 8
import javax.persistence.EnumType;
9
import javax.persistence.Enumerated;
23968 amit.gupta 10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
22653 ashik.ali 12
import javax.persistence.Id;
13
import javax.persistence.Table;
24592 amit.gupta 14
import javax.persistence.Transient;
22653 ashik.ali 15
 
24592 amit.gupta 16
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
27377 amit.gupta 17
import com.spice.profitmandi.dao.enumuration.transaction.SchemePayoutStatus;
24592 amit.gupta 18
 
22653 ashik.ali 19
@Entity
24592 amit.gupta 20
@Table(name = "fofo.scheme_in_out", schema = "fofo")
27377 amit.gupta 21
public class SchemeInOut implements Serializable {
22
 
24592 amit.gupta 23
	public SchemeInOut(int schemeId, int inventoryItemId) {
24
		this.schemeId = schemeId;
25
		this.inventoryItemId = inventoryItemId;
26
	}
22653 ashik.ali 27
 
24592 amit.gupta 28
	public SchemeInOut() {
29
	}
27377 amit.gupta 30
 
22653 ashik.ali 31
	private static final long serialVersionUID = 1L;
24592 amit.gupta 32
 
22859 ashik.ali 33
	@Id
23968 amit.gupta 34
	@GeneratedValue(strategy = GenerationType.IDENTITY)
35
	private int id;
24592 amit.gupta 36
 
22859 ashik.ali 37
	@Column(name = "scheme_id")
38
	private int schemeId;
22653 ashik.ali 39
 
22859 ashik.ali 40
	@Column(name = "inventory_item_id")
41
	private int inventoryItemId;
24592 amit.gupta 42
 
22653 ashik.ali 43
	@Column(name = "amount")
44
	private float amount;
24592 amit.gupta 45
 
27377 amit.gupta 46
	@Column(name = "status")
47
	@Enumerated(EnumType.STRING)
48
	private SchemePayoutStatus status;
49
 
23345 ashik.ali 50
	@Column(name = "create_timestamp")
23339 ashik.ali 51
	private LocalDateTime createTimestamp = LocalDateTime.now();
24592 amit.gupta 52
 
23509 amit.gupta 53
	@Column(name = "rolled_back_timestamp")
23527 ashik.ali 54
	private LocalDateTime rolledBackTimestamp;
27377 amit.gupta 55
 
56
	@Column(name = "credit_timestamp")
57
	private LocalDateTime creditTimestamp;
58
 
27381 amit.gupta 59
	@Column(name = "description")
27377 amit.gupta 60
	private String statusDescription;
61
 
62
	public int getId() {
63
		return id;
64
	}
65
 
66
	public void setId(int id) {
67
		this.id = id;
68
	}
69
 
70
	public SchemePayoutStatus getStatus() {
71
		return status;
72
	}
73
 
74
	public void setStatus(SchemePayoutStatus status) {
75
		this.status = status;
76
	}
77
 
78
	public LocalDateTime getCreditTimestamp() {
79
		return creditTimestamp;
80
	}
81
 
82
	public void setCreditTimestamp(LocalDateTime creditTimestamp) {
83
		this.creditTimestamp = creditTimestamp;
84
	}
85
 
86
	public String getStatusDescription() {
87
		return statusDescription;
88
	}
89
 
90
	public void setStatusDescription(String statusDescription) {
91
		this.statusDescription = statusDescription;
92
	}
93
 
24592 amit.gupta 94
	@Transient
24671 amit.gupta 95
	private int reference;
27377 amit.gupta 96
 
24671 amit.gupta 97
	public int getReference() {
98
		return reference;
99
	}
100
 
101
	public void setReference(int reference) {
102
		this.reference = reference;
103
	}
104
 
105
	@Transient
24592 amit.gupta 106
	private String serialNumber;
27377 amit.gupta 107
 
24592 amit.gupta 108
	@Transient
109
	private String storeCode;
27377 amit.gupta 110
 
24592 amit.gupta 111
	@Transient
112
	private SchemeType schemeType;
23509 amit.gupta 113
 
24592 amit.gupta 114
	public String getStoreCode() {
115
		return storeCode;
116
	}
117
 
118
	public void setStoreCode(String storeCode) {
119
		this.storeCode = storeCode;
120
	}
121
 
122
	public SchemeType getSchemeType() {
123
		return schemeType;
124
	}
125
 
126
	public void setSchemeType(SchemeType schemeType) {
127
		this.schemeType = schemeType;
128
	}
129
 
130
	public String getSerialNumber() {
131
		return serialNumber;
132
	}
133
 
134
	public void setSerialNumber(String serialNumber) {
135
		this.serialNumber = serialNumber;
136
	}
137
 
22859 ashik.ali 138
	public int getSchemeId() {
139
		return schemeId;
22653 ashik.ali 140
	}
24592 amit.gupta 141
 
22859 ashik.ali 142
	public void setSchemeId(int schemeId) {
143
		this.schemeId = schemeId;
22653 ashik.ali 144
	}
24592 amit.gupta 145
 
22859 ashik.ali 146
	public int getInventoryItemId() {
147
		return inventoryItemId;
148
	}
24592 amit.gupta 149
 
22859 ashik.ali 150
	public void setInventoryItemId(int inventoryItemId) {
151
		this.inventoryItemId = inventoryItemId;
152
	}
24592 amit.gupta 153
 
22653 ashik.ali 154
	public float getAmount() {
155
		return amount;
156
	}
24592 amit.gupta 157
 
22653 ashik.ali 158
	public void setAmount(float amount) {
159
		this.amount = amount;
160
	}
24592 amit.gupta 161
 
23339 ashik.ali 162
	public LocalDateTime getCreateTimestamp() {
163
		return createTimestamp;
164
	}
24592 amit.gupta 165
 
23339 ashik.ali 166
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
167
		this.createTimestamp = createTimestamp;
168
	}
24592 amit.gupta 169
 
23527 ashik.ali 170
	public LocalDateTime getRolledBackTimestamp() {
171
		return rolledBackTimestamp;
172
	}
24592 amit.gupta 173
 
23527 ashik.ali 174
	public void setRolledBackTimestamp(LocalDateTime rolledBackTimestamp) {
175
		this.rolledBackTimestamp = rolledBackTimestamp;
176
	}
22859 ashik.ali 177
 
22653 ashik.ali 178
	@Override
179
	public int hashCode() {
180
		final int prime = 31;
181
		int result = 1;
22859 ashik.ali 182
		result = prime * result + Float.floatToIntBits(amount);
23339 ashik.ali 183
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
24592 amit.gupta 184
		result = prime * result + id;
22859 ashik.ali 185
		result = prime * result + inventoryItemId;
24592 amit.gupta 186
		result = prime * result + ((rolledBackTimestamp == null) ? 0 : rolledBackTimestamp.hashCode());
22859 ashik.ali 187
		result = prime * result + schemeId;
24592 amit.gupta 188
		result = prime * result + ((schemeType == null) ? 0 : schemeType.hashCode());
189
		result = prime * result + ((serialNumber == null) ? 0 : serialNumber.hashCode());
22653 ashik.ali 190
		return result;
191
	}
22859 ashik.ali 192
 
22653 ashik.ali 193
	@Override
194
	public boolean equals(Object obj) {
195
		if (this == obj)
196
			return true;
197
		if (obj == null)
198
			return false;
199
		if (getClass() != obj.getClass())
200
			return false;
22859 ashik.ali 201
		SchemeInOut other = (SchemeInOut) obj;
202
		if (Float.floatToIntBits(amount) != Float.floatToIntBits(other.amount))
22653 ashik.ali 203
			return false;
23339 ashik.ali 204
		if (createTimestamp == null) {
205
			if (other.createTimestamp != null)
206
				return false;
207
		} else if (!createTimestamp.equals(other.createTimestamp))
208
			return false;
24592 amit.gupta 209
		if (id != other.id)
210
			return false;
22859 ashik.ali 211
		if (inventoryItemId != other.inventoryItemId)
212
			return false;
24592 amit.gupta 213
		if (rolledBackTimestamp == null) {
214
			if (other.rolledBackTimestamp != null)
215
				return false;
216
		} else if (!rolledBackTimestamp.equals(other.rolledBackTimestamp))
217
			return false;
22859 ashik.ali 218
		if (schemeId != other.schemeId)
219
			return false;
24592 amit.gupta 220
		if (schemeType != other.schemeType)
221
			return false;
222
		if (serialNumber == null) {
223
			if (other.serialNumber != null)
224
				return false;
225
		} else if (!serialNumber.equals(other.serialNumber))
226
			return false;
22653 ashik.ali 227
		return true;
228
	}
229
 
230
	@Override
231
	public String toString() {
24592 amit.gupta 232
		return "SchemeInOut [id=" + id + ", schemeId=" + schemeId + ", inventoryItemId=" + inventoryItemId + ", amount="
27377 amit.gupta 233
				+ amount + ", status=" + status + ", createTimestamp=" + createTimestamp + ", rolledBackTimestamp="
234
				+ rolledBackTimestamp + ", creditTimestamp=" + creditTimestamp + ", statusDescription="
235
				+ statusDescription + ", reference=" + reference + ", serialNumber=" + serialNumber + ", storeCode="
236
				+ storeCode + ", schemeType=" + schemeType + "]";
22653 ashik.ali 237
	}
24592 amit.gupta 238
 
22653 ashik.ali 239
}