mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 06:03:12 +00:00
64 lines
2.3 KiB
C#
64 lines
2.3 KiB
C#
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<string>? ServiceAreas { get; init; }
|
|
public IReadOnlyDictionary<string, UserPermissionState>? 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<string> ServiceAreas { get; init; }
|
|
public bool PendingRegistration { get; init; }
|
|
|
|
/// <summary>Set only on create: false means the member exists but the invite email failed; re-invite from their details.</summary>
|
|
[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<TeamPermissionValueDTO> Permissions { get; init; } = Array.Empty<TeamPermissionValueDTO>();
|
|
}
|
|
|
|
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<string>? ServiceAreas { get; init; }
|
|
public IReadOnlyDictionary<string, UserPermissionState>? 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; }
|
|
}
|