feat(EnvelopeReceiverBase): HasPhoneNumber-Eigenschaft sowohl zur Entität als auch zum DTO hinzugefügt

This commit is contained in:
Developer 02 2024-11-28 20:46:51 +01:00
parent 423b293197
commit b4a97abe6b
3 changed files with 6 additions and 0 deletions

View File

@ -25,5 +25,7 @@ namespace EnvelopeGenerator.Application.DTOs.EnvelopeReceiver
public DateTime AddedWhen { get; init; }
public DateTime? ChangedWhen { get; init; }
public bool HasPhoneNumber { get; init; }
}
}

View File

@ -46,6 +46,10 @@ namespace EnvelopeGenerator.Domain.Entities
[RegularExpression(@"^\+[0-9]+$", ErrorMessage = "Phone number must start with '+' followed by digits.")]
public string? PhoneNumber { get; set; }
[NotMapped]
public (int Envelope, int Receiver) Id => (Envelope: EnvelopeId, Receiver: ReceiverId);
[NotMapped]
public bool HasPhoneNumber => PhoneNumber is not null;
}
}