package listing

import (
	"hfb_sys/backend/internal/auditlog"

	"gorm.io/gorm"
)

func appendAuditLog(tx *gorm.DB, actorID uint64, action string, bizType string, bizID uint64, meta AuditMeta, detail map[string]any) error {
	return auditlog.Append(tx, auditlog.Entry{
		ActorType: "admin",
		ActorID:   actorID,
		Action:    action,
		BizType:   bizType,
		BizID:     &bizID,
		Meta:      meta,
		Detail:    detail,
	})
}
