Skip to content

Conversation

@scott-enableyou
Copy link
Contributor

Implement complete family member management system including:

Member Invitation Flow

  • CreateInvitationCommand with NanoId-based codes (7-day expiry)
  • AcceptInvitationCommand creates user and returns auth token
  • DeclineInvitationCommand and RevokeInvitationCommand
  • GetInvitationByCodeQuery, GetFamilyInvitationsQuery, GetPendingInvitationsQuery
  • InvitationsController with full CRUD operations

Role Assignment System

  • UpdateUserRoleCommand with authorization checks
  • Role hierarchy: Owner > Admin > Adult > Teen > Child > Caregiver
  • Safeguards: Cannot demote Owner, Admin can't promote to Admin

Profile Management Endpoints

  • UpdateCaregiverInfoCommand for medical/emergency info
  • RemoveUserFromFamilyCommand with soft delete
  • Updated UsersController with new endpoints

Caregiver Access Tokens

  • GenerateCaregiverAccessTokenCommand (1-168 hour expiry)
  • TokenService updated with GenerateCaregiverToken method
  • Token includes: target_user_id, access_type=caregiver, is_read_only=true

Infrastructure

  • IInvitationRepository interface and InvitationRepository implementation
  • Updated IUnitOfWork and UnitOfWork with Invitations
  • Added GetInvitationsContainerAsync to CosmosDbContext

DTOs and Tests

  • InvitationDto, SendInvitationRequestDto, AcceptedInvitationResultDto
  • UpdateUserRoleRequestDto, UpdateCaregiverInfoRequestDto, CaregiverAccessTokenDto
  • Comprehensive unit tests for Invitation entity

Updates ROADMAP.md with Phase 1.3 completion status.

Implement complete family member management system including:

## Member Invitation Flow
- CreateInvitationCommand with NanoId-based codes (7-day expiry)
- AcceptInvitationCommand creates user and returns auth token
- DeclineInvitationCommand and RevokeInvitationCommand
- GetInvitationByCodeQuery, GetFamilyInvitationsQuery, GetPendingInvitationsQuery
- InvitationsController with full CRUD operations

## Role Assignment System
- UpdateUserRoleCommand with authorization checks
- Role hierarchy: Owner > Admin > Adult > Teen > Child > Caregiver
- Safeguards: Cannot demote Owner, Admin can't promote to Admin

## Profile Management Endpoints
- UpdateCaregiverInfoCommand for medical/emergency info
- RemoveUserFromFamilyCommand with soft delete
- Updated UsersController with new endpoints

## Caregiver Access Tokens
- GenerateCaregiverAccessTokenCommand (1-168 hour expiry)
- TokenService updated with GenerateCaregiverToken method
- Token includes: target_user_id, access_type=caregiver, is_read_only=true

## Infrastructure
- IInvitationRepository interface and InvitationRepository implementation
- Updated IUnitOfWork and UnitOfWork with Invitations
- Added GetInvitationsContainerAsync to CosmosDbContext

## DTOs and Tests
- InvitationDto, SendInvitationRequestDto, AcceptedInvitationResultDto
- UpdateUserRoleRequestDto, UpdateCaregiverInfoRequestDto, CaregiverAccessTokenDto
- Comprehensive unit tests for Invitation entity

Updates ROADMAP.md with Phase 1.3 completion status.
Fix build error in AcceptInvitationCommand where UpdateProfile was
called without the required modifiedBy parameter.
…tibility

Swashbuckle.AspNetCore 10.x no longer bundles Microsoft.OpenApi directly,
requiring an explicit package reference for Microsoft.OpenApi.Models namespace.
…ompatibility

Resolves NU1605 package downgrade error. Swashbuckle.AspNetCore 10.1.0
requires Microsoft.OpenApi >= 2.3.0.
Let Swashbuckle.AspNetCore bring in Microsoft.OpenApi as a transitive
dependency to avoid version conflicts and assembly resolution issues.
Swashbuckle.AspNetCore 10.x requires Microsoft.OpenApi 2.x which has
breaking namespace changes. Version 7.2.0 is stable, supports .NET 9,
and uses Microsoft.OpenApi 1.x with the standard Models namespace.
@trickpatty trickpatty merged commit df5bcea into main Dec 24, 2025
3 checks passed
@trickpatty trickpatty deleted the claude/family-member-management-ExALn branch December 24, 2025 04:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants