package com.ffii.fpsms.modules.master.web

import com.ffii.fpsms.modules.master.service.MasterDataIssueService
import com.ffii.fpsms.modules.master.web.models.MasterDataIssueSummaryResponse
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RequestParam
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/master-data")
class MasterDataIssueController(
    private val masterDataIssueService: MasterDataIssueService,
) {
    @GetMapping("/issues/summary")
    fun getIssuesSummary(
        @RequestParam(required = false, defaultValue = "false") includeTiming: Boolean,
    ): MasterDataIssueSummaryResponse =
        masterDataIssueService.findMasterDataIssuesSummary(includeTiming)
}
