| Line 22... |
Line 22... |
| 22 |
import com.spice.profitmandi.dao.model.CreateRefferalRequest;
|
22 |
import com.spice.profitmandi.dao.model.CreateRefferalRequest;
|
| 23 |
import com.spice.profitmandi.dao.model.DateRangeModel;
|
23 |
import com.spice.profitmandi.dao.model.DateRangeModel;
|
| 24 |
import com.spice.profitmandi.dao.model.UserCart;
|
24 |
import com.spice.profitmandi.dao.model.UserCart;
|
| 25 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
25 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 26 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
26 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| - |
|
27 |
import com.spice.profitmandi.dao.repository.cs.DemoPartnerAccessService;
|
| 27 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
28 |
import com.spice.profitmandi.dao.repository.dtr.*;
|
| 28 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
29 |
import com.spice.profitmandi.dao.repository.fofo.PartnerTypeChangeService;
|
| 29 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
30 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 30 |
import com.spice.profitmandi.dao.repository.user.PromoterRepository;
|
31 |
import com.spice.profitmandi.dao.repository.user.PromoterRepository;
|
| 31 |
import com.spice.profitmandi.service.AuthService;
|
32 |
import com.spice.profitmandi.service.AuthService;
|
| Line 133... |
Line 134... |
| 133 |
|
134 |
|
| 134 |
@Autowired
|
135 |
@Autowired
|
| 135 |
private CsService csService;
|
136 |
private CsService csService;
|
| 136 |
|
137 |
|
| 137 |
@Autowired
|
138 |
@Autowired
|
| - |
|
139 |
private DemoPartnerAccessService demoPartnerAccessService;
|
| - |
|
140 |
|
| - |
|
141 |
@Autowired
|
| 138 |
private RestClient restClient;
|
142 |
private RestClient restClient;
|
| 139 |
|
143 |
|
| 140 |
@Autowired
|
144 |
@Autowired
|
| 141 |
private RoleManager roleManager;
|
145 |
private RoleManager roleManager;
|
| 142 |
|
146 |
|
| Line 636... |
Line 640... |
| 636 |
return responseSender.badRequest("No user found for the provided email");
|
640 |
return responseSender.badRequest("No user found for the provided email");
|
| 637 |
}
|
641 |
}
|
| 638 |
|
642 |
|
| 639 |
Map<String, Set<String>> storeGuyMap = csService.getAuthUserPartnerEmailMapping();
|
643 |
Map<String, Set<String>> storeGuyMap = csService.getAuthUserPartnerEmailMapping();
|
| 640 |
|
644 |
|
| - |
|
645 |
// Copy: the mapping is a shared cached object and must not carry demo partners.
|
| - |
|
646 |
Set<String> emails = new HashSet<>();
|
| - |
|
647 |
if (storeGuyMap.get(authUser.getEmailId().toLowerCase()) != null) {
|
| 641 |
Set<String> emails = storeGuyMap.get(authUser.getEmailId().toLowerCase());
|
648 |
emails.addAll(storeGuyMap.get(authUser.getEmailId().toLowerCase()));
|
| - |
|
649 |
}
|
| - |
|
650 |
emails.addAll(demoPartnerAccessService.getDemoPartnerEmails(authUser.getId()));
|
| 642 |
LOGGER.info("emails: {}", emails);
|
651 |
LOGGER.info("emails: {}", emails);
|
| 643 |
if (emails == null || emails.isEmpty()) {
|
652 |
if (emails == null || emails.isEmpty()) {
|
| 644 |
LOGGER.info("No partner emails found for user: {}", gmailId);
|
653 |
LOGGER.info("No partner emails found for user: {}", gmailId);
|
| 645 |
return responseSender.ok(new ArrayList<>());
|
654 |
return responseSender.ok(new ArrayList<>());
|
| 646 |
}
|
655 |
}
|