Files
template-vitrine/backend/internal/modules/customerverification/model.go
T
Xor290 919c807004
ci-api / test (push) Failing after 8m7s
ci-web / test (push) Failing after 5m5s
chore: build
2026-09-20 12:18:33 +02:00

39 lines
1.1 KiB
Go

// Package customerverification lets a customer submit an identity document
// (front/back) for manual admin review, gating checkout when the admin has
// turned on site.Settings.CustomerVerificationRequired -- e.g. for
// age/ID-restricted goods. Documents are stored privately (never through
// the public media module) and served only to the admin and the owning
// customer through authenticated endpoints.
package customerverification
import (
"time"
"github.com/google/uuid"
)
const (
StatusPending = "pending"
StatusApproved = "approved"
StatusRejected = "rejected"
)
var ValidStatuses = map[string]bool{
StatusPending: true,
StatusApproved: true,
StatusRejected: true,
}
type CustomerVerification struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
UserID uuid.UUID `gorm:"type:uuid;uniqueIndex;not null"`
FrontKey string `gorm:"not null"`
BackKey string `gorm:"not null"`
Status string `gorm:"not null;default:pending"`
AdminNote string `gorm:"not null;default:''"`
CreatedAt time.Time
UpdatedAt time.Time
}
func (CustomerVerification) TableName() string { return "customer_verifications" }