| Line 22... |
Line 22... |
| 22 |
import com.spice.profitmandi.dao.entity.transaction.TransactionApproval;
|
22 |
import com.spice.profitmandi.dao.entity.transaction.TransactionApproval;
|
| 23 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
23 |
import com.spice.profitmandi.dao.entity.transaction.UserWalletHistory;
|
| 24 |
import com.spice.profitmandi.dao.entity.user.Address;
|
24 |
import com.spice.profitmandi.dao.entity.user.Address;
|
| 25 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
25 |
import com.spice.profitmandi.dao.enumuration.cs.EscalationType;
|
| 26 |
import com.spice.profitmandi.dao.enumuration.dtr.PaymentOptionReferenceType;
|
26 |
import com.spice.profitmandi.dao.enumuration.dtr.PaymentOptionReferenceType;
|
| - |
|
27 |
import com.spice.profitmandi.dao.enumuration.dtr.StoreTimeline;
|
| 27 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
28 |
import com.spice.profitmandi.dao.enumuration.transaction.OrderStatus;
|
| 28 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionApprovalStatus;
|
29 |
import com.spice.profitmandi.dao.enumuration.transaction.TransactionApprovalStatus;
|
| 29 |
import com.spice.profitmandi.dao.model.ItemWiseCustomerOfferSummaryModel;
|
30 |
import com.spice.profitmandi.dao.model.ItemWiseCustomerOfferSummaryModel;
|
| 30 |
import com.spice.profitmandi.dao.model.hdfc.IrnResetOrderModel;
|
31 |
import com.spice.profitmandi.dao.model.hdfc.IrnResetOrderModel;
|
| 31 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
32 |
import com.spice.profitmandi.dao.repository.auth.AuthRepository;
|
| Line 1958... |
Line 1959... |
| 1958 |
transactionApproval.setApprovalId(approvalId);
|
1959 |
transactionApproval.setApprovalId(approvalId);
|
| 1959 |
transactionApproval.setApprovedBy(approvedBy);
|
1960 |
transactionApproval.setApprovedBy(approvedBy);
|
| 1960 |
transactionApproval.setApprovedOn(approvedOn);
|
1961 |
transactionApproval.setApprovedOn(approvedOn);
|
| 1961 |
if (transactionApprovalStatus.equals(TransactionApprovalStatus.APPROVED)) {
|
1962 |
if (transactionApprovalStatus.equals(TransactionApprovalStatus.APPROVED)) {
|
| 1962 |
transactionService.processTransaction(transactionId, 0);
|
1963 |
transactionService.processTransaction(transactionId, 0);
|
| 1963 |
// Track PO_APPROVAL on timeline (validateEvent handles duplicate/blocker checks)
|
1964 |
// Track PO_APPROVAL on timeline (direct call like BILLING — bypasses BLOCKER_MAP
|
| - |
|
1965 |
// since the PO is actually being approved, the timeline must record it)
|
| 1964 |
try {
|
1966 |
try {
|
| 1965 |
FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(retailerId);
|
1967 |
FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(retailerId);
|
| 1966 |
if (fofoStore != null && fofoStore.getCode() != null) {
|
1968 |
if (fofoStore != null && fofoStore.getCode() != null) {
|
| 1967 |
PartnerOnBoardingPanel pob = partnerOnBoardingPanelRepository.selectByCode(fofoStore.getCode());
|
1969 |
PartnerOnBoardingPanel pob = partnerOnBoardingPanelRepository.selectByCode(fofoStore.getCode());
|
| 1968 |
if (pob != null) {
|
1970 |
if (pob != null) {
|
| 1969 |
storeTimelineTatService.onPoApprovalComplete(pob.getId());
|
1971 |
storeTimelineTatService.createStoreTimelinetb(pob.getId(), StoreTimeline.PO_APPROVAL);
|
| 1970 |
}
|
1972 |
}
|
| 1971 |
}
|
1973 |
}
|
| 1972 |
} catch (Exception e) {
|
1974 |
} catch (Exception e) {
|
| 1973 |
LOGGER.error("Failed to track PO_APPROVAL timeline for transactionId: " + transactionId, e);
|
1975 |
LOGGER.error("Failed to track PO_APPROVAL timeline for transactionId: " + transactionId, e);
|
| 1974 |
}
|
1976 |
}
|