Subversion Repositories SmartDukaan

Rev

Rev 34141 | Go to most recent revision | 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
 
153
	@Convert(converter = LocalDateTimeAttributeConverter.class)
154
	@Column(name = "pickup_create_timestamp")
155
	private LocalDateTime pickupCreateTimestamp;
156
 
157
	@Convert(converter = LocalDateTimeAttributeConverter.class)
158
	@Column(name = "scheduled_pickup_timestamp")
159
	private LocalDateTime scheduledPickupTimestamp;
160
 
161
	@Convert(converter = LocalDateTimeAttributeConverter.class)
162
	@Column(name = "return_timestamp")
163
	private LocalDateTime returnTimestamp;
164
 
165
	@Convert(converter = LocalDateTimeAttributeConverter.class)
166
	@Column(name = "refund_timestamp")
167
	private LocalDateTime refundTimestamp;
168
 
169
	@Override
170
	public int hashCode() {
171
		final int prime = 31;
172
		int result = 1;
173
		result = prime * result + inventoryItemId;
174
		return result;
175
	}
176
 
177
	@Override
178
	public boolean equals(Object obj) {
179
		if (this == obj)
180
			return true;
181
		if (obj == null)
182
			return false;
183
		if (getClass() != obj.getClass())
184
			return false;
185
		PurchaseReturnItem other = (PurchaseReturnItem) obj;
186
		if (inventoryItemId != other.inventoryItemId)
187
			return false;
188
		return true;
189
	}
190
 
191
	public LocalDateTime getPickupCreateTimestamp() {
192
		return pickupCreateTimestamp;
193
	}
194
 
195
	public void setPickupCreateTimestamp(LocalDateTime pickupCreateTimestamp) {
196
		this.pickupCreateTimestamp = pickupCreateTimestamp;
197
	}
198
 
199
	public LocalDateTime getScheduledPickupTimestamp() {
200
		return scheduledPickupTimestamp;
201
	}
202
 
203
	public void setScheduledPickupTimestamp(LocalDateTime scheduledPickupTimestamp) {
204
		this.scheduledPickupTimestamp = scheduledPickupTimestamp;
205
	}
206
 
207
	public LocalDateTime getReturnTimestamp() {
208
		return returnTimestamp;
209
	}
210
 
211
	public void setReturnTimestamp(LocalDateTime returnTimestamp) {
212
		this.returnTimestamp = returnTimestamp;
213
	}
214
 
215
	public LocalDateTime getRefundTimestamp() {
216
		return refundTimestamp;
217
	}
218
 
219
	public void setRefundTimestamp(LocalDateTime refundTimestamp) {
220
		this.refundTimestamp = refundTimestamp;
221
	}
222
 
223
	public int getInventoryItemId() {
224
		return inventoryItemId;
225
	}
226
 
227
	public void setInventoryItemId(int inventoryItemId) {
228
		this.inventoryItemId = inventoryItemId;
229
	}
230
 
231
	public int getFofoId() {
232
		return fofoId;
233
	}
234
 
235
	public void setFofoId(int fofoId) {
236
		this.fofoId = fofoId;
237
	}
238
 
239
	public PurchaseReturnStatus getStatus() {
240
		return status;
241
	}
242
 
243
	public void setStatus(PurchaseReturnStatus status) {
244
		this.status = status;
245
	}
246
 
247
	public LocalDateTime getCreateTimestamp() {
248
		return createTimestamp;
249
	}
250
 
251
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
252
		this.createTimestamp = createTimestamp;
253
	}
254
 
255
	public String getFormattedCreateTimestamp() {
256
		if (createTimestamp == null) {
257
			return null;
258
		}
24402 amit.gupta 259
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
23509 amit.gupta 260
		return createTimestamp.format(formatter);
261
	}
262
 
263
	public String getFormattedApproveTimestamp() {
264
		if (approveTimestamp == null) {
265
			return null;
266
		}
24402 amit.gupta 267
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
23509 amit.gupta 268
		return approveTimestamp.format(formatter);
269
	}
270
 
271
	public LocalDateTime getApproveTimestamp() {
272
		return approveTimestamp;
273
	}
274
 
275
	public void setApproveTimestamp(LocalDateTime approvedTimestamp) {
276
		this.approveTimestamp = approvedTimestamp;
277
	}
278
 
279
	public LocalDateTime getDenyTimestamp() {
280
		return denyTimestamp;
281
	}
282
 
283
	public void setDenyTimestamp(LocalDateTime denyTimestamp) {
284
		this.denyTimestamp = denyTimestamp;
285
	}
286
}