package entity

import (
	"github.com/google/uuid"
	"time"
)

type ApprovalWorkflowSteps struct {
	ID                    uint       `json:"id" gorm:"primaryKey;type:int4;autoIncrement"`
	WorkflowId            uint       `json:"workflow_id" gorm:"type:int4;not null"`
	StepOrder             int        `json:"step_order" gorm:"type:int4;not null"`
	StepName              string     `json:"step_name" gorm:"type:varchar;not null"`
	RequiredUserLevelId   uint       `json:"required_user_level_id" gorm:"type:int4;not null"`
	CanSkip               *bool      `json:"can_skip" gorm:"type:bool;default:false"`
	AutoApproveAfterHours *int       `json:"auto_approve_after_hours" gorm:"type:int4"`
	IsActive              *bool      `json:"is_active" gorm:"type:bool;default:true"`
	ClientId              *uuid.UUID `json:"client_id" gorm:"type:UUID"`
	CreatedAt             time.Time  `json:"created_at" gorm:"default:now()"`
	UpdatedAt             time.Time  `json:"updated_at" gorm:"default:now()"`

	// Relations
	Workflow        ApprovalWorkflows `json:"workflow" gorm:"foreignKey:WorkflowId;constraint:OnDelete:CASCADE"`
	RequiredUserLevel UserLevels      `json:"required_user_level" gorm:"foreignKey:RequiredUserLevelId"`
}