package base

import "time"

type ID uint64

type Base struct {
	ID        ID        `gorm:"primary_key;not null"`
	CreatedAt time.Time `gorm:"created_at;type:TIMESTAMP;not null;<-:create"` // create and read only
}

type Updatable struct {
	Base
	UpdatedAt *time.Time `gorm:"updated_at;type:TIMESTAMP"`
}

func (id ID) Uint64() uint64 {
	return uint64(id)
}

func (u Base) GetID() ID {
	return u.ID
}
