Class InvoicePreviewController
java.lang.Object
de.bytestore.hostinger.api.ecommerce.InvoicePreviewController
@RestController
@Configuration
@RequestMapping("/internal/invoice/preview")
public class InvoicePreviewController
extends Object
-
Constructor Summary
ConstructorsConstructorDescriptionInvoicePreviewController(io.jmix.core.DataManager dataManager, io.jmix.core.Metadata metadata, io.jmix.core.FileStorage fileStorage, InvoicesService invoicesService) -
Method Summary
Modifier and TypeMethodDescriptionvoidinvoiceGet(String id, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.ServletRequest servletRequest) Handles HTTP GET requests to retrieve an invoice based on its unique identifier.
-
Constructor Details
-
InvoicePreviewController
public InvoicePreviewController(io.jmix.core.DataManager dataManager, io.jmix.core.Metadata metadata, io.jmix.core.FileStorage fileStorage, InvoicesService invoicesService)
-
-
Method Details
-
invoiceGet
@GetMapping("/{id}") public void invoiceGet(@PathVariable String id, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.ServletRequest servletRequest) throws RuntimeException Handles HTTP GET requests to retrieve an invoice based on its unique identifier. Generates a PDF file for the requested invoice and returns it in the response. If the invoice cannot be found, returns a JSON error message.- Parameters:
id- the unique identifier of the invoice.response- the HTTP response object used to send the generated PDF or error message.servletRequest- the servlet request object containing the client's request details.- Throws:
RuntimeException- if an error occurs while generating or writing the PDF to the response.
-