Subversion Repositories SmartDukaan

Rev

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