Files
mtusi2026lab5-fork/backend/internal/domain/entity.go
T

71 lines
1.6 KiB
Go

package domain
import "time"
type Health struct {
Status string
}
type User struct {
ID string
Username string
DisplayName string
PasswordHash string // в DTO UserResponse его не будет
CreatedAt time.Time
}
type Chat struct {
ID string
Title string
MemberIDs []string
CreatedAt time.Time
}
type Message struct {
ID string
ChatID string
SenderID string
Text string
AttachmentIDs []string
CreatedAt time.Time
}
type Session struct {
TokenHash []byte
UserID string
ExpiresAt time.Time
CreatedAt time.Time
}
type AttachmentStatus string
const (
AttachmentStatusQueued AttachmentStatus = "queued"
AttachmentStatusProcessing AttachmentStatus = "processing"
AttachmentStatusReady AttachmentStatus = "ready"
AttachmentStatusFailed AttachmentStatus = "failed"
)
type Attachment struct {
ID string
ChatID string
OwnerID string
Filename string
ContentType string
SizeBytes int64
SHA256 []byte
ObjectKey string
Status AttachmentStatus
ErrorCode *string
CreatedAt time.Time
UpdatedAt time.Time
Attempts int // авторитетный счётчик попыток (в БД)
NextAttemptAt *time.Time // "не раньше"; nil = можно брать сразу
LockedUntil *time.Time // lease; nil = не арендовано
PipelineVersion int // guard в CompleteJob; в БД default 1
StagingKey string // S3-ключ оригинала до 202; "" в lab4-пути
Variants []AttachmentVariant
}