Subversion Repositories SmartDukaan

Rev

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

Rev 31203 Rev 31444
Line 1100... Line 1100...
1100
	public ResponseEntity<?> checkEligibilityStoreOffers(HttpServletRequest request, @RequestParam(value = "id") int id)
1100
	public ResponseEntity<?> checkEligibilityStoreOffers(HttpServletRequest request, @RequestParam(value = "id") int id)
1101
			throws Exception {
1101
			throws Exception {
1102
 
1102
 
1103
		boolean eligibility = false;
1103
		boolean eligibility = false;
1104
 
1104
 
-
 
1105
		LocalDateTime startDate = LocalDateTime.of(LocalDate.now().getYear(), LocalDate.now().getMonth(), 14, 0, 0);
-
 
1106
 
1105
		List<ScratchOffer> scratchOffers = scratchOfferRepository.selectBycCustomerId(id);
1107
		List<ScratchOffer> scratchOffers = scratchOfferRepository.selectBycCustomerIdAndDate(id,
-
 
1108
				startDate.toLocalDate());
1106
 
1109
 
1107
		if (!scratchOffers.isEmpty()) {
1110
		if (!scratchOffers.isEmpty()) {
1108
			eligibility = true;
1111
			eligibility = true;
1109
 
1112
 
1110
		} else {
1113
		} else {
Line 1118... Line 1121...
1118
	public ResponseEntity<?> scratchOffers(HttpServletRequest request, @RequestParam(value = "id") int id)
1121
	public ResponseEntity<?> scratchOffers(HttpServletRequest request, @RequestParam(value = "id") int id)
1119
			throws Exception {
1122
			throws Exception {
1120
 
1123
 
1121
		List<ScratchOffer> scratchOffers = scratchOfferRepository.selectBycCustomerId(id);
1124
		List<ScratchOffer> scratchOffers = scratchOfferRepository.selectBycCustomerId(id);
1122
		for (ScratchOffer so : scratchOffers) {
1125
		for (ScratchOffer so : scratchOffers) {
-
 
1126
			LocalDateTime endDate = LocalDateTime.of(LocalDate.now().getYear(), LocalDate.now().getMonth(), 27, 21, 00);
1123
 
1127
 
1124
			if (so.getOfferName() != null) {
1128
			if (so.getOfferName() != null) {
1125
				/*
-
 
1126
				 * if (so.getOfferName().equals(ScratchedGift.OTSR)) {
-
 
1127
				 * so.setExpiredTimestamp(so.getCreatedTimestamp().plusDays(1)); } else
-
 
1128
				 */if (so.getOfferName().equals(ScratchedGift.EW)) {
-
 
1129
					so.setExpiredTimestamp(so.getCreatedTimestamp().plusDays(2));
-
 
1130
				} else {
-
 
1131
					so.setExpiredTimestamp(so.getCreatedTimestamp().plusDays(2));
1129
				so.setExpiredTimestamp(endDate);
1132
				}
-
 
1133
			}
1130
			}
1134
			if (LocalDateTime.now().isAfter(so.getUnlockedAt())) {
1131
			if (LocalDateTime.now().isAfter(so.getUnlockedAt())) {
1135
				so.setUnlocked(true);
1132
				so.setUnlocked(true);
1136
			} else {
1133
			} else {
1137
				so.setUnlocked(false);
1134
				so.setUnlocked(false);