| 29777 |
amit.gupta |
1 |
package com.spice.profitmandi.dao.entity.dtr;
|
|
|
2 |
|
|
|
3 |
import java.io.Serializable;
|
|
|
4 |
import java.time.LocalDateTime;
|
|
|
5 |
|
|
|
6 |
import javax.persistence.Column;
|
|
|
7 |
import javax.persistence.Entity;
|
|
|
8 |
import javax.persistence.EnumType;
|
|
|
9 |
import javax.persistence.Enumerated;
|
|
|
10 |
import javax.persistence.Id;
|
|
|
11 |
import javax.persistence.Table;
|
|
|
12 |
|
|
|
13 |
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
|
|
|
14 |
|
|
|
15 |
@Entity
|
|
|
16 |
@Table(name="dtr.credit_account", schema = "dtr")
|
|
|
17 |
public class CreditAccount implements Serializable{
|
|
|
18 |
|
|
|
19 |
private static final long serialVersionUID = 1L;
|
|
|
20 |
|
|
|
21 |
@Id
|
|
|
22 |
@Column(name="fofo_id", unique=true, updatable=false)
|
|
|
23 |
private int fofoId;
|
|
|
24 |
|
|
|
25 |
@Id
|
|
|
26 |
@Enumerated(EnumType.STRING)
|
|
|
27 |
private Gateway gateway;
|
|
|
28 |
|
|
|
29 |
|
|
|
30 |
@Column
|
|
|
31 |
private float sanctionedAmount;
|
|
|
32 |
|
|
|
33 |
@Column
|
|
|
34 |
private float availableAmount;
|
|
|
35 |
|
|
|
36 |
@Column
|
|
|
37 |
private float interestRate;
|
|
|
38 |
|
|
|
39 |
@Column
|
|
|
40 |
@Enumerated(EnumType.STRING)
|
|
|
41 |
private CreditStatus creditStatus;
|
|
|
42 |
|
|
|
43 |
@Column
|
|
|
44 |
LocalDateTime updatedOn;
|
|
|
45 |
|
|
|
46 |
|
|
|
47 |
public CreditStatus getCreditStatus() {
|
|
|
48 |
return creditStatus;
|
|
|
49 |
}
|
|
|
50 |
|
|
|
51 |
public void setCreditStatus(CreditStatus creditStatus) {
|
|
|
52 |
this.creditStatus = creditStatus;
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
public LocalDateTime getUpdatedOn() {
|
|
|
56 |
return updatedOn;
|
|
|
57 |
}
|
|
|
58 |
|
|
|
59 |
public void setUpdatedOn(LocalDateTime updatedOn) {
|
|
|
60 |
this.updatedOn = updatedOn;
|
|
|
61 |
}
|
|
|
62 |
|
|
|
63 |
@Override
|
|
|
64 |
public String toString() {
|
|
|
65 |
return "CreditAccount [fofoId=" + fofoId + ", gateway=" + gateway + ", sanctionedAmount=" + sanctionedAmount
|
|
|
66 |
+ ", availableAmount=" + availableAmount + ", interestRate=" + interestRate + ", creditStatus="
|
|
|
67 |
+ creditStatus + ", updatedOn=" + updatedOn + "]";
|
|
|
68 |
}
|
|
|
69 |
|
|
|
70 |
public int getFofoId() {
|
|
|
71 |
return fofoId;
|
|
|
72 |
}
|
|
|
73 |
|
|
|
74 |
public void setFofoId(int fofoId) {
|
|
|
75 |
this.fofoId = fofoId;
|
|
|
76 |
}
|
|
|
77 |
|
|
|
78 |
public Gateway getGateway() {
|
|
|
79 |
return gateway;
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
public void setGateway(Gateway gateway) {
|
|
|
83 |
this.gateway = gateway;
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
public float getSanctionedAmount() {
|
|
|
87 |
return sanctionedAmount;
|
|
|
88 |
}
|
|
|
89 |
|
|
|
90 |
public void setSanctionedAmount(float sanctionedAmount) {
|
|
|
91 |
this.sanctionedAmount = sanctionedAmount;
|
|
|
92 |
}
|
|
|
93 |
|
|
|
94 |
public float getAvailableAmount() {
|
|
|
95 |
return availableAmount;
|
|
|
96 |
}
|
|
|
97 |
|
|
|
98 |
public void setAvailableAmount(float availableAmount) {
|
|
|
99 |
this.availableAmount = availableAmount;
|
|
|
100 |
}
|
|
|
101 |
|
|
|
102 |
public float getInterestRate() {
|
|
|
103 |
return interestRate;
|
|
|
104 |
}
|
|
|
105 |
|
|
|
106 |
public void setInterestRate(float interestRate) {
|
|
|
107 |
this.interestRate = interestRate;
|
|
|
108 |
}
|
|
|
109 |
|
|
|
110 |
@Override
|
|
|
111 |
public int hashCode() {
|
|
|
112 |
final int prime = 31;
|
|
|
113 |
int result = 1;
|
|
|
114 |
result = prime * result + Float.floatToIntBits(availableAmount);
|
|
|
115 |
result = prime * result + ((creditStatus == null) ? 0 : creditStatus.hashCode());
|
|
|
116 |
result = prime * result + fofoId;
|
|
|
117 |
result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
|
|
|
118 |
result = prime * result + Float.floatToIntBits(interestRate);
|
|
|
119 |
result = prime * result + Float.floatToIntBits(sanctionedAmount);
|
|
|
120 |
result = prime * result + ((updatedOn == null) ? 0 : updatedOn.hashCode());
|
|
|
121 |
return result;
|
|
|
122 |
}
|
|
|
123 |
|
|
|
124 |
@Override
|
|
|
125 |
public boolean equals(Object obj) {
|
|
|
126 |
if (this == obj)
|
|
|
127 |
return true;
|
|
|
128 |
if (obj == null)
|
|
|
129 |
return false;
|
|
|
130 |
if (getClass() != obj.getClass())
|
|
|
131 |
return false;
|
|
|
132 |
CreditAccount other = (CreditAccount) obj;
|
|
|
133 |
if (Float.floatToIntBits(availableAmount) != Float.floatToIntBits(other.availableAmount))
|
|
|
134 |
return false;
|
|
|
135 |
if (creditStatus != other.creditStatus)
|
|
|
136 |
return false;
|
|
|
137 |
if (fofoId != other.fofoId)
|
|
|
138 |
return false;
|
|
|
139 |
if (gateway != other.gateway)
|
|
|
140 |
return false;
|
|
|
141 |
if (Float.floatToIntBits(interestRate) != Float.floatToIntBits(other.interestRate))
|
|
|
142 |
return false;
|
|
|
143 |
if (Float.floatToIntBits(sanctionedAmount) != Float.floatToIntBits(other.sanctionedAmount))
|
|
|
144 |
return false;
|
|
|
145 |
if (updatedOn == null) {
|
|
|
146 |
if (other.updatedOn != null)
|
|
|
147 |
return false;
|
|
|
148 |
} else if (!updatedOn.equals(other.updatedOn))
|
|
|
149 |
return false;
|
|
|
150 |
return true;
|
|
|
151 |
}
|
|
|
152 |
|
|
|
153 |
}
|