package entities

import (
	"time"

	"github.com/google/uuid"
)

type LetterIncomingActivityLog struct {
	ID                uuid.UUID  `gorm:"type:uuid;primary_key;default:gen_random_uuid()" json:"id"`
	LetterID          uuid.UUID  `gorm:"type:uuid;not null" json:"letter_id"`
	ActionType        string     `gorm:"not null" json:"action_type"`
	ActorUserID       *uuid.UUID `json:"actor_user_id,omitempty"`
	ActorDepartmentID *uuid.UUID `json:"actor_department_id,omitempty"`
	TargetType        *string    `json:"target_type,omitempty"`
	TargetID          *uuid.UUID `json:"target_id,omitempty"`
	FromStatus        *string    `json:"from_status,omitempty"`
	ToStatus          *string    `json:"to_status,omitempty"`
	Context           JSONB      `gorm:"type:jsonb" json:"context,omitempty"`
	OccurredAt        time.Time  `gorm:"autoCreateTime" json:"occurred_at"`
}

func (LetterIncomingActivityLog) TableName() string { return "letter_incoming_activity_logs" }
