"ProviderMapping": {
"VervotechId": 12345,
"ProviderHotelId": "PROV123",
"ProviderName": "Provider A",
"ChannelIds": ["CH1", "CH2"],
"ModifiedOn": "2024-06-18T10:30:00Z",
"ProviderLocationCode": "LOC123",
"Type": "New"
}
}
[HttpPost("PushMapping")]
public async Task<IActionResult> PushMapping([FromBody] ProviderMapping pushMappingRequest)
{
string accountId = (RequestContext.OnGoing as UnicaApiCallContext).AccountId;
try
{
var mapping = ParseProviderMapping(accountId, pushMappingRequest);
bool status = await _hotelMappingProvider.SavePushMappingsAsync(accountId, mapping);
if (status)
{
_logger.Information($"[PushMapping] Mapping saved for {pushMappingRequest.VervotechId}-{pushMappingRequest.ProviderHotelId}{pushMappingRequest.ProviderName}");
}
}
catch (System.Exception ex)
{
_logger.Fatal(ex, ex.Message + " - " + JsonConvert.SerializeObject(pushMappingRequest));
}
return Ok(new ApiResponse()
{
Status = true,
Message = $"Mapping is saved successfully in {accountId}",
StatusCode = 200
});
}