| 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 |
|
|
|
56 |
@Column(name = "completed", columnDefinition="tinyint(1) default 0")
|
|
|
57 |
private boolean completed;
|
|
|
58 |
|
| 21639 |
kshitij.so |
59 |
@Convert(converter = LocalDateTimeAttributeConverter.class)
|
| 21633 |
ashik.ali |
60 |
@Column(name = "create_timestamp")
|
| 21640 |
kshitij.so |
61 |
private LocalDateTime createTimestamp = LocalDateTime.now();
|
| 21633 |
ashik.ali |
62 |
|
|
|
63 |
public int getId() {
|
|
|
64 |
return id;
|
|
|
65 |
}
|
|
|
66 |
public void setId(int id) {
|
|
|
67 |
this.id = id;
|
|
|
68 |
}
|
|
|
69 |
|
| 21640 |
kshitij.so |
70 |
public int getFofoId() {
|
|
|
71 |
return fofoId;
|
|
|
72 |
}
|
|
|
73 |
public void setFofoId(int fofoId) {
|
|
|
74 |
this.fofoId = fofoId;
|
|
|
75 |
}
|
|
|
76 |
|
| 21633 |
ashik.ali |
77 |
public String getPurchaseReference() {
|
|
|
78 |
return purchaseReference;
|
|
|
79 |
}
|
|
|
80 |
public void setPurchaseReference(String purchaseReference) {
|
|
|
81 |
this.purchaseReference = purchaseReference;
|
|
|
82 |
}
|
|
|
83 |
public int getSerializedQuantity() {
|
|
|
84 |
return serializedQuantity;
|
|
|
85 |
}
|
|
|
86 |
public void setSerializedQuantity(int serializedQuantity) {
|
|
|
87 |
this.serializedQuantity = serializedQuantity;
|
|
|
88 |
}
|
|
|
89 |
public int getNonSerializedQuantity() {
|
|
|
90 |
return nonSerializedQuantity;
|
|
|
91 |
}
|
|
|
92 |
public void setNonSerializedQuantity(int nonSerializedQuantity) {
|
|
|
93 |
this.nonSerializedQuantity = nonSerializedQuantity;
|
|
|
94 |
}
|
|
|
95 |
public int getUnfullfilledSerializedQuantity() {
|
|
|
96 |
return unfullfilledSerializedQuantity;
|
|
|
97 |
}
|
|
|
98 |
public void setUnfullfilledSerializedQuantity(int unfullfilledSerializedQuantity) {
|
|
|
99 |
this.unfullfilledSerializedQuantity = unfullfilledSerializedQuantity;
|
|
|
100 |
}
|
|
|
101 |
public int getUnfullfilledNonSerializedQuantity() {
|
|
|
102 |
return unfullfilledNonSerializedQuantity;
|
|
|
103 |
}
|
|
|
104 |
public void setUnfullfilledNonSerializedQuantity(int unfullfilledNonSerializedQuantity) {
|
|
|
105 |
this.unfullfilledNonSerializedQuantity = unfullfilledNonSerializedQuantity;
|
|
|
106 |
}
|
|
|
107 |
public boolean isCompleted() {
|
|
|
108 |
return completed;
|
|
|
109 |
}
|
|
|
110 |
public void setCompleted(boolean completed) {
|
|
|
111 |
this.completed = completed;
|
|
|
112 |
}
|
| 21924 |
ashik.ali |
113 |
public LocalDateTime getCreateTimestamp() {
|
|
|
114 |
return createTimestamp;
|
|
|
115 |
}
|
|
|
116 |
public void setCreateTimestamp(LocalDateTime createTimestamp) {
|
|
|
117 |
this.createTimestamp = createTimestamp;
|
|
|
118 |
}
|
|
|
119 |
|
| 21984 |
kshitij.so |
120 |
public String getFormattedDate(){
|
|
|
121 |
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
|
|
|
122 |
return this.createTimestamp.format(formatter);
|
|
|
123 |
}
|
| 21633 |
ashik.ali |
124 |
|
| 22009 |
ashik.ali |
125 |
|
|
|
126 |
|
|
|
127 |
@Override
|
|
|
128 |
public int hashCode() {
|
|
|
129 |
final int prime = 31;
|
|
|
130 |
int result = 1;
|
|
|
131 |
result = prime * result + id;
|
|
|
132 |
return result;
|
|
|
133 |
}
|
|
|
134 |
@Override
|
|
|
135 |
public boolean equals(Object obj) {
|
|
|
136 |
if (this == obj)
|
|
|
137 |
return true;
|
|
|
138 |
if (obj == null)
|
|
|
139 |
return false;
|
|
|
140 |
if (getClass() != obj.getClass())
|
|
|
141 |
return false;
|
|
|
142 |
Purchase other = (Purchase) obj;
|
|
|
143 |
if (id != other.id)
|
|
|
144 |
return false;
|
|
|
145 |
return true;
|
|
|
146 |
}
|
|
|
147 |
@Override
|
|
|
148 |
public String toString() {
|
|
|
149 |
return "Purchase [id=" + id + ", purchaseReference=" + purchaseReference + ", serializedQuantity="
|
|
|
150 |
+ serializedQuantity + ", nonSerializedQuantity=" + nonSerializedQuantity
|
|
|
151 |
+ ", unfullfilledSerializedQuantity=" + unfullfilledSerializedQuantity
|
|
|
152 |
+ ", unfullfilledNonSerializedQuantity=" + unfullfilledNonSerializedQuantity + ", completed="
|
|
|
153 |
+ completed + ", createTimestamp=" + createTimestamp + "]";
|
|
|
154 |
}
|
|
|
155 |
|
| 21633 |
ashik.ali |
156 |
}
|