| Line 1160... |
Line 1160... |
| 1160 |
}
|
1160 |
}
|
| 1161 |
|
1161 |
|
| 1162 |
return responseSender.ok(isCombo);
|
1162 |
return responseSender.ok(isCombo);
|
| 1163 |
}
|
1163 |
}
|
| 1164 |
|
1164 |
|
| 1165 |
|
- |
|
| 1166 |
@GetMapping(value = "/partner/wodCompleteBrands", produces = MediaType.APPLICATION_JSON_VALUE)
|
1165 |
@GetMapping(value = "/partner/wodCompleteBrands", produces = MediaType.APPLICATION_JSON_VALUE)
|
| 1167 |
public ResponseEntity<?> getWodcompletBrands(HttpServletRequest request) throws Exception {
|
1166 |
public ResponseEntity<?> getWodcompletBrands(HttpServletRequest request) throws Exception {
|
| 1168 |
UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
|
1167 |
UserInfo userInfo = (UserInfo) request.getAttribute("userInfo");
|
| 1169 |
FofoStore fofoStore = fofoStoreRepository.selectByRetailerId(userInfo.getRetailerId());
|
- |
|
| 1170 |
PartnerOnBoardingPanel partnerOnBoardingPanel = partnerOnBoardingPanelRepository.selectByCode(fofoStore.getCode());
|
- |
|
| 1171 |
List<PartnerDealerMapping> partnerDealerMappingList = new ArrayList<>();
|
- |
|
| 1172 |
List<String> wodCompletedBrands = new ArrayList<>();
|
- |
|
| 1173 |
if (partnerOnBoardingPanel != null) {
|
- |
|
| 1174 |
partnerDealerMappingList = partnerDealerRepository.selectByOnboardingId(partnerOnBoardingPanel.getId());
|
- |
|
| 1175 |
if (partnerDealerMappingList != null && partnerDealerMappingList.size() > 0) {
|
- |
|
| 1176 |
//working brands -> Partner only work with brands that having 'Dealer Code'
|
- |
|
| 1177 |
wodCompletedBrands = partnerDealerMappingList.stream().filter(x -> x.getBrandCode().trim().length() > 0).map(x -> x.getBrand()).collect(Collectors.toList());
|
- |
|
| 1178 |
}
|
- |
|
| 1179 |
}
|
- |
|
| 1180 |
BrandAndAddToCartEligibleModel partnerWorkingBrandMappingModel = new BrandAndAddToCartEligibleModel();
|
1168 |
BrandAndAddToCartEligibleModel brandAndAddToCartEligibleModel = brandsService.wodcompletBrands(userInfo.getRetailerId());
|
| 1181 |
partnerWorkingBrandMappingModel.setWodCompleteBrands(wodCompletedBrands);
|
- |
|
| 1182 |
//brandsToBeCheck
|
- |
|
| 1183 |
List<String> wodRequiredBrand = brandCommitRepository.selectAllActiveBrand().stream().filter(x -> x.isNocRequired()).map(x -> x.getBrand()).collect(Collectors.toList());
|
- |
|
| 1184 |
partnerWorkingBrandMappingModel.setWodRequiredBrands(wodRequiredBrand);
|
- |
|
| 1185 |
return responseSender.ok(partnerWorkingBrandMappingModel);
|
1169 |
return responseSender.ok(brandAndAddToCartEligibleModel);
|
| 1186 |
|
1170 |
|
| 1187 |
}
|
1171 |
}
|
| 1188 |
|
1172 |
|
| 1189 |
}
|
1173 |
}
|
| 1190 |
|
1174 |
|