Class LoteController

java.lang.Object
com.deusto.coffeestack.controller.LoteController

@RestController @RequestMapping("/api/lotes") public class LoteController extends Object
REST controller for supply batch (lote) reception and traceability.

Access rules:

  • GET endpoints – any authenticated user
  • POST /api/lotes – EMPLEADO, PROPIETARIO or ROOT
  • Constructor Details

    • LoteController

      public LoteController(LoteService service)
  • Method Details

    • recibir

      @PostMapping @PreAuthorize("hasAnyRole(\'EMPLEADO\',\'PROPIETARIO\',\'ROOT\')") public org.springframework.http.ResponseEntity<LoteResponse> recibir(@Valid @RequestBody @Valid LoteCreateRequest request)
    • listarPorInsumo

      @GetMapping("/insumo/{insumoId}") @PreAuthorize("isAuthenticated()") public List<LoteResponse> listarPorInsumo(@PathVariable Long insumoId)
    • obtener

      @GetMapping("/{id}") @PreAuthorize("isAuthenticated()") public LoteResponse obtener(@PathVariable Long id)