| 21714 |
ashik.ali |
1 |
package com.spice.profitmandi.dao.entity.fofo;
|
| 21633 |
ashik.ali |
2 |
|
|
|
3 |
import java.io.Serializable;
|
|
|
4 |
import java.time.LocalDateTime;
|
| 21984 |
kshitij.so |
5 |
import java.time.format.DateTimeFormatter;
|
| 21633 |
ashik.ali |
6 |
|
|
|
7 |
import javax.persistence.Column;
|
| 21639 |
kshitij.so |
8 |
import javax.persistence.Convert;
|
| 21633 |
ashik.ali |
9 |
import javax.persistence.Entity;
|
|
|
10 |
import javax.persistence.GeneratedValue;
|
|
|
11 |
import javax.persistence.GenerationType;
|
|
|
12 |
import javax.persistence.Id;
|
|
|
13 |
import javax.persistence.Table;
|
|
|
14 |
|
| 21639 |
kshitij.so |
15 |
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
|
|
|
16 |
|
| 21633 |
ashik.ali |
17 |
/**
|
|
|
18 |
* This class basically contains api details
|
|
|
19 |
*
|
|
|
20 |
* @author ashikali
|
|
|
21 |
*
|
|
|
22 |
*/
|
|
|
23 |
@Entity
|
| 21637 |
kshitij.so |
24 |
@Table(name="fofo.purchase", schema = "fofo")
|
|
|
25 |
|
| 21633 |
ashik.ali |
26 |
public class Purchase implements Serializable{
|
| 21984 |
kshitij.so |
27 |
|
| 21633 |
ashik.ali |
28 |
private static final long serialVersionUID = 1L;
|
|
|
29 |
|
|
|
30 |
public Purchase() {
|
|
|
31 |
}
|
|
|
32 |
|
|
|
33 |
@Id
|
|
|
34 |
@Column(name="id")
|
|
|
35 |
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
|
36 |
private int id;
|
|
|
37 |
|
| 21640 |
kshitij.so |
38 |
@Column(name = "fofo_id")
|
|
|
39 |
private int fofoId;
|
|
|
40 |
|
| 21653 |
ashik.ali |
41 |
@Column(name="purchase_reference")
|
| 21633 |
ashik.ali |
42 |
private String purchaseReference;
|
|
|
43 |
|
|
|
44 |
@Column(name = "serialized_quantity")
|
|
|
45 |
private int serializedQuantity;
|
|
|
46 |
|
|
|
47 |
@Column(name = "non_serialized_quantity")
|
|
|
48 |
private int nonSerializedQuantity;
|
|
|
49 |
|
|
|
50 |
@Column(name = "unfullfilled_serialized_quantity")
|
|
|
51 |
private int unfullfilledSerializedQuantity;
|
|
|
52 |
|
|
|
53 |
@Column(name = "unfullfilled_non_serialized_quantity")
|
|
|
54 |
private int unfullfilledNonSerializedQuantity;
|
|
|
55 |
|
| 22859 |
ashik.ali |
56 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
|
|
57 |
@Column(name = "complete_timestamp")
|
|
|
58 |
private LocalDateTime completeTimestamp = null;
|
| 21633 |
ashik.ali |
59 |
|
| 22859 |
ashik.ali |
60 |
@Column(name = "cashback")
|
|
|
61 |
private float cashback;
|
|
|
62 |
|
| 21639 |
kshitij.so |
63 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
| 21633 |
ashik.ali |
64 |
@Column(name = "create_timestamp")
|
| 21640 |
kshitij.so |
65 |
private LocalDateTime createTimestamp = LocalDateTime.now();
|
| 21633 |
ashik.ali |
66 |
|
|
|
67 |
public int getId() {
|
|
|
68 |
return id;
|
|
|
69 |
}
|
|
|
70 |
public void setId(int id) {
|
|
|
71 |
this.id = id;
|
|
|
72 |
}
|
|
|
73 |
|
| 21640 |
kshitij.so |
74 |
public int getFofoId() {
|
|
|
75 |
return fofoId;
|
|
|
76 |
}
|
|
|
77 |
public void setFofoId(int fofoId) {
|
|
|
78 |
this.fofoId = fofoId;
|
|
|
79 |
}
|
|
|
80 |
|
| 21633 |
ashik.ali |
81 |
public String getPurchaseReference() {
|
|
|
82 |
return purchaseReference;
|
|
|
83 |
}
|
|
|
84 |
public void setPurchaseReference(String purchaseReference) {
|
|
|
85 |
this.purchaseReference = purchaseReference;
|
|
|
86 |
}
|
|
|
87 |
public int getSerializedQuantity() {
|
|
|
88 |
return serializedQuantity;
|
|
|
89 |
}
|
|
|
90 |
public void setSerializedQuantity(int serializedQuantity) {
|
|
|
91 |
this.serializedQuantity = serializedQuantity;
|
|
|
92 |
}
|
|
|
93 |
public int getNonSerializedQuantity() {
|
|
|
94 |
return nonSerializedQuantity;
|
|
|
95 |
}
|
|
|
96 |
public void setNonSerializedQuantity(int nonSerializedQuantity) {
|
|
|
97 |
this.nonSerializedQuantity = nonSerializedQuantity;
|
|
|
98 |
}
|
|
|
99 |
public int getUnfullfilledSerializedQuantity() {
|
|
|
100 |
return unfullfilledSerializedQuantity;
|
|
|
101 |
}
|
|
|
102 |
public void setUnfullfilledSerializedQuantity(int unfullfilledSerializedQuantity) {
|
|
|
103 |
this.unfullfilledSerializedQuantity = unfullfilledSerializedQuantity;
|
|
|
104 |
}
|
|
|
105 |
public int getUnfullfilledNonSerializedQuantity() {
|
|
|
106 |
return unfullfilledNonSerializedQuantity;
|
|
|
107 |
}
|
|
|
108 |
public void setUnfullfilledNonSerializedQuantity(int unfullfilledNonSerializedQuantity) {
|
|
|
109 |
this.unfullfilledNonSerializedQuantity = unfullfilledNonSerializedQuantity;
|
|
|
110 |
}
|
| 22859 |
ashik.ali |
111 |
public LocalDateTime getCompleteTimestamp() {
|
|
|
112 |
return completeTimestamp;
|
| 21633 |
ashik.ali |
113 |
}
|
| 22859 |
ashik.ali |
114 |
public void setCompleteTimestamp(LocalDateTime completeTimestamp) {
|
|
|
115 |
this.completeTimestamp = completeTimestamp;
|
| 21633 |
ashik.ali |
116 |
}
|
| 22859 |
ashik.ali |
117 |
public float getCashback() {
|
|
|
118 |
return cashback;
|
|
|
119 |
}
|
|
|
120 |
public void setCashback(float cashback) {
|
|
|
121 |
this.cashback = cashback;
|
|
|
122 |
}
|
| 21924 |
ashik.ali |
123 |
public LocalDateTime getCreateTimestamp() {
|
|
|
124 |
return createTimestamp;
|
|
|
125 |
}
|
|
|
126 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
|
|
127 |
this.createTimestamp = createTimestamp;
|
|
|
128 |
}
|
|
|
129 |
|
| 21984 |
kshitij.so |
130 |
public String getFormattedDate(){
|
|
|
131 |
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
|
|
|
132 |
return this.createTimestamp.format(formatter);
|
|
|
133 |
}
|
| 21633 |
ashik.ali |
134 |
|
| 22009 |
ashik.ali |
135 |
@Override
|
|
|
136 |
public int hashCode() {
|
|
|
137 |
final int prime = 31;
|
|
|
138 |
int result = 1;
|
|
|
139 |
result = prime * result + id;
|
|
|
140 |
return result;
|
|
|
141 |
}
|
|
|
142 |
@Override
|
|
|
143 |
public boolean equals(Object obj) {
|
|
|
144 |
if (this == obj)
|
|
|
145 |
return true;
|
|
|
146 |
if (obj == null)
|
|
|
147 |
return false;
|
|
|
148 |
if (getClass() != obj.getClass())
|
|
|
149 |
return false;
|
|
|
150 |
Purchase other = (Purchase) obj;
|
|
|
151 |
if (id != other.id)
|
|
|
152 |
return false;
|
|
|
153 |
return true;
|
|
|
154 |
}
|
|
|
155 |
@Override
|
|
|
156 |
public String toString() {
|
|
|
157 |
return "Purchase [id=" + id + ", purchaseReference=" + purchaseReference + ", serializedQuantity="
|
|
|
158 |
+ serializedQuantity + ", nonSerializedQuantity=" + nonSerializedQuantity
|
|
|
159 |
+ ", unfullfilledSerializedQuantity=" + unfullfilledSerializedQuantity
|
| 22859 |
ashik.ali |
160 |
+ ", unfullfilledNonSerializedQuantity=" + unfullfilledNonSerializedQuantity + ", completedTimestamp="
|
|
|
161 |
+ completeTimestamp + ", cashback=" + cashback + ", createTimestamp=" + createTimestamp + "]";
|
| 22009 |
ashik.ali |
162 |
}
|
|
|
163 |
|
| 21633 |
ashik.ali |
164 |
}
|