|
- namespace Campaign_Tracker.Server.Municipalities;
-
- public sealed record MunicipalityContactSaveResult
- {
- public bool Saved { get; init; }
- public bool IsNotFound { get; init; }
- public string? Error { get; init; }
- public MunicipalityContact? Contact { get; init; }
-
- public static MunicipalityContactSaveResult Success(MunicipalityContact contact) =>
- new() { Saved = true, Contact = contact };
-
- public static MunicipalityContactSaveResult Failure(string error) =>
- new() { Saved = false, Error = error };
-
- public static MunicipalityContactSaveResult NotFound(string contactId) =>
- new()
- {
- IsNotFound = true,
- Error = $"Contact '{contactId}' not found."
- };
- }
|