package data

import (
	"time"

	"gorm.io/gorm"
)

// dataAccessLogPO is the infrastructure-side write model used by GORM
// callbacks. The system module owns the query repository for the same table.
type dataAccessLogPO struct {
	ID                                uint `gorm:"primaryKey"`
	CreatedAt                         time.Time
	UpdatedAt                         time.Time
	DeletedAt                         gorm.DeletedAt `gorm:"index"`
	EventType, TargetTable, Operation string
	UserID, AuthorityID               uint
	Scope                             int
	RequestID, Method, Path, Detail   string
}

func (dataAccessLogPO) TableName() string { return "sys_data_access_logs" }
