fix(storage): read lab5 job fields in GetByID

This commit is contained in:
Голиков Maximillian Антон
2026-11-07 11:23:46 +03:00
parent f4c6657a10
commit 228aa88723
@@ -71,7 +71,8 @@ func (r *AttachmentRepo) CreateInTx(ctx context.Context, tx domain.Tx, a *domain
func (r *AttachmentRepo) GetByID(ctx context.Context, id string) (*domain.Attachment, error) {
const q = `
SELECT id, chat_id, owner_id, filename, content_type, size_bytes, sha256,
object_key, status, error_code, created_at, updated_at
object_key, status, error_code, created_at, updated_at,
attempts, next_attempt_at, locked_until, pipeline_version, staging_key
FROM attachments
WHERE id = $1::uuid
`
@@ -80,7 +81,8 @@ func (r *AttachmentRepo) GetByID(ctx context.Context, id string) (*domain.Attach
err := r.pool.QueryRow(ctx, q, id).
Scan(&a.ID, &a.ChatID, &a.OwnerID, &a.Filename, &a.ContentType,
&a.SizeBytes, &a.SHA256, &a.ObjectKey, &status, &a.ErrorCode,
&a.CreatedAt, &a.UpdatedAt)
&a.CreatedAt, &a.UpdatedAt,
&a.Attempts, &a.NextAttemptAt, &a.LockedUntil, &a.PipelineVersion, &a.StagingKey)
if err != nil {
return nil, notFound(err, "attachment", id)
}