| 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;
|
|
|
75 |
|
|
|
76 |
public int getQuantity() {
|
|
|
77 |
return quantity;
|
|
|
78 |
}
|
|
|
79 |
|
|
|
80 |
public void setQuantity(int quantity) {
|
|
|
81 |
this.quantity = quantity;
|
|
|
82 |
}
|
|
|
83 |
|
|
|
84 |
public void setId(int id) {
|
|
|
85 |
this.id = id;
|
|
|
86 |
}
|
|
|
87 |
|
|
|
88 |
@Override
|
|
|
89 |
public String toString() {
|
| 34141 |
tejus.loha |
90 |
return "PurchaseReturnItem{" +
|
|
|
91 |
"id=" + id +
|
|
|
92 |
", returnType=" + returnType +
|
|
|
93 |
", requestedBy='" + requestedBy + '\'' +
|
|
|
94 |
", quantity=" + quantity +
|
|
|
95 |
", inventoryItemId=" + inventoryItemId +
|
|
|
96 |
", fofoId=" + fofoId +
|
|
|
97 |
", status=" + status +
|
|
|
98 |
", debitNoteId=" + debitNoteId +
|
|
|
99 |
", createTimestamp=" + createTimestamp +
|
|
|
100 |
", approveTimestamp=" + approveTimestamp +
|
|
|
101 |
", denyTimestamp=" + denyTimestamp +
|
|
|
102 |
", pickupCreateTimestamp=" + pickupCreateTimestamp +
|
|
|
103 |
", scheduledPickupTimestamp=" + scheduledPickupTimestamp +
|
|
|
104 |
", returnTimestamp=" + returnTimestamp +
|
|
|
105 |
", refundTimestamp=" + refundTimestamp +
|
|
|
106 |
'}';
|
| 23638 |
amit.gupta |
107 |
}
|
|
|
108 |
|
| 23509 |
amit.gupta |
109 |
@Column(name = "inventory_item_id")
|
|
|
110 |
private int inventoryItemId;
|
|
|
111 |
|
|
|
112 |
@Column(name = "fofo_id")
|
|
|
113 |
private int fofoId;
|
|
|
114 |
|
|
|
115 |
@Column(name = "status")
|
|
|
116 |
@Enumerated(EnumType.STRING)
|
|
|
117 |
private PurchaseReturnStatus status = PurchaseReturnStatus.CREATED;
|
|
|
118 |
|
|
|
119 |
@Column(name = "debit_note_id")
|
|
|
120 |
private int debitNoteId;
|
|
|
121 |
|
|
|
122 |
public int getDebitNoteId() {
|
|
|
123 |
return debitNoteId;
|
|
|
124 |
}
|
|
|
125 |
|
|
|
126 |
public void setDebitNoteId(int debitNoteId) {
|
|
|
127 |
this.debitNoteId = debitNoteId;
|
|
|
128 |
}
|
|
|
129 |
|
|
|
130 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
131 |
@Column(name = "create_timestamp")
|
|
|
132 |
private LocalDateTime createTimestamp = LocalDateTime.now();
|
|
|
133 |
|
|
|
134 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
135 |
@Column(name = "approve_timestamp")
|
|
|
136 |
private LocalDateTime approveTimestamp;
|
|
|
137 |
|
|
|
138 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
139 |
@Column(name = "deny_timestamp")
|
|
|
140 |
private LocalDateTime denyTimestamp;
|
|
|
141 |
|
|
|
142 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
143 |
@Column(name = "pickup_create_timestamp")
|
|
|
144 |
private LocalDateTime pickupCreateTimestamp;
|
|
|
145 |
|
|
|
146 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
147 |
@Column(name = "scheduled_pickup_timestamp")
|
|
|
148 |
private LocalDateTime scheduledPickupTimestamp;
|
|
|
149 |
|
|
|
150 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
151 |
@Column(name = "return_timestamp")
|
|
|
152 |
private LocalDateTime returnTimestamp;
|
|
|
153 |
|
|
|
154 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
155 |
@Column(name = "refund_timestamp")
|
|
|
156 |
private LocalDateTime refundTimestamp;
|
|
|
157 |
|
|
|
158 |
@Override
|
|
|
159 |
public int hashCode() {
|
|
|
160 |
final int prime = 31;
|
|
|
161 |
int result = 1;
|
|
|
162 |
result = prime * result + inventoryItemId;
|
|
|
163 |
return result;
|
|
|
164 |
}
|
|
|
165 |
|
|
|
166 |
@Override
|
|
|
167 |
public boolean equals(Object obj) {
|
|
|
168 |
if (this == obj)
|
|
|
169 |
return true;
|
|
|
170 |
if (obj == null)
|
|
|
171 |
return false;
|
|
|
172 |
if (getClass() != obj.getClass())
|
|
|
173 |
return false;
|
|
|
174 |
PurchaseReturnItem other = (PurchaseReturnItem) obj;
|
|
|
175 |
if (inventoryItemId != other.inventoryItemId)
|
|
|
176 |
return false;
|
|
|
177 |
return true;
|
|
|
178 |
}
|
|
|
179 |
|
|
|
180 |
public LocalDateTime getPickupCreateTimestamp() {
|
|
|
181 |
return pickupCreateTimestamp;
|
|
|
182 |
}
|
|
|
183 |
|
|
|
184 |
public void setPickupCreateTimestamp(LocalDateTime pickupCreateTimestamp) {
|
|
|
185 |
this.pickupCreateTimestamp = pickupCreateTimestamp;
|
|
|
186 |
}
|
|
|
187 |
|
|
|
188 |
public LocalDateTime getScheduledPickupTimestamp() {
|
|
|
189 |
return scheduledPickupTimestamp;
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
public void setScheduledPickupTimestamp(LocalDateTime scheduledPickupTimestamp) {
|
|
|
193 |
this.scheduledPickupTimestamp = scheduledPickupTimestamp;
|
|
|
194 |
}
|
|
|
195 |
|
|
|
196 |
public LocalDateTime getReturnTimestamp() {
|
|
|
197 |
return returnTimestamp;
|
|
|
198 |
}
|
|
|
199 |
|
|
|
200 |
public void setReturnTimestamp(LocalDateTime returnTimestamp) {
|
|
|
201 |
this.returnTimestamp = returnTimestamp;
|
|
|
202 |
}
|
|
|
203 |
|
|
|
204 |
public LocalDateTime getRefundTimestamp() {
|
|
|
205 |
return refundTimestamp;
|
|
|
206 |
}
|
|
|
207 |
|
|
|
208 |
public void setRefundTimestamp(LocalDateTime refundTimestamp) {
|
|
|
209 |
this.refundTimestamp = refundTimestamp;
|
|
|
210 |
}
|
|
|
211 |
|
|
|
212 |
public int getInventoryItemId() {
|
|
|
213 |
return inventoryItemId;
|
|
|
214 |
}
|
|
|
215 |
|
|
|
216 |
public void setInventoryItemId(int inventoryItemId) {
|
|
|
217 |
this.inventoryItemId = inventoryItemId;
|
|
|
218 |
}
|
|
|
219 |
|
|
|
220 |
public int getFofoId() {
|
|
|
221 |
return fofoId;
|
|
|
222 |
}
|
|
|
223 |
|
|
|
224 |
public void setFofoId(int fofoId) {
|
|
|
225 |
this.fofoId = fofoId;
|
|
|
226 |
}
|
|
|
227 |
|
|
|
228 |
public PurchaseReturnStatus getStatus() {
|
|
|
229 |
return status;
|
|
|
230 |
}
|
|
|
231 |
|
|
|
232 |
public void setStatus(PurchaseReturnStatus status) {
|
|
|
233 |
this.status = status;
|
|
|
234 |
}
|
|
|
235 |
|
|
|
236 |
public LocalDateTime getCreateTimestamp() {
|
|
|
237 |
return createTimestamp;
|
|
|
238 |
}
|
|
|
239 |
|
|
|
240 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
|
|
241 |
this.createTimestamp = createTimestamp;
|
|
|
242 |
}
|
|
|
243 |
|
|
|
244 |
public String getFormattedCreateTimestamp() {
|
|
|
245 |
if (createTimestamp == null) {
|
|
|
246 |
return null;
|
|
|
247 |
}
|
| 24402 |
amit.gupta |
248 |
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
|
| 23509 |
amit.gupta |
249 |
return createTimestamp.format(formatter);
|
|
|
250 |
}
|
|
|
251 |
|
|
|
252 |
public String getFormattedApproveTimestamp() {
|
|
|
253 |
if (approveTimestamp == null) {
|
|
|
254 |
return null;
|
|
|
255 |
}
|
| 24402 |
amit.gupta |
256 |
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
|
| 23509 |
amit.gupta |
257 |
return approveTimestamp.format(formatter);
|
|
|
258 |
}
|
|
|
259 |
|
|
|
260 |
public LocalDateTime getApproveTimestamp() {
|
|
|
261 |
return approveTimestamp;
|
|
|
262 |
}
|
|
|
263 |
|
|
|
264 |
public void setApproveTimestamp(LocalDateTime approvedTimestamp) {
|
|
|
265 |
this.approveTimestamp = approvedTimestamp;
|
|
|
266 |
}
|
|
|
267 |
|
|
|
268 |
public LocalDateTime getDenyTimestamp() {
|
|
|
269 |
return denyTimestamp;
|
|
|
270 |
}
|
|
|
271 |
|
|
|
272 |
public void setDenyTimestamp(LocalDateTime denyTimestamp) {
|
|
|
273 |
this.denyTimestamp = denyTimestamp;
|
|
|
274 |
}
|
|
|
275 |
}
|