From 094c8953b6f4b68ee190c90611c60040c7237be1 Mon Sep 17 00:00:00 2001 From: emil Date: Fri, 1 May 2026 17:10:41 +0300 Subject: [PATCH] fix: scan timestamptz into time.Time in users repository MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Same pgx v5 binary protocol issue as admin service — created_at in transactions cannot be scanned into *string. Co-Authored-By: Claude Sonnet 4.6 --- backend/internal/users/repository.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/internal/users/repository.go b/backend/internal/users/repository.go index fbe6699..d5c01c4 100644 --- a/backend/internal/users/repository.go +++ b/backend/internal/users/repository.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "time" "github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5/pgxpool" @@ -95,9 +96,11 @@ func (r *Repository) ListTransactions(ctx context.Context, userID string, limit, var txs []Transaction for rows.Next() { var t Transaction - if err := rows.Scan(&t.ID, &t.Amount, &t.Type, &t.Description, &t.PartnerID, &t.CreatedAt); err != nil { + var createdAt time.Time + if err := rows.Scan(&t.ID, &t.Amount, &t.Type, &t.Description, &t.PartnerID, &createdAt); err != nil { return nil, fmt.Errorf("repository.ListTransactions: scan: %w", err) } + t.CreatedAt = createdAt.UTC().Format(time.RFC3339) txs = append(txs, t) } if err := rows.Err(); err != nil {