Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
23110 ashik.ali 1
package com.spice.profitmandi.dao.entity.transaction;
2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
23819 govind 5
import java.time.format.DateTimeFormatter;
23110 ashik.ali 6
 
7
import javax.persistence.Column;
8
import javax.persistence.Convert;
9
import javax.persistence.Entity;
10
import javax.persistence.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
23968 amit.gupta 14
import javax.persistence.Transient;
23110 ashik.ali 15
 
16
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
17
 
18
/**
23819 govind 19
 * This class basically contains details
23110 ashik.ali 20
 * 
21
 * @author ashikali
22
 *
23
 */
23968 amit.gupta 24
/**
25
 * @author amit
26
 *
27
 */
23110 ashik.ali 28
@Entity
23819 govind 29
@Table(name = "transaction.price_drop", schema = "transaction")
30
public class PriceDrop implements Serializable {
31
 
23110 ashik.ali 32
	private static final long serialVersionUID = 1L;
23819 govind 33
 
23110 ashik.ali 34
	public PriceDrop() {
35
	}
23819 govind 36
 
23110 ashik.ali 37
	@Id
23819 govind 38
	@Column(name = "id")
23110 ashik.ali 39
	@GeneratedValue(strategy = GenerationType.IDENTITY)
40
	private int id;
23819 govind 41
 
23951 amit.gupta 42
	@Column(name = "catalog_id")
43
	private int catalogItemId;
23968 amit.gupta 44
 
45
	@Transient
46
	private String description;
23819 govind 47
 
23968 amit.gupta 48
	public String getDescription() {
49
		return description;
50
	}
51
 
52
	public void setDescription(String description) {
53
		this.description = description;
54
	}
55
 
23110 ashik.ali 56
	@Column(name = "amount")
57
	private float amount;
23968 amit.gupta 58
 
59
	@Column(name="new_dp")
60
	private float newDp;
61
 
62
	@Column(name="old_dp")
63
	private float oldDp;
64
 
65
	@Column(name="tp")
66
	private float tp;
67
 
68
	@Column(name="nlc")
69
	private float nlc;
23819 govind 70
 
23968 amit.gupta 71
 
72
	public float getNewDp() {
73
		return newDp;
74
	}
75
 
76
	public void setNewDp(float newDp) {
77
		this.newDp = newDp;
78
	}
79
 
80
	public float getOldDp() {
81
		return oldDp;
82
	}
83
 
84
	public void setOldDp(float oldDp) {
85
		this.oldDp = oldDp;
86
	}
87
 
88
	public float getTp() {
89
		return tp;
90
	}
91
 
92
	public void setTp(float tp) {
93
		this.tp = tp;
94
	}
95
 
96
	public float getNlc() {
97
		return nlc;
98
	}
99
 
100
	public void setNlc(float nlc) {
101
		this.nlc = nlc;
102
	}
103
 
23819 govind 104
	@Column(name = "credit_note_number")
105
	private String creditNoteNumber;
106
 
23110 ashik.ali 107
	@Convert(converter = LocalDateTimeAttributeConverter.class)
108
	@Column(name = "process_timestamp")
23874 amit.gupta 109
	private LocalDateTime processTimestamp;
23819 govind 110
 
23823 amit.gupta 111
 
112
	@Column(name = "price_drop_in")
113
	private float priceDropIn;
114
 
115
	@Column(name = "partner_payout")
116
	private float partnerPayout;
23819 govind 117
 
118
	@Convert(converter = LocalDateTimeAttributeConverter.class)
119
	@Column(name = "created_on")
120
	private LocalDateTime createdOn = LocalDateTime.now();
121
 
122
	@Convert(converter = LocalDateTimeAttributeConverter.class)
123
	@Column(name = "affected_on")
23874 amit.gupta 124
	private LocalDateTime affectedOn = LocalDateTime.now();
23819 govind 125
 
126
	@Convert(converter = LocalDateTimeAttributeConverter.class)
127
	@Column(name = "credit_note_date")
23874 amit.gupta 128
	private LocalDateTime creditNoteDate;
23819 govind 129
 
23110 ashik.ali 130
	public int getId() {
131
		return id;
132
	}
23819 govind 133
 
23110 ashik.ali 134
	public void setId(int id) {
135
		this.id = id;
136
	}
23823 amit.gupta 137
 
138
 
139
 
23819 govind 140
 
23823 amit.gupta 141
	public float getPriceDropIn() {
142
		return priceDropIn;
143
	}
144
 
145
	public void setPriceDropIn(float priceDropIn) {
146
		this.priceDropIn = priceDropIn;
147
	}
148
 
23951 amit.gupta 149
	public int getCatalogItemId() {
150
		return catalogItemId;
23110 ashik.ali 151
	}
23819 govind 152
 
23951 amit.gupta 153
	public void setCatalogItemId(int catalogItemId) {
154
		this.catalogItemId = catalogItemId;
23110 ashik.ali 155
	}
23819 govind 156
 
23951 amit.gupta 157
	@Override
158
	public String toString() {
23968 amit.gupta 159
		return "PriceDrop [id=" + id + ", catalogItemId=" + catalogItemId + ", description=" + description + ", amount="
160
				+ amount + ", newDp=" + newDp + ", oldDp=" + oldDp + ", tp=" + tp + ", nlc=" + nlc
161
				+ ", creditNoteNumber=" + creditNoteNumber + ", processTimestamp=" + processTimestamp + ", priceDropIn="
162
				+ priceDropIn + ", partnerPayout=" + partnerPayout + ", createdOn=" + createdOn + ", affectedOn="
163
				+ affectedOn + ", creditNoteDate=" + creditNoteDate + "]";
23951 amit.gupta 164
	}
165
 
23110 ashik.ali 166
	public float getAmount() {
167
		return amount;
168
	}
23819 govind 169
 
23110 ashik.ali 170
	public void setAmount(float amount) {
171
		this.amount = amount;
172
	}
23819 govind 173
 
23110 ashik.ali 174
	public LocalDateTime getProcessTimestamp() {
175
		return processTimestamp;
176
	}
23819 govind 177
 
23110 ashik.ali 178
	public void setProcessTimestamp(LocalDateTime processTimestamp) {
179
		this.processTimestamp = processTimestamp;
180
	}
23819 govind 181
 
182
	public String getCreditNoteNumber() {
183
		return creditNoteNumber;
184
	}
185
 
186
	public void setCreditNoteNumber(String creditNoteNumber) {
187
		this.creditNoteNumber = creditNoteNumber;
188
	}
189
 
190
	public LocalDateTime getCreatedOn() {
191
		return createdOn;
192
	}
193
 
194
	public void setCreatedOn(LocalDateTime createdOn) {
195
		this.createdOn = createdOn;
196
	}
197
 
23110 ashik.ali 198
 
23819 govind 199
 
23874 amit.gupta 200
	public LocalDateTime getAffectedOn() {
201
		return affectedOn;
23819 govind 202
	}
203
 
23874 amit.gupta 204
	public void setAffectedOn(LocalDateTime affectedOn) {
205
		this.affectedOn = affectedOn;
23819 govind 206
	}
207
 
208
	public LocalDateTime getCreditNoteDate() {
209
		return creditNoteDate;
210
	}
211
 
212
	public void setCreditNoteDate(LocalDateTime creditNoteDate) {
213
		this.creditNoteDate = creditNoteDate;
214
	}
215
 
23823 amit.gupta 216
	public float getPartnerPayout() {
217
		return partnerPayout;
23819 govind 218
	}
219
 
23823 amit.gupta 220
	public void setPartnerPayout(float partnerPayout) {
221
		this.partnerPayout = partnerPayout;
23819 govind 222
	}
223
 
224
	public String getDate(LocalDateTime ldt) {
225
		DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd");
226
		String s = dtf.format(ldt);
227
		return s;
228
	}
229
 
23110 ashik.ali 230
	@Override
231
	public int hashCode() {
232
		final int prime = 31;
233
		int result = 1;
234
		result = prime * result + id;
235
		return result;
236
	}
23819 govind 237
 
23110 ashik.ali 238
	@Override
239
	public boolean equals(Object obj) {
240
		if (this == obj)
241
			return true;
242
		if (obj == null)
243
			return false;
244
		if (getClass() != obj.getClass())
245
			return false;
246
		PriceDrop other = (PriceDrop) obj;
247
		if (id != other.id)
248
			return false;
249
		return true;
250
	}
23819 govind 251
 
23110 ashik.ali 252
}