public async Task<List<string>> CheckMappingDiscrepanciesAsync(List<VervotechMapping> vervotechMappings,List<ExistingMapping> existingMappings)
{
List<string> discrepancies = new List<string>();
foreach (var vervotechMapping in vervotechMappings)
{
bool existsInExisting = existingMappings.Any(existing =>
existing.ProviderHotelId == vervotechMapping.ProviderHotelId &&
existing.ProviderFamily == vervotechMapping.ProviderFamily);
if (!existsInExisting)
discrepancies.Add("Discrepancy found, take required action");
}
foreach (var existingMapping in existingMappings)
{
bool existsInVervotech = vervotechMappings.Any(vervotech =>
vervotech.ProviderHotelId == existingMapping.ProviderHotelId &&
vervotech.ProviderFamily == existingMapping.ProviderFamily);
if (!existsInVervotech)
{
discrepancies.Add("Discrepancy found, take required action");
}
}
return discrepancies;
}
// Example usage
string providerHotelId = "12345";
string providerFamily = "SampleProvider";
//Fetch mapping using vervotech dual mapping
List<VervotechMapping> vervotechMapping = FetchMappingByProviderHotelId(providerHotelId,providerFamily);
string result = await CompareProviderMappingsAsync(vervotechMappings, existingMappings);