package com.ffii.fpsms.modules.stock.service

import com.ffii.core.support.AbstractBaseEntityService
import com.ffii.core.support.JdbcDao
import com.ffii.fpsms.modules.master.entity.Items
import com.ffii.fpsms.modules.master.entity.ItemsRepository
import com.ffii.fpsms.modules.master.web.models.MessageResponse
import com.ffii.fpsms.modules.pickOrder.entity.PickOrderRepository
import com.ffii.fpsms.modules.pickOrder.enums.PickOrderStatus
import com.ffii.fpsms.modules.stock.entity.*
import com.ffii.fpsms.modules.stock.web.model.SaveStockOutRequest
import com.ffii.fpsms.modules.stock.web.model.StockOutLineStatus
import com.ffii.fpsms.modules.stock.web.model.StockOutStatus
import org.springframework.stereotype.Service
import org.springframework.transaction.annotation.Transactional
import java.io.IOException
import java.time.LocalDate
import java.time.LocalDateTime

@Service
open class StockOutService(
    private val jdbcDao: JdbcDao,
    private val pickOrderRepository: PickOrderRepository,
    private val stockOutRepository: StockOutRepository,
    private val stockOutLIneRepository: StockOutLIneRepository,
    private val stockOutLineService: StockOutLineService,
    private val stockLedgerRepository: StockLedgerRepository,
    ): AbstractBaseEntityService<StockOut, Long, StockOutRepository>(jdbcDao, stockOutRepository)  {

        open fun getConsoStatus(consoCode: String): String {
            return stockOutRepository.findByConsoPickOrderCode(consoCode).orElseThrow().status!!
        }
}