Subversion Repositories SmartDukaan

Rev

Rev 27360 | Rev 27918 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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