feat: change email, export my data, delete account (with data anonymization)

This commit is contained in:
Florian Sylvain committed 2026-10-30 20:19:07 +01:00
1 parent bb191c389a
commit 10a66cd979
123 files changed
+10789 -76

No files matched your search

+15
View File
@@ -5,6 +5,7 @@ import (
"RenewCMS/internal/domain/author"
"RenewCMS/internal/infrastructure/useCases"
"errors"
"slices"
"sort"
"strings"
"testing"
@@ -52,6 +53,20 @@ func (m *mockArticleRepo) withAuthors(a article.Article) article.Article {
return a
}
func (m *mockArticleRepo) ListForAccount(creatorID uint32, authorID *uint32) ([]article.Article, error) {
if err := m.fail.trigger("ListForAccount"); err != nil {
return nil, err
}
listed := []article.Article{}
for _, id := range m.sortedIds() {
stored := m.articles[id]
if stored.CreatedBy == creatorID || stored.IsOnline && authorID != nil && slices.Contains(m.credits[id], *authorID) {
listed = append(listed, m.withAuthors(stored))
}
}
return listed, nil
}
func (m *mockArticleRepo) credit(articleID uint32, authorIDs ...uint32) {
m.credits[articleID] = append([]uint32{}, authorIDs...)
}