2026-01-20 03:34:58 +00:00
package entity
import (
"time"
)
// ApprovalHistories is a generic table to store approval/rejection history for all modules
type ApprovalHistories struct {
ID uint ` json:"id" gorm:"primaryKey;type:int4;autoIncrement" `
ModuleType string ` json:"module_type" gorm:"type:varchar" ` // e.g., "banners", "galleries", "products", "sales_agents", "promotions"
ModuleId uint ` json:"module_id" gorm:"type:int4" ` // ID of the record in the respective module table
2026-01-25 16:50:49 +00:00
StatusId * int ` json:"status_id" gorm:"type:int4" ` // StatusId nullable, karena action "comment" tidak mengubah status // 1: pending, 2: approved, 3: rejected
2026-01-20 03:34:58 +00:00
Action string ` json:"action" gorm:"type:varchar" ` // "approve" or "reject"
ApprovedBy * uint ` json:"approved_by" gorm:"type:int4" ` // User ID who performed the action
Message * string ` json:"message" gorm:"type:text" ` // Optional message/reason
CreatedAt time . Time ` json:"created_at" gorm:"default:now()" `
UpdatedAt time . Time ` json:"updated_at" gorm:"default:now()" `
}