Subversion Repositories SmartDukaan

Rev

Rev 24402 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
23627 ashik.ali 1
package com.spice.profitmandi.dao.entity.dtr;
2
 
3
import java.io.Serializable;
4
import java.time.LocalDate;
5
import java.time.format.DateTimeFormatter;
6
 
7
import javax.persistence.Column;
8
import javax.persistence.Convert;
9
import javax.persistence.Entity;
10
import javax.persistence.Id;
11
import javax.persistence.Table;
12
 
13
import com.spice.profitmandi.dao.convertor.LocalDateAttributeConverter;
14
 
15
/**
16
 * This class basically contains daily recharge details
17
 * 
18
 * @author ashikali
19
 *
20
 */
21
 
22
@Entity
31860 tejbeer 23
@Table(name="dtr.daily_recharge")
23627 ashik.ali 24
public class DailyRecharge implements Serializable{
25
 
26
	private static final long serialVersionUID = 1L;
27
 
28
	public DailyRecharge() {
29
	}
30
 
31
	@Id
32
	@Column(name = "provider_id")
33
	private int providerId;
34
 
35
	@Id
36
	@Convert(converter = LocalDateAttributeConverter.class)
37
	@Column(name="create_date", updatable = false, unique = true)
38
	private LocalDate createDate = LocalDate.now();
39
 
40
	@Column(name = "opening_balance")
41
	private float openingBalance;
42
 
23663 amit.gupta 43
	@Column(name = "wallet_recharge_amount")
44
	private float walletRechargeAmount;
23627 ashik.ali 45
 
46
	@Column(name = "total_amount")
47
	private float totalAmount;
23663 amit.gupta 48
 
49
	@Column(name = "closing_balance")
50
	private float closingBalance;
23627 ashik.ali 51
 
23663 amit.gupta 52
 
23627 ashik.ali 53
	@Column(name = "total_commission")
54
	private float totalCommission;
55
 
56
 
57
	public int getProviderId() {
58
		return providerId;
59
	}
60
 
61
	public void setProviderId(int providerId) {
62
		this.providerId = providerId;
63
	}
64
 
65
	public float getOpeningBalance() {
66
		return openingBalance;
67
	}
68
 
69
	public void setOpeningBalance(float openingBalance) {
70
		this.openingBalance = openingBalance;
71
	}
72
 
73
	public float getClosingBalance() {
74
		return closingBalance;
75
	}
76
 
77
	public void setClosingBalance(float closingBalance) {
78
		this.closingBalance = closingBalance;
79
	}
80
 
81
	public float getTotalAmount() {
82
		return totalAmount;
83
	}
84
 
85
	public void setTotalAmount(float totalAmount) {
86
		this.totalAmount = totalAmount;
87
	}
88
 
89
	public float getTotalCommission() {
90
		return totalCommission;
91
	}
92
 
93
	public void setTotalCommission(float totalCommission) {
94
		this.totalCommission = totalCommission;
95
	}
96
 
97
	public LocalDate getCreateDate() {
98
		return createDate;
99
	}
100
 
101
	public void setCreateDate(LocalDate createDate) {
102
		this.createDate = createDate;
103
	}
104
 
105
	public String getFormattedCreateDate(){
106
		if(createDate == null){
107
			return null;
108
		}
24402 amit.gupta 109
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
23627 ashik.ali 110
		return createDate.format(formatter);
111
    }
112
 
113
	@Override
114
	public int hashCode() {
115
		final int prime = 31;
116
		int result = 1;
117
		result = prime * result + ((createDate == null) ? 0 : createDate.hashCode());
118
		result = prime * result + providerId;
119
		return result;
120
	}
121
 
122
	@Override
123
	public boolean equals(Object obj) {
124
		if (this == obj)
125
			return true;
126
		if (obj == null)
127
			return false;
128
		if (getClass() != obj.getClass())
129
			return false;
130
		DailyRecharge other = (DailyRecharge) obj;
131
		if (createDate == null) {
132
			if (other.createDate != null)
133
				return false;
134
		} else if (!createDate.equals(other.createDate))
135
			return false;
136
		if (providerId != other.providerId)
137
			return false;
138
		return true;
139
	}
140
 
141
	@Override
142
	public String toString() {
143
		return "DailyRecharge [providerId=" + providerId + ", createDate=" + createDate + ", openingBalance="
23663 amit.gupta 144
				+ openingBalance + ", walletRechargeAmount=" + walletRechargeAmount + ", totalAmount=" + totalAmount
145
				+ ", closingBalance=" + closingBalance + ", totalCommission=" + totalCommission + "]";
23627 ashik.ali 146
	}
23663 amit.gupta 147
 
148
	public void setWalletRechargeAmount(float walletRechargeAmount) {
149
		// TODO Auto-generated method stub
150
 
151
	}
152
 
153
	public float getWalletRechargeAmount() {
154
		return walletRechargeAmount;
155
	}
23627 ashik.ali 156
 
157
}