using System.Text.Json.Serialization; using Data.SeaHavenIndustries.Enums; namespace SeaHaven.Services.DTOs; public sealed record CreateTeamMemberRequestDTO { public string? Name { get; init; } public string? Role { get; init; } public string? Color { get; init; } public string? Email { get; init; } public string? Phone { get; init; } public IReadOnlyList? ServiceAreas { get; init; } public IReadOnlyDictionary? PermissionOverrides { get; init; } } public class TeamMemberCreatedDTO { public required string Id { get; init; } public required string Name { get; init; } public required string Role { get; init; } public required string Color { get; init; } public string? Email { get; init; } public string? Phone { get; init; } public required IReadOnlyList ServiceAreas { get; init; } public bool PendingRegistration { get; init; } /// /// Set only when an invite was emailed: on create, and on an update that changed a pending member's email. /// False means the invite email failed; re-invite from their details. /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public bool? InviteEmailSent { get; init; } } public sealed class TeamMemberDetailDTO : TeamMemberCreatedDTO { public string Status { get; init; } = "Active"; public bool IsAccountOwner { get; init; } public IReadOnlyList Permissions { get; init; } = Array.Empty(); } public sealed record UpdateTeamMemberRequestDTO { public string? Name { get; init; } public string? Role { get; init; } public string? Color { get; init; } public string? Email { get; init; } public string? Phone { get; init; } public IReadOnlyList? ServiceAreas { get; init; } public IReadOnlyDictionary? PermissionOverrides { get; init; } public bool IsActive { get; init; } = true; } public sealed class TeamMemberOperationOutcomeDTO { public bool Success { get; init; } public string? Error { get; init; } public TeamMemberDetailDTO? Member { get; init; } } public sealed class CreateTeamMemberOutcomeDTO { public bool Success { get; init; } public string? Error { get; init; } public TeamMemberCreatedDTO? Member { get; init; } }