Subversion Repositories SmartDukaan

Rev

Rev 23638 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
23509 amit.gupta 1
package com.spice.profitmandi.dao.entity.fofo;
2
 
3
import java.io.Serializable;
4
import java.time.LocalDateTime;
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.EnumType;
11
import javax.persistence.Enumerated;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
14
 
15
import com.spice.profitmandi.common.enumuration.PurchaseReturnStatus;
16
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
17
 
18
/**
19
 * This class basically contains api details
20
 * 
21
 * @author ashikali
22
 *
23
 */
24
@Entity
25
@Table(name = "fofo.purchase_return_item", schema = "fofo")
26
 
27
public class PurchaseReturnItem implements Serializable {
28
 
29
	private static final long serialVersionUID = 1L;
30
 
31
	@Id
32
	@Column(name = "inventory_item_id")
33
	private int inventoryItemId;
34
 
35
	@Column(name = "fofo_id")
36
	private int fofoId;
37
 
38
	@Column(name = "status")
39
	@Enumerated(EnumType.STRING)
40
	private PurchaseReturnStatus status = PurchaseReturnStatus.CREATED;
41
 
42
	@Column(name = "debit_note_id")
43
	private int debitNoteId;
44
 
45
	public int getDebitNoteId() {
46
		return debitNoteId;
47
	}
48
 
49
	public void setDebitNoteId(int debitNoteId) {
50
		this.debitNoteId = debitNoteId;
51
	}
52
 
53
	@Convert(converter = LocalDateTimeAttributeConverter.class)
54
	@Column(name = "create_timestamp")
55
	private LocalDateTime createTimestamp = LocalDateTime.now();
56
 
57
	@Convert(converter = LocalDateTimeAttributeConverter.class)
58
	@Column(name = "approve_timestamp")
59
	private LocalDateTime approveTimestamp;
60
 
61
	@Convert(converter = LocalDateTimeAttributeConverter.class)
62
	@Column(name = "deny_timestamp")
63
	private LocalDateTime denyTimestamp;
64
 
65
	@Convert(converter = LocalDateTimeAttributeConverter.class)
66
	@Column(name = "pickup_create_timestamp")
67
	private LocalDateTime pickupCreateTimestamp;
68
 
69
	@Convert(converter = LocalDateTimeAttributeConverter.class)
70
	@Column(name = "scheduled_pickup_timestamp")
71
	private LocalDateTime scheduledPickupTimestamp;
72
 
73
	@Convert(converter = LocalDateTimeAttributeConverter.class)
74
	@Column(name = "return_timestamp")
75
	private LocalDateTime returnTimestamp;
76
 
77
	@Convert(converter = LocalDateTimeAttributeConverter.class)
78
	@Column(name = "refund_timestamp")
79
	private LocalDateTime refundTimestamp;
80
 
81
	@Override
82
	public int hashCode() {
83
		final int prime = 31;
84
		int result = 1;
85
		result = prime * result + inventoryItemId;
86
		return result;
87
	}
88
 
89
	@Override
90
	public boolean equals(Object obj) {
91
		if (this == obj)
92
			return true;
93
		if (obj == null)
94
			return false;
95
		if (getClass() != obj.getClass())
96
			return false;
97
		PurchaseReturnItem other = (PurchaseReturnItem) obj;
98
		if (inventoryItemId != other.inventoryItemId)
99
			return false;
100
		return true;
101
	}
102
 
103
	public LocalDateTime getPickupCreateTimestamp() {
104
		return pickupCreateTimestamp;
105
	}
106
 
107
	public void setPickupCreateTimestamp(LocalDateTime pickupCreateTimestamp) {
108
		this.pickupCreateTimestamp = pickupCreateTimestamp;
109
	}
110
 
111
	public LocalDateTime getScheduledPickupTimestamp() {
112
		return scheduledPickupTimestamp;
113
	}
114
 
115
	public void setScheduledPickupTimestamp(LocalDateTime scheduledPickupTimestamp) {
116
		this.scheduledPickupTimestamp = scheduledPickupTimestamp;
117
	}
118
 
119
	public LocalDateTime getReturnTimestamp() {
120
		return returnTimestamp;
121
	}
122
 
123
	public void setReturnTimestamp(LocalDateTime returnTimestamp) {
124
		this.returnTimestamp = returnTimestamp;
125
	}
126
 
127
	public LocalDateTime getRefundTimestamp() {
128
		return refundTimestamp;
129
	}
130
 
131
	public void setRefundTimestamp(LocalDateTime refundTimestamp) {
132
		this.refundTimestamp = refundTimestamp;
133
	}
134
 
135
	public int getInventoryItemId() {
136
		return inventoryItemId;
137
	}
138
 
139
	public void setInventoryItemId(int inventoryItemId) {
140
		this.inventoryItemId = inventoryItemId;
141
	}
142
 
143
	public int getFofoId() {
144
		return fofoId;
145
	}
146
 
147
	public void setFofoId(int fofoId) {
148
		this.fofoId = fofoId;
149
	}
150
 
151
	public PurchaseReturnStatus getStatus() {
152
		return status;
153
	}
154
 
155
	public void setStatus(PurchaseReturnStatus status) {
156
		this.status = status;
157
	}
158
 
159
	public LocalDateTime getCreateTimestamp() {
160
		return createTimestamp;
161
	}
162
 
163
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
164
		this.createTimestamp = createTimestamp;
165
	}
166
 
167
	public String getFormattedCreateTimestamp() {
168
		if (createTimestamp == null) {
169
			return null;
170
		}
171
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
172
		return createTimestamp.format(formatter);
173
	}
174
 
175
	public String getFormattedApproveTimestamp() {
176
		if (approveTimestamp == null) {
177
			return null;
178
		}
179
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-YYYY HH:mm");
180
		return approveTimestamp.format(formatter);
181
	}
182
 
183
	public LocalDateTime getApproveTimestamp() {
184
		return approveTimestamp;
185
	}
186
 
187
	public void setApproveTimestamp(LocalDateTime approvedTimestamp) {
188
		this.approveTimestamp = approvedTimestamp;
189
	}
190
 
191
	public LocalDateTime getDenyTimestamp() {
192
		return denyTimestamp;
193
	}
194
 
195
	public void setDenyTimestamp(LocalDateTime denyTimestamp) {
196
		this.denyTimestamp = denyTimestamp;
197
	}
198
}