feat: storage, language rules and migration

This commit is contained in:
Florian Sylvain committed 2026-11-01 17:50:28 +01:00
1 parent 8c4a1825ab
commit 0806733d5c
70 files changed
+1771 -132

No files matched your search

+2 -2
View File
@@ -294,7 +294,7 @@ func TestContentScopeArticleUseCases(t *testing.T) {
t.Run("CreateArticle needs content.create for the article type and stores the caller", func(t *testing.T) {
repo, sites, authors, _ := newRepos()
create := useCases.NewCreateArticleUseCase(repo, &fakeBodyRenderer{}, discardRecorder, sites, authors)
create := useCases.NewCreateArticleUseCase(passthroughCreateTransactor(repo), &fakeBodyRenderer{}, discardRecorder, sites, authors)
created, err := create.CreateArticle(testCtx, useCases.CreateArticleCommand{Title: "A new draft", Caller: callerWith(25, "content.create=all", "content.update:article=none")})
if err != nil || created.CreatedBy != 25 || created.IsOnline {
t.Fatalf("expected a draft created by 25, got %+v %v", created, err)
@@ -493,7 +493,7 @@ func TestContentScopeCreateArticleAuthorLookupFailure(t *testing.T) {
boom := errors.New("author store down")
authors.fail.failNextWith("GetByUserID", boom)
articles := newMockArticleRepo()
create := useCases.NewCreateArticleUseCase(articles, &fakeBodyRenderer{}, discardRecorder, plainSites(), authors)
create := useCases.NewCreateArticleUseCase(passthroughCreateTransactor(articles), &fakeBodyRenderer{}, discardRecorder, plainSites(), authors)
caller := useCases.ContentCaller{UserID: 9, Grants: role.Role{Grants: grantRows("content.create=all")}.GrantSet()}
_, err := create.CreateArticle(context.Background(), useCases.CreateArticleCommand{Title: "Hello", Body: "x", Caller: caller})
if !errors.Is(err, boom) {