package com.ffii.fpsms.modules.stock.entity

import com.ffii.core.support.AbstractRepository
import org.springframework.stereotype.Repository
import java.util.Optional

@Repository
interface StockOutRepository: AbstractRepository<StockOut, Long>  {
    fun findByConsoPickOrderCode(consoPickOrderCode: String) : Optional<StockOut>
    // consoPickOrderCode 可能在 DB 中存在重复，避免 single-result exception
    fun findFirstByConsoPickOrderCodeOrderByIdDesc(consoPickOrderCode: String): StockOut?
    fun findByStockTakeIdAndDeletedFalse(stockTakeId: Long): StockOut?

}