package models

import (
	"encoding/json"
	"time"

	"github.com/google/uuid"
)

type AuditLog struct {
	ID         int64            `db:"id" json:"id"`
	TenantID   uuid.UUID        `db:"tenant_id" json:"tenant_id"`
	UserID     *uuid.UUID       `db:"user_id" json:"user_id,omitempty"`
	Action     string           `db:"action" json:"action"`
	EntityType string           `db:"entity_type" json:"entity_type"`
	EntityID   *uuid.UUID       `db:"entity_id" json:"entity_id,omitempty"`
	OldValues  *json.RawMessage `db:"old_values" json:"old_values,omitempty"`
	NewValues  *json.RawMessage `db:"new_values" json:"new_values,omitempty"`
	IPAddress  *string          `db:"ip_address" json:"ip_address,omitempty"`
	UserAgent  *string          `db:"user_agent" json:"user_agent,omitempty"`
	CreatedAt  time.Time        `db:"created_at" json:"created_at"`
}
