package response

import (
	"time"
	approvalWorkflowStepsResponse "web-qudo-be/app/module/approval_workflow_steps/response"
)

type ApprovalWorkflowsResponse struct {
	ID          uint      `json:"id"`
	Name        string    `json:"name"`
	Description *string   `json:"description"`
	IsActive    bool      `json:"isActive"`
	CreatedBy   uint      `json:"createdBy"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`

	// Relations
	Steps []*approvalWorkflowStepsResponse.ApprovalWorkflowStepsResponse `json:"steps,omitempty"`
}

type ApprovalWorkflowsWithStepsResponse struct {
	ID          uint      `json:"id"`
	Name        string    `json:"name"`
	Description *string   `json:"description"`
	IsActive    bool      `json:"isActive"`
	CreatedBy   uint      `json:"createdBy"`
	CreatedAt   time.Time `json:"createdAt"`
	UpdatedAt   time.Time `json:"updatedAt"`

	// Relations
	Steps []*approvalWorkflowStepsResponse.ApprovalWorkflowStepsResponse `json:"steps"`
}

type ApprovalWorkflowsSummaryResponse struct {
	ID          uint    `json:"id"`
	Name        string  `json:"name"`
	Description *string `json:"description"`
	IsActive    bool    `json:"isActive"`
	StepCount   int     `json:"stepCount"`
}

type ApprovalWorkflowsStatsResponse struct {
	TotalWorkflows       int `json:"totalWorkflows"`
	ActiveWorkflows      int `json:"activeWorkflows"`
	InactiveWorkflows    int `json:"inactiveWorkflows"`
	TotalSteps          int `json:"totalSteps"`
	AverageStepsPerFlow int `json:"averageStepsPerFlow"`
}