42 lines
1.3 KiB
C#
42 lines
1.3 KiB
C#
using System;
|
|
using System.Web.Http;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Serilog;
|
|
using LCU.API.Internal.CoreSoapApiWrapper.Services;
|
|
using LCU.API.Internal.CoreSoapApiWrapper.Attributes;
|
|
|
|
namespace LCU.API.Internal.CoreSoapApiWrapper.Controllers
|
|
{
|
|
[RoutePrefix("api/core/IndirectLoan")]
|
|
public class IndirectLoanController : ApiController
|
|
{
|
|
private readonly IIndirectLoanService _indirectLoanService;
|
|
|
|
public IndirectLoanController (IIndirectLoanService indirectLoanService)
|
|
{
|
|
_indirectLoanService = indirectLoanService;
|
|
}
|
|
|
|
[ApiKeyAuthorize]
|
|
[Route("PutDealerOriginalBalance")]
|
|
public IHttpActionResult PutDealerOriginalBalance(string accountNumber)
|
|
{
|
|
if (string.IsNullOrEmpty(accountNumber))
|
|
{
|
|
Log.Warning($"Account number is invalid");
|
|
return BadRequest("Account number cannot be null.");
|
|
}
|
|
|
|
try
|
|
{
|
|
var response = _indirectLoanService.UpdateDealerOriginalBalances(accountNumber);
|
|
return Ok(response);
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
return BadRequest(ex.Message);
|
|
}
|
|
}
|
|
}
|
|
} |