Subversion Repositories SmartDukaan

Rev

Rev 30859 | 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
31860 tejbeer 19
@Table(name = "dtr.credit_account")
29811 tejbeer 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
30859 tejbeer 53
	private int freeDays;
54
 
55
	@Column
29777 amit.gupta 56
	@Enumerated(EnumType.STRING)
57
	private CreditStatus creditStatus;
29811 tejbeer 58
 
29777 amit.gupta 59
	@Column
60
	LocalDateTime updatedOn;
29811 tejbeer 61
 
62
	@Column
63
	private boolean active;
64
 
65
	@Column
66
	private String description;
67
 
30219 tejbeer 68
	@Column(name = "loan_reference_id")
69
	private String loanReferenceId;
70
 
71
	@Transient
72
	private LocalDateTime expiredOn;
73
 
74
	@Transient
75
	private String processingFee;
76
 
30859 tejbeer 77
	public int getFreeDays() {
78
		return freeDays;
79
	}
80
 
81
	public void setFreeDays(int freeDays) {
82
		this.freeDays = freeDays;
83
	}
84
 
30219 tejbeer 85
	public String getProcessingFee() {
86
		return processingFee;
87
	}
88
 
89
	public void setProcessingFee(String processingFee) {
90
		this.processingFee = processingFee;
91
	}
92
 
93
	public String getLoanReferenceId() {
94
		return loanReferenceId;
95
	}
96
 
97
	public LocalDateTime getExpiredOn() {
98
		return expiredOn;
99
	}
100
 
101
	public void setExpiredOn(LocalDateTime expiredOn) {
102
		this.expiredOn = expiredOn;
103
	}
104
 
105
	public void setLoanReferenceId(String loanReferenceId) {
106
		this.loanReferenceId = loanReferenceId;
107
	}
108
 
29811 tejbeer 109
	public boolean isActive() {
110
		return active;
111
	}
112
 
113
	public void setActive(boolean active) {
114
		this.active = active;
115
	}
116
 
117
	public String getDescription() {
118
		return description;
119
	}
120
 
121
	public void setDescription(String description) {
122
		this.description = description;
123
	}
124
 
29777 amit.gupta 125
	public CreditStatus getCreditStatus() {
126
		return creditStatus;
127
	}
128
 
129
	public void setCreditStatus(CreditStatus creditStatus) {
130
		this.creditStatus = creditStatus;
131
	}
132
 
133
	public LocalDateTime getUpdatedOn() {
134
		return updatedOn;
135
	}
136
 
137
	public void setUpdatedOn(LocalDateTime updatedOn) {
138
		this.updatedOn = updatedOn;
139
	}
140
 
141
	public int getFofoId() {
142
		return fofoId;
143
	}
144
 
145
	public void setFofoId(int fofoId) {
146
		this.fofoId = fofoId;
147
	}
148
 
149
	public Gateway getGateway() {
150
		return gateway;
151
	}
152
 
153
	public void setGateway(Gateway gateway) {
154
		this.gateway = gateway;
155
	}
156
 
157
	public float getSanctionedAmount() {
158
		return sanctionedAmount;
159
	}
160
 
161
	public void setSanctionedAmount(float sanctionedAmount) {
162
		this.sanctionedAmount = sanctionedAmount;
163
	}
164
 
165
	public float getAvailableAmount() {
166
		return availableAmount;
167
	}
168
 
169
	public void setAvailableAmount(float availableAmount) {
170
		this.availableAmount = availableAmount;
171
	}
172
 
173
	public float getInterestRate() {
174
		return interestRate;
175
	}
176
 
177
	public void setInterestRate(float interestRate) {
178
		this.interestRate = interestRate;
179
	}
180
 
181
	@Override
182
	public int hashCode() {
183
		final int prime = 31;
184
		int result = 1;
29811 tejbeer 185
		result = prime * result + (active ? 1231 : 1237);
29777 amit.gupta 186
		result = prime * result + Float.floatToIntBits(availableAmount);
187
		result = prime * result + ((creditStatus == null) ? 0 : creditStatus.hashCode());
29811 tejbeer 188
		result = prime * result + ((description == null) ? 0 : description.hashCode());
29777 amit.gupta 189
		result = prime * result + fofoId;
190
		result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
29813 tejbeer 191
		result = prime * result + id;
29777 amit.gupta 192
		result = prime * result + Float.floatToIntBits(interestRate);
30219 tejbeer 193
		result = prime * result + ((loanReferenceId == null) ? 0 : loanReferenceId.hashCode());
29777 amit.gupta 194
		result = prime * result + Float.floatToIntBits(sanctionedAmount);
195
		result = prime * result + ((updatedOn == null) ? 0 : updatedOn.hashCode());
196
		return result;
197
	}
198
 
199
	@Override
200
	public boolean equals(Object obj) {
201
		if (this == obj)
202
			return true;
203
		if (obj == null)
204
			return false;
205
		if (getClass() != obj.getClass())
206
			return false;
207
		CreditAccount other = (CreditAccount) obj;
29811 tejbeer 208
		if (active != other.active)
209
			return false;
29777 amit.gupta 210
		if (Float.floatToIntBits(availableAmount) != Float.floatToIntBits(other.availableAmount))
211
			return false;
212
		if (creditStatus != other.creditStatus)
213
			return false;
29811 tejbeer 214
		if (description == null) {
215
			if (other.description != null)
216
				return false;
217
		} else if (!description.equals(other.description))
218
			return false;
29777 amit.gupta 219
		if (fofoId != other.fofoId)
220
			return false;
221
		if (gateway != other.gateway)
222
			return false;
29813 tejbeer 223
		if (id != other.id)
224
			return false;
29777 amit.gupta 225
		if (Float.floatToIntBits(interestRate) != Float.floatToIntBits(other.interestRate))
226
			return false;
30219 tejbeer 227
		if (loanReferenceId == null) {
228
			if (other.loanReferenceId != null)
229
				return false;
230
		} else if (!loanReferenceId.equals(other.loanReferenceId))
231
			return false;
29777 amit.gupta 232
		if (Float.floatToIntBits(sanctionedAmount) != Float.floatToIntBits(other.sanctionedAmount))
233
			return false;
234
		if (updatedOn == null) {
235
			if (other.updatedOn != null)
236
				return false;
237
		} else if (!updatedOn.equals(other.updatedOn))
238
			return false;
239
		return true;
240
	}
29811 tejbeer 241
 
242
	@Override
243
	public String toString() {
29813 tejbeer 244
		return "CreditAccount [id=" + id + ", fofoId=" + fofoId + ", gateway=" + gateway + ", sanctionedAmount="
245
				+ sanctionedAmount + ", availableAmount=" + availableAmount + ", interestRate=" + interestRate
246
				+ ", creditStatus=" + creditStatus + ", updatedOn=" + updatedOn + ", active=" + active
30219 tejbeer 247
				+ ", description=" + description + ", loanReferenceId=" + loanReferenceId + "]";
29811 tejbeer 248
	}
249
 
29777 amit.gupta 250
}