Subversion Repositories SmartDukaan

Rev

Rev 23823 | Rev 23951 | 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
 
23110 ashik.ali 37
	@Column(name = "item_id")
38
	private int itemId;
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
 
23110 ashik.ali 88
	public int getItemId() {
89
		return itemId;
90
	}
23819 govind 91
 
23110 ashik.ali 92
	public void setItemId(int itemId) {
93
		this.itemId = itemId;
94
	}
23819 govind 95
 
23110 ashik.ali 96
	public float getAmount() {
97
		return amount;
98
	}
23819 govind 99
 
23110 ashik.ali 100
	public void setAmount(float amount) {
101
		this.amount = amount;
102
	}
23819 govind 103
 
23110 ashik.ali 104
	public LocalDateTime getProcessTimestamp() {
105
		return processTimestamp;
106
	}
23819 govind 107
 
23110 ashik.ali 108
	public void setProcessTimestamp(LocalDateTime processTimestamp) {
109
		this.processTimestamp = processTimestamp;
110
	}
23819 govind 111
 
112
	public String getCreditNoteNumber() {
113
		return creditNoteNumber;
114
	}
115
 
116
	public void setCreditNoteNumber(String creditNoteNumber) {
117
		this.creditNoteNumber = creditNoteNumber;
118
	}
119
 
120
	public LocalDateTime getCreatedOn() {
121
		return createdOn;
122
	}
123
 
124
	public void setCreatedOn(LocalDateTime createdOn) {
125
		this.createdOn = createdOn;
126
	}
127
 
23110 ashik.ali 128
 
23819 govind 129
 
23874 amit.gupta 130
	public LocalDateTime getAffectedOn() {
131
		return affectedOn;
23819 govind 132
	}
133
 
23874 amit.gupta 134
	public void setAffectedOn(LocalDateTime affectedOn) {
135
		this.affectedOn = affectedOn;
23819 govind 136
	}
137
 
138
	public LocalDateTime getCreditNoteDate() {
139
		return creditNoteDate;
140
	}
141
 
142
	public void setCreditNoteDate(LocalDateTime creditNoteDate) {
143
		this.creditNoteDate = creditNoteDate;
144
	}
145
 
23823 amit.gupta 146
	public float getPartnerPayout() {
147
		return partnerPayout;
23819 govind 148
	}
149
 
23823 amit.gupta 150
	public void setPartnerPayout(float partnerPayout) {
151
		this.partnerPayout = partnerPayout;
23819 govind 152
	}
153
 
154
	public String getDate(LocalDateTime ldt) {
155
		DateTimeFormatter dtf = DateTimeFormatter.ofPattern("yyyy/MM/dd");
156
		String s = dtf.format(ldt);
157
		return s;
158
	}
159
 
23110 ashik.ali 160
	@Override
161
	public int hashCode() {
162
		final int prime = 31;
163
		int result = 1;
164
		result = prime * result + id;
165
		return result;
166
	}
23819 govind 167
 
23110 ashik.ali 168
	@Override
169
	public boolean equals(Object obj) {
170
		if (this == obj)
171
			return true;
172
		if (obj == null)
173
			return false;
174
		if (getClass() != obj.getClass())
175
			return false;
176
		PriceDrop other = (PriceDrop) obj;
177
		if (id != other.id)
178
			return false;
179
		return true;
180
	}
23819 govind 181
 
23110 ashik.ali 182
	@Override
183
	public String toString() {
23819 govind 184
		return "PriceDrop [id=" + id + ", itemId=" + itemId + ", amount=" + amount + ", creditNoteNumber="
23823 amit.gupta 185
				+ creditNoteNumber + ", processTimestamp=" + processTimestamp + ", priceDropIn=" + priceDropIn
23874 amit.gupta 186
				+ ", partnerPayout=" + partnerPayout + ", createdOn=" + createdOn + ", affectedon=" + affectedOn
23823 amit.gupta 187
				+ ", creditNoteDate=" + creditNoteDate + "]";
23110 ashik.ali 188
	}
23819 govind 189
 
23110 ashik.ali 190
}