Subversion Repositories SmartDukaan

Rev

Rev 29813 | Rev 30859 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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;
29813 tejbeer 10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
29777 amit.gupta 12
import javax.persistence.Id;
13
import javax.persistence.Table;
30219 tejbeer 14
import javax.persistence.Transient;
29777 amit.gupta 15
 
16
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
17
 
18
@Entity
29811 tejbeer 19
@Table(name = "dtr.credit_account", schema = "dtr")
20
public class CreditAccount implements Serializable {
21
 
29777 amit.gupta 22
	private static final long serialVersionUID = 1L;
23
 
24
	@Id
29813 tejbeer 25
	@Column(name = "id", unique = true, updatable = false)
26
	@GeneratedValue(strategy = GenerationType.IDENTITY)
27
	private int id;
28
 
29
	public int getId() {
30
		return id;
31
	}
32
 
33
	public void setId(int id) {
34
		this.id = id;
35
	}
36
 
29811 tejbeer 37
	@Column(name = "fofo_id", unique = true, updatable = false)
29777 amit.gupta 38
	private int fofoId;
29811 tejbeer 39
 
29777 amit.gupta 40
	@Enumerated(EnumType.STRING)
41
	private Gateway gateway;
42
 
43
	@Column
44
	private float sanctionedAmount;
29811 tejbeer 45
 
29777 amit.gupta 46
	@Column
47
	private float availableAmount;
29811 tejbeer 48
 
29777 amit.gupta 49
	@Column
50
	private float interestRate;
29811 tejbeer 51
 
29777 amit.gupta 52
	@Column
53
	@Enumerated(EnumType.STRING)
54
	private CreditStatus creditStatus;
29811 tejbeer 55
 
29777 amit.gupta 56
	@Column
57
	LocalDateTime updatedOn;
29811 tejbeer 58
 
59
	@Column
60
	private boolean active;
61
 
62
	@Column
63
	private String description;
64
 
30219 tejbeer 65
	@Column(name = "loan_reference_id")
66
	private String loanReferenceId;
67
 
68
	@Transient
69
	private LocalDateTime expiredOn;
70
 
71
	@Transient
72
	private String processingFee;
73
 
74
	public String getProcessingFee() {
75
		return processingFee;
76
	}
77
 
78
	public void setProcessingFee(String processingFee) {
79
		this.processingFee = processingFee;
80
	}
81
 
82
	public String getLoanReferenceId() {
83
		return loanReferenceId;
84
	}
85
 
86
	public LocalDateTime getExpiredOn() {
87
		return expiredOn;
88
	}
89
 
90
	public void setExpiredOn(LocalDateTime expiredOn) {
91
		this.expiredOn = expiredOn;
92
	}
93
 
94
	public void setLoanReferenceId(String loanReferenceId) {
95
		this.loanReferenceId = loanReferenceId;
96
	}
97
 
29811 tejbeer 98
	public boolean isActive() {
99
		return active;
100
	}
101
 
102
	public void setActive(boolean active) {
103
		this.active = active;
104
	}
105
 
106
	public String getDescription() {
107
		return description;
108
	}
109
 
110
	public void setDescription(String description) {
111
		this.description = description;
112
	}
113
 
29777 amit.gupta 114
	public CreditStatus getCreditStatus() {
115
		return creditStatus;
116
	}
117
 
118
	public void setCreditStatus(CreditStatus creditStatus) {
119
		this.creditStatus = creditStatus;
120
	}
121
 
122
	public LocalDateTime getUpdatedOn() {
123
		return updatedOn;
124
	}
125
 
126
	public void setUpdatedOn(LocalDateTime updatedOn) {
127
		this.updatedOn = updatedOn;
128
	}
129
 
130
	public int getFofoId() {
131
		return fofoId;
132
	}
133
 
134
	public void setFofoId(int fofoId) {
135
		this.fofoId = fofoId;
136
	}
137
 
138
	public Gateway getGateway() {
139
		return gateway;
140
	}
141
 
142
	public void setGateway(Gateway gateway) {
143
		this.gateway = gateway;
144
	}
145
 
146
	public float getSanctionedAmount() {
147
		return sanctionedAmount;
148
	}
149
 
150
	public void setSanctionedAmount(float sanctionedAmount) {
151
		this.sanctionedAmount = sanctionedAmount;
152
	}
153
 
154
	public float getAvailableAmount() {
155
		return availableAmount;
156
	}
157
 
158
	public void setAvailableAmount(float availableAmount) {
159
		this.availableAmount = availableAmount;
160
	}
161
 
162
	public float getInterestRate() {
163
		return interestRate;
164
	}
165
 
166
	public void setInterestRate(float interestRate) {
167
		this.interestRate = interestRate;
168
	}
169
 
170
	@Override
171
	public int hashCode() {
172
		final int prime = 31;
173
		int result = 1;
29811 tejbeer 174
		result = prime * result + (active ? 1231 : 1237);
29777 amit.gupta 175
		result = prime * result + Float.floatToIntBits(availableAmount);
176
		result = prime * result + ((creditStatus == null) ? 0 : creditStatus.hashCode());
29811 tejbeer 177
		result = prime * result + ((description == null) ? 0 : description.hashCode());
29777 amit.gupta 178
		result = prime * result + fofoId;
179
		result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
29813 tejbeer 180
		result = prime * result + id;
29777 amit.gupta 181
		result = prime * result + Float.floatToIntBits(interestRate);
30219 tejbeer 182
		result = prime * result + ((loanReferenceId == null) ? 0 : loanReferenceId.hashCode());
29777 amit.gupta 183
		result = prime * result + Float.floatToIntBits(sanctionedAmount);
184
		result = prime * result + ((updatedOn == null) ? 0 : updatedOn.hashCode());
185
		return result;
186
	}
187
 
188
	@Override
189
	public boolean equals(Object obj) {
190
		if (this == obj)
191
			return true;
192
		if (obj == null)
193
			return false;
194
		if (getClass() != obj.getClass())
195
			return false;
196
		CreditAccount other = (CreditAccount) obj;
29811 tejbeer 197
		if (active != other.active)
198
			return false;
29777 amit.gupta 199
		if (Float.floatToIntBits(availableAmount) != Float.floatToIntBits(other.availableAmount))
200
			return false;
201
		if (creditStatus != other.creditStatus)
202
			return false;
29811 tejbeer 203
		if (description == null) {
204
			if (other.description != null)
205
				return false;
206
		} else if (!description.equals(other.description))
207
			return false;
29777 amit.gupta 208
		if (fofoId != other.fofoId)
209
			return false;
210
		if (gateway != other.gateway)
211
			return false;
29813 tejbeer 212
		if (id != other.id)
213
			return false;
29777 amit.gupta 214
		if (Float.floatToIntBits(interestRate) != Float.floatToIntBits(other.interestRate))
215
			return false;
30219 tejbeer 216
		if (loanReferenceId == null) {
217
			if (other.loanReferenceId != null)
218
				return false;
219
		} else if (!loanReferenceId.equals(other.loanReferenceId))
220
			return false;
29777 amit.gupta 221
		if (Float.floatToIntBits(sanctionedAmount) != Float.floatToIntBits(other.sanctionedAmount))
222
			return false;
223
		if (updatedOn == null) {
224
			if (other.updatedOn != null)
225
				return false;
226
		} else if (!updatedOn.equals(other.updatedOn))
227
			return false;
228
		return true;
229
	}
29811 tejbeer 230
 
231
	@Override
232
	public String toString() {
29813 tejbeer 233
		return "CreditAccount [id=" + id + ", fofoId=" + fofoId + ", gateway=" + gateway + ", sanctionedAmount="
234
				+ sanctionedAmount + ", availableAmount=" + availableAmount + ", interestRate=" + interestRate
235
				+ ", creditStatus=" + creditStatus + ", updatedOn=" + updatedOn + ", active=" + active
30219 tejbeer 236
				+ ", description=" + description + ", loanReferenceId=" + loanReferenceId + "]";
29811 tejbeer 237
	}
238
 
29777 amit.gupta 239
}