feat: sync account deletion lifecycle

Sync telesrv 73f5c91 (feat(account): implement unified account deletion lifecycle).

Skipped telesrv docs changes per public sync rules.
This commit is contained in:
A 2026-07-19 20:35:58 +08:00
parent 96a419b565
commit edb7057757
32 changed files with 3236 additions and 88 deletions

View file

@ -0,0 +1,19 @@
package userprojection
import (
"context"
"testing"
"telesrv/internal/domain"
)
func TestDeletedUserProjectionCannotReintroducePII(t *testing.T) {
in := domain.User{ID: 42, AccessHash: 99, Deleted: true, Phone: "stale", FirstName: "Stale", PhotoID: 123, Contact: true}
got, err := New().One(context.Background(), 7, in)
if err != nil {
t.Fatal(err)
}
if !got.Deleted || got.ID != 42 || got.Phone != "" || got.FirstName != "" || got.PhotoID != 0 || got.Contact {
t.Fatalf("deleted projection leaked PII: %+v", got)
}
}