Subversion Repositories SmartDukaan

Rev

Rev 36348 | Rev 36492 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36348 Rev 36487
Line 401... Line 401...
401
            throws Exception {
401
            throws Exception {
402
        CreateOfferRequest createOfferRequest = offerService.getOffer(0, offerId);
402
        CreateOfferRequest createOfferRequest = offerService.getOffer(0, offerId);
403
        if (!createOfferRequest.isActive()) {
403
        if (!createOfferRequest.isActive()) {
404
            throw new ProfitMandiBusinessException("Offer not active", "Offer not active", "Offer not active");
404
            throw new ProfitMandiBusinessException("Offer not active", "Offer not active", "Offer not active");
405
        }
405
        }
-
 
406
        if (offerBatchService.hasUnfinishedBatch(offerId)) {
-
 
407
            throw new ProfitMandiBusinessException("Reprocessing not allowed",
-
 
408
                    "Existing batch for this offer is not fully processed yet",
-
 
409
                    "Existing batch for this offer is not fully processed yet");
-
 
410
        }
-
 
411
        Offer offer = offerRepository.selectById(offerId);
-
 
412
        offer.setProcessedTimestamp(LocalDateTime.now());
406
        String message = offerBatchService.submitBatchAsync(offerId);
413
        String message = offerBatchService.submitBatchAsync(offerId);
407
        return responseSender.ok(message);
414
        return responseSender.ok(message);
408
    }
415
    }
409
 
416
 
410
    @RequestMapping(value = "/offerDownload", method = RequestMethod.GET)
417
    @RequestMapping(value = "/offerDownload", method = RequestMethod.GET)