Subversion Repositories SmartDukaan

Rev

Rev 32556 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 32556 Rev 36376
Line 3... Line 3...
3
import in.shop2020.model.v1.user.CartStatus;
3
import in.shop2020.model.v1.user.CartStatus;
4
import org.hibernate.annotations.UpdateTimestamp;
4
import org.hibernate.annotations.UpdateTimestamp;
5
 
5
 
6
import javax.persistence.*;
6
import javax.persistence.*;
7
import java.time.LocalDateTime;
7
import java.time.LocalDateTime;
-
 
8
import com.spice.profitmandi.dao.cart.v2.CartLifecycleStatus;
-
 
9
import com.spice.profitmandi.dao.cart.v2.SaleType;
8
 
10
 
9
/**
11
/**
10
 * This class basically contains cart details
12
 * This class basically contains cart details
11
 * 
13
 * 
12
 * @author ashikali
14
 * @author ashikali
Line 41... Line 43...
41
	private LocalDateTime createTimestamp = LocalDateTime.now();
43
	private LocalDateTime createTimestamp = LocalDateTime.now();
42
	
44
	
43
	@Column(name="updated_on")
45
	@Column(name="updated_on")
44
	@UpdateTimestamp
46
	@UpdateTimestamp
45
	private LocalDateTime updateTimestamp = LocalDateTime.now();
47
	private LocalDateTime updateTimestamp = LocalDateTime.now();
-
 
48
 
-
 
49
	@Version
-
 
50
	@Column(name = "version")
-
 
51
	private Long version = 0L;
46
	
52
 
-
 
53
	@Enumerated(EnumType.STRING)
-
 
54
	@Column(name = "lifecycle_status")
-
 
55
	private CartLifecycleStatus lifecycleStatus = CartLifecycleStatus.ACTIVE;
-
 
56
 
-
 
57
	@Column(name = "last_activity_at")
-
 
58
	private LocalDateTime lastActivityAt = LocalDateTime.now();
-
 
59
 
-
 
60
	@Enumerated(EnumType.STRING)
-
 
61
	@Column(name = "sale_type")
-
 
62
	private SaleType saleType = SaleType.PARTNER_PROCUREMENT;
-
 
63
 
-
 
64
	/** Populated for TERTIARY_SALE drafts; null for procurement carts. */
-
 
65
	@Column(name = "customer_id")
-
 
66
	private Integer customerId;
-
 
67
 
-
 
68
	/**
-
 
69
	 * Denormalised retailer/fofo-store id so we can list a partner's
-
 
70
	 * tertiary drafts with a single indexed query. Procurement carts keep
-
 
71
	 * this in sync too.
-
 
72
	 */
-
 
73
	@Column(name = "retailer_id")
-
 
74
	private int retailerId;
-
 
75
 
47
 
76
 
48
	public int getId() {
77
	public int getId() {
49
		return id;
78
		return id;
50
	}
79
	}
51
 
80
 
Line 109... Line 138...
109
 
138
 
110
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
139
	public void setUpdateTimestamp(LocalDateTime updateTimestamp) {
111
		this.updateTimestamp = updateTimestamp;
140
		this.updateTimestamp = updateTimestamp;
112
	}
141
	}
113
 
142
 
-
 
143
	public Long getVersion() { return version; }
-
 
144
	public void setVersion(Long version) { this.version = version; }
-
 
145
 
-
 
146
	public CartLifecycleStatus getLifecycleStatus() { return lifecycleStatus; }
-
 
147
	public void setLifecycleStatus(CartLifecycleStatus lifecycleStatus) { this.lifecycleStatus = lifecycleStatus; }
-
 
148
 
-
 
149
	public LocalDateTime getLastActivityAt() { return lastActivityAt; }
-
 
150
	public void setLastActivityAt(LocalDateTime lastActivityAt) { this.lastActivityAt = lastActivityAt; }
-
 
151
 
-
 
152
	public SaleType getSaleType() { return saleType; }
-
 
153
	public void setSaleType(SaleType saleType) { this.saleType = saleType; }
-
 
154
 
-
 
155
	public Integer getCustomerId() { return customerId; }
-
 
156
	public void setCustomerId(Integer customerId) { this.customerId = customerId; }
-
 
157
 
-
 
158
	public int getRetailerId() { return retailerId; }
-
 
159
	public void setRetailerId(int retailerId) { this.retailerId = retailerId; }
-
 
160
 
114
	@Override
161
	@Override
115
	public int hashCode() {
162
	public int hashCode() {
116
		final int prime = 31;
163
		final int prime = 31;
117
		int result = 1;
164
		int result = 1;
118
		result = prime * result + id;
165
		result = prime * result + id;