- KycInformationDto для операций создания (идентификатор не требуется)
- KycInformationDetailDto для операций получения/обновления (включая идентификатор)
- KycInformationDetailDto включает свойство Id
- DocumentsКоллекция использует KycDocumentDetailDto вместо KycDocumentDto
public class KycInformation : BaseEntity
{
public required KycStatus Status { get; set; }
public required RiskRating RiskRating { get; set; }
public required AmlStatus AmlStatus { get; set; }
public required SanctionsCheckStatus SanctionsCheckStatus { get; set; }
public string? ComplianceNotes { get; set; }
public string? ParentCompany { get; set; }
public required Guid LegalEntityId { get; set; }
public required LegalEntity LegalEntity { get; set; }
public ICollection Documents { get; set; } = new List();
public void AddDocument(KycDocument document) => Documents.Add(document);
public void ClearDocuments() => Documents.Clear();
}
public record KycInformationDto
{
public required KycStatus Status { get; init; }
public required RiskRating RiskRating { get; init; }
public required AmlStatus AmlStatus { get; init; }
public required SanctionsCheckStatus SanctionsCheckStatus { get; init; }
public string? ComplianceNotes { get; init; }
public string? ParentCompany { get; init; }
public ICollection Documents { get; init; } = new List();
private class Mapping : Profile
{
public Mapping()
{
CreateMap();
CreateMap();
}
}
}
public record KycInformationDetailDto : KycInformationDto
{
public required Guid Id { get; init; }
public new ICollection Documents { get; init; } = new List();
private class Mapping : Profile
{
public Mapping()
{
CreateMap();
CreateMap();
}
}
}
public record KycDocumentDto
{
public required string DocumentType { get; init; }
public required string DocumentName { get; init; }
public string? DocumentDescription { get; init; }
public required string DocumentUrl { get; init; }
private class Mapping : Profile
{
public Mapping()
{
CreateMap();
CreateMap();
}
}
}
public record KycDocumentDetailDto : KycDocumentDto
{
public required Guid Id { get; init; }
private class Mapping : Profile
{
public Mapping()
{
CreateMap();
CreateMap();
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/791 ... th-an-id-p