| Line 49... |
Line 49... |
| 49 |
import com.spice.profitmandi.dao.entity.user.Address;
|
49 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 50 |
import com.spice.profitmandi.dao.entity.user.Promoter;
|
50 |
import com.spice.profitmandi.dao.entity.user.Promoter;
|
| 51 |
import com.spice.profitmandi.dao.entity.user.Refferal;
|
51 |
import com.spice.profitmandi.dao.entity.user.Refferal;
|
| 52 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
52 |
import com.spice.profitmandi.dao.enumuration.dtr.RefferalStatus;
|
| 53 |
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
|
53 |
import com.spice.profitmandi.dao.enumuration.dtr.RoleType;
|
| - |
|
54 |
import com.spice.profitmandi.dao.model.CreateRefferalRequest;
|
| 54 |
import com.spice.profitmandi.dao.model.DateRangeModel;
|
55 |
import com.spice.profitmandi.dao.model.DateRangeModel;
|
| 55 |
import com.spice.profitmandi.dao.model.UserCart;
|
56 |
import com.spice.profitmandi.dao.model.UserCart;
|
| 56 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
57 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| 57 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
58 |
import com.spice.profitmandi.dao.repository.cs.CsService;
|
| 58 |
import com.spice.profitmandi.dao.repository.dtr.RefferalRepository;
|
59 |
import com.spice.profitmandi.dao.repository.dtr.RefferalRepository;
|
| Line 68... |
Line 69... |
| 68 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
69 |
import com.spice.profitmandi.service.authentication.RoleManager;
|
| 69 |
import com.spice.profitmandi.service.user.RetailerService;
|
70 |
import com.spice.profitmandi.service.user.RetailerService;
|
| 70 |
import com.spice.profitmandi.service.user.UserService;
|
71 |
import com.spice.profitmandi.service.user.UserService;
|
| 71 |
import com.spice.profitmandi.web.enumuration.UserStatus;
|
72 |
import com.spice.profitmandi.web.enumuration.UserStatus;
|
| 72 |
import com.spice.profitmandi.web.processor.GoogleLoginProcessor;
|
73 |
import com.spice.profitmandi.web.processor.GoogleLoginProcessor;
|
| 73 |
import com.spice.profitmandi.web.req.CreateRefferalRequest;
|
- |
|
| - |
|
74 |
|
| 74 |
import com.spice.profitmandi.web.req.RefferalEarning;
|
75 |
import com.spice.profitmandi.web.req.RefferalEarning;
|
| 75 |
import com.spice.profitmandi.web.req.RefferalEarningModel;
|
76 |
import com.spice.profitmandi.web.req.RefferalEarningModel;
|
| 76 |
import com.spice.profitmandi.web.req.UserRequest;
|
77 |
import com.spice.profitmandi.web.req.UserRequest;
|
| 77 |
import com.spice.profitmandi.web.res.Partner;
|
78 |
import com.spice.profitmandi.web.res.Partner;
|
| 78 |
|
79 |
|
| Line 712... |
Line 713... |
| 712 |
} else if (confirmedRefferalValue >= 10) {
|
713 |
} else if (confirmedRefferalValue >= 10) {
|
| 713 |
rfm.setMinimumEarning(200000);
|
714 |
rfm.setMinimumEarning(200000);
|
| 714 |
}
|
715 |
}
|
| 715 |
return rfm;
|
716 |
return rfm;
|
| 716 |
}
|
717 |
}
|
| 717 |
|
718 |
|
| 718 |
@RequestMapping(value = "/user/partnerTarget", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
719 |
@RequestMapping(value = "/user/partnerTarget", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
| 719 |
@ApiImplicitParams({
|
720 |
@ApiImplicitParams({
|
| 720 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
721 |
@ApiImplicitParam(name = "Auth-Token", value = "Auth-Token", required = true, dataType = "string", paramType = "header") })
|
| 721 |
public ResponseEntity<?> PartnerTarget(HttpServletRequest request) throws Exception {
|
722 |
public ResponseEntity<?> PartnerTarget(HttpServletRequest request) throws Exception {
|
| 722 |
int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
|
723 |
int userId = (int) request.getAttribute(ProfitMandiConstants.USER_ID);
|
| 723 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
724 |
int retailerId = userAccountRepository.selectRetailerIdByUserId(userId);
|
| 724 |
PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(retailerId, LocalDate.now());
|
725 |
PartnerType partnerType = partnerTypeChangeService.getTypeOnDate(retailerId, LocalDate.now());
|
| 725 |
|
726 |
|
| 726 |
return responseSender.ok(partnerType);
|
727 |
return responseSender.ok(partnerType);
|
| 727 |
}
|
728 |
}
|
| 728 |
|
729 |
|
| 729 |
}
|
730 |
}
|