| Line 575... |
Line 575... |
| 575 |
}
|
575 |
}
|
| 576 |
|
576 |
|
| 577 |
//CDs would be rejected based on cdFreeDays
|
577 |
//CDs would be rejected based on cdFreeDays
|
| 578 |
public void processSchemeIn(int purchaseId, int retailerId) throws ProfitMandiBusinessException {
|
578 |
public void processSchemeIn(int purchaseId, int retailerId) throws ProfitMandiBusinessException {
|
| 579 |
LOGGER.info("Processing scheme in for purchaseId - {}", purchaseId);
|
579 |
LOGGER.info("Processing scheme in for purchaseId - {}", purchaseId);
|
| - |
|
580 |
// Serialize processors of the same purchase (GRN scans, cron sweep, manual triggers) so the
|
| - |
|
581 |
// paid/pending dedup checks below always read post-commit state.
|
| - |
|
582 |
purchaseRepository.selectForUpdate(purchaseId);
|
| 580 |
Purchase purchase = purchaseRepository.selectByIdAndFofoId(purchaseId, retailerId);
|
583 |
Purchase purchase = purchaseRepository.selectByIdAndFofoId(purchaseId, retailerId);
|
| 581 |
String purchaseInvoice = purchase.getPurchaseReference();
|
584 |
String purchaseInvoice = purchase.getPurchaseReference();
|
| 582 |
|
585 |
|
| 583 |
Loan loan = loanRepository.selectLoanByInvoice(purchaseInvoice);
|
586 |
Loan loan = loanRepository.selectLoanByInvoice(purchaseInvoice);
|
| 584 |
|
587 |
|