using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using XYY.Authentication.Standard;
using XYY.Common.Standard;
using XYY.Core.Standard.Mvc;
using XYY.Model.Standard.Finance;
using XYY.Service.Standard.Finance;

namespace XYY.Api.Finance.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CustomerRemittancetController : ApiControllerBase
    {
        IFinance_Customer_RemittanceService _remittanceService;

        public CustomerRemittancetController(IFinance_Customer_RemittanceService remittanceService)
        {
            _remittanceService = remittanceService;
        }

        [HttpPost]
        public async Task<IActionResult> GetPageResult(QueryModel queryMdoel)
        {

            var data = await _remittanceService.GetPageResult(queryMdoel);
            return Ok(data);
        }
         
        [HttpPost]
        public async Task<IActionResult> RejectionRemittance(Finance_Customer_Remittance remittance)
        {
            await _remittanceService.RejectionRemittance(remittance);
            return Ok();
        }




        public class InputDto
        {
            public string Url
            {
                get; set;
            }
        }

        [HttpPost]
        public async Task<IActionResult> InputRemittance(InputDto dto)
        {
            var user = User.GetUserContent();
            await _remittanceService.Input(dto.Url,user.NiceName);
            return Ok();
        }

        public async Task<IActionResult> PassRemittance(Finance_Customer_Remittance remittance)
        {
            await _remittanceService.PassRemittance(remittance);
            return Ok();
        }

        public async Task<IActionResult> SetRemittanceDate(Finance_Customer_Remittance remittance)
        {
            await _remittanceService.SetRemittanceDate(remittance);
            return Ok();
        }
    }
}
