package com.ffii.fpsms.modules.master.web

import com.ffii.fpsms.modules.master.entity.Process
import com.ffii.fpsms.modules.master.entity.ProcessRepository
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/Process")
class ProcessController(
    private val processRepository: ProcessRepository,
) {
    /** All non-deleted master processes (for dropdowns, e.g. distinct codes on the client). */
    @GetMapping
    fun allProcesses(): List<Process> = processRepository.findAllByDeletedFalse()
}
