Plany: PATCH z startDate (aktywacja przy zapisie) i udostepnianie planow trener-podopieczny (PlanShare, sekcja Udostepnione mi, widok read-only)

This commit is contained in:
tisachi
2026-09-13 02:28:29 +02:00
parent 8049c4bc47
commit 1f29ce7003
19 changed files with 1791 additions and 76 deletions

View File

@@ -274,6 +274,8 @@ export interface PlanWeek {
export interface Plan {
id: string;
/** Właściciel planu (podopieczny, gdy plan utworzył trener). */
userId: string;
title: string;
status: 'DRAFT' | 'ACTIVE' | 'COMPLETED' | 'ABANDONED';
weeksCount: number;
@@ -282,6 +284,15 @@ export interface Plan {
gym: { id: string; name: string } | null;
/** Kto utworzył plan (trener, gdy plan należy do podopiecznego); null = podopieczny sam. */
creator: { id: string; firstName: string | null; lastName: string | null } | null;
/** Kto udostępnił plan (sekcja „Udostępnione mi”); brak = plan własny. */
sharedBy?: { id: string; firstName: string | null; lastName: string | null };
/** Odbiorcy share'u (tylko detal, dla właściciela); brak = nieudostępniony lub nie-właściciel. */
shares?: {
userId: string;
user: { id: string; firstName: string | null; lastName: string | null };
}[];
/** Detal: czy zalogowany może zarządzać planem (właściciel lub trener z ACTIVE coachingiem). */
canManage?: boolean;
/** Podsumowanie postępu (lista planów); brak = dane niedostępne. */
progress?: { completed: number; total: number; percent: number };
weeks: PlanWeek[];