| | | 1 | | using OzonDomains.Models.Partners; |
| | | 2 | | |
| | | 3 | | namespace Services.PartnerServices; |
| | | 4 | | |
| | | 5 | | public sealed record PartnerListItemDto( |
| | | 6 | | long Id, |
| | | 7 | | string Name, |
| | | 8 | | string Login, |
| | | 9 | | string? Email, |
| | | 10 | | string? GoogleEmail, |
| | | 11 | | bool IsActive, |
| | | 12 | | DateTime? LastLoginAtUtc, |
| | | 13 | | int RulesCount, |
| | | 14 | | IReadOnlyList<PartnerPermissionCode> Permissions); |
| | | 15 | | |
| | 47 | 16 | | public sealed record PartnerDetailsDto( |
| | 35 | 17 | | long Id, |
| | 0 | 18 | | string Name, |
| | 0 | 19 | | string Login, |
| | 2 | 20 | | string? Email, |
| | 0 | 21 | | string? GoogleEmail, |
| | 0 | 22 | | bool IsActive, |
| | 0 | 23 | | DateTime CreatedAtUtc, |
| | 0 | 24 | | DateTime? LastLoginAtUtc, |
| | 0 | 25 | | PartnerNotificationChannels NotificationChannels, |
| | 0 | 26 | | string? NotificationEmail, |
| | 0 | 27 | | string? TelegramChatId, |
| | 1 | 28 | | IReadOnlyList<PartnerPermissionCode> Permissions, |
| | 49 | 29 | | IReadOnlyList<PartnerRuleDto> Rules); |
| | | 30 | | |
| | | 31 | | public sealed record PartnerRuleDto( |
| | | 32 | | long? Id, |
| | | 33 | | string Name, |
| | | 34 | | bool IsActive, |
| | | 35 | | IReadOnlyList<PartnerRuleConditionDto> Conditions); |
| | | 36 | | |
| | | 37 | | public sealed record PartnerRuleConditionDto( |
| | | 38 | | PartnerRuleField Field, |
| | | 39 | | IReadOnlyList<string> Values); |
| | | 40 | | |
| | | 41 | | public sealed record CreatePartnerRequest( |
| | | 42 | | string Name, |
| | | 43 | | string Email, |
| | | 44 | | string? GoogleEmail); |
| | | 45 | | |
| | | 46 | | public sealed record UpdatePartnerRequest( |
| | | 47 | | string Name, |
| | | 48 | | string? Email, |
| | | 49 | | string? GoogleEmail, |
| | | 50 | | bool IsActive, |
| | | 51 | | PartnerNotificationChannels NotificationChannels, |
| | | 52 | | string? NotificationEmail, |
| | | 53 | | string? TelegramChatId); |
| | | 54 | | |
| | | 55 | | /// <summary>Результат операции управления: либо значение, либо понятная ошибка для владельца.</summary> |
| | | 56 | | public sealed record PartnerOpResult<T>(T? Value, string? Error) |
| | | 57 | | { |
| | | 58 | | public bool Ok => Error is null; |
| | | 59 | | |
| | | 60 | | public static PartnerOpResult<T> Success(T value) => new(value, null); |
| | | 61 | | |
| | | 62 | | public static PartnerOpResult<T> Fail(string error) => new(default, error); |
| | | 63 | | } |
| | | 64 | | |
| | | 65 | | public sealed record PartnerAuditQuery( |
| | | 66 | | long? PartnerId, |
| | | 67 | | string? Action, |
| | | 68 | | DateTime? FromUtc, |
| | | 69 | | DateTime? ToUtc, |
| | | 70 | | int Skip, |
| | | 71 | | int Take); |