| Line 1... |
Line 1... |
| 1 |
package com.spice.profitmandi.web.controller;
|
1 |
package com.spice.profitmandi.web.controller;
|
| 2 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
2 |
import com.spice.profitmandi.common.model.ProfitMandiConstants;
|
| 3 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
3 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| 4 |
import com.spice.profitmandi.dao.entity.fofo.TrialForm;
|
4 |
import com.spice.profitmandi.dao.entity.fofo.TrialForm;
|
| - |
|
5 |
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
|
| 5 |
import com.spice.profitmandi.dao.repository.trialOnboarding.TrialFormRepository;
|
6 |
import com.spice.profitmandi.dao.repository.trialOnboarding.TrialFormRepository;
|
| 6 |
import com.spice.profitmandi.dao.repository.user.PrivateDealUserRepository;
|
- |
|
| 7 |
import com.spice.profitmandi.dao.service.TrialService;
|
7 |
import com.spice.profitmandi.dao.service.TrialService;
|
| 8 |
import com.spice.profitmandi.service.integrations.gstpro.GstProService;
|
8 |
import com.spice.profitmandi.service.integrations.gstpro.GstProService;
|
| 9 |
import com.spice.profitmandi.service.integrations.gstpro.entity.GstDetails;
|
9 |
import com.spice.profitmandi.service.integrations.gstpro.entity.GstDetails;
|
| 10 |
import org.apache.logging.log4j.LogManager;
|
10 |
import org.apache.logging.log4j.LogManager;
|
| 11 |
import org.apache.logging.log4j.Logger;
|
11 |
import org.apache.logging.log4j.Logger;
|
| Line 41... |
Line 41... |
| 41 |
|
41 |
|
| 42 |
@Autowired
|
42 |
@Autowired
|
| 43 |
TrialService trialService;
|
43 |
TrialService trialService;
|
| 44 |
|
44 |
|
| 45 |
@Autowired
|
45 |
@Autowired
|
| 46 |
PrivateDealUserRepository privateDealUserRepository;
|
46 |
FofoStoreRepository fofoStoreRepository;
|
| 47 |
|
47 |
|
| 48 |
private static final Logger LOGGER = LogManager.getLogger(DealsController.class);
|
48 |
private static final Logger LOGGER = LogManager.getLogger(DealsController.class);
|
| 49 |
|
49 |
|
| 50 |
|
50 |
|
| 51 |
@RequestMapping(value = "/gstValidate", method = RequestMethod.GET)
|
51 |
@RequestMapping(value = "/gstValidate", method = RequestMethod.GET)
|
| Line 72... |
Line 72... |
| 72 |
TrialForm existingUser = trialOnboardingRepository.findByMobile(trialForm.getMobile());
|
72 |
TrialForm existingUser = trialOnboardingRepository.findByMobile(trialForm.getMobile());
|
| 73 |
if (existingUser != null) {
|
73 |
if (existingUser != null) {
|
| 74 |
return responseSender.badRequest("User already exists, PLease check your mobile number");
|
74 |
return responseSender.badRequest("User already exists, PLease check your mobile number");
|
| 75 |
}
|
75 |
}
|
| 76 |
|
76 |
|
| 77 |
boolean existingGst= privateDealUserRepository.isActiveByGst(trialForm.getGstNumber());
|
77 |
boolean existingGst= fofoStoreRepository.existsByGstNumber(trialForm.getGstNumber());
|
| 78 |
if(existingGst){
|
78 |
if(existingGst){
|
| 79 |
return responseSender.badRequest("User Gst already exists, PLease check your gst number");
|
79 |
return responseSender.badRequest("User Gst already exists, PLease check your gst number");
|
| 80 |
}
|
80 |
}
|
| 81 |
|
81 |
|
| 82 |
trialForm.setStatus(ProfitMandiConstants.Status.PENDING);
|
82 |
trialForm.setStatus(ProfitMandiConstants.Status.PENDING);
|