first
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// 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" }
|
||||
Reference in New Issue
Block a user