Subversion Repositories SmartDukaan

Rev

Rev 35099 | Rev 36397 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
22600 ashik.ali 1
package com.spice.profitmandi.dao.entity.catalog;
2
 
35099 amit 3
import com.spice.profitmandi.common.util.FormattingUtils;
30121 amit.gupta 4
import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;
5
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
6
import com.spice.profitmandi.dao.enumuration.catalog.AmountType;
7
import com.spice.profitmandi.dao.enumuration.catalog.SchemeType;
8
 
9
import javax.persistence.*;
22600 ashik.ali 10
import java.io.Serializable;
11
import java.time.LocalDateTime;
22859 ashik.ali 12
import java.time.format.DateTimeFormatter;
30454 amit.gupta 13
import java.util.*;
22600 ashik.ali 14
 
15
/**
16
 * This class basically contains scheme details
30896 amit.gupta 17
 *
22600 ashik.ali 18
 * @author ashikali
19
 */
31651 tejbeer 20
@NamedQueries({ @NamedQuery(name = "scheme.selectSchemesByRetailerIdsSchemeIds", query = "select sr.schemeId from"
21
		+ " SchemeRegion sr join PartnerRegion pr on pr.regionId=sr.regionId where pr.fofoId in :fofoIds and sr.schemeId in :schemeIds"),
30896 amit.gupta 22
 
31651 tejbeer 23
		@NamedQuery(name = "Scheme.selectSchemeByModelsPartnerTypeFofoId", query = "select s from Scheme s"
24
				+ " join SchemeItem si on si.schemeId = s.id" + " join SchemeRegion sr on sr.schemeId = s.id"
25
				+ " join PartnerRegion pr on pr.regionId=sr.regionId"
26
				+ " where pr.fofoId in :fofoIds and s.partnerType in :partnerTypes" + " and si.catalogId in :catalogIds"
27
				+ " and :onDate between s.startDateTime and s.endDateTime" +
28
				// " and s.endDateTime >= :onDate" +
36374 ranu 29
				" and s.activeTimestamp is not null"),
31441 amit.gupta 30
 
36374 ranu 31
		@NamedQuery(name = "Scheme.selectSchemesByBrandsAndFofoRegion", query = "select distinct s from Scheme s"
32
				+ " join SchemeItem si on si.schemeId = s.id"
33
				+ " join Item i on i.catalogItemId = si.catalogId"
34
				+ " join SchemeRegion sr on sr.schemeId = s.id"
35
				+ " where i.brand in :brands"
36
				+ " and s.activeTimestamp is not null"
37
				+ " and s.partnerType in :partnerTypes"
38
				+ " and s.startDateTime <= :onDate"
39
				+ " and COALESCE(s.expireTimestamp, s.endDateTime) >= :onDate"
40
				+ " and (si.endDate is null or si.endDate >= :onDate)"
41
				+ " and (sr.regionId = 5 or sr.regionId in :regionIds)"
42
				+ " order by s.id desc"),
43
 
44
		@NamedQuery(name = "Scheme.selectSchemesByBrands", query = "select distinct s from Scheme s"
45
				+ " join SchemeItem si on si.schemeId = s.id"
46
				+ " join Item i on i.catalogItemId = si.catalogId"
47
				+ " where i.brand in :brands"
48
				+ " and s.activeTimestamp is not null"
49
				+ " and s.partnerType in :partnerTypes"
50
				+ " and s.startDateTime <= :onDate"
51
				+ " and COALESCE(s.expireTimestamp, s.endDateTime) >= :onDate"
52
				+ " and (si.endDate is null or si.endDate >= :onDate)"
53
				+ " order by s.id desc"),
54
 
55
		@NamedQuery(name = "Scheme.selectActiveSchemesByFofoRegion", query = "select distinct s from Scheme s"
56
				+ " join SchemeItem si on si.schemeId = s.id"
57
				+ " join SchemeRegion sr on sr.schemeId = s.id"
58
				+ " where s.activeTimestamp is not null"
59
				+ " and s.partnerType in :partnerTypes"
60
				+ " and s.startDateTime <= :onDate"
61
				+ " and COALESCE(s.expireTimestamp, s.endDateTime) >= :onDate"
62
				+ " and (si.endDate is null or si.endDate >= :onDate)"
63
				+ " and (sr.regionId = 5 or sr.regionId in :regionIds)"
64
				+ " order by s.id desc"),
65
 
66
		@NamedQuery(name = "Scheme.selectAllActiveSchemes", query = "select distinct s from Scheme s"
67
				+ " join SchemeItem si on si.schemeId = s.id"
68
				+ " where s.activeTimestamp is not null"
69
				+ " and s.partnerType in :partnerTypes"
70
				+ " and s.startDateTime <= :onDate"
71
				+ " and COALESCE(s.expireTimestamp, s.endDateTime) >= :onDate"
72
				+ " and (si.endDate is null or si.endDate >= :onDate)"
73
				+ " order by s.id desc")
74
 
31651 tejbeer 75
		/*
76
		 * ,
77
		 * 
78
		 * @NamedQuery(name="scheme.getImeiMarginsPaidOnBillingMonth", query=
79
		 * "select new com.spice.profitmandi.dao.repository.catalog.ImeiMarginModel(" +
80
		 * ") from LineItemImei li1" +
81
		 * "         left join LineItemImei li2 on (li1.serialNumber = li2.serialNumber and li1.id < li2.id)"
82
		 * + "         join LineItem li on li.id = li1.lineItemId" +
83
		 * "         join Order o on o.id = li.orderId" +
84
		 * "         join Item ci on li.itemId = ci.id" +
85
		 * "         join SchemeItem si on si.catalogId = ci.catalogItemId" +
86
		 * "         join Scheme s1 on s1.id = si.schemeId" +
87
		 * "         join SchemeRegion sr on sr.schemeId = s1.id" +
88
		 * "         join PartnerRegion pr on (pr.regionId = sr.regionId and pr.fofoId in (0, o.id))"
89
		 * + "         left join PartnerTypeChange ptc on ptc.fofoId = o.retailerId" +
90
		 * "         left join PartnerTypeChange ptc2 on (ptc2.fofoId = ptc.fofoId and ptc.createTimestamp < ptc2.createTimestamp)"
91
		 * + "where li2.id is null" + "  and ptc2.createTimestamp is null" +
92
		 * "  and o.billing_timestamp between :startDate and :endDate" +
93
		 * "  and '2022-12-01' between s1.start_date_time and s1.end_date_time" +
94
		 * "  and ((ptc.partnerType is null and s1.partner_type in ('ALL', 'NEW'))" +
95
		 * "    or s1.partnerType in (ptc.partnerType, 'ALL'))" +
96
		 * "  and s1.activeTimestamp is not null" + "  and s1.amountType = 'PERCENTAGE'"
97
		 * + "group by li.serial_number) as set1\n" + "")
98
		 */
31441 amit.gupta 99
 
31170 amit.gupta 100
})
101
 
30896 amit.gupta 102
@NamedNativeQueries({
103
 
31695 tejbeer 104
		@NamedNativeQuery(name = "scheme.getActiveScheme", query = "select si.catalog_id from catalog.scheme s join "
31696 tejbeer 105
				+ " fofo.scheme_item si on s.id = si.scheme_id join catalog.item i on i.catalog_item_id = si.catalog_id"
31698 tejbeer 106
				+ " where s.active_timestamp is not null and start_date_time <= :startDate and end_date_time >= :startDate and s.type = 'SPECIAL_SUPPORT' and i.hsnCode = '85171300' order by active_timestamp desc "),
31651 tejbeer 107
 
108
		@NamedNativeQuery(name = "scheme.selectMissedActivationSale", query = "select cs.id as scheme_id, ai.serial_number, sr.order_id, ii.id as inventory_item_id, ai.activation_timestamp"
109
				+ " from fofo.activated_imei ai "
110
				+ "   join fofo.inventory_item ii on ai.serial_number = ii.serial_number "
111
				+ "   join catalog.item i on i.id = ii.item_id "
34752 amit.gupta 112
				+ "   join catalog.scheme cs on ai.activation_timestamp >= cs.start_date_time and ai.activation_timestamp <= cs.end_date_time  "
31651 tejbeer 113
				+ "   join fofo.scheme_item si on (si.scheme_id = cs.id and i.catalog_item_id = si.catalog_id) "
34697 amit.gupta 114
				+ "	  join fofo.scan_record sr on (sr.inventory_item_id = ii.id)"
115
				+ "   join fofo.scheme_region sre on sre.scheme_id = cs.id"
116
				+ "   join cs.partner_region pr on (pr.region_id = sre.region_id and (pr.fofo_id = ii.fofo_id or pr.fofo_id = 0))"
31651 tejbeer 117
				+ "	left join fofo.scheme_in_out sio on (sio.scheme_id = cs.id and sio.inventory_item_id = ii.id) "
34752 amit.gupta 118
				+ " where cs.active_timestamp is not null " + " and cs.type ='SPECIAL_SUPPORT'"
31651 tejbeer 119
				+ " and sr.type = 'SALE'" + " and (sio.id is null or sio.status='REJECTED') "
120
				+ " and ai.checked = false", resultSetMapping = "missedActivationSaleMapping") })
121
 
122
@SqlResultSetMappings({ @SqlResultSetMapping(name = "missedActivationSaleMapping", classes = {
123
		@ConstructorResult(targetClass = SchemesImeisModel.class, columns = {
124
				@ColumnResult(name = "serial_number", type = String.class),
125
				@ColumnResult(name = "activation_timestamp", type = LocalDateTime.class),
126
				@ColumnResult(name = "order_id", type = Integer.class),
127
				@ColumnResult(name = "inventory_item_id", type = Integer.class),
128
				@ColumnResult(name = "scheme_id", type = Integer.class), }) }) })
22600 ashik.ali 129
@Entity
31860 tejbeer 130
@Table(name = "catalog.scheme")
25503 amit.gupta 131
public class Scheme implements Serializable {
132
 
133
	public PartnerType getPartnerType() {
134
		return partnerType;
135
	}
136
 
137
	public void setPartnerType(PartnerType partnerType) {
138
		this.partnerType = partnerType;
139
	}
140
 
22600 ashik.ali 141
	private static final long serialVersionUID = 1L;
25503 amit.gupta 142
 
22600 ashik.ali 143
	public Scheme() {
144
	}
25503 amit.gupta 145
 
22600 ashik.ali 146
	@Id
25503 amit.gupta 147
	@Column(name = "id")
22600 ashik.ali 148
	@GeneratedValue(strategy = GenerationType.IDENTITY)
149
	private int id;
25503 amit.gupta 150
 
31651 tejbeer 151
	@Column(name = "`name`")
22653 ashik.ali 152
	private String name;
25503 amit.gupta 153
 
22653 ashik.ali 154
	@Column(name = "description")
155
	private String description;
25503 amit.gupta 156
 
31651 tejbeer 157
	@Column(name = "`type`")
23297 ashik.ali 158
	@Enumerated(EnumType.STRING)
22653 ashik.ali 159
	private SchemeType type;
25503 amit.gupta 160
 
22600 ashik.ali 161
	@Column(name = "amount_type")
23297 ashik.ali 162
	@Enumerated(EnumType.STRING)
23527 ashik.ali 163
	private AmountType amountType;
25503 amit.gupta 164
 
30454 amit.gupta 165
	@Column(name = "base_plus_gst_calc")
166
	private boolean basePlusGstCalc;
167
 
22600 ashik.ali 168
	@Column(name = "amount")
169
	private float amount;
25503 amit.gupta 170
 
22600 ashik.ali 171
	@Convert(converter = LocalDateTimeAttributeConverter.class)
23019 ashik.ali 172
	@Column(name = "start_date_time")
173
	private LocalDateTime startDateTime = LocalDateTime.now();
25503 amit.gupta 174
 
22600 ashik.ali 175
	@Convert(converter = LocalDateTimeAttributeConverter.class)
23019 ashik.ali 176
	@Column(name = "end_date_time")
177
	private LocalDateTime endDateTime = LocalDateTime.now();
25503 amit.gupta 178
 
22608 ashik.ali 179
	@Convert(converter = LocalDateTimeAttributeConverter.class)
22600 ashik.ali 180
	@Column(name = "create_timestamp")
22859 ashik.ali 181
	private LocalDateTime createTimestamp = LocalDateTime.now();
25503 amit.gupta 182
 
22653 ashik.ali 183
	@Convert(converter = LocalDateTimeAttributeConverter.class)
184
	@Column(name = "active_timestamp")
185
	private LocalDateTime activeTimestamp = null;
25503 amit.gupta 186
 
22653 ashik.ali 187
	@Convert(converter = LocalDateTimeAttributeConverter.class)
22702 ashik.ali 188
	@Column(name = "expire_timestamp")
22653 ashik.ali 189
	private LocalDateTime expireTimestamp = null;
25503 amit.gupta 190
 
22600 ashik.ali 191
	@Column(name = "created_by")
192
	private int createdBy;
25503 amit.gupta 193
 
32310 amit.gupta 194
	//Dummy hardcode
195
	@Transient
196
	private int target;
197
 
198
	public int getTarget() {
199
		return target;
200
	}
201
 
202
	public void setTarget(int target) {
203
		this.target = target;
204
	}
205
 
26679 amit.gupta 206
	@Column
26685 amit.gupta 207
	private boolean cashback;
26679 amit.gupta 208
 
22859 ashik.ali 209
	@Transient
34697 amit.gupta 210
	private Set<Integer> retailerIds;
30896 amit.gupta 211
 
27388 amit.gupta 212
	@Transient
213
	private String amountModel;
30896 amit.gupta 214
 
28653 amit.gupta 215
	@Transient
216
	private float schemeValue;
25503 amit.gupta 217
 
28653 amit.gupta 218
	public float getSchemeValue() {
219
		return schemeValue;
220
	}
221
 
222
	public void setSchemeValue(float schemeValue) {
223
		this.schemeValue = schemeValue;
224
	}
225
 
35099 amit 226
	public String getSchemePeriod() {
227
		return FormattingUtils.formatDateMonthNonHyphenated(this.getStartDateTime()) + " - " + FormattingUtils.formatDateMonthNonHyphenated(this.getEndDateTime());
228
	}
229
 
30454 amit.gupta 230
	@Column(name = "partner_type")
25503 amit.gupta 231
	@Enumerated(EnumType.STRING)
232
	private PartnerType partnerType;
233
 
30454 amit.gupta 234
	@Override
235
	public String toString() {
31651 tejbeer 236
		return "Scheme{" + "id=" + id + ", name='" + name + '\'' + ", description='" + description + '\'' + ", type="
237
				+ type + ", amountType=" + amountType + ", gstReversal=" + basePlusGstCalc + ", amount=" + amount
238
				+ ", startDateTime=" + startDateTime + ", endDateTime=" + endDateTime + ", createTimestamp="
239
				+ createTimestamp + ", activeTimestamp=" + activeTimestamp + ", expireTimestamp=" + expireTimestamp
240
				+ ", createdBy=" + createdBy + ", cashback=" + cashback + ", retailerIds=" + retailerIds
241
				+ ", amountModel='" + amountModel + '\'' + ", schemeValue=" + schemeValue + ", partnerType="
242
				+ partnerType + ", catalogStringMap=" + catalogStringMap + '}';
30454 amit.gupta 243
	}
244
 
245
	@Override
246
	public boolean equals(Object o) {
31651 tejbeer 247
		if (this == o)
248
			return true;
249
		if (o == null || getClass() != o.getClass())
250
			return false;
30454 amit.gupta 251
		Scheme scheme = (Scheme) o;
31651 tejbeer 252
		return id == scheme.id && basePlusGstCalc == scheme.basePlusGstCalc && Float.compare(scheme.amount, amount) == 0
253
				&& createdBy == scheme.createdBy && cashback == scheme.cashback
254
				&& Float.compare(scheme.schemeValue, schemeValue) == 0 && Objects.equals(name, scheme.name)
255
				&& Objects.equals(description, scheme.description) && type == scheme.type
256
				&& amountType == scheme.amountType && Objects.equals(startDateTime, scheme.startDateTime)
257
				&& Objects.equals(endDateTime, scheme.endDateTime)
258
				&& Objects.equals(createTimestamp, scheme.createTimestamp)
259
				&& Objects.equals(activeTimestamp, scheme.activeTimestamp)
260
				&& Objects.equals(expireTimestamp, scheme.expireTimestamp)
261
				&& Objects.equals(retailerIds, scheme.retailerIds) && Objects.equals(amountModel, scheme.amountModel)
262
				&& partnerType == scheme.partnerType && Objects.equals(catalogStringMap, scheme.catalogStringMap);
30454 amit.gupta 263
	}
264
 
265
	@Override
266
	public int hashCode() {
31651 tejbeer 267
		return Objects.hash(id, name, description, type, amountType, basePlusGstCalc, amount, startDateTime,
268
				endDateTime, createTimestamp, activeTimestamp, expireTimestamp, createdBy, cashback, retailerIds,
269
				amountModel, schemeValue, partnerType, catalogStringMap);
30454 amit.gupta 270
	}
271
 
22859 ashik.ali 272
	@Transient
30121 amit.gupta 273
	private Map<Integer, String> catalogStringMap = new HashMap<>();
25503 amit.gupta 274
 
22600 ashik.ali 275
	public int getId() {
276
		return id;
277
	}
25503 amit.gupta 278
 
22600 ashik.ali 279
	public void setId(int id) {
280
		this.id = id;
281
	}
25503 amit.gupta 282
 
27388 amit.gupta 283
	public String getAmountModel() {
284
		return amountModel;
285
	}
286
 
287
	public void setAmountModel(String amountModel) {
288
		this.amountModel = amountModel;
289
	}
290
 
22653 ashik.ali 291
	public String getName() {
292
		return name;
22600 ashik.ali 293
	}
25503 amit.gupta 294
 
22653 ashik.ali 295
	public void setName(String name) {
296
		this.name = name;
22600 ashik.ali 297
	}
25503 amit.gupta 298
 
22653 ashik.ali 299
	public String getDescription() {
300
		return description;
22600 ashik.ali 301
	}
25503 amit.gupta 302
 
22653 ashik.ali 303
	public void setDescription(String description) {
304
		this.description = description;
22600 ashik.ali 305
	}
25503 amit.gupta 306
 
26685 amit.gupta 307
	public boolean isCashback() {
308
		return cashback;
26679 amit.gupta 309
	}
310
 
26685 amit.gupta 311
	public void setCashback(boolean cashback) {
312
		this.cashback = cashback;
26679 amit.gupta 313
	}
314
 
22653 ashik.ali 315
	public SchemeType getType() {
316
		return type;
317
	}
25503 amit.gupta 318
 
22653 ashik.ali 319
	public void setType(SchemeType type) {
320
		this.type = type;
321
	}
25503 amit.gupta 322
 
23527 ashik.ali 323
	public AmountType getAmountType() {
22600 ashik.ali 324
		return amountType;
325
	}
25503 amit.gupta 326
 
23527 ashik.ali 327
	public void setAmountType(AmountType amountType) {
22600 ashik.ali 328
		this.amountType = amountType;
329
	}
25503 amit.gupta 330
 
22600 ashik.ali 331
	public float getAmount() {
332
		return amount;
333
	}
25503 amit.gupta 334
 
22600 ashik.ali 335
	public void setAmount(float amount) {
336
		this.amount = amount;
337
	}
25503 amit.gupta 338
 
23019 ashik.ali 339
	public LocalDateTime getStartDateTime() {
340
		return startDateTime;
22600 ashik.ali 341
	}
25503 amit.gupta 342
 
23019 ashik.ali 343
	public void setStartDateTime(LocalDateTime startDateTime) {
344
		this.startDateTime = startDateTime;
22600 ashik.ali 345
	}
25503 amit.gupta 346
 
23019 ashik.ali 347
	public LocalDateTime getEndDateTime() {
348
		return endDateTime;
22653 ashik.ali 349
	}
25503 amit.gupta 350
 
23019 ashik.ali 351
	public void setEndDateTime(LocalDateTime endDateTime) {
352
		this.endDateTime = endDateTime;
22653 ashik.ali 353
	}
25503 amit.gupta 354
 
22859 ashik.ali 355
	public LocalDateTime getCreateTimestamp() {
356
		return createTimestamp;
22600 ashik.ali 357
	}
25503 amit.gupta 358
 
22859 ashik.ali 359
	public void setCreateTimestamp(LocalDateTime createTimestamp) {
360
		this.createTimestamp = createTimestamp;
22600 ashik.ali 361
	}
25503 amit.gupta 362
 
22600 ashik.ali 363
	public int getCreatedBy() {
364
		return createdBy;
365
	}
25503 amit.gupta 366
 
22600 ashik.ali 367
	public void setCreatedBy(int createdBy) {
368
		this.createdBy = createdBy;
369
	}
25503 amit.gupta 370
 
22653 ashik.ali 371
	public LocalDateTime getActiveTimestamp() {
372
		return activeTimestamp;
22600 ashik.ali 373
	}
25503 amit.gupta 374
 
22653 ashik.ali 375
	public void setActiveTimestamp(LocalDateTime activeTimestamp) {
376
		this.activeTimestamp = activeTimestamp;
22600 ashik.ali 377
	}
25503 amit.gupta 378
 
22653 ashik.ali 379
	public LocalDateTime getExpireTimestamp() {
380
		return expireTimestamp;
381
	}
25503 amit.gupta 382
 
22653 ashik.ali 383
	public void setExpireTimestamp(LocalDateTime expireTimestamp) {
384
		this.expireTimestamp = expireTimestamp;
385
	}
25503 amit.gupta 386
 
387
	public String getFormattedStartDateTime() {
388
		if (startDateTime == null) {
22859 ashik.ali 389
			return null;
390
		}
24402 amit.gupta 391
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
23019 ashik.ali 392
		return startDateTime.format(formatter);
25503 amit.gupta 393
	}
394
 
395
	public String getFormattedEndDateTime() {
396
		if (endDateTime == null) {
22859 ashik.ali 397
			return null;
398
		}
24402 amit.gupta 399
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy");
23019 ashik.ali 400
		return endDateTime.format(formatter);
25503 amit.gupta 401
	}
402
 
403
	public String getFormattedCreateTimestamp() {
404
		if (createTimestamp == null) {
22859 ashik.ali 405
			return null;
406
		}
24402 amit.gupta 407
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
22859 ashik.ali 408
		return createTimestamp.format(formatter);
25503 amit.gupta 409
	}
410
 
411
	public String getFormattedActiveTimestamp() {
412
		if (activeTimestamp == null) {
22859 ashik.ali 413
			return null;
414
		}
24402 amit.gupta 415
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
22859 ashik.ali 416
		return activeTimestamp.format(formatter);
25503 amit.gupta 417
	}
418
 
419
	public String getFormattedExpireTimestamp() {
420
		if (expireTimestamp == null) {
22859 ashik.ali 421
			return null;
422
		}
24402 amit.gupta 423
		DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd-MM-yyyy HH:mm");
22859 ashik.ali 424
		return expireTimestamp.format(formatter);
25503 amit.gupta 425
	}
426
 
22859 ashik.ali 427
	public Set<Integer> getRetailerIds() {
428
		return retailerIds;
429
	}
25503 amit.gupta 430
 
22859 ashik.ali 431
	public void setRetailerIds(Set<Integer> retailerIds) {
432
		this.retailerIds = retailerIds;
433
	}
25503 amit.gupta 434
 
435
	public String getRetailerIdsString() {
36374 ranu 436
		if (retailerIds == null || retailerIds.isEmpty()) {
437
			return "";
438
		}
22859 ashik.ali 439
		Set<String> stringRetailerIds = new HashSet<>();
36374 ranu 440
		for (int retailerId : retailerIds) {
441
			stringRetailerIds.add(String.valueOf(retailerId));
22859 ashik.ali 442
		}
443
		return String.join(", ", stringRetailerIds);
444
	}
25503 amit.gupta 445
 
30454 amit.gupta 446
	public boolean isBasePlusGstCalc() {
447
		return basePlusGstCalc;
448
	}
449
 
450
	public void setBasePlusGstCalc(boolean gstReversal) {
451
		this.basePlusGstCalc = gstReversal;
452
	}
453
 
30121 amit.gupta 454
	public Map<Integer, String> getCatalogStringMap() {
455
		return catalogStringMap;
22859 ashik.ali 456
	}
25503 amit.gupta 457
 
30121 amit.gupta 458
	public void setCatalogStringMap(Map<Integer, String> catalogStringMap) {
459
		this.catalogStringMap = catalogStringMap;
22859 ashik.ali 460
	}
25503 amit.gupta 461
 
30640 amit.gupta 462
	public boolean isWithinRange(LocalDateTime testDate) {
463
		return !(testDate.isBefore(this.startDateTime) || testDate.isAfter(endDateTime));
464
	}
22600 ashik.ali 465
}