Notes
Notes - notes.io |
namespace QBENA_PricingTools_API.A_HRaterController
{
[Route("api/[controller]")]
[ApiController]
public class AHRaterController : ControllerBase
{
private readonly IAHRaterService _ahService;
private readonly IAHDominoService _dominoService;
public AHRaterController(IAHRaterService ahRaterService, IAHDominoService ahDominoService)
{
_ahService = ahRaterService;
_dominoService = ahDominoService;
}
[HttpPost]
[Route("SaveUpdateAH")]
public async Task<ActionResult<AHRaterReq>> SaveAHRater([FromBody] AHRaterReq request, [FromQuery] int? ptdealID, [FromQuery] string raterType, [FromQuery] string versionNumber, [FromQuery] int scenarioId)
{
try
{
if (raterType == ModelCode.ahRater)
{
request.RaterType = raterType;
request.DEAL_ID = ptdealID;
request.VersionNumber = versionNumber;
request.SCENERIO_ID = scenarioId;
request.TransactionID = Guid.NewGuid().ToString();
if (request.isCalculate)
{
if (request.dominoCalls.Contains(dominoEnums.InputBaseExpenses))
{
request = await _dominoService.InputBaseExpensesDominoCalculations(request);
}
if (request.dominoCalls.Contains(dominoEnums.InputBaseLookUps))
{
request = await _dominoService.InputBaseLookUpsDominoCalculations(request);
}
if (request.dominoCalls.Contains(dominoEnums.RateCalcTargetPrem))
{
request = await _dominoService.RateCalcTargetPremDominoCalculations(request);
}
if (request.dominoCalls.Contains(dominoEnums.RateCalcPremAtCommWithYg))
{
request = await _dominoService.RateCalcYoungGroupCalculations(request);
}
if (request.dominoCalls.Contains(dominoEnums.MsaClaimsSplit))
{
request = await _dominoService.MsaClaimsSplitDominoCalculations(request);
}
if (request.dominoCalls.Contains(dominoEnums.MsaIcsCalc))
{
request = await _dominoService.MsaIcsCalcCalculation(request);
}
if (request.dominoCalls.Contains(dominoEnums.MsaRateCalc))
{
request = await _dominoService.MsaRateCalcCalculation(request);
}
if (request.dominoCalls.Contains(dominoEnums.SirRateCalcAnnualTargetPremium) || request.dominoCalls.Contains(dominoEnums.SirRateCalcCalculationOverride) || request.dominoCalls.Contains(dominoEnums.SirRateCalcPremAtCommons))
{
request = await _dominoService.SirRateCalcCalculation(request);
}
if (request.dominoCalls.Length == 0)
{ // if ui will not send any data in array then backend will call all domino APIs.
request = await _dominoService.InputBaseExpensesDominoCalculations(request);
request = await _dominoService.InputBaseLookUpsDominoCalculations(request);
request = await _dominoService.RateCalcTargetPremDominoCalculations(request);
request = await _dominoService.RateCalcYoungGroupCalculations(request);
request = await _dominoService.MsaClaimsSplitDominoCalculations(request);
request = await _dominoService.MsaIcsCalcCalculation(request);
request = await _dominoService.MsaRateCalcCalculation(request);
request = await _dominoService.SirRateCalcCalculation(request);
}
}
AHRaterInfo AHRaterRequestDTO = _ahService.MapRequestToDTO(request);
AHRaterReq response = await _ahService.SaveCalculateAHRater(AHRaterRequestDTO);
return response;
}
else
{
return BadRequest();
}
}
catch(QBEException ex)
{
HttpContext.Response.StatusCode = ex.StatusCode;
return StatusCode(ex.StatusCode, new { message = ex.Value, error = ex.StackTrace });
}
}
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team