src/main/java/com/kshrd/derphsar_api/rest/restcontroller/OrderDetailRestController.java
/**
     * Put a promotion
     *
     * @param orderId - Id of a promotion
     * @param orderDetailUpdateIsCheckoutModel - Promotion request model
     * @return - Return response message
     */
Put a promotion
@param orderId - Id of a promotion
@param orderDetailUpdateIsCheckoutModel - Promotion request model
@return - Return response message
Put a promotion @param orderId - Id of a promotion @param orderDetailUpdateIsCheckoutModel - Promotion request model @return - Return response message
@PatchMapping("/orderDetails/{orderId}")
    @ApiOperation(value = "checkout", response = OrderDetailUpdateIsCheckoutModel.class)
    public ResponseEntity<BaseApiNoPaginationResponse<List<OrderDetailUpdateIsCheckoutModel>>> updateIsCheckout(@PathVariable("orderId") String orderId,
                                                                                                  @RequestBody OrderDetailUpdateIsCheckoutModel orderDetailUpdateIsCheckoutModel) {
        ModelMapper modelMapper = new ModelMapper();
        BaseApiNoPaginationResponse<List<OrderDetailUpdateIsCheckoutModel>> response = new BaseApiNoPaginationResponse<>();
        List<OrderDetailUpdateIsCheckoutModel> orderDetailUpdateIsCheckoutModelArrayList = new ArrayList<>();
        try {
            OrderDetailDto orderDetailDto = modelMapper.map(orderDetailUpdateIsCheckoutModel, OrderDetailDto.class);
            OrderDto findOrderByOrderId = orderServiceImp.getOrderByOrderId(orderId);
            System.out.println(findOrderByOrderId);
            List<OrderDetailDto> result = orderDetailServiceImp.updateIsCheckout(findOrderByOrderId.getId(), orderDetailDto);
            for(OrderDetailDto orderDetailDto1 : result){
                orderDetailUpdateIsCheckoutModelArrayList.add(modelMapper.map(orderDetailDto1, OrderDetailUpdateIsCheckoutModel.class));
            }
            response.setMessage(message.updated("OrderDetail"));
            response.setStatus(HttpStatus.OK);
            response.setData(orderDetailUpdateIsCheckoutModelArrayList);
        }catch (Exception e){
            e.printStackTrace();
        }
        response.setTime(new Timestamp(System.currentTimeMillis()));
        return ResponseEntity.ok(response);
    }
@ PatchMapping ( "/orderDetails/{orderId}" ) @ ApiOperation ( value = "checkout" , response = OrderDetailUpdateIsCheckoutModel . class ) public ResponseEntity < BaseApiNoPaginationResponse < List < OrderDetailUpdateIsCheckoutModel > > > updateIsCheckout ( @ PathVariable ( "orderId" ) String orderId , @ RequestBody OrderDetailUpdateIsCheckoutModel orderDetailUpdateIsCheckoutModel ) { ModelMapper modelMapper = new ModelMapper ( ) ; BaseApiNoPaginationResponse < List < OrderDetailUpdateIsCheckoutModel > > response = new BaseApiNoPaginationResponse < > ( ) ; List < OrderDetailUpdateIsCheckoutModel > orderDetailUpdateIsCheckoutModelArrayList = new ArrayList < > ( ) ; try { OrderDetailDto orderDetailDto = modelMapper . map ( orderDetailUpdateIsCheckoutModel , OrderDetailDto . class ) ; OrderDto findOrderByOrderId = orderServiceImp . getOrderByOrderId ( orderId ) ; System . out . println ( findOrderByOrderId ) ; List < OrderDetailDto > result = orderDetailServiceImp . updateIsCheckout ( findOrderByOrderId . getId ( ) , orderDetailDto ) ; for ( OrderDetailDto orderDetailDto1 : result ) { orderDetailUpdateIsCheckoutModelArrayList . add ( modelMapper . map ( orderDetailDto1 , OrderDetailUpdateIsCheckoutModel . class ) ) ; } response . setMessage ( message . updated ( "OrderDetail" ) ) ; response . setStatus ( HttpStatus . OK ) ; response . setData ( orderDetailUpdateIsCheckoutModelArrayList ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } response . setTime ( new Timestamp ( System . currentTimeMillis ( ) ) ) ; return ResponseEntity . ok ( response ) ; }
Put a promotion
 @param orderId - Id of a promotion
 @param orderDetailUpdateIsCheckoutModel - Promotion request model
 @return - Return response message
Put a promotion @param orderId - Id of a promotion @param orderDetailUpdateIsCheckoutModel - Promotion request model @return - Return response message