diff --git a/prompt/prompt-fase3-backend-testing.md b/prompt/prompt-fase3-backend-testing.md new file mode 100644 index 0000000..98140ea --- /dev/null +++ b/prompt/prompt-fase3-backend-testing.md @@ -0,0 +1,56 @@ +# 🚀 Fase 3: Backend Enhancement & Testing + +## Overview +Dopo il completamento di Fase 1 (Forgot Password) e Fase 2 (User Profile), questa fase si concentra sul backend e i test. + +## Obiettivi Principali + +### 1. Backend: PUT /auth/me +- **Endpoint**: `PUT /api/v1/auth/me` +- **Funzionalità**: Aggiornare nome, cognome, email utente +- **Validazione**: Pydantic schema con `UserUpdate` +- **Deadline**: 2026-04-14 + +### 2. Backend: DELETE /auth/me +- **Endpoint**: `DELETE /api/v1/auth/me` +- **Funzionalità**: Disattivare account utente (soft delete) +- **Dipendenze**: Revocare API keys associate +- **Deadline**: 2026-04-15 + +### 3. Frontend Integration +- **SettingsProfile.tsx**: Form aggiornamento profilo +- **SettingsAccount.tsx**: Pulsante disattiva account +- **useProfile.ts**: Hook per nuove API + +### 4. Test E2E +- Test profilo utente (update nome/cognome) +- Test cambio password +- Test disattivazione account +- Test autenticazione (login/logout) + +## Stack Tecnologico +- **Backend**: FastAPI + SQLAlchemy + PostgreSQL +- **Frontend**: React + TypeScript + Tailwind +- **Testing**: Playwright + +## Riferimenti +- Schema: `src/schemas/user.py` +- API: `src/api/v1/auth.py` +- Frontend: `frontend/src/pages/settings/` + +## Team Assignment +- @backend-dev: Endpoints PUT/DELETE +- @frontend-dev: Integrazione UI +- @qa-engineer: E2E tests + +## Success Criteria +- [ ] PUT /auth/me funziona con validazione +- [ ] DELETE /auth/me disattiva account +- [ ] Frontend aggiornato con nuovi form +- [ ] Test E2E passano +- [ ] Build successful + +--- + +*Prompt generato: 2026-04-08* +*Status: Pronto per assegnazione team* \ No newline at end of file diff --git a/src/schemas/user.py b/src/schemas/user.py index 8d12401..b6ff19c 100644 --- a/src/schemas/user.py +++ b/src/schemas/user.py @@ -23,6 +23,7 @@ class UserUpdate(BaseModel): """Schema for updating a user.""" full_name: Optional[str] = Field(None, max_length=255) + email: Optional[EmailStr] = Field(None, max_length=255) class UserResponse(UserBase): @@ -91,4 +92,4 @@ class AuthResponse(BaseModel): user: UserResponse access_token: str refresh_token: str - token_type: str = "bearer" + token_type: str = "bearer" \ No newline at end of file diff --git a/todo.md b/todo.md index 34ed320..78332b5 100644 --- a/todo.md +++ b/todo.md @@ -536,15 +536,15 @@ Il sistema può inviare email ma l'utente non ha visibilità sullo stato. - [x] Build verificato - [ ] Test end-to-end (da fare) -- [ ] **Fase 2: User Profile** - - [ ] Profile.tsx - - [ ] SettingsLayout.tsx - - [ ] SettingsProfile.tsx - - [ ] SettingsPassword.tsx - - [ ] Header dropdown menu - - [ ] Routes protette - - [ ] Hook useProfile - - [ ] Test funzionalità +- [x] **Fase 2: User Profile** ✅ COMPLETATO (2026-04-12) + - [x] Profile.tsx + - [x] SettingsLayout.tsx + - [x] SettingsProfile.tsx + - [x] SettingsPassword.tsx + - [x] Header dropdown menu + - [x] Routes protette + - [x] Hook useProfile + - [x] Test funzionalità ---