| | | 1 | | using LGDXRobotCloud.Data.Models.DTOs.V1.Responses; |
| | | 2 | | |
| | | 3 | | namespace LGDXRobotCloud.Data.Models.Business.Administration; |
| | | 4 | | |
| | | 5 | | public record RobotCertificateListBusinessModel |
| | | 6 | | { |
| | | 7 | | public required Guid Id { get; set; } |
| | | 8 | | |
| | | 9 | | public required string Thumbprint { get; set; } |
| | | 10 | | |
| | | 11 | | public string? ThumbprintBackup { get; set; } |
| | | 12 | | |
| | | 13 | | public required DateTime NotBefore { get; set; } |
| | | 14 | | |
| | | 15 | | public required DateTime NotAfter { get; set; } |
| | | 16 | | } |
| | | 17 | | |
| | | 18 | | public static class RobotCertificateListBusinessModelExtensions |
| | | 19 | | { |
| | | 20 | | public static RobotCertificateListDto ToDto(this RobotCertificateListBusinessModel robotCertificate) |
| | 0 | 21 | | { |
| | 0 | 22 | | return new RobotCertificateListDto{ |
| | 0 | 23 | | Id = robotCertificate.Id, |
| | 0 | 24 | | Thumbprint = robotCertificate.Thumbprint, |
| | 0 | 25 | | ThumbprintBackup = robotCertificate.ThumbprintBackup, |
| | 0 | 26 | | NotBefore = robotCertificate.NotBefore, |
| | 0 | 27 | | NotAfter = robotCertificate.NotAfter |
| | 0 | 28 | | }; |
| | 0 | 29 | | } |
| | | 30 | | |
| | | 31 | | public static IEnumerable<RobotCertificateListDto> ToDto(this IEnumerable<RobotCertificateListBusinessModel> robotCert |
| | 0 | 32 | | { |
| | 0 | 33 | | return robotCertificates.Select(a => a.ToDto()); |
| | 0 | 34 | | } |
| | | 35 | | } |