Subversion Repositories SmartDukaan

Rev

Rev 28241 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28241 Rev 29497
Line 10... Line 10...
10
import javax.persistence.GenerationType;
10
import javax.persistence.GenerationType;
11
import javax.persistence.Id;
11
import javax.persistence.Id;
12
import javax.persistence.Table;
12
import javax.persistence.Table;
13
 
13
 
14
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
14
import com.spice.profitmandi.dao.enumuration.fofo.Gateway;
15
import com.spice.profitmandi.dao.enumuration.fofo.LoanPaymentStatus;
15
import com.spice.profitmandi.dao.enumuration.fofo.PaymentStatus;
16
 
16
 
17
@Entity
17
@Entity
18
@Table(name = "fofo.loan_payment_request", schema = "fofo")
18
@Table(name = "fofo.payment", schema = "fofo")
19
public class LoanPaymentRequest {
19
public class FofoPayment {
20
	
20
	
21
	private static final long serialVersionUID = 1L;
21
	private static final long serialVersionUID = 1L;
22
	@Id
22
	@Id
23
	@Column(name = "id")
23
	@Column(name = "id")
24
	@GeneratedValue(strategy = GenerationType.IDENTITY)
24
	@GeneratedValue(strategy = GenerationType.IDENTITY)
25
	private int id;
25
	private int id;
26
	
26
	
27
	@Column(name="fofo_id")
27
	@Column(name="fofo_id")
28
	private int fofoId;
28
	private int fofoId;
29
	@Column(name="credit_amount")
29
	@Column(name="amount")
30
	private double creditAmount;
30
	private double amount;
-
 
31
	
-
 
32
	@Column(name="gateway")
-
 
33
	@Enumerated(EnumType.STRING)
-
 
34
	private Gateway gateway;
-
 
35
 
-
 
36
	@Column(name="payment_method")
-
 
37
	private String paymentMethod;
31
	
38
	
32
	@Column(name="gateway_fee")
39
	@Column(name="gateway_fee")
33
	private double gatewayFee;
40
	private double gatewayFee;
34
	
41
	
-
 
42
	@Column(name="gateway_reference")
-
 
43
	private String gatewayReference;
-
 
44
	
35
	@Column(name="status")
45
	@Column(name="status")
36
	@Enumerated(EnumType.STRING)
46
	@Enumerated(EnumType.STRING)
37
	private LoanPaymentStatus loanPaymentStatus=LoanPaymentStatus.INIT;
47
	private PaymentStatus status=PaymentStatus.INIT;
38
	
48
	
39
	@Column(name="create_timestamp")
49
	@Column(name="create_timestamp")
40
	private LocalDateTime createTimestamp;
50
	private LocalDateTime createTimestamp;
41
	
51
	
-
 
52
	
42
	@Column(name="gateway_identifier")
53
	@Column(name="update_timestamp")
43
	@Enumerated(EnumType.STRING)
-
 
44
	private Gateway gateway;
54
	private LocalDateTime updateTimestamp;
45
	
55
	
46
	
56
	
47
	@Column(name="payment_method")
-
 
48
	private String paymentMethod;
-
 
49
	
57
	
50
	public double getTotalAmount() {
58
	public double getTotalAmount() {
51
		return creditAmount + gatewayFee;
59
		return amount + gatewayFee;
52
	}
60
	}
-
 
61
 
-
 
62
	@Override
-
 
63
	public String toString() {
-
 
64
		return "FofoPayment [id=" + id + ", fofoId=" + fofoId + ", amount=" + amount + ", gateway=" + gateway
-
 
65
				+ ", gatewayFee=" + gatewayFee + ", gatewayReference=" + gatewayReference + ", status=" + status
-
 
66
				+ ", createTimestamp=" + createTimestamp + ", updateTimestamp=" + updateTimestamp + ", paymentMethod="
-
 
67
				+ paymentMethod + "]";
53
	
68
	}
-
 
69
 
54
	public int getId() {
70
	public int getId() {
55
		return id;
71
		return id;
56
	}
72
	}
-
 
73
 
57
	public void setId(int id) {
74
	public void setId(int id) {
58
		this.id = id;
75
		this.id = id;
59
	}
76
	}
60
	public LoanPaymentStatus getLoanPaymentStatus() {
-
 
61
		return loanPaymentStatus;
-
 
62
	}
-
 
63
	public void setLoanPaymentStatus(LoanPaymentStatus loanPaymentStatus) {
-
 
64
		this.loanPaymentStatus = loanPaymentStatus;
-
 
65
	}
77
 
66
	public LocalDateTime getCreateTimestamp() {
-
 
67
		return createTimestamp;
-
 
68
	}
-
 
69
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
-
 
70
		this.createTimestamp = createTimestamp;
-
 
71
	}
-
 
72
	public int getFofoId() {
78
	public int getFofoId() {
73
		return fofoId;
79
		return fofoId;
74
	}
80
	}
-
 
81
 
75
	public void setFofoId(int fofoId) {
82
	public void setFofoId(int fofoId) {
76
		this.fofoId = fofoId;
83
		this.fofoId = fofoId;
77
	}
84
	}
78
 
85
 
79
	
-
 
80
	public double getCreditAmount() {
86
	public double getAmount() {
81
		return creditAmount;
87
		return amount;
82
	}
88
	}
83
 
89
 
84
	public void setCreditAmount(double creditAmount) {
90
	public void setAmount(double amount) {
85
		this.creditAmount = creditAmount;
91
		this.amount = amount;
-
 
92
	}
-
 
93
 
-
 
94
	public Gateway getGateway() {
-
 
95
		return gateway;
-
 
96
	}
-
 
97
 
-
 
98
	public void setGateway(Gateway gateway) {
-
 
99
		this.gateway = gateway;
86
	}
100
	}
87
 
101
 
88
	public double getGatewayFee() {
102
	public double getGatewayFee() {
89
		return gatewayFee;
103
		return gatewayFee;
90
	}
104
	}
-
 
105
 
91
	public void setGatewayFee(double gatewayFee) {
106
	public void setGatewayFee(double gatewayFee) {
92
		this.gatewayFee = gatewayFee;
107
		this.gatewayFee = gatewayFee;
93
	}
108
	}
-
 
109
 
-
 
110
	public String getGatewayReference() {
-
 
111
		return gatewayReference;
-
 
112
	}
-
 
113
 
-
 
114
	public void setGatewayReference(String gatewayReference) {
-
 
115
		this.gatewayReference = gatewayReference;
-
 
116
	}
-
 
117
 
-
 
118
	public PaymentStatus getStatus() {
-
 
119
		return status;
-
 
120
	}
-
 
121
 
-
 
122
	public void setStatus(PaymentStatus status) {
-
 
123
		this.status = status;
-
 
124
	}
-
 
125
 
-
 
126
	public LocalDateTime getCreateTimestamp() {
-
 
127
		return createTimestamp;
-
 
128
	}
-
 
129
 
-
 
130
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
-
 
131
		this.createTimestamp = createTimestamp;
-
 
132
	}
-
 
133
 
-
 
134
	public LocalDateTime getUpdateTimestamp() {
-
 
135
		return updateTimestamp;
-
 
136
	}
-
 
137
 
-
 
138
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
-
 
139
		this.updateTimestamp = updateTimestamp;
-
 
140
	}
-
 
141
 
94
	public String getPaymentMethod() {
142
	public String getPaymentMethod() {
95
		return paymentMethod;
143
		return paymentMethod;
96
	}
144
	}
-
 
145
 
97
	public void setPaymentMethod(String paymentMethod) {
146
	public void setPaymentMethod(String paymentMethod) {
98
		this.paymentMethod = paymentMethod;
147
		this.paymentMethod = paymentMethod;
99
	}
148
	}
-
 
149
 
100
	@Override
150
	@Override
101
	public int hashCode() {
151
	public int hashCode() {
102
		final int prime = 31;
152
		final int prime = 31;
103
		int result = 1;
153
		int result = 1;
104
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
-
 
105
		long temp;
154
		long temp;
106
		temp = Double.doubleToLongBits(creditAmount);
155
		temp = Double.doubleToLongBits(amount);
107
		result = prime * result + (int) (temp ^ (temp >>> 32));
156
		result = prime * result + (int) (temp ^ (temp >>> 32));
-
 
157
		result = prime * result + ((createTimestamp == null) ? 0 : createTimestamp.hashCode());
108
		result = prime * result + fofoId;
158
		result = prime * result + fofoId;
109
		result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
159
		result = prime * result + ((gateway == null) ? 0 : gateway.hashCode());
110
		temp = Double.doubleToLongBits(gatewayFee);
160
		temp = Double.doubleToLongBits(gatewayFee);
111
		result = prime * result + (int) (temp ^ (temp >>> 32));
161
		result = prime * result + (int) (temp ^ (temp >>> 32));
-
 
162
		result = prime * result + ((gatewayReference == null) ? 0 : gatewayReference.hashCode());
112
		result = prime * result + id;
163
		result = prime * result + id;
113
		result = prime * result + ((loanPaymentStatus == null) ? 0 : loanPaymentStatus.hashCode());
-
 
114
		result = prime * result + ((paymentMethod == null) ? 0 : paymentMethod.hashCode());
164
		result = prime * result + ((paymentMethod == null) ? 0 : paymentMethod.hashCode());
-
 
165
		result = prime * result + ((status == null) ? 0 : status.hashCode());
-
 
166
		result = prime * result + ((updateTimestamp == null) ? 0 : updateTimestamp.hashCode());
115
		return result;
167
		return result;
116
	}
168
	}
117
 
169
 
118
	@Override
170
	@Override
119
	public boolean equals(Object obj) {
171
	public boolean equals(Object obj) {
Line 121... Line 173...
121
			return true;
173
			return true;
122
		if (obj == null)
174
		if (obj == null)
123
			return false;
175
			return false;
124
		if (getClass() != obj.getClass())
176
		if (getClass() != obj.getClass())
125
			return false;
177
			return false;
126
		LoanPaymentRequest other = (LoanPaymentRequest) obj;
178
		FofoPayment other = (FofoPayment) obj;
-
 
179
		if (Double.doubleToLongBits(amount) != Double.doubleToLongBits(other.amount))
-
 
180
			return false;
127
		if (createTimestamp == null) {
181
		if (createTimestamp == null) {
128
			if (other.createTimestamp != null)
182
			if (other.createTimestamp != null)
129
				return false;
183
				return false;
130
		} else if (!createTimestamp.equals(other.createTimestamp))
184
		} else if (!createTimestamp.equals(other.createTimestamp))
131
			return false;
185
			return false;
132
		if (Double.doubleToLongBits(creditAmount) != Double.doubleToLongBits(other.creditAmount))
-
 
133
			return false;
-
 
134
		if (fofoId != other.fofoId)
186
		if (fofoId != other.fofoId)
135
			return false;
187
			return false;
136
		if (gateway != other.gateway)
188
		if (gateway != other.gateway)
137
			return false;
189
			return false;
138
		if (Double.doubleToLongBits(gatewayFee) != Double.doubleToLongBits(other.gatewayFee))
190
		if (Double.doubleToLongBits(gatewayFee) != Double.doubleToLongBits(other.gatewayFee))
139
			return false;
191
			return false;
140
		if (id != other.id)
192
		if (gatewayReference == null) {
-
 
193
			if (other.gatewayReference != null)
-
 
194
				return false;
-
 
195
		} else if (!gatewayReference.equals(other.gatewayReference))
141
			return false;
196
			return false;
142
		if (loanPaymentStatus != other.loanPaymentStatus)
197
		if (id != other.id)
143
			return false;
198
			return false;
144
		if (paymentMethod == null) {
199
		if (paymentMethod == null) {
145
			if (other.paymentMethod != null)
200
			if (other.paymentMethod != null)
146
				return false;
201
				return false;
147
		} else if (!paymentMethod.equals(other.paymentMethod))
202
		} else if (!paymentMethod.equals(other.paymentMethod))
148
			return false;
203
			return false;
-
 
204
		if (status != other.status)
-
 
205
			return false;
-
 
206
		if (updateTimestamp == null) {
-
 
207
			if (other.updateTimestamp != null)
-
 
208
				return false;
-
 
209
		} else if (!updateTimestamp.equals(other.updateTimestamp))
-
 
210
			return false;
149
		return true;
211
		return true;
150
	}
212
	}
151
 
-
 
152
	public Gateway getGateway() {
-
 
153
		return gateway;
-
 
154
	}
-
 
155
 
-
 
156
	public void setGateway(Gateway gateway) {
-
 
157
		this.gateway = gateway;
-
 
158
	}
-
 
159
 
-
 
160
	@Override
-
 
161
	public String toString() {
-
 
162
		return "LoanPaymentRequest [id=" + id + ", fofoId=" + fofoId + ", creditAmount=" + creditAmount
-
 
163
				+ ", gatewayFee=" + gatewayFee + ", loanPaymentStatus=" + loanPaymentStatus + ", createTimestamp="
-
 
164
				+ createTimestamp + ", gateway=" + gateway + ", paymentMethod=" + paymentMethod + "]";
-
 
165
	}
-
 
166
	
213
	
167
	
214
	
168
}
215
}
169
 
216