Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
21714 ashik.ali 1
package com.spice.profitmandi.dao.entity.fofo;
21596 ashik.ali 2
 
3
import java.io.Serializable;
25726 amit.gupta 4
import java.time.LocalDate;
21596 ashik.ali 5
import java.time.LocalDateTime;
22243 ashik.ali 6
import java.time.format.DateTimeFormatter;
21596 ashik.ali 7
 
8
import javax.persistence.Column;
22009 ashik.ali 9
import javax.persistence.Convert;
21596 ashik.ali 10
import javax.persistence.Entity;
11
import javax.persistence.GeneratedValue;
12
import javax.persistence.GenerationType;
13
import javax.persistence.Id;
14
import javax.persistence.Table;
25083 amit.gupta 15
import javax.persistence.Transient;
21596 ashik.ali 16
 
22009 ashik.ali 17
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
18
 
21596 ashik.ali 19
@Entity
20
@Table(name="fofo.fofo_order", schema = "fofo")
21
public class FofoOrder 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_id")
34
	private int customerId;
35
 
21710 ashik.ali 36
	@Column(name = "customer_address_id")
37
	private int customerAddressId;
38
 
23369 ashik.ali 39
	@Column(name = "customer_gst_number")
40
	private String customerGstNumber;
41
 
21596 ashik.ali 42
	@Column(name = "total_amount")
43
	private float totalAmount;
44
 
21609 ashik.ali 45
	@Column(name = "invoice_number", length = 50)
21596 ashik.ali 46
	private String invoiceNumber;
47
 
22859 ashik.ali 48
	@Column(name = "cashback")
49
	private float cashback;
50
 
22009 ashik.ali 51
	@Convert(converter = LocalDateTimeAttributeConverter.class)
21596 ashik.ali 52
	@Column(name = "create_timestamp")
23202 ashik.ali 53
	private LocalDateTime createTimestamp = LocalDateTime.now();	
21596 ashik.ali 54
 
24264 amit.gupta 55
	@Convert(converter = LocalDateTimeAttributeConverter.class)
56
	@Column(name = "cancelled_timestamp")
57
	private LocalDateTime cancelledTimestamp;	
58
 
25083 amit.gupta 59
 
60
	@Transient
61
	private FofoOrderItem orderItem;
62
 
25726 amit.gupta 63
 
64
	@Transient
65
	private LocalDate dateOfBirth;
66
 
67
	public LocalDate getDateOfBirth() {
68
		return dateOfBirth;
69
	}
70
	public void setDateOfBirth(LocalDate dateOfBirth) {
71
		this.dateOfBirth = dateOfBirth;
72
	}
25083 amit.gupta 73
	public FofoOrderItem getOrderItem() {
74
		return orderItem;
75
	}
76
	public void setOrderItem(FofoOrderItem orderItem) {
77
		this.orderItem = orderItem;
78
	}
24264 amit.gupta 79
	public LocalDateTime getCancelledTimestamp() {
80
		return cancelledTimestamp;
81
	}
82
	public void setCancelledTimestamp(LocalDateTime cancelledTimestamp) {
83
		this.cancelledTimestamp = cancelledTimestamp;
84
	}
21984 kshitij.so 85
	public int getId() {
86
		return id;
87
	}
88
	public void setId(int id) {
89
		this.id = id;
90
	}
91
	public int getFofoId() {
92
		return fofoId;
93
	}
94
	public void setFofoId(int fofoId) {
95
		this.fofoId = fofoId;
96
	}
97
	public int getCustomerId() {
98
		return customerId;
99
	}
100
	public void setCustomerId(int customerId) {
101
		this.customerId = customerId;
102
	}
103
	public int getCustomerAddressId() {
104
		return customerAddressId;
105
	}
106
	public void setCustomerAddressId(int customerAddressId) {
107
		this.customerAddressId = customerAddressId;
108
	}
23369 ashik.ali 109
	public String getCustomerGstNumber() {
110
		return customerGstNumber;
111
	}
112
	public void setCustomerGstNumber(String customerGstNumber) {
113
		this.customerGstNumber = customerGstNumber;
114
	}
21984 kshitij.so 115
	public float getTotalAmount() {
116
		return totalAmount;
117
	}
118
	public void setTotalAmount(float totalAmount) {
119
		this.totalAmount = totalAmount;
120
	}
121
	public String getInvoiceNumber() {
122
		return invoiceNumber;
123
	}
124
	public void setInvoiceNumber(String invoiceNumber) {
125
		this.invoiceNumber = invoiceNumber;
126
	}
22859 ashik.ali 127
	public float getCashback() {
128
		return cashback;
129
	}
130
	public void setCashback(float cashback) {
131
		this.cashback = cashback;
132
	}
21984 kshitij.so 133
	public LocalDateTime getCreateTimestamp() {
134
		return createTimestamp;
135
	}
136
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
137
		this.createTimestamp = createTimestamp;
138
	}
22009 ashik.ali 139
 
22243 ashik.ali 140
	public String getFormattedDate(){
24402 amit.gupta 141
    	DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
22243 ashik.ali 142
		return this.createTimestamp.format(formatter);
143
    }
22009 ashik.ali 144
 
21924 ashik.ali 145
	@Override
22009 ashik.ali 146
	public int hashCode() {
147
		final int prime = 31;
148
		int result = 1;
149
		result = prime * result + id;
150
		return result;
151
	}
22859 ashik.ali 152
 
22009 ashik.ali 153
	@Override
154
	public boolean equals(Object obj) {
155
		if (this == obj)
156
			return true;
157
		if (obj == null)
158
			return false;
159
		if (getClass() != obj.getClass())
160
			return false;
161
		FofoOrder other = (FofoOrder) obj;
162
		if (id != other.id)
163
			return false;
164
		return true;
165
	}
22859 ashik.ali 166
 
22009 ashik.ali 167
	@Override
21602 ashik.ali 168
	public String toString() {
21710 ashik.ali 169
		return "FofoOrder [id=" + id + ", fofoId=" + fofoId + ", customerId=" + customerId + ", customerAddressId="
23369 ashik.ali 170
				+ customerAddressId + ", customerGstNumber=" + customerGstNumber + ", totalAmount=" + totalAmount
171
				+ ", invoiceNumber=" + invoiceNumber + ", cashback=" + cashback + ", createTimestamp=" + createTimestamp
25726 amit.gupta 172
				+ ", cancelledTimestamp=" + cancelledTimestamp + ", orderItem=" + orderItem + ", dateOfBirth="
173
				+ dateOfBirth + "]";
21602 ashik.ali 174
	}
175
 
21596 ashik.ali 176
}