OrderProductController.java

package cz.vsb.crm.controller;

import cz.vsb.crm.dto.OrderProductView;
import cz.vsb.crm.service.OrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/order-products")
@RequiredArgsConstructor
public class OrderProductController {

    private final OrderService orderService;

    @GetMapping
    public List<OrderProductView> list() {
        return orderService.getAllProductLines();
    }
}