Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
23418 ashik.ali 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.GeneratedValue;
11
import javax.persistence.GenerationType;
12
import javax.persistence.Id;
13
import javax.persistence.Table;
23880 ashik.ali 14
import javax.persistence.Transient;
23418 ashik.ali 15
import javax.persistence.UniqueConstraint;
16
 
17
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
18
 
19
@Entity
31860 tejbeer 20
@Table(name="fofo.prebooking_order", uniqueConstraints = {@UniqueConstraint(columnNames = {"catalog_id", "customer_mobile_number"})})
23418 ashik.ali 21
public class PrebookingOrder implements Serializable{
22
 
23
	private static final long serialVersionUID = 1L;
24
 
25
	@Id
26
	@Column(name = "id")
27
	@GeneratedValue(strategy = GenerationType.IDENTITY)
28
	private int id;
29
 
30
	@Column(name = "fofo_id")
31
	private int fofoId;
32
 
33
	@Column(name = "customer_name")
34
	private String customerName;
35
 
36
	@Column(name = "customer_mobile_number")
37
	private String customerMobileNumber;
38
 
39
	@Column(name = "customer_email_id")
40
	private String customerEmailId;
41
 
24085 amit.gupta 42
	@Column(name = "catalog_id")
43
	private int catalogId;
44
 
23418 ashik.ali 45
	@Column(name = "quantity")
46
	private int quantity;
47
 
24085 amit.gupta 48
	public int getCatalogId() {
49
		return catalogId;
50
	}
51
 
52
	public void setCatalogId(int catalogId) {
53
		this.catalogId = catalogId;
54
	}
55
 
23418 ashik.ali 56
	@Column(name = "available_quantity")
57
	private int availableQuantity;
58
 
59
	@Convert(converter = LocalDateTimeAttributeConverter.class)
60
	@Column(name = "complete_timestamp")
61
	private LocalDateTime completeTimestamp = null;
62
 
63
	@Convert(converter = LocalDateTimeAttributeConverter.class)
64
	@Column(name = "create_timestamp")
65
	private LocalDateTime createTimestamp = LocalDateTime.now();
66
 
23580 govind 67
	@Convert(converter = LocalDateTimeAttributeConverter.class)
68
	@Column(name = "notify_timestamp")
69
	private LocalDateTime notifyTimeStamp = null;
70
 
23880 ashik.ali 71
	@Transient
72
	private String description;
73
 
26042 amit.gupta 74
	@Column(name = "advance_paid")
23880 ashik.ali 75
	private float advanceAmount;
35833 amit 76
 
77
	@Column(name = "payment_mode")
78
	private String paymentMode = "WALLET";
79
 
80
	@Column(name = "loan_id")
81
	private Integer loanId;
82
 
23880 ashik.ali 83
	@Transient
84
	private float tentativeAmount;
85
 
23580 govind 86
	public LocalDateTime getNotifyTimeStamp() {
87
		return notifyTimeStamp;
88
	}
89
 
90
	public void setNotifyTimeStamp(LocalDateTime notifyTimeStamp) {
91
		this.notifyTimeStamp = notifyTimeStamp;
92
	}
93
 
23418 ashik.ali 94
	public int getId() {
95
		return id;
96
	}
97
 
98
	public void setId(int id) {
99
		this.id = id;
100
	}
101
 
102
	public int getFofoId() {
103
		return fofoId;
104
	}
105
 
106
	public void setFofoId(int fofoId) {
107
		this.fofoId = fofoId;
108
	}
109
 
110
	public String getCustomerName() {
111
		return customerName;
112
	}
113
 
114
	public void setCustomerName(String customerName) {
115
		this.customerName = customerName;
116
	}
117
 
118
	public String getCustomerMobileNumber() {
119
		return customerMobileNumber;
120
	}
121
 
122
	public void setCustomerMobileNumber(String customerMobileNumber) {
123
		this.customerMobileNumber = customerMobileNumber;
124
	}
125
 
126
	public String getCustomerEmailId() {
127
		return customerEmailId;
128
	}
129
 
130
	public void setCustomerEmailId(String customerEmailId) {
131
		this.customerEmailId = customerEmailId;
132
	}
133
 
134
	public int getQuantity() {
135
		return quantity;
136
	}
137
 
138
	public void setQuantity(int quantity) {
139
		this.quantity = quantity;
140
	}
141
 
142
	public int getAvailableQuantity() {
143
		return availableQuantity;
144
	}
145
 
146
	public void setAvailableQuantity(int availableQuantity) {
147
		this.availableQuantity = availableQuantity;
148
	}
149
 
150
	public LocalDateTime getCompleteTimestamp() {
151
		return completeTimestamp;
152
	}
153
 
154
	public void setCompleteTimestamp(LocalDateTime completeTimestamp) {
155
		this.completeTimestamp = completeTimestamp;
156
	}
157
 
158
	public LocalDateTime getCreateTimestamp() {
159
		return createTimestamp;
160
	}
161
 
162
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
163
		this.createTimestamp = createTimestamp;
164
	}
165
 
166
	public String getFormattedCreateTimestamp(){
167
		if(createTimestamp == null){
168
			return null;
169
		}
24402 amit.gupta 170
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
23418 ashik.ali 171
		return createTimestamp.format(formatter);
172
    }
23880 ashik.ali 173
 
174
	public String getDescription() {
175
		return description;
176
	}
177
	public void setDescription(String description) {
178
		this.description = description;
179
	}
180
 
181
	public float getAdvanceAmount() {
182
		return advanceAmount;
183
	}
184
	public void setAdvanceAmount(float advanceAmount) {
185
		this.advanceAmount = advanceAmount;
186
	}
187
	public float getTentativeAmount() {
188
		return tentativeAmount;
189
	}
190
	public void setTentativeAmount(float tentativeAmount) {
191
		this.tentativeAmount = tentativeAmount;
192
	}
35833 amit 193
	public String getPaymentMode() {
194
		return paymentMode;
195
	}
196
	public void setPaymentMode(String paymentMode) {
197
		this.paymentMode = paymentMode;
198
	}
199
	public Integer getLoanId() {
200
		return loanId;
201
	}
202
	public void setLoanId(Integer loanId) {
203
		this.loanId = loanId;
204
	}
23418 ashik.ali 205
 
206
	@Override
207
	public int hashCode() {
208
		final int prime = 31;
209
		int result = 1;
210
		result = prime * result + id;
211
		return result;
212
	}
213
 
214
	@Override
215
	public boolean equals(Object obj) {
216
		if (this == obj)
217
			return true;
218
		if (obj == null)
219
			return false;
220
		if (getClass() != obj.getClass())
221
			return false;
222
		PrebookingOrder other = (PrebookingOrder) obj;
223
		if (id != other.id)
224
			return false;
225
		return true;
226
	}
227
 
228
	@Override
229
	public String toString() {
230
		return "PrebookingOrder [id=" + id + ", fofoId=" + fofoId + ", customerName=" + customerName
231
				+ ", customerMobileNumber=" + customerMobileNumber + ", customerEmailId=" + customerEmailId
24087 amit.gupta 232
				+ ", catalogId=" + catalogId + ", quantity=" + quantity + ", availableQuantity=" + availableQuantity
233
				+ ", completeTimestamp=" + completeTimestamp + ", createTimestamp=" + createTimestamp
234
				+ ", notifyTimeStamp=" + notifyTimeStamp + ", description=" + description + ", advanceAmount="
235
				+ advanceAmount + ", tentativeAmount=" + tentativeAmount + "]";
23418 ashik.ali 236
	}
237
 
238
}