| Line 468... |
Line 468... |
| 468 |
throw new ProfitMandiBusinessException("invalidItemIds", itemIdCustomFofoOrderItemMap.keySet(), "FFORDR_1003");
|
468 |
throw new ProfitMandiBusinessException("invalidItemIds", itemIdCustomFofoOrderItemMap.keySet(), "FFORDR_1003");
|
| 469 |
}
|
469 |
}
|
| 470 |
|
470 |
|
| 471 |
Map<Integer, Item> itemMap = this.toItemMap(items);
|
471 |
Map<Integer, Item> itemMap = this.toItemMap(items);
|
| 472 |
|
472 |
|
| - |
|
473 |
// Validate brand code eligibility - block orders for brands without dealer code
|
| - |
|
474 |
FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(fofoId);
|
| - |
|
475 |
if (!fofoStore.isInternal()) {
|
| - |
|
476 |
List<String> partnerIneligibleBrands = brandsService.partnerIneligibleBrands(fofoId);
|
| - |
|
477 |
for (Item item : items) {
|
| - |
|
478 |
if (partnerIneligibleBrands.contains(item.getBrand())) {
|
| - |
|
479 |
LOGGER.error("Brand code not active for brand {}, fofoId {}", item.getBrand(), fofoId);
|
| - |
|
480 |
throw new ProfitMandiBusinessException("Brand is not allowed",
|
| - |
|
481 |
"Brand code not active for " + item.getBrand() + ". Please contact your RBM for further details.", "FFORDR_1018");
|
| - |
|
482 |
}
|
| - |
|
483 |
}
|
| - |
|
484 |
}
|
| - |
|
485 |
|
| 473 |
Set<Integer> nonSerializedItemIds = new HashSet<>();
|
486 |
Set<Integer> nonSerializedItemIds = new HashSet<>();
|
| 474 |
Set<String> serialNumbers = new HashSet<>();
|
487 |
Set<String> serialNumbers = new HashSet<>();
|
| 475 |
List<InsuranceModel> insuredModels = new ArrayList<>();
|
488 |
List<InsuranceModel> insuredModels = new ArrayList<>();
|
| 476 |
noGST = items.stream().anyMatch(item -> "NOGST".equals(item.getHsnCode()));
|
489 |
noGST = items.stream().anyMatch(item -> "NOGST".equals(item.getHsnCode()));
|
| 477 |
for (CustomFofoOrderItem customFofoOrderItem : createOrderRequest.getFofoOrderItems()) {
|
490 |
for (CustomFofoOrderItem customFofoOrderItem : createOrderRequest.getFofoOrderItems()) {
|