refactor: replace long arg lists with input/config structs and builder
Some checks failed
lint / lint (push) Failing after 7m8s
test / unit (push) Successful in 17m2s
test / integration (push) Failing after 17m47s

- Thought::new_local → NewThought struct (7 args → 1)
- UserWriter::update_profile → UpdateProfileInput struct (6 args → 2)
- update_profile use case → UpdateProfileInput (8 args → 3)
- ActivityPubService::new → builder pattern (9 args → 5 required + 4 optional setters)
- accept_note → AcceptNoteInput struct (8 args → 1)
- ThoughtNote::new_public → ThoughtNoteInput struct (8 args → 1)

Remove all #[allow(clippy::too_many_arguments)] annotations.
This commit is contained in:
2026-05-17 12:25:53 +02:00
parent f39c1a614d
commit c5d9833c8b
31 changed files with 449 additions and 450 deletions

View File

@@ -5,7 +5,7 @@ use domain::{
events::DomainEvent,
models::{
feed::{PageParams, Paginated, UserSummary},
user::User,
user::{UpdateProfileInput, User},
},
ports::{AuthService, GeneratedToken, PasswordHasher, UserReader, UserWriter},
testing::{NoOpEventPublisher, TestStore},
@@ -56,22 +56,9 @@ impl UserWriter for ConflictOnSaveStore {
async fn update_profile(
&self,
user_id: &UserId,
display_name: Option<String>,
bio: Option<String>,
avatar_url: Option<String>,
header_url: Option<String>,
custom_css: Option<String>,
input: UpdateProfileInput,
) -> Result<(), DomainError> {
self.0
.update_profile(
user_id,
display_name,
bio,
avatar_url,
header_url,
custom_css,
)
.await
self.0.update_profile(user_id, input).await
}
}
@@ -114,22 +101,9 @@ impl UserWriter for EmailConflictOnSaveStore {
async fn update_profile(
&self,
user_id: &UserId,
display_name: Option<String>,
bio: Option<String>,
avatar_url: Option<String>,
header_url: Option<String>,
custom_css: Option<String>,
input: UpdateProfileInput,
) -> Result<(), DomainError> {
self.0
.update_profile(
user_id,
display_name,
bio,
avatar_url,
header_url,
custom_css,
)
.await
self.0.update_profile(user_id, input).await
}
}