20 lines
461 B
Go
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" }
|