30 lines
1.0 KiB
Go
30 lines
1.0 KiB
Go
// Package contactlinks lets the admin publish an arbitrary list of
|
|
// communication channels (WhatsApp, Telegram, Signal, Discord, email, ...)
|
|
// for customers to reach the shop through. Each entry is a label, a URL,
|
|
// and its own style: either a built-in brand icon (IconKey, matched against
|
|
// the frontend's curated icon set) or a custom image picked from the media
|
|
// library (IconMediaID), plus a color -- so no per-app integration is
|
|
// needed to add a new one.
|
|
package contactlinks
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type ContactLink struct {
|
|
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
|
|
Label string `gorm:"not null"`
|
|
URL string `gorm:"not null"`
|
|
IconKey string `gorm:"not null;default:''"`
|
|
IconMediaID *uuid.UUID `gorm:"type:uuid"`
|
|
Color string `gorm:"not null;default:''"`
|
|
Position int `gorm:"not null;default:0"`
|
|
IsActive bool `gorm:"not null;default:true"`
|
|
CreatedAt time.Time
|
|
UpdatedAt time.Time
|
|
}
|
|
|
|
func (ContactLink) TableName() string { return "contact_links" }
|