feat(account): keep complaints on deletion, clear their typed-in contact; say so in the privacy draft

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N4f2nya58RoRu4yEmJgRGE
This commit is contained in:
Jesse_Chen
2026-09-30 09:42:11 +08:00
co-authored by Claude Opus 5.5
parent 96adbce3a9
commit e742da268d
5 changed files with 19 additions and 4 deletions
@@ -110,7 +110,10 @@ as $$
'usage_ledger',
'usage_reservations',
'user_product_redemptions',
'user_subscriptions'
'user_subscriptions',
-- Complaints and feedback are kept for handling records (2026-09-30,
-- product decision); the typed-in contact is cleared at purge below.
'user_feedback'
]::text[];
$$;
@@ -343,6 +346,13 @@ begin
using errcode = '55000';
end if;
-- Kept complaints lose the contact the user typed in (it may be a phone or
-- an email); the body stays for the handling record.
if to_regclass('public.user_feedback') is not null then
execute 'update public.user_feedback set contact = null, updated_at = now() where user_id = $1'
using v_user;
end if;
-- The identity becomes an anonymous tombstone: no email, name, image,
-- login method, session or pending verification. Kept financial rows point
-- at it and at nothing else.