package com.ffii.fpsms.modules.purchaseOrder.entity

import com.ffii.core.support.AbstractRepository
import com.ffii.fpsms.modules.purchaseOrder.entity.projections.PurchaseOrderInfo
import org.springframework.stereotype.Repository
import java.io.Serializable
import java.util.Optional

@Repository
interface PurchaseOrderRepository : AbstractRepository<PurchaseOrder, Long> {
    fun findTopByM18DataLogIdAndDeletedIsFalseOrderByModifiedDesc(m18datalogId: Serializable): PurchaseOrder?

    fun findPurchaseOrderInfoByDeletedIsFalse(): List<PurchaseOrderInfo>
    fun findPurchaseOrderInfoByIdAndDeletedIsFalse(id: Long): PurchaseOrderInfo

    fun findByIdAndDeletedFalse(id: Long): Optional<PurchaseOrder>
}