Subversion Repositories SmartDukaan

Rev

Rev 35810 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23509 amit.gupta 1
package com.spice.profitmandi.dao.entity.fofo;
2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
5
import java.time.format.DateTimeFormatter;
6
 
7
import javax.persistence.Column;
8
import javax.persistence.Convert;
9
import javax.persistence.Entity;
10
import javax.persistence.EnumType;
11
import javax.persistence.Enumerated;
23638 amit.gupta 12
import javax.persistence.GeneratedValue;
13
import javax.persistence.GenerationType;
23509 amit.gupta 14
import javax.persistence.Id;
15
import javax.persistence.Table;
23638 amit.gupta 16
import javax.persistence.Transient;
23509 amit.gupta 17
 
18
import com.spice.profitmandi.common.enumuration.PurchaseReturnStatus;
19
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
23638 amit.gupta 20
import com.spice.profitmandi.dao.enumuration.fofo.ReturnType;
23509 amit.gupta 21
 
22
/**
23
 * This class basically contains api details
24
 * 
25
 * @author ashikali
26
 *
27
 */
23638 amit.gupta 28
/**
29
 * @author amit
30
 *
31
 */
23509 amit.gupta 32
@Entity
31860 tejbeer 33
@Table(name = "fofo.purchase_return_item")
23509 amit.gupta 34
 
35
public class PurchaseReturnItem implements Serializable {
36
 
37
	private static final long serialVersionUID = 1L;
38
 
39
	@Id
23638 amit.gupta 40
	@Column(name="id", columnDefinition = "int(11)")
41
	@GeneratedValue(strategy = GenerationType.IDENTITY)
42
	private int id;
43
 
23639 amit.gupta 44
	@Column(name="id", columnDefinition = "int(11)")
23638 amit.gupta 45
	public int getId() {
46
		return id;
47
	}
48
 
23639 amit.gupta 49
 
23640 amit.gupta 50
	@Column(name = "type")
23639 amit.gupta 51
	@Enumerated(EnumType.STRING)
23638 amit.gupta 52
	private ReturnType returnType;
34141 tejus.loha 53
 
54
	@Column(name = "requested_by")
55
	private String requestedBy;
56
 
57
	public String getRequestedBy() {
58
		return requestedBy;
59
	}
60
 
61
	public void setRequestedBy(String requestedBy) {
62
		this.requestedBy = requestedBy;
63
	}
64
 
23638 amit.gupta 65
	public ReturnType getReturnType() {
66
		return returnType;
67
	}
68
 
69
	public void setReturnType(ReturnType returnType) {
70
		this.returnType = returnType;
71
	}
72
 
73
	@Transient
74
	private int quantity;
35810 amit 75
 
76
	@Transient
77
	private int approvedQuantity;
78
 
23638 amit.gupta 79
	public int getQuantity() {
80
		return quantity;
81
	}
82
 
83
	public void setQuantity(int quantity) {
84
		this.quantity = quantity;
85
	}
86
 
35810 amit 87
	public int getApprovedQuantity() {
88
		return approvedQuantity;
89
	}
90
 
91
	public void setApprovedQuantity(int approvedQuantity) {
92
		this.approvedQuantity = approvedQuantity;
93
	}
94
 
23638 amit.gupta 95
	public void setId(int id) {
96
		this.id = id;
97
	}
98
 
99
	@Override
100
	public String toString() {
34141 tejus.loha 101
		return "PurchaseReturnItem{" +
102
				"id=" + id +
103
				", returnType=" + returnType +
104
				", requestedBy='" + requestedBy + '\'' +
105
				", quantity=" + quantity +
106
				", inventoryItemId=" + inventoryItemId +
107
				", fofoId=" + fofoId +
108
				", status=" + status +
109
				", debitNoteId=" + debitNoteId +
110
				", createTimestamp=" + createTimestamp +
111
				", approveTimestamp=" + approveTimestamp +
112
				", denyTimestamp=" + denyTimestamp +
113
				", pickupCreateTimestamp=" + pickupCreateTimestamp +
114
				", scheduledPickupTimestamp=" + scheduledPickupTimestamp +
115
				", returnTimestamp=" + returnTimestamp +
116
				", refundTimestamp=" + refundTimestamp +
117
				'}';
23638 amit.gupta 118
	}
119
 
23509 amit.gupta 120
	@Column(name = "inventory_item_id")
121
	private int inventoryItemId;
122
 
123
	@Column(name = "fofo_id")
124
	private int fofoId;
125
 
126
	@Column(name = "status")
127
	@Enumerated(EnumType.STRING)
128
	private PurchaseReturnStatus status = PurchaseReturnStatus.CREATED;
129
 
130
	@Column(name = "debit_note_id")
131
	private int debitNoteId;
132
 
133
	public int getDebitNoteId() {
134
		return debitNoteId;
135
	}
136
 
137
	public void setDebitNoteId(int debitNoteId) {
138
		this.debitNoteId = debitNoteId;
139
	}
140
 
141
	@Convert(converter = LocalDateTimeAttributeConverter.class)
142
	@Column(name = "create_timestamp")
143
	private LocalDateTime createTimestamp = LocalDateTime.now();
144
 
145
	@Convert(converter = LocalDateTimeAttributeConverter.class)
146
	@Column(name = "approve_timestamp")
147
	private LocalDateTime approveTimestamp;
148
 
149
	@Convert(converter = LocalDateTimeAttributeConverter.class)
150
	@Column(name = "deny_timestamp")
151
	private LocalDateTime denyTimestamp;
152
 
36103 amit 153
	@Column(name = "deny_reason")
154
	private String denyReason;
155
 
23509 amit.gupta 156
	@Convert(converter = LocalDateTimeAttributeConverter.class)
157
	@Column(name = "pickup_create_timestamp")
158
	private LocalDateTime pickupCreateTimestamp;
159
 
160
	@Convert(converter = LocalDateTimeAttributeConverter.class)
161
	@Column(name = "scheduled_pickup_timestamp")
162
	private LocalDateTime scheduledPickupTimestamp;
163
 
164
	@Convert(converter = LocalDateTimeAttributeConverter.class)
165
	@Column(name = "return_timestamp")
166
	private LocalDateTime returnTimestamp;
167
 
168
	@Convert(converter = LocalDateTimeAttributeConverter.class)
169
	@Column(name = "refund_timestamp")
170
	private LocalDateTime refundTimestamp;
171
 
172
	@Override
173
	public int hashCode() {
174
		final int prime = 31;
175
		int result = 1;
176
		result = prime * result + inventoryItemId;
177
		return result;
178
	}
179
 
180
	@Override
181
	public boolean equals(Object obj) {
182
		if (this == obj)
183
			return true;
184
		if (obj == null)
185
			return false;
186
		if (getClass() != obj.getClass())
187
			return false;
188
		PurchaseReturnItem other = (PurchaseReturnItem) obj;
189
		if (inventoryItemId != other.inventoryItemId)
190
			return false;
191
		return true;
192
	}
193
 
194
	public LocalDateTime getPickupCreateTimestamp() {
195
		return pickupCreateTimestamp;
196
	}
197
 
198
	public void setPickupCreateTimestamp(LocalDateTime pickupCreateTimestamp) {
199
		this.pickupCreateTimestamp = pickupCreateTimestamp;
200
	}
201
 
202
	public LocalDateTime getScheduledPickupTimestamp() {
203
		return scheduledPickupTimestamp;
204
	}
205
 
206
	public void setScheduledPickupTimestamp(LocalDateTime scheduledPickupTimestamp) {
207
		this.scheduledPickupTimestamp = scheduledPickupTimestamp;
208
	}
209
 
210
	public LocalDateTime getReturnTimestamp() {
211
		return returnTimestamp;
212
	}
213
 
214
	public void setReturnTimestamp(LocalDateTime returnTimestamp) {
215
		this.returnTimestamp = returnTimestamp;
216
	}
217
 
218
	public LocalDateTime getRefundTimestamp() {
219
		return refundTimestamp;
220
	}
221
 
222
	public void setRefundTimestamp(LocalDateTime refundTimestamp) {
223
		this.refundTimestamp = refundTimestamp;
224
	}
225
 
226
	public int getInventoryItemId() {
227
		return inventoryItemId;
228
	}
229
 
230
	public void setInventoryItemId(int inventoryItemId) {
231
		this.inventoryItemId = inventoryItemId;
232
	}
233
 
234
	public int getFofoId() {
235
		return fofoId;
236
	}
237
 
238
	public void setFofoId(int fofoId) {
239
		this.fofoId = fofoId;
240
	}
241
 
242
	public PurchaseReturnStatus getStatus() {
243
		return status;
244
	}
245
 
246
	public void setStatus(PurchaseReturnStatus status) {
247
		this.status = status;
248
	}
249
 
250
	public LocalDateTime getCreateTimestamp() {
251
		return createTimestamp;
252
	}
253
 
254
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
255
		this.createTimestamp = createTimestamp;
256
	}
257
 
258
	public String getFormattedCreateTimestamp() {
259
		if (createTimestamp == null) {
260
			return null;
261
		}
24402 amit.gupta 262
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
23509 amit.gupta 263
		return createTimestamp.format(formatter);
264
	}
265
 
266
	public String getFormattedApproveTimestamp() {
267
		if (approveTimestamp == null) {
268
			return null;
269
		}
24402 amit.gupta 270
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
23509 amit.gupta 271
		return approveTimestamp.format(formatter);
272
	}
273
 
274
	public LocalDateTime getApproveTimestamp() {
275
		return approveTimestamp;
276
	}
277
 
278
	public void setApproveTimestamp(LocalDateTime approvedTimestamp) {
279
		this.approveTimestamp = approvedTimestamp;
280
	}
281
 
282
	public LocalDateTime getDenyTimestamp() {
283
		return denyTimestamp;
284
	}
285
 
286
	public void setDenyTimestamp(LocalDateTime denyTimestamp) {
287
		this.denyTimestamp = denyTimestamp;
288
	}
36103 amit 289
 
290
	public String getDenyReason() {
291
		return denyReason;
292
	}
293
 
294
	public void setDenyReason(String denyReason) {
295
		this.denyReason = denyReason;
296
	}
23509 amit.gupta 297
}