feat: vertical slice — migrations, postgres adapters, presentation handlers, bootstrap wiring

This commit is contained in:
2026-05-31 05:52:42 +02:00
parent 201eff717d
commit 9aba393fde
11 changed files with 70 additions and 55 deletions

View File

@@ -42,7 +42,10 @@ impl PostgresUserRepository {
#[async_trait]
impl UserRepository for PostgresUserRepository {
async fn find_by_id(&self, id: &SystemId) -> Result<Option<domain::entities::User>, DomainError> {
async fn find_by_id(
&self,
id: &SystemId,
) -> Result<Option<domain::entities::User>, DomainError> {
let row = sqlx::query_as::<_, UserRow>(
"SELECT id, username, email, password_hash, created_at FROM users WHERE id = $1",
)
@@ -54,7 +57,10 @@ impl UserRepository for PostgresUserRepository {
row.map(TryInto::try_into).transpose()
}
async fn find_by_email(&self, email: &Email) -> Result<Option<domain::entities::User>, DomainError> {
async fn find_by_email(
&self,
email: &Email,
) -> Result<Option<domain::entities::User>, DomainError> {
let row = sqlx::query_as::<_, UserRow>(
"SELECT id, username, email, password_hash, created_at FROM users WHERE email = $1",
)
@@ -66,7 +72,10 @@ impl UserRepository for PostgresUserRepository {
row.map(TryInto::try_into).transpose()
}
async fn find_by_username(&self, username: &str) -> Result<Option<domain::entities::User>, DomainError> {
async fn find_by_username(
&self,
username: &str,
) -> Result<Option<domain::entities::User>, DomainError> {
let row = sqlx::query_as::<_, UserRow>(
"SELECT id, username, email, password_hash, created_at FROM users WHERE username = $1",
)