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

import com.ffii.core.support.AbstractRepository
import com.ffii.fpsms.modules.stock.entity.projection.QrCodeInfo
import com.ffii.fpsms.modules.stock.entity.projection.StockInLineInfo
import org.springframework.stereotype.Repository
import java.util.Optional

@Repository
interface StockInLineRepository : AbstractRepository<StockInLine, Long> {
    fun findAllStockInLineInfoByStockInIdAndDeletedFalse(stockInId: Long): List<StockInLineInfo>
    fun findStockInLineInfoByIdAndDeletedFalse(id: Long): StockInLineInfo
    fun findAllByStockInIdAndDeletedFalse(stockInId: Long): List<StockInLine>
    fun findStockInLineInfoByIdInAndDeletedFalse(id: List<Long>): List<StockInLineInfo>
    fun findStockInLineInfoByPurchaseOrderLineIdAndStatusNotAndDeletedFalse(purchaseOrderLineId: Long, status: String): List<StockInLineInfo>
    fun findStockInLineInfoByPurchaseOrderLineIdAndDeletedFalse(purchaseOrderLineId: Long): List<StockInLineInfo>
    fun findStockInLineInfoByIdAndStatusAndDeletedFalse(id: Long, status: String): Optional<StockInLineInfo>
    fun findAllStockInLineInfoByPurchaseOrderIdAndStatusStartsWithAndDeletedFalse(purchaseOrderId: Long, status: String): List<Optional<StockInLineInfo>>
    fun findAllByPurchaseOrderIdAndDeletedFalse(purchaseOrderId: Long): Optional<List<StockInLine>>
    fun findStockInLineInfoByInventoryLotLineId(inventoryLotLineId: Long): Optional<StockInLineInfo>
    fun findStockInLineInfoById(id: Long): Optional<StockInLineInfo>
}