Files
template-vitrine/backend/internal/modules/units/model.go
T
2026-09-14 20:50:19 +02:00

20 lines
461 B
Go

// Package units lets the admin define their own measurement units
// (kg, g, piece, carton, ...) instead of the code hard-coding a fixed list.
package units
import (
"time"
"github.com/google/uuid"
)
type Unit struct {
ID uuid.UUID `gorm:"type:uuid;primaryKey"`
Name string `gorm:"not null"`
Symbol string `gorm:"uniqueIndex;not null"`
CreatedAt time.Time
UpdatedAt time.Time
}
func (Unit) TableName() string { return "units" }