Subversion Repositories SmartDukaan

Rev

Rev 23874 | Rev 23968 | 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;
14
 
15
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
16
 
17
/**
23819 govind 18
 * This class basically contains details
23110 ashik.ali 19
 * 
20
 * @author ashikali
21
 *
22
 */
23
@Entity
23819 govind 24
@Table(name = "transaction.price_drop", schema = "transaction")
25
public class PriceDrop implements Serializable {
26
 
23110 ashik.ali 27
	private static final long serialVersionUID = 1L;
23819 govind 28
 
23110 ashik.ali 29
	public PriceDrop() {
30
	}
23819 govind 31
 
23110 ashik.ali 32
	@Id
23819 govind 33
	@Column(name = "id")
23110 ashik.ali 34
	@GeneratedValue(strategy = GenerationType.IDENTITY)
35
	private int id;
23819 govind 36
 
23951 amit.gupta 37
	@Column(name = "catalog_id")
38
	private int catalogItemId;
23819 govind 39
 
23110 ashik.ali 40
	@Column(name = "amount")
41
	private float amount;
23819 govind 42
 
43
	@Column(name = "credit_note_number")
44
	private String creditNoteNumber;
45
 
23110 ashik.ali 46
	@Convert(converter = LocalDateTimeAttributeConverter.class)
47
	@Column(name = "process_timestamp")
23874 amit.gupta 48
	private LocalDateTime processTimestamp;
23819 govind 49
 
23823 amit.gupta 50
 
51
	@Column(name = "price_drop_in")
52
	private float priceDropIn;
53
 
54
	@Column(name = "partner_payout")
55
	private float partnerPayout;
23819 govind 56
 
57
	@Convert(converter = LocalDateTimeAttributeConverter.class)
58
	@Column(name = "created_on")
59
	private LocalDateTime createdOn = LocalDateTime.now();
60
 
61
	@Convert(converter = LocalDateTimeAttributeConverter.class)
62
	@Column(name = "affected_on")
23874 amit.gupta 63
	private LocalDateTime affectedOn = LocalDateTime.now();
23819 govind 64
 
65
	@Convert(converter = LocalDateTimeAttributeConverter.class)
66
	@Column(name = "credit_note_date")
23874 amit.gupta 67
	private LocalDateTime creditNoteDate;
23819 govind 68
 
23110 ashik.ali 69
	public int getId() {
70
		return id;
71
	}
23819 govind 72
 
23110 ashik.ali 73
	public void setId(int id) {
74
		this.id = id;
75
	}
23823 amit.gupta 76
 
77
 
78
 
23819 govind 79
 
23823 amit.gupta 80
	public float getPriceDropIn() {
81
		return priceDropIn;
82
	}
83
 
84
	public void setPriceDropIn(float priceDropIn) {
85
		this.priceDropIn = priceDropIn;
86
	}
87
 
23951 amit.gupta 88
	public int getCatalogItemId() {
89
		return catalogItemId;
23110 ashik.ali 90
	}
23819 govind 91
 
23951 amit.gupta 92
	public void setCatalogItemId(int catalogItemId) {
93
		this.catalogItemId = catalogItemId;
23110 ashik.ali 94
	}
23819 govind 95
 
23951 amit.gupta 96
	@Override
97
	public String toString() {
98
		return "PriceDrop [id=" + id + ", catalogItemId=" + catalogItemId + ", amount=" + amount + ", creditNoteNumber="
99
				+ creditNoteNumber + ", processTimestamp=" + processTimestamp + ", priceDropIn=" + priceDropIn
100
				+ ", partnerPayout=" + partnerPayout + ", createdOn=" + createdOn + ", affectedOn=" + affectedOn
101
				+ ", creditNoteDate=" + creditNoteDate + "]";
102
	}
103
 
23110 ashik.ali 104
	public float getAmount() {
105
		return amount;
106
	}
23819 govind 107
 
23110 ashik.ali 108
	public void setAmount(float amount) {
109
		this.amount = amount;
110
	}
23819 govind 111
 
23110 ashik.ali 112
	public LocalDateTime getProcessTimestamp() {
113
		return processTimestamp;
114
	}
23819 govind 115
 
23110 ashik.ali 116
	public void setProcessTimestamp(LocalDateTime processTimestamp) {
117
		this.processTimestamp = processTimestamp;
118
	}
23819 govind 119
 
120
	public String getCreditNoteNumber() {
121
		return creditNoteNumber;
122
	}
123
 
124
	public void setCreditNoteNumber(String creditNoteNumber) {
125
		this.creditNoteNumber = creditNoteNumber;
126
	}
127
 
128
	public LocalDateTime getCreatedOn() {
129
		return createdOn;
130
	}
131
 
132
	public void setCreatedOn(LocalDateTime createdOn) {
133
		this.createdOn = createdOn;
134
	}
135
 
23110 ashik.ali 136
 
23819 govind 137
 
23874 amit.gupta 138
	public LocalDateTime getAffectedOn() {
139
		return affectedOn;
23819 govind 140
	}
141
 
23874 amit.gupta 142
	public void setAffectedOn(LocalDateTime affectedOn) {
143
		this.affectedOn = affectedOn;
23819 govind 144
	}
145
 
146
	public LocalDateTime getCreditNoteDate() {
147
		return creditNoteDate;
148
	}
149
 
150
	public void setCreditNoteDate(LocalDateTime creditNoteDate) {
151
		this.creditNoteDate = creditNoteDate;
152
	}
153
 
23823 amit.gupta 154
	public float getPartnerPayout() {
155
		return partnerPayout;
23819 govind 156
	}
157
 
23823 amit.gupta 158
	public void setPartnerPayout(float partnerPayout) {
159
		this.partnerPayout = partnerPayout;
23819 govind 160
	}
161
 
162
	public String getDate(LocalDateTime ldt) {
163
		DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd");
164
		String s = dtf.format(ldt);
165
		return s;
166
	}
167
 
23110 ashik.ali 168
	@Override
169
	public int hashCode() {
170
		final int prime = 31;
171
		int result = 1;
172
		result = prime * result + id;
173
		return result;
174
	}
23819 govind 175
 
23110 ashik.ali 176
	@Override
177
	public boolean equals(Object obj) {
178
		if (this == obj)
179
			return true;
180
		if (obj == null)
181
			return false;
182
		if (getClass() != obj.getClass())
183
			return false;
184
		PriceDrop other = (PriceDrop) obj;
185
		if (id != other.id)
186
			return false;
187
		return true;
188
	}
23819 govind 189
 
23110 ashik.ali 190
}