| Line 237... |
Line 237... |
| 237 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
237 |
LoginDetails loginDetails = cookiesProcessor.getCookiesObject(request);
|
| 238 |
if (loginDetails.getEmailId().equals("tarun.verma@smartdukaan.com") || loginDetails.getEmailId().equals("kamini.sharma@smartdukaan.com")) {
|
238 |
if (loginDetails.getEmailId().equals("tarun.verma@smartdukaan.com") || loginDetails.getEmailId().equals("kamini.sharma@smartdukaan.com")) {
|
| 239 |
SDCreditRequirement sdCreditRequirement = sdCreditRequirementRepository.selectById(id);
|
239 |
SDCreditRequirement sdCreditRequirement = sdCreditRequirementRepository.selectById(id);
|
| 240 |
sdCreditRequirement.setHardLimit(false);
|
240 |
sdCreditRequirement.setHardLimit(false);
|
| 241 |
sdCreditRequirement.setLimit(sdCreditRequirement.getSuggestedLimit());
|
241 |
sdCreditRequirement.setLimit(sdCreditRequirement.getSuggestedLimit());
|
| - |
|
242 |
sdCreditRequirement.setUpdateTimestamp(LocalDateTime.now());
|
| - |
|
243 |
|
| - |
|
244 |
// Mirror the new sanction to the gateway in the same request, as /creditRequirement
|
| - |
|
245 |
// already does. Releasing a hard limit can move the sanction a long way — Inder Mobile
|
| - |
|
246 |
// sat at a pinned 8,00,000 against a suggested 9,09,114 — and leaving credit_account
|
| - |
|
247 |
// behind means the gateway under-reports the partner until a full limit pass rewrites
|
| - |
|
248 |
// it. That used to be masked: the 20-minute pass rewrote ~220 partners every run because
|
| - |
|
249 |
// float noise made almost every comparison look like a change, so the mirror was
|
| - |
|
250 |
// repaired by accident. With that noise removed and the full pass now daily, the stale
|
| - |
|
251 |
// window would be most of a day.
|
| - |
|
252 |
CreditAccount creditAccount = creditAccountRepository.selectByFofoIdAndGateway(
|
| - |
|
253 |
sdCreditRequirement.getFofoId(), Gateway.SDDIRECT);
|
| - |
|
254 |
if (creditAccount == null) {
|
| - |
|
255 |
creditAccount = creditAccountRepository.selectByFofoIdAndGateway(
|
| - |
|
256 |
sdCreditRequirement.getFofoId(), Gateway.SIDBI);
|
| - |
|
257 |
}
|
| - |
|
258 |
if (creditAccount != null) {
|
| - |
|
259 |
BigDecimal utilizedLimit = sdCreditService.getUtilizationAmount(sdCreditRequirement.getFofoId());
|
| - |
|
260 |
creditAccount.setSanctionedAmount(sdCreditRequirement.getLimit().floatValue());
|
| - |
|
261 |
creditAccount.setAvailableAmount(sdCreditRequirement.getLimit().subtract(utilizedLimit).floatValue());
|
| - |
|
262 |
creditAccount.setUpdatedOn(LocalDateTime.now());
|
| - |
|
263 |
}
|
| 242 |
}
|
264 |
}
|
| 243 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
265 |
model.addAttribute("response1", mvcResponseSender.createResponseString(true));
|
| 244 |
return "response";
|
266 |
return "response";
|
| 245 |
}
|
267 |
}
|
| 246 |
|
268 |
|