68f82d79c2fbf5385a4747883fc87101ff665ed7
KVKK 'veri taşınabilirliği' ve 'unutulma hakkı' için iki uçtan yeni
akış: dışa aktar ve kalıcı sil. İkisi de /settings/workspace altındaki
yeni 'Tehlikeli Bölge' kartına eklendi, sadece owner görür.
Export — GET /api/account/export
- requireTenant guard.
- Sırayla tenant-owned tablolar (settings, profiles, connections,
patients, clinic_pricing, jobs, job_files, history, prosthetics,
finance_entries, payments, notifications, audit_logs) gezilir.
Çift sahipli tablolar (jobs, connections, payments, clinic_pricing,
job_files, history) için iki kez sorgu atılıp $id ile dedupe edilir.
- { exportedAt, tenantId, tenantKind, requestedBy, data } JSON olarak
Content-Disposition: attachment ile döner. ~ek dep yok.
Delete — deleteWorkspaceAction (owner-only, server action)
- Onay: kullanıcının companyName'i birebir yazması gerekir.
- 1) Storage: tenant logosu + arşivlenmemiş job_files objelerini sil.
- 2) DB: hard-delete tüm tenant verisi — notifications, audit_logs,
payments, finance_entries, history, job_files, jobs, clinic_pricing,
prosthetics, patients, connections, profiles, tenant_settings.
Her tablo için Query.equal + sayfa sayfa 500'er silme.
- 3) teams.delete(tenantId) — son aşama, takım yok artık.
- 4) active-tenant cookie temizle; session bırak (kullanıcı başka
workspace'e geçebilir veya çıkış yapabilir).
- redirect('/onboarding').
UI — DangerZone (client)
- 'JSON indir' butonu: /api/account/export'a fetch, blob download.
- 'Sil' Dialog: çalışma alanı adı confirm input ile gated; eşit
olana kadar 'Kalıcı olarak sil' disabled.
Description
No description provided
Languages
TypeScript
99.2%
CSS
0.7%