|
1 | 1 | using AutoMapper;
|
| 2 | +using Ganss.Xss; |
2 | 3 | using Microsoft.AspNetCore.Http;
|
3 | 4 | using Microsoft.Extensions.Configuration;
|
4 | 5 | using Microsoft.Extensions.Logging;
|
@@ -55,6 +56,8 @@ public DelistingService(ICurrentUser currentUser, IFieldValidatorService validat
|
55 | 56 |
|
56 | 57 | public async Task<Dictionary<string, List<string>>> CreateTakedownNoticeAsync(TakedownNoticeCreateDto dto)
|
57 | 58 | {
|
| 59 | + CommonUtils.SanitizeObject(dto); |
| 60 | + |
58 | 61 | var platform = await _orgService.GetOrganizationByIdAsync(dto.PlatformId);
|
59 | 62 | var lg = await _orgService.GetOrganizationByIdAsync(_currentUser.OrganizationId);
|
60 | 63 |
|
@@ -203,6 +206,8 @@ private async Task SendTakedownNoticeAsync(TakedownNoticeCreateDto dto, Organiza
|
203 | 206 | }
|
204 | 207 | public async Task<(Dictionary<string, List<string>> errors, EmailPreview preview)> GetTakedownNoticePreviewAsync(TakedownNoticeCreateDto dto)
|
205 | 208 | {
|
| 209 | + CommonUtils.SanitizeObject(dto); |
| 210 | + |
206 | 211 | var platform = await _orgService.GetOrganizationByIdAsync(dto.PlatformId);
|
207 | 212 | var lg = await _orgService.GetOrganizationByIdAsync(_currentUser.OrganizationId);
|
208 | 213 |
|
@@ -250,6 +255,8 @@ private TakedownNotice GetTakedownNoticeTemplate(TakedownNoticeCreateDto dto, Or
|
250 | 255 |
|
251 | 256 | public async Task<Dictionary<string, List<string>>> CreateTakedownNoticesFromListingAsync(TakedownNoticesFromListingDto[] listings)
|
252 | 257 | {
|
| 258 | + CommonUtils.SanitizeObject(listings); |
| 259 | + |
253 | 260 | var errors = new Dictionary<string, List<string>>();
|
254 | 261 | var emailRegex = RegexDefs.GetRegexInfo(RegexDefs.Email);
|
255 | 262 | var templates = new List<TakedownNoticeFromListing>();
|
@@ -392,6 +399,8 @@ private async Task SendTakedownNoticeEmailFromListingAsync(TakedownNoticesFromLi
|
392 | 399 |
|
393 | 400 | public async Task<(Dictionary<string, List<string>> errors, EmailPreview preview)> GetTakedownNoticesFromListingPreviewAsync(TakedownNoticesFromListingDto[] listings)
|
394 | 401 | {
|
| 402 | + CommonUtils.SanitizeObject(listings); |
| 403 | + |
395 | 404 | var errors = new Dictionary<string, List<string>>();
|
396 | 405 | var emailRegex = RegexDefs.GetRegexInfo(RegexDefs.Email);
|
397 | 406 | var templates = new List<TakedownNoticeFromListing>();
|
@@ -443,6 +452,8 @@ private async Task SendTakedownNoticeEmailFromListingAsync(TakedownNoticesFromLi
|
443 | 452 |
|
444 | 453 | public async Task<Dictionary<string, List<string>>> CreateTakedownRequestsFromListingAsync(TakedownRequestsFromListingDto[] listings)
|
445 | 454 | {
|
| 455 | + CommonUtils.SanitizeObject(listings); |
| 456 | + |
446 | 457 | var errors = new Dictionary<string, List<string>>();
|
447 | 458 | var templates = new List<TakedownRequestFromListing>();
|
448 | 459 |
|
@@ -529,6 +540,8 @@ private TakedownRequestFromListing CreateTakedownRequestTemplateFromListing(Take
|
529 | 540 | OrgCd = rentalListing.OrganizationCd,
|
530 | 541 | ListingId = rentalListing.PlatformListingNo,
|
531 | 542 | Info = $"{rentalListing.OrganizationCd}-{rentalListing.PlatformListingNo}",
|
| 543 | + IsWithStandardDetail = listing.IsWithStandardDetail, |
| 544 | + TakedownRequestDetail = listing.CustomDetailTxt, |
532 | 545 | To = new string[] { _currentUser.EmailAddress },
|
533 | 546 | Cc = listing.CcList ?? new List<string>()
|
534 | 547 | };
|
@@ -587,6 +600,8 @@ private async Task SendTakedownRequestEmailFromListingAsync(TakedownRequestsFrom
|
587 | 600 |
|
588 | 601 | public async Task<(Dictionary<string, List<string>> errors, EmailPreview preview)> GetTakedownRequestsFromListingPreviewAsync(TakedownRequestsFromListingDto[] listings)
|
589 | 602 | {
|
| 603 | + CommonUtils.SanitizeObject(listings); |
| 604 | + |
590 | 605 | var errors = new Dictionary<string, List<string>>();
|
591 | 606 | var templates = new List<TakedownRequestFromListing>();
|
592 | 607 |
|
@@ -624,6 +639,8 @@ private async Task SendTakedownRequestEmailFromListingAsync(TakedownRequestsFrom
|
624 | 639 |
|
625 | 640 | public async Task<Dictionary<string, List<string>>> CreateTakedownRequestAsync(TakedownRequestCreateDto dto)
|
626 | 641 | {
|
| 642 | + CommonUtils.SanitizeObject(dto); |
| 643 | + |
627 | 644 | var platform = await _orgService.GetOrganizationByIdAsync(dto.PlatformId);
|
628 | 645 | var lg = await _orgService.GetOrganizationByIdAsync(_currentUser.OrganizationId);
|
629 | 646 |
|
@@ -748,13 +765,16 @@ private TakedownRequest GetTakedownRequestTemplate(TakedownRequestCreateDto dto,
|
748 | 765 | To = dto.ToList,
|
749 | 766 | Cc = dto.CcList,
|
750 | 767 | Info = dto.ListingUrl,
|
| 768 | + IsWithStandardDetail = dto.IsWithStandardDetail, |
751 | 769 | Preview = preview
|
752 | 770 | };
|
753 | 771 | return template;
|
754 | 772 | }
|
755 | 773 |
|
756 | 774 | public async Task<(Dictionary<string, List<string>> errors, EmailPreview preview)> GetTakedownRequestPreviewAsync(TakedownRequestCreateDto dto)
|
757 | 775 | {
|
| 776 | + CommonUtils.SanitizeObject(dto); |
| 777 | + |
758 | 778 | var platform = await _orgService.GetOrganizationByIdAsync(dto.PlatformId);
|
759 | 779 | var lg = await _orgService.GetOrganizationByIdAsync(_currentUser.OrganizationId);
|
760 | 780 |
|
@@ -813,7 +833,7 @@ private async Task ProcessTakedownRequestBatchEmailAsync(OrganizationDto platfor
|
813 | 833 | ListingId = x.UnreportedListingNo ?? "",
|
814 | 834 | Url = x.UnreportedListingUrl ?? "",
|
815 | 835 | RequestedBy = x.RequestingOrganization?.OrganizationNm ?? "",
|
816 |
| - TakedownRequest = (x.IsWithStandardDetail ?? false) ? "Remove the listing from the platform, do not allow transactions for payments associated with the listing, and cancel all booking associated with the listing." : "", |
| 836 | + TakedownRequest = (x.IsWithStandardDetail ?? false) ? Constants.StandardTakedownDetail : "", |
817 | 837 | TakedownRequestDetail = x.CustomDetailTxt ?? ""
|
818 | 838 | })
|
819 | 839 | .ToList();
|
@@ -1071,6 +1091,8 @@ private async Task<Dictionary<string, List<string>>> ValidateBatchTakedownNotice
|
1071 | 1091 | }
|
1072 | 1092 | public async Task<(Dictionary<string, List<string>> errors, EmailPreview preview)> GetComplianceOrdersFromListingPreviewAsync(ComplianceOrderDto[] listings)
|
1073 | 1093 | {
|
| 1094 | + CommonUtils.SanitizeObject(listings); |
| 1095 | + |
1074 | 1096 | var errors = new Dictionary<string, List<string>>();
|
1075 | 1097 | var templates = new List<ComplianceOrderFromListing>();
|
1076 | 1098 |
|
@@ -1143,6 +1165,8 @@ private async Task ProcessComplianceOrderListings(ComplianceOrderDto[] listings,
|
1143 | 1165 | }
|
1144 | 1166 | public async Task<Dictionary<string, List<string>>> CreateComplianceOrdersFromListingAsync(ComplianceOrderDto[] listings)
|
1145 | 1167 | {
|
| 1168 | + CommonUtils.SanitizeObject(listings); |
| 1169 | + |
1146 | 1170 | var errors = new Dictionary<string, List<string>>();
|
1147 | 1171 | var emailRegex = RegexDefs.GetRegexInfo(RegexDefs.Email);
|
1148 | 1172 | var templates = new List<ComplianceOrderFromListing>();
|
|
0 commit comments