src/main/java/com/kshrd/derphsar_api/rest/restcontroller/PromotionRestController.java
/**
     * Delete a promotion
     *
     * @param promoId - Id of a promotion
     * @return - Return response message
     */
Delete a promotion
@param promoId - Id of a promotion
@return - Return response message
Delete a promotion @param promoId - Id of a promotion @return - Return response message
@DeleteMapping("/promotions/{promoId}")
    @ApiOperation(value = "delete a promotion by promotion id", response = Void.class)
    public ResponseEntity<BaseApiNoPaginationResponse<Void>> deletePromotion(@PathVariable("promoId") String promoId) {
        BaseApiNoPaginationResponse<Void> response = new BaseApiNoPaginationResponse<>();
        PromotionDto promotionDto = promotionServiceImp.findById(promoId);
        if(promotionDto != null){
            promotionServiceImp.deletePromotion(promoId);
            response.setMessage(message.deleted("Promotion"));
            response.setStatus(HttpStatus.OK);
        }else {
            response.setMessage(message.deleteError("Promotion"));
            response.setStatus(HttpStatus.BAD_REQUEST);
        }
        response.setTime(new Timestamp(System.currentTimeMillis()));
        return ResponseEntity.ok(response);
    }
@ DeleteMapping ( "/promotions/{promoId}" ) @ ApiOperation ( value = "delete a promotion by promotion id" , response = Void . class ) public ResponseEntity < BaseApiNoPaginationResponse < Void > > deletePromotion ( @ PathVariable ( "promoId" ) String promoId ) { BaseApiNoPaginationResponse < Void > response = new BaseApiNoPaginationResponse < > ( ) ; PromotionDto promotionDto = promotionServiceImp . findById ( promoId ) ; if ( promotionDto != null ) { promotionServiceImp . deletePromotion ( promoId ) ; response . setMessage ( message . deleted ( "Promotion" ) ) ; response . setStatus ( HttpStatus . OK ) ; } else { response . setMessage ( message . deleteError ( "Promotion" ) ) ; response . setStatus ( HttpStatus . BAD_REQUEST ) ; } response . setTime ( new Timestamp ( System . currentTimeMillis ( ) ) ) ; return ResponseEntity . ok ( response ) ; }
Delete a promotion
 @param promoId - Id of a promotion
 @return - Return response message
Delete a promotion @param promoId - Id of a promotion @return - Return response message