| Line 53... |
Line 53... |
| 53 |
import com.spice.profitmandi.dao.entity.dtr.Retailer;
|
53 |
import com.spice.profitmandi.dao.entity.dtr.Retailer;
|
| 54 |
import com.spice.profitmandi.dao.entity.dtr.Role;
|
54 |
import com.spice.profitmandi.dao.entity.dtr.Role;
|
| 55 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
55 |
import com.spice.profitmandi.dao.entity.dtr.User;
|
| 56 |
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
|
56 |
import com.spice.profitmandi.dao.entity.dtr.UserAccount;
|
| 57 |
import com.spice.profitmandi.dao.entity.dtr.UserRole;
|
57 |
import com.spice.profitmandi.dao.entity.dtr.UserRole;
|
| - |
|
58 |
import com.spice.profitmandi.dao.entity.fofo.FofoStore;
|
| - |
|
59 |
import com.spice.profitmandi.dao.entity.fofo.PartnerOnBoardingPanel;
|
| 58 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
60 |
import com.spice.profitmandi.dao.entity.fofo.PartnerType;
|
| 59 |
import com.spice.profitmandi.dao.entity.user.Address;
|
61 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 60 |
import com.spice.profitmandi.dao.entity.user.Promoter;
|
62 |
import com.spice.profitmandi.dao.entity.user.Promoter;
|
| 61 |
import com.spice.profitmandi.dao.entity.user.Refferal;
|
63 |
import com.spice.profitmandi.dao.entity.user.Refferal;
|
| 62 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
64 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
| 63 |
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
|
65 |
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
|
| - |
|
66 |
import com.spice.profitmandi.dao.enumuration.dtr.StoreTimeline;
|
| 64 |
import com.spice.profitmandi.dao.model.CreateRefferalRequest;
|
67 |
import com.spice.profitmandi.dao.model.CreateRefferalRequest;
|
| 65 |
import com.spice.profitmandi.dao.model.DateRangeModel;
|
68 |
import com.spice.profitmandi.dao.model.DateRangeModel;
|
| - |
|
69 |
import com.spice.profitmandi.dao.model.OnBoardingTimelineModel;
|
| 66 |
import com.spice.profitmandi.dao.model.UserCart;
|
70 |
import com.spice.profitmandi.dao.model.UserCart;
|
| 67 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
71 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 68 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
72 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| - |
|
73 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 69 |
import com.spice.profitmandi.dao.repository.dtr.MobileAppSettingsRepository;
|
74 |
import com.spice.profitmandi.dao.repository.dtr.MobileAppSettingsRepository;
|
| - |
|
75 |
import com.spice.profitmandi.dao.repository.dtr.PartnerOnBoardingPanelRepository;
|
| 70 |
import com.spice.profitmandi.dao.repository.dtr.RefferalRepository;
|
76 |
import com.spice.profitmandi.dao.repository.dtr.RefferalRepository;
|
| 71 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
|
77 |
import com.spice.profitmandi.dao.repository.dtr.RetailerRepository;
|
| 72 |
import com.spice.profitmandi.dao.repository.dtr.RoleRepository;
|
78 |
import com.spice.profitmandi.dao.repository.dtr.RoleRepository;
|
| 73 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
79 |
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
|
| 74 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
80 |
import com.spice.profitmandi.dao.repository.dtr.UserRepository;
|
| Line 77... |
Line 83... |
| 77 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
83 |
import com.spice.profitmandi.dao.repository.user.AddressRepository;
|
| 78 |
import com.spice.profitmandi.dao.repository.user.PromoterRepository;
|
84 |
import com.spice.profitmandi.dao.repository.user.PromoterRepository;
|
| 79 |
import com.spice.profitmandi.service.AuthService;
|
85 |
import com.spice.profitmandi.service.AuthService;
|
| 80 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
86 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 81 |
import com.spice.profitmandi.service.user.RetailerService;
|
87 |
import com.spice.profitmandi.service.user.RetailerService;
|
| - |
|
88 |
import com.spice.profitmandi.service.user.StoreTimelineTatService;
|
| 82 |
import com.spice.profitmandi.service.user.UserService;
|
89 |
import com.spice.profitmandi.service.user.UserService;
|
| 83 |
import com.spice.profitmandi.web.controller.checkout.OrderController;
|
90 |
import com.spice.profitmandi.web.controller.checkout.OrderController;
|
| 84 |
import com.spice.profitmandi.web.enumuration.UserStatus;
|
91 |
import com.spice.profitmandi.web.enumuration.UserStatus;
|
| 85 |
import com.spice.profitmandi.web.processor.GoogleLoginProcessor;
|
92 |
import com.spice.profitmandi.web.processor.GoogleLoginProcessor;
|
| 86 |
import com.spice.profitmandi.web.req.RefferalEarning;
|
93 |
import com.spice.profitmandi.web.req.RefferalEarning;
|
| Line 275... |
Line 282... |
| 275 |
// else retailer is not verifed
|
282 |
// else retailer is not verifed
|
| 276 |
if (retailer.isActive() || user.isActivated()) {
|
283 |
if (retailer.isActive() || user.isActivated()) {
|
| 277 |
if (roleManager.isPartner(roleIdsSet)) {
|
284 |
if (roleManager.isPartner(roleIdsSet)) {
|
| 278 |
responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.FOFO.getValue());
|
285 |
responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.FOFO.getValue());
|
| 279 |
responseMap.put("storeUrl", retailerService.getAllFofoRetailerIdUrlMap().get(uc.getUserId()));
|
286 |
responseMap.put("storeUrl", retailerService.getAllFofoRetailerIdUrlMap().get(uc.getUserId()));
|
| - |
|
287 |
responseMap.put("timelineStatus", this.getTimeLineStatus(uc.getUserId()));
|
| 280 |
} else {
|
288 |
} else {
|
| 281 |
responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.VERIFIED_RETAILER.getValue());
|
289 |
responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.VERIFIED_RETAILER.getValue());
|
| 282 |
}
|
290 |
}
|
| 283 |
} else if (retailer.isMigrated()) {
|
291 |
} else if (retailer.isMigrated()) {
|
| 284 |
responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.RETAILER.getValue());
|
292 |
responseMap.put(ProfitMandiConstants.USER_STATUS, UserStatus.RETAILER.getValue());
|
| Line 295... |
Line 303... |
| 295 |
}
|
303 |
}
|
| 296 |
|
304 |
|
| 297 |
return responseSender.ok(responseMap);
|
305 |
return responseSender.ok(responseMap);
|
| 298 |
}
|
306 |
}
|
| 299 |
|
307 |
|
| - |
|
308 |
@Autowired
|
| - |
|
309 |
FofoStoreRepository fofoStoreRepository;
|
| - |
|
310 |
@Autowired
|
| - |
|
311 |
PartnerOnBoardingPanelRepository partnerOnBoardingPanelRepository;
|
| - |
|
312 |
@Autowired
|
| - |
|
313 |
StoreTimelineTatService storeTimelineTatService;
|
| - |
|
314 |
private boolean getTimeLineStatus(int fofoId) throws ProfitMandiBusinessException {
|
| - |
|
315 |
FofoStore fs = fofoStoreRepository.selectByRetailerId(fofoId);
|
| - |
|
316 |
PartnerOnBoardingPanel partnerOnBoardingPanel = partnerOnBoardingPanelRepository.selectByCode(fs.getCode());
|
| - |
|
317 |
boolean status = true;
|
| - |
|
318 |
if (partnerOnBoardingPanel != null) {
|
| - |
|
319 |
|
| - |
|
320 |
status = storeTimelineTatService.getTimelineCompleted(partnerOnBoardingPanel.getId());
|
| - |
|
321 |
}
|
| - |
|
322 |
|
| - |
|
323 |
LOGGER.info("status" + status);
|
| - |
|
324 |
return status;
|
| - |
|
325 |
}
|
| - |
|
326 |
|
| 300 |
private RegisteredUserInfo getRegisteredUserInfo(User user) throws Throwable {
|
327 |
private RegisteredUserInfo getRegisteredUserInfo(User user) throws Throwable {
|
| 301 |
RegisteredUserInfo ri = new RegisteredUserInfo();
|
328 |
RegisteredUserInfo ri = new RegisteredUserInfo();
|
| 302 |
ri.setCity(user.getCity());
|
329 |
ri.setCity(user.getCity());
|
| 303 |
ri.setFirstName(user.getFirstName());
|
330 |
ri.setFirstName(user.getFirstName());
|
| 304 |
ri.setLastName(user.getLastName());
|
331 |
ri.setLastName(user.getLastName());
|