@@ -0,0 +1,27 @@
|
||||
package domain
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Credential struct {
|
||||
ID string `db:"id"`
|
||||
UserID string `db:"user_id"`
|
||||
LoginName string `db:"login_name"`
|
||||
PasswordHash string `db:"password_hash" json:"-"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
}
|
||||
|
||||
func (Credential) TableName() string { return "veyra_credential" }
|
||||
|
||||
type Session struct {
|
||||
ID string `db:"id"`
|
||||
UserID string `db:"user_id"`
|
||||
TokenHash string `db:"token_hash" json:"-"`
|
||||
Audience string `db:"audience"`
|
||||
ExpiresAt time.Time `db:"expires_at"`
|
||||
RevokedAt *time.Time `db:"revoked_at"`
|
||||
CreatedAt time.Time `db:"created_at"`
|
||||
}
|
||||
|
||||
func (Session) TableName() string { return "veyra_session" }
|
||||
@@ -0,0 +1,15 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
// User maps explicitly to veyra_user. IDs are canonical UUID strings.
|
||||
type User struct {
|
||||
ID string `db:"id" json:"id"`
|
||||
DisplayName string `db:"display_name" json:"display_name"`
|
||||
Status string `db:"status" json:"status"`
|
||||
Role string `db:"role" json:"-"`
|
||||
CreatedAt time.Time `db:"created_at" json:"created_at"`
|
||||
UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
|
||||
}
|
||||
|
||||
func (User) TableName() string { return "veyra_user" }
|
||||
Reference in New Issue
Block a user