documentationenhancementgood first issuehelp wanted
Repository metrics
- Stars
- (30 個のスター)
- PR merge metrics
- (PR metrics pending)
説明
Description:
Enable users to securely share their SymptomSync data (medication schedules, appointments, health logs) with trusted caregivers or family members (“Care Team”). Invitees should have configurable view-only or edit permissions and see real-time updates. This will help patients collaborate with doctors, nurses, or loved ones to better manage their health.
Acceptance Criteria:
- Invite Flow:
- User can open a “Care Team” panel from Settings and send email invites to one or more caregivers.
- Invites include a secure, time-limited signup link.
- Permissions Model:
- Two permission levels: View-only (read data) and Editor (add/edit logs, reminders, appointments).
- Owner can upgrade/downgrade or revoke access at any time.
- UI & Dashboard:
- Care Team members see a filtered dashboard showing only the patient’s data they have access to.
- Patient sees a list of current Care Team members with their permission level.
- Real-Time Sync:
- Any changes by patient or Editor-level caregivers sync in real time across all devices (via Supabase Realtime).
- Security & Privacy:
- All shared data respects existing RLS policies—caregivers cannot access unrelated users’ data.
- Audit log in database (timestamp, actor, action) for all create/update/delete by Care Team.
- Notifications:
- Email alert to caregivers when invited, permission changed, or revoked.
- In-app notification for patient when a caregiver makes edits.
Tasks:
- Define new
care_teamtable in Supabase with columnsid,patient_id,user_id,permission_level,status,created_at. - Create invitation API endpoints:
POST /api/care-team/inviteGET /api/care-team/pendingPOST /api/care-team/accept/:tokenPATCH /api/care-team/:id(update/revoke)
- Build frontend Care Team management UI under Settings: invite form, member list with permission controls.
- Generate secure JWT-based invite tokens (expires in 7 days).
- Implement RLS policies for
care_teamand resource tables to enforce view/edit permissions. - Wire up Supabase Realtime subscriptions so both patient and editors see live updates.
- Send transactional emails via existing Supabase Functions when invites sent/accepted/revoked.
- Add audit-log triggers in Postgres for all care_team-related actions.
- Write Jest & Playwright tests covering invite flow, permission enforcement, and real-time sync.
- Update Swagger docs with new care-team endpoints and examples.
Estimated Effort: ~3–4 sprints