package com.ffii.fpsms.modules.purchaseOrder.web

import com.ffii.core.support.JdbcDao
import com.ffii.fpsms.modules.master.entity.Items
import com.ffii.fpsms.modules.master.service.ItemsService
import com.ffii.fpsms.modules.purchaseOrder.entity.PurchaseOrder
import com.ffii.fpsms.modules.purchaseOrder.entity.projections.PurchaseOrderInfo
import com.ffii.fpsms.modules.purchaseOrder.service.PurchaseOrderService
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/po")
class PurchaseOrderController(
    private val purchaseOrderService: PurchaseOrderService
) {
    @GetMapping("/list")
    fun getPoList(): List<PurchaseOrderInfo> {
        return purchaseOrderService.getPoList()
    }
    @GetMapping("/detail/{id}")
    fun getDetailedPo(@PathVariable id: Long): Map<String, Any> {
        return purchaseOrderService.getDetailedPo(id)
    }
}