| 26588 |
tejbeer |
1 |
package com.spice.profitmandi.dao.model;
|
|
|
2 |
|
|
|
3 |
import java.time.LocalDateTime;
|
| 27878 |
amit.gupta |
4 |
import java.util.ArrayList;
|
| 26588 |
tejbeer |
5 |
import java.util.List;
|
| 27878 |
amit.gupta |
6 |
import java.util.stream.IntStream;
|
| 26588 |
tejbeer |
7 |
|
| 27878 |
amit.gupta |
8 |
import com.spice.profitmandi.dao.enumuration.catalog.OfferSchemeType;
|
| 27918 |
amit.gupta |
9 |
import com.spice.profitmandi.dao.enumuration.catalog.AchievementType;
|
| 27878 |
amit.gupta |
10 |
import com.spice.profitmandi.service.offers.ItemCriteria;
|
|
|
11 |
import com.spice.profitmandi.service.offers.PartnerCriteria;
|
| 26588 |
tejbeer |
12 |
|
|
|
13 |
public class CreateOfferRequest {
|
| 27360 |
tejbeer |
14 |
private int id;
|
| 27878 |
amit.gupta |
15 |
private boolean active;
|
| 26588 |
tejbeer |
16 |
private String name;
|
|
|
17 |
private LocalDateTime startDate;
|
|
|
18 |
private LocalDateTime endDate;
|
| 27878 |
amit.gupta |
19 |
private String offerNotes;
|
|
|
20 |
private String terms;
|
| 27918 |
amit.gupta |
21 |
private AchievementType targetType;
|
|
|
22 |
private AchievementType payoutType;
|
| 27878 |
amit.gupta |
23 |
private String activationBrands;
|
|
|
24 |
private OfferSchemeType schemeType;
|
|
|
25 |
private double sellinPercentage;
|
|
|
26 |
private double brandShareTerms;
|
|
|
27 |
private ItemCriteria itemCriteria;
|
|
|
28 |
private String itemCriteriaString;
|
|
|
29 |
private LocalDateTime createdOn;
|
|
|
30 |
private List<TargetSlab> targetSlabs;
|
|
|
31 |
private PartnerCriteria partnerCriteria;
|
|
|
32 |
private String partnerCriteriaString;
|
|
|
33 |
|
|
|
34 |
public int getEligibleSale() {
|
|
|
35 |
return eligibleSale;
|
| 26694 |
tejbeer |
36 |
}
|
| 27878 |
amit.gupta |
37 |
public void setEligibleSale(int eligibleSale) {
|
|
|
38 |
this.eligibleSale = eligibleSale;
|
| 27353 |
tejbeer |
39 |
}
|
|
|
40 |
|
| 27878 |
amit.gupta |
41 |
private int eligibleSale;
|
|
|
42 |
private TargetSlab nextTargetSlab;
|
|
|
43 |
private TargetSlab currentTargetSlab;
|
|
|
44 |
|
|
|
45 |
|
| 27353 |
tejbeer |
46 |
|
| 27878 |
amit.gupta |
47 |
public TargetSlab getNextTargetSlab() {
|
|
|
48 |
return nextTargetSlab;
|
| 27353 |
tejbeer |
49 |
}
|
| 27878 |
amit.gupta |
50 |
public void setNextTargetSlab(TargetSlab nextTargetSlab) {
|
|
|
51 |
this.nextTargetSlab = nextTargetSlab;
|
| 26694 |
tejbeer |
52 |
}
|
| 27878 |
amit.gupta |
53 |
public TargetSlab getCurrentTargetSlab() {
|
|
|
54 |
return currentTargetSlab;
|
| 26694 |
tejbeer |
55 |
}
|
| 27878 |
amit.gupta |
56 |
public void setCurrentTargetSlab(TargetSlab currentTargetSlab) {
|
|
|
57 |
this.currentTargetSlab = currentTargetSlab;
|
| 26694 |
tejbeer |
58 |
}
|
|
|
59 |
|
| 27878 |
amit.gupta |
60 |
public boolean isActive() {
|
|
|
61 |
return active;
|
| 26694 |
tejbeer |
62 |
}
|
|
|
63 |
|
| 27878 |
amit.gupta |
64 |
public void setActive(boolean active) {
|
|
|
65 |
this.active = active;
|
| 26694 |
tejbeer |
66 |
}
|
|
|
67 |
|
| 27878 |
amit.gupta |
68 |
public LocalDateTime getCreatedOn() {
|
|
|
69 |
return createdOn;
|
| 26694 |
tejbeer |
70 |
}
|
| 27878 |
amit.gupta |
71 |
|
|
|
72 |
|
| 27918 |
amit.gupta |
73 |
|
|
|
74 |
|
| 26694 |
tejbeer |
75 |
|
| 27918 |
amit.gupta |
76 |
public AchievementType getPayoutType() {
|
|
|
77 |
return payoutType;
|
|
|
78 |
}
|
|
|
79 |
public void setPayoutType(AchievementType payoutType) {
|
|
|
80 |
this.payoutType = payoutType;
|
|
|
81 |
}
|
| 27878 |
amit.gupta |
82 |
public String getActivationBrands() {
|
|
|
83 |
return activationBrands;
|
| 26694 |
tejbeer |
84 |
}
|
| 27878 |
amit.gupta |
85 |
public void setActivationBrands(String activationBrands) {
|
|
|
86 |
this.activationBrands = activationBrands;
|
| 26674 |
tejbeer |
87 |
}
|
| 27878 |
amit.gupta |
88 |
public void setCreatedOn(LocalDateTime createdOn) {
|
|
|
89 |
this.createdOn = createdOn;
|
|
|
90 |
}
|
| 26674 |
tejbeer |
91 |
|
| 27878 |
amit.gupta |
92 |
|
|
|
93 |
public String getItemCriteriaString() {
|
|
|
94 |
return itemCriteriaString;
|
| 26674 |
tejbeer |
95 |
}
|
|
|
96 |
|
| 27878 |
amit.gupta |
97 |
public String getPartnerCriteriaString() {
|
|
|
98 |
return partnerCriteriaString;
|
| 26674 |
tejbeer |
99 |
}
|
|
|
100 |
|
| 27878 |
amit.gupta |
101 |
public void setPartnerCriteriaString(String partnerCriteriaString) {
|
|
|
102 |
this.partnerCriteriaString = partnerCriteriaString;
|
| 26674 |
tejbeer |
103 |
}
|
|
|
104 |
|
| 27878 |
amit.gupta |
105 |
public PartnerCriteria getPartnerCriteria() {
|
|
|
106 |
return partnerCriteria;
|
| 26674 |
tejbeer |
107 |
}
|
|
|
108 |
|
| 27878 |
amit.gupta |
109 |
public void setPartnerCriteria(PartnerCriteria partnerCriteria) {
|
|
|
110 |
this.partnerCriteria = partnerCriteria;
|
| 26588 |
tejbeer |
111 |
}
|
|
|
112 |
|
| 27878 |
amit.gupta |
113 |
public ItemCriteria getItemCriteria() {
|
|
|
114 |
return itemCriteria;
|
| 26588 |
tejbeer |
115 |
}
|
|
|
116 |
|
| 27878 |
amit.gupta |
117 |
public void setItemCriteria(ItemCriteria itemCriteria) {
|
|
|
118 |
this.itemCriteria = itemCriteria;
|
| 26588 |
tejbeer |
119 |
}
|
|
|
120 |
|
| 27878 |
amit.gupta |
121 |
public double getBrandShareTerms() {
|
|
|
122 |
return brandShareTerms;
|
| 26588 |
tejbeer |
123 |
}
|
|
|
124 |
|
| 27878 |
amit.gupta |
125 |
public void setBrandShareTerms(double brandShareTerms) {
|
|
|
126 |
this.brandShareTerms = brandShareTerms;
|
| 26588 |
tejbeer |
127 |
}
|
|
|
128 |
|
| 27878 |
amit.gupta |
129 |
public List<TargetSlab> getTargetSlabs() {
|
|
|
130 |
return targetSlabs;
|
| 26588 |
tejbeer |
131 |
}
|
|
|
132 |
|
| 27878 |
amit.gupta |
133 |
public void setTargetSlabs(List<TargetSlab> targetSlabs) {
|
|
|
134 |
this.targetSlabs = targetSlabs;
|
| 26588 |
tejbeer |
135 |
}
|
|
|
136 |
|
| 27878 |
amit.gupta |
137 |
@Override
|
|
|
138 |
public String toString() {
|
|
|
139 |
return "CreateOfferRequest [id=" + id + ", active=" + active + ", name=" + name + ", startDate=" + startDate
|
|
|
140 |
+ ", endDate=" + endDate + ", offerNotes=" + offerNotes + ", terms=" + terms + ", targetType="
|
| 27918 |
amit.gupta |
141 |
+ targetType + ", payoutType=" + payoutType + ", activationBrands=" + activationBrands + ", schemeType="
|
|
|
142 |
+ schemeType + ", sellinPercentage=" + sellinPercentage + ", brandShareTerms=" + brandShareTerms
|
|
|
143 |
+ ", itemCriteria=" + itemCriteria + ", itemCriteriaString=" + itemCriteriaString + ", createdOn="
|
|
|
144 |
+ createdOn + ", targetSlabs=" + targetSlabs + ", partnerCriteria=" + partnerCriteria
|
|
|
145 |
+ ", partnerCriteriaString=" + partnerCriteriaString + ", eligibleSale=" + eligibleSale
|
|
|
146 |
+ ", nextTargetSlab=" + nextTargetSlab + ", currentTargetSlab=" + currentTargetSlab + "]";
|
| 26588 |
tejbeer |
147 |
}
|
|
|
148 |
|
| 27878 |
amit.gupta |
149 |
public int getId() {
|
|
|
150 |
return id;
|
| 26588 |
tejbeer |
151 |
}
|
|
|
152 |
|
| 27878 |
amit.gupta |
153 |
public void setId(int id) {
|
|
|
154 |
this.id = id;
|
| 26588 |
tejbeer |
155 |
}
|
|
|
156 |
|
|
|
157 |
public String getName() {
|
|
|
158 |
return name;
|
|
|
159 |
}
|
|
|
160 |
|
|
|
161 |
public void setName(String name) {
|
|
|
162 |
this.name = name;
|
|
|
163 |
}
|
|
|
164 |
|
| 27878 |
amit.gupta |
165 |
public LocalDateTime getStartDate() {
|
|
|
166 |
return startDate;
|
| 26588 |
tejbeer |
167 |
}
|
|
|
168 |
|
| 27878 |
amit.gupta |
169 |
public void setStartDate(LocalDateTime startDate) {
|
|
|
170 |
this.startDate = startDate;
|
| 26588 |
tejbeer |
171 |
}
|
|
|
172 |
|
| 27878 |
amit.gupta |
173 |
public LocalDateTime getEndDate() {
|
|
|
174 |
return endDate;
|
| 26588 |
tejbeer |
175 |
}
|
|
|
176 |
|
| 27878 |
amit.gupta |
177 |
public void setEndDate(LocalDateTime endDate) {
|
|
|
178 |
this.endDate = endDate;
|
| 26588 |
tejbeer |
179 |
}
|
|
|
180 |
|
| 27918 |
amit.gupta |
181 |
public AchievementType getTargetType() {
|
| 27878 |
amit.gupta |
182 |
return targetType;
|
| 26588 |
tejbeer |
183 |
}
|
|
|
184 |
|
| 27918 |
amit.gupta |
185 |
public void setTargetType(AchievementType targetType) {
|
| 27878 |
amit.gupta |
186 |
this.targetType = targetType;
|
| 26588 |
tejbeer |
187 |
}
|
|
|
188 |
|
| 27878 |
amit.gupta |
189 |
public OfferSchemeType getSchemeType() {
|
|
|
190 |
return schemeType;
|
| 26588 |
tejbeer |
191 |
}
|
|
|
192 |
|
| 27878 |
amit.gupta |
193 |
public void setSchemeType(OfferSchemeType schemeType) {
|
|
|
194 |
this.schemeType = schemeType;
|
| 26588 |
tejbeer |
195 |
}
|
|
|
196 |
|
| 27878 |
amit.gupta |
197 |
public double getSellinPercentage() {
|
|
|
198 |
return sellinPercentage;
|
| 26588 |
tejbeer |
199 |
}
|
|
|
200 |
|
| 27878 |
amit.gupta |
201 |
public void setSellinPercentage(double sellinPercentage) {
|
|
|
202 |
this.sellinPercentage = sellinPercentage;
|
| 26588 |
tejbeer |
203 |
}
|
|
|
204 |
|
| 27878 |
amit.gupta |
205 |
public String getOfferNotes() {
|
|
|
206 |
return offerNotes;
|
| 26588 |
tejbeer |
207 |
}
|
|
|
208 |
|
| 27878 |
amit.gupta |
209 |
public void setOfferNotes(String offerNotes) {
|
|
|
210 |
this.offerNotes = offerNotes;
|
| 26588 |
tejbeer |
211 |
}
|
|
|
212 |
|
| 27878 |
amit.gupta |
213 |
public String getTerms() {
|
|
|
214 |
return terms;
|
| 26588 |
tejbeer |
215 |
}
|
|
|
216 |
|
| 27878 |
amit.gupta |
217 |
public void setTerms(String terms) {
|
|
|
218 |
this.terms = terms;
|
| 26588 |
tejbeer |
219 |
}
|
|
|
220 |
|
| 27878 |
amit.gupta |
221 |
public void setItemCriteriaString(String itemCriteriaString) {
|
|
|
222 |
this.itemCriteriaString = itemCriteriaString;
|
| 26588 |
tejbeer |
223 |
}
|
|
|
224 |
|
| 27878 |
amit.gupta |
225 |
@Override
|
|
|
226 |
public boolean equals(Object obj) {
|
|
|
227 |
if (this == obj)
|
|
|
228 |
return true;
|
|
|
229 |
if (obj == null)
|
|
|
230 |
return false;
|
|
|
231 |
if (getClass() != obj.getClass())
|
|
|
232 |
return false;
|
|
|
233 |
CreateOfferRequest other = (CreateOfferRequest) obj;
|
|
|
234 |
if (activationBrands == null) {
|
|
|
235 |
if (other.activationBrands != null)
|
|
|
236 |
return false;
|
|
|
237 |
} else if (!activationBrands.equals(other.activationBrands))
|
|
|
238 |
return false;
|
|
|
239 |
if (active != other.active)
|
|
|
240 |
return false;
|
|
|
241 |
if (Double.doubleToLongBits(brandShareTerms) != Double.doubleToLongBits(other.brandShareTerms))
|
|
|
242 |
return false;
|
|
|
243 |
if (createdOn == null) {
|
|
|
244 |
if (other.createdOn != null)
|
|
|
245 |
return false;
|
|
|
246 |
} else if (!createdOn.equals(other.createdOn))
|
|
|
247 |
return false;
|
|
|
248 |
if (currentTargetSlab == null) {
|
|
|
249 |
if (other.currentTargetSlab != null)
|
|
|
250 |
return false;
|
|
|
251 |
} else if (!currentTargetSlab.equals(other.currentTargetSlab))
|
|
|
252 |
return false;
|
|
|
253 |
if (eligibleSale != other.eligibleSale)
|
|
|
254 |
return false;
|
|
|
255 |
if (endDate == null) {
|
|
|
256 |
if (other.endDate != null)
|
|
|
257 |
return false;
|
|
|
258 |
} else if (!endDate.equals(other.endDate))
|
|
|
259 |
return false;
|
|
|
260 |
if (id != other.id)
|
|
|
261 |
return false;
|
|
|
262 |
if (itemCriteria == null) {
|
|
|
263 |
if (other.itemCriteria != null)
|
|
|
264 |
return false;
|
|
|
265 |
} else if (!itemCriteria.equals(other.itemCriteria))
|
|
|
266 |
return false;
|
|
|
267 |
if (itemCriteriaString == null) {
|
|
|
268 |
if (other.itemCriteriaString != null)
|
|
|
269 |
return false;
|
|
|
270 |
} else if (!itemCriteriaString.equals(other.itemCriteriaString))
|
|
|
271 |
return false;
|
|
|
272 |
if (name == null) {
|
|
|
273 |
if (other.name != null)
|
|
|
274 |
return false;
|
|
|
275 |
} else if (!name.equals(other.name))
|
|
|
276 |
return false;
|
|
|
277 |
if (nextTargetSlab == null) {
|
|
|
278 |
if (other.nextTargetSlab != null)
|
|
|
279 |
return false;
|
|
|
280 |
} else if (!nextTargetSlab.equals(other.nextTargetSlab))
|
|
|
281 |
return false;
|
|
|
282 |
if (offerNotes == null) {
|
|
|
283 |
if (other.offerNotes != null)
|
|
|
284 |
return false;
|
|
|
285 |
} else if (!offerNotes.equals(other.offerNotes))
|
|
|
286 |
return false;
|
|
|
287 |
if (partnerCriteria == null) {
|
|
|
288 |
if (other.partnerCriteria != null)
|
|
|
289 |
return false;
|
|
|
290 |
} else if (!partnerCriteria.equals(other.partnerCriteria))
|
|
|
291 |
return false;
|
|
|
292 |
if (partnerCriteriaString == null) {
|
|
|
293 |
if (other.partnerCriteriaString != null)
|
|
|
294 |
return false;
|
|
|
295 |
} else if (!partnerCriteriaString.equals(other.partnerCriteriaString))
|
|
|
296 |
return false;
|
| 27918 |
amit.gupta |
297 |
if (payoutType != other.payoutType)
|
|
|
298 |
return false;
|
| 27878 |
amit.gupta |
299 |
if (schemeType != other.schemeType)
|
|
|
300 |
return false;
|
|
|
301 |
if (Double.doubleToLongBits(sellinPercentage) != Double.doubleToLongBits(other.sellinPercentage))
|
|
|
302 |
return false;
|
|
|
303 |
if (startDate == null) {
|
|
|
304 |
if (other.startDate != null)
|
|
|
305 |
return false;
|
|
|
306 |
} else if (!startDate.equals(other.startDate))
|
|
|
307 |
return false;
|
|
|
308 |
if (targetSlabs == null) {
|
|
|
309 |
if (other.targetSlabs != null)
|
|
|
310 |
return false;
|
|
|
311 |
} else if (!targetSlabs.equals(other.targetSlabs))
|
|
|
312 |
return false;
|
|
|
313 |
if (targetType != other.targetType)
|
|
|
314 |
return false;
|
|
|
315 |
if (terms == null) {
|
|
|
316 |
if (other.terms != null)
|
|
|
317 |
return false;
|
|
|
318 |
} else if (!terms.equals(other.terms))
|
|
|
319 |
return false;
|
|
|
320 |
return true;
|
| 26588 |
tejbeer |
321 |
}
|
|
|
322 |
|
| 27878 |
amit.gupta |
323 |
@Override
|
|
|
324 |
public int hashCode() {
|
|
|
325 |
final int prime = 31;
|
|
|
326 |
int result = 1;
|
|
|
327 |
result = prime * result + ((activationBrands == null) ? 0 : activationBrands.hashCode());
|
|
|
328 |
result = prime * result + (active ? 1231 : 1237);
|
|
|
329 |
long temp;
|
|
|
330 |
temp = Double.doubleToLongBits(brandShareTerms);
|
|
|
331 |
result = prime * result + (int) (temp ^ (temp >>> 32));
|
|
|
332 |
result = prime * result + ((createdOn == null) ? 0 : createdOn.hashCode());
|
|
|
333 |
result = prime * result + ((currentTargetSlab == null) ? 0 : currentTargetSlab.hashCode());
|
|
|
334 |
result = prime * result + eligibleSale;
|
|
|
335 |
result = prime * result + ((endDate == null) ? 0 : endDate.hashCode());
|
|
|
336 |
result = prime * result + id;
|
|
|
337 |
result = prime * result + ((itemCriteria == null) ? 0 : itemCriteria.hashCode());
|
|
|
338 |
result = prime * result + ((itemCriteriaString == null) ? 0 : itemCriteriaString.hashCode());
|
|
|
339 |
result = prime * result + ((name == null) ? 0 : name.hashCode());
|
|
|
340 |
result = prime * result + ((nextTargetSlab == null) ? 0 : nextTargetSlab.hashCode());
|
|
|
341 |
result = prime * result + ((offerNotes == null) ? 0 : offerNotes.hashCode());
|
|
|
342 |
result = prime * result + ((partnerCriteria == null) ? 0 : partnerCriteria.hashCode());
|
|
|
343 |
result = prime * result + ((partnerCriteriaString == null) ? 0 : partnerCriteriaString.hashCode());
|
| 27918 |
amit.gupta |
344 |
result = prime * result + ((payoutType == null) ? 0 : payoutType.hashCode());
|
| 27878 |
amit.gupta |
345 |
result = prime * result + ((schemeType == null) ? 0 : schemeType.hashCode());
|
|
|
346 |
temp = Double.doubleToLongBits(sellinPercentage);
|
|
|
347 |
result = prime * result + (int) (temp ^ (temp >>> 32));
|
|
|
348 |
result = prime * result + ((startDate == null) ? 0 : startDate.hashCode());
|
|
|
349 |
result = prime * result + ((targetSlabs == null) ? 0 : targetSlabs.hashCode());
|
|
|
350 |
result = prime * result + ((targetType == null) ? 0 : targetType.hashCode());
|
|
|
351 |
result = prime * result + ((terms == null) ? 0 : terms.hashCode());
|
|
|
352 |
return result;
|
| 26588 |
tejbeer |
353 |
}
|
|
|
354 |
}
|