auditlog

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initialize

func Initialize(
	rctx repocontext.RepoContext,
	auditTables, ignoreFields []string,
	systemUserId string) error

Types

type AuditLog

type AuditLog struct {
	ID        []byte         `gorm:"primaryKey;type:binary(16)"`
	TableName string         `gorm:"size:255"`
	RecordID  string         `gorm:"size:255;index"`
	UserId    string         `gorm:"index"`
	CreatedAt time.Time      `gorm:"autoCreateTime"`
	UpdatedAt time.Time      `gorm:"autoUpdateTime"`
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

GORM Models for Audit Logging tables

type AuditLogDetails

type AuditLogDetails struct {
	ID         []byte         `gorm:"primaryKey;type:binary(16)"`
	AuditLogId []byte         `gorm:"type:binary(16)"`
	FieldName  string         `gorm:"size:255;index"`
	OldValue   string         `gorm:"type:text"`
	NewValue   string         `gorm:"type:text"`
	CreatedAt  time.Time      `gorm:"autoCreateTime"`
	UpdatedAt  time.Time      `gorm:"autoUpdateTime"`
	DeletedAt  gorm.DeletedAt `gorm:"index"`
}

type AuditTrail

type AuditTrail struct {
	AuditLogID       []byte    `json:"audit_log_id"`
	TableName        string    `json:"table_name"`
	RecordID         string    `json:"record_id"`
	UserID           string    `json:"user_id"`
	LogCreatedAt     time.Time `json:"log_created_on" gorm:"column:log_created_on"`
	AuditLogDetailID []byte    `json:"audit_log_detail_id"`
	FieldName        string    `json:"field_name"`
	OldValue         string    `json:"old_value"`
	NewValue         string    `json:"new_value"`
	DetailCreatedAt  time.Time `json:"detail_created_on" gorm:"column:detail_created_on"`
}

Get Audit Trail response model

type AuditTrailData

type AuditTrailData struct {
	TotalRecords int64        `json:"total_records"`
	Records      []AuditTrail `json:"records"`
}

type AuditTrailRepo

type AuditTrailRepo struct {
	repocontext.RepoContext
}

func NewAuditTrailRepo

func NewAuditTrailRepo(
	_ctx repocontext.RepoContext,
) *AuditTrailRepo

func (*AuditTrailRepo) GetAuditTrail

func (ar *AuditTrailRepo) GetAuditTrail(recordIds []uuid.UUID, batchSize int, offset int) mo.Result[*AuditTrailData]

type Auditable

type Auditable interface {
	GetTableName() string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL