33 lines
1.2 KiB
Go
33 lines
1.2 KiB
Go
package domain
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/google/uuid"
|
|
)
|
|
|
|
type Document struct {
|
|
ID uuid.UUID `json:"id" db:"id"`
|
|
TenantID uuid.UUID `json:"tenant_id" db:"tenant_id"`
|
|
ParentID *uuid.UUID `json:"parent_id" db:"parent_id"`
|
|
Title string `json:"title" db:"title"`
|
|
Content string `json:"content" db:"content"` // JSON for blocks
|
|
Status string `json:"status" db:"status"` // draft, published
|
|
CreatedBy uuid.UUID `json:"created_by" db:"created_by"`
|
|
LastUpdatedBy uuid.UUID `json:"last_updated_by" db:"last_updated_by"`
|
|
Version int `json:"version" db:"version"`
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
|
|
}
|
|
|
|
type DocumentActivity struct {
|
|
ID uuid.UUID `json:"id" db:"id"`
|
|
DocumentID uuid.UUID `json:"document_id" db:"document_id"`
|
|
TenantID uuid.UUID `json:"tenant_id" db:"tenant_id"`
|
|
UserID uuid.UUID `json:"user_id" db:"user_id"`
|
|
UserName string `json:"user_name" db:"user_name"` // For join
|
|
Action string `json:"action" db:"action"`
|
|
Description string `json:"description" db:"description"`
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
}
|