Files
novelly/src/Novelly.Api/Users/NovelMemberContracts.cs
T
James Wampler 4313c8f206 Rename Project concept to Novel across the stack
Renames the domain concept from Project to Novel throughout the backend
(entities, DTOs, services, endpoints, ProjectAccessService/Permission,
ProjectId foreign keys), MCP server (tool names and routes), and the
React/Vite frontend (types, hooks, routes, components). Adds a new EF
Core migration (RenameProjectToNovel) using RenameTable/RenameColumn to
preserve existing data instead of dropping/recreating tables. Updates
CLAUDE.md's structure section to reference Novels/ instead of Projects/.
2026-08-17 23:03:09 -07:00

24 lines
784 B
C#

using Novelly.Api.Common.Validation;
namespace Novelly.Api.Users;
public record GrantAccessRequest(string Email, NovelRole NovelRole);
public record NovelMemberResponse(Guid UserId, string Email, string DisplayName, NovelRole NovelRole, DateTimeOffset GrantedAt);
public class GrantAccessRequestValidator : IModelValidator<GrantAccessRequest>
{
public ValidationResult Validate(GrantAccessRequest model)
{
var result = new ValidationResult();
result.AddRequiredTextErrors("Email", "Email", model.Email, 256);
return result;
}
}
public static class NovelMemberMapping
{
public static NovelMemberResponse ToResponse(this NovelMember m) =>
new(m.UserId, m.User!.Email ?? string.Empty, m.User.DisplayName, m.NovelRole, m.GrantedAt);
}