Subversion Repositories SmartDukaan

Rev

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