package thyyxxk.webserver.controller.medicalinsurance;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import thyyxxk.webserver.entity.ResultVo;
import thyyxxk.webserver.entity.medicalinsurance.inpatient.SiAdmissApply;
import thyyxxk.webserver.entity.inpatient.patient.Patient;
import thyyxxk.webserver.service.medicalinsurance.SiAdmVerifyService;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/siAdmissApply")
public class SiAdmVerifyController {
    private final SiAdmVerifyService service;

    @Autowired
    public SiAdmVerifyController(SiAdmVerifyService service) {
        this.service = service;
    }

    @PostMapping("/selectAdmissApply")
    public ResultVo<SiAdmissApply> selectAdmissApply(@RequestBody Patient p) {
        return service.selectAdmissApply(p);
    }

    @PostMapping("/submitAdmissApply")
    public ResultVo<String> submitAdmissApply(@RequestBody SiAdmissApply apply) {
        return service.submitAdmissApply(apply);
    }

    @GetMapping("/selectUnhandledApplies")
    public ResultVo<List<SiAdmissApply>> selectUnhandledApplies() {
        return service.selectUnhandledApplies();
    }

    @PostMapping("/selectPatientInfo")
    public ResultVo<Map<String, Object>> selectPatientInfo(@RequestBody SiAdmissApply apply) {
        return service.selectPatientInfo(apply);
    }

    @PostMapping("/handleApply")
    public ResultVo<String> handleApply(@RequestBody SiAdmissApply apply) {
        return service.handleApply(apply);
    }
}
