Class InsumoController

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

@RestController @RequestMapping("/api/insumos") public class InsumoController extends Object
REST controller for insumo (supply/ingredient) catalogue management.

Access rules:

  • GET endpoints – any authenticated user (EMPLEADO, PROPIETARIO, ROOT)
  • POST / PUT – PROPIETARIO or ROOT (managers create/edit supplies)
  • DELETE /{id} – PROPIETARIO or ROOT (soft-deactivation)
  • Constructor Details

    • InsumoController

      public InsumoController(InsumoService service)
  • Method Details

    • listar

      @GetMapping @PreAuthorize("isAuthenticated()") public org.springframework.data.domain.Page<InsumoResponse> listar(org.springframework.data.domain.Pageable pageable)
    • obtener

      @GetMapping("/{id}") @PreAuthorize("isAuthenticated()") public InsumoResponse obtener(@PathVariable Long id)
    • crear

      @PostMapping @PreAuthorize("hasAnyRole(\'PROPIETARIO\',\'ROOT\')") public org.springframework.http.ResponseEntity<InsumoResponse> crear(@Valid @RequestBody @Valid InsumoCreateRequest request)
    • actualizar

      @PutMapping("/{id}") @PreAuthorize("hasAnyRole(\'PROPIETARIO\',\'ROOT\')") public InsumoResponse actualizar(@PathVariable Long id, @Valid @RequestBody @Valid InsumoUpdateRequest request)
    • desactivar

      @DeleteMapping("/{id}") @PreAuthorize("hasAnyRole(\'PROPIETARIO\',\'ROOT\')") public org.springframework.http.ResponseEntity<Void> desactivar(@PathVariable Long id)