NAM-APJATEL-BACKEND/model/dto/res/activity_logs_res.go

34 lines
1.1 KiB
Go

package res
import (
"time"
"github.com/google/uuid"
)
// ActivityLogResponse - simplified response for users
type ActivityLogResponse struct {
ID uuid.UUID `json:"id"`
Username string `json:"username"`
Role string `json:"role"`
Action string `json:"action"`
Resource string `json:"resource"`
IPAddress string `json:"ip_address"`
UserAgent string `json:"user_agent"`
Timestamp time.Time `json:"timestamp"`
}
// ActivityLogDetailResponse - detailed response for admins (if needed)
type ActivityLogDetailResponse struct {
ID uuid.UUID `json:"id"`
UserID uuid.UUID `json:"user_id"`
Username string `json:"username"`
Role string `json:"role"`
Action string `json:"action"`
Resource string `json:"resource"`
ResourceID *string `json:"resource_id,omitempty"`
OldData *string `json:"old_data,omitempty"`
NewData *string `json:"new_data,omitempty"`
IPAddress string `json:"ip_address"`
UserAgent string `json:"user_agent"`
Timestamp time.Time `json:"timestamp"`
}