adding
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Web;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace LCU.Library.Internal.DocumentModels.Requests.Search;
|
||||
|
||||
public class DocumentInformationFilter
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
public string? Type { get; set; }
|
||||
public string? BusinessName { get; set; }
|
||||
public string[]? TypeContainsAny { get; set; }
|
||||
public bool? ScanStatus { get; set; }
|
||||
public string? Source { get; set; }
|
||||
public string? DataSource { get; set; }
|
||||
public Guid? TraceId { get; set; }
|
||||
public string? PersonNumbersEquals { get; set; }
|
||||
public string[]? PersonNumbersContains { get; set; }
|
||||
public string[]? PersonNumbersContainsAny { get; set; }
|
||||
public string? OrganizationNumbersEquals { get; set; }
|
||||
public string[]? OrganizationNumbersContains { get; set; }
|
||||
public string[]? OrganizationNumbersContainsAny { get; set; }
|
||||
public string? AccountNumberEquals { get; set; }
|
||||
public string[]? AccountNumberContainsAny { get; set; }
|
||||
public Dictionary<string, string>? AttributesEquals { get; set; }
|
||||
public Dictionary<string, string>? AttributesContains { get; set; }
|
||||
public Dictionary<string, string>? AttributesContainsAny { get; set; }
|
||||
public DateTime? CreatedDateMinimum { get; set; }
|
||||
public DateTime? CreatedDateMaximum { get; set; }
|
||||
public DateTime? UploadDateMinimum { get; set; }
|
||||
public DateTime? UploadDateMaximum { get; set; }
|
||||
public DateTime? LastModifiedMinimum { get; set; }
|
||||
public DateTime? LastModifiedDateMaximum { get; set; }
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
using System.Collections.Generic;
|
||||
using LCU.Library.Internal.DocumentIngestorModels.Models.Pagination;
|
||||
|
||||
namespace LCU.Library.Internal.DocumentModels.Requests.Search;
|
||||
|
||||
public class DocumentInformationFilteredSearch
|
||||
{
|
||||
public DocumentInformationFilter Filter { get; set; }
|
||||
public int? Skip { get; set; }
|
||||
public int? Take { get; set; }
|
||||
public List<SortableField>? SortDefinition { get; set; }
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
using System.Collections.Generic;
|
||||
using LCU.Library.DocumentType.Models.Responses;
|
||||
|
||||
namespace LCU.Library.Internal.DocumentModels.Requests.Search;
|
||||
|
||||
public class GetDocumentCleanupRequest
|
||||
{
|
||||
public List<DocumentCodeDetailsResponse> DocumentCodeDetailInfos { get; set; }
|
||||
public int Limit { get; set; }
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
using System.Collections.Generic;
|
||||
using MongoDB.Driver;
|
||||
using LCU.Library.Internal.DocumentIngestorModels.Models.Pagination;
|
||||
|
||||
namespace LCU.Library.Internal.DocumentModels.Requests.Search;
|
||||
|
||||
public class Sorter<T>
|
||||
{
|
||||
public static SortDefinition<T> GetSorter(List<SortableField> fields)
|
||||
{
|
||||
SortDefinition<T>? sortDefinition = null;
|
||||
|
||||
if(fields == null)
|
||||
{
|
||||
return sortDefinition;
|
||||
}
|
||||
|
||||
fields.Sort((a, b) => a.Position.CompareTo(b.Position));
|
||||
|
||||
foreach (var field in fields)
|
||||
{
|
||||
if (sortDefinition == null)
|
||||
{
|
||||
sortDefinition = field.IsDescending ? Builders<T>.Sort.Descending(field.Field) : Builders<T>.Sort.Ascending(field.Field);
|
||||
}
|
||||
else
|
||||
{
|
||||
sortDefinition = field.IsDescending ? sortDefinition.Descending(field.Field) : sortDefinition.Ascending(field.Field);
|
||||
}
|
||||
}
|
||||
|
||||
return sortDefinition;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user