kontenhumas-be/app/module/article_approval_flows/response/article_approval_flows.resp...

112 lines
4.9 KiB
Go
Raw Normal View History

2025-09-28 01:53:09 +00:00
package response
import (
2025-09-30 13:34:56 +00:00
approvalWorkflowsResponse "netidhub-saas-be/app/module/approval_workflows/response"
articleApprovalStepLogsResponse "netidhub-saas-be/app/module/article_approval_step_logs/response"
articlesResponse "netidhub-saas-be/app/module/articles/response"
2025-09-28 01:53:09 +00:00
"time"
)
type ArticleApprovalFlowsResponse struct {
ID uint `json:"id"`
ArticleID uint `json:"articleId"`
WorkflowID uint `json:"workflowId"`
CurrentStep int `json:"currentStep"`
Status string `json:"status"`
SubmittedBy uint `json:"submittedBy"`
SubmittedAt time.Time `json:"submittedAt"`
CompletedAt *time.Time `json:"completedAt"`
RejectedAt *time.Time `json:"rejectedAt"`
RejectionReason *string `json:"rejectionReason"`
RevisionRequestedAt *time.Time `json:"revisionRequestedAt"`
RevisionReason *string `json:"revisionReason"`
ResubmittedAt *time.Time `json:"resubmittedAt"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
// Relations
2025-09-30 13:34:56 +00:00
Article *articlesResponse.ArticlesResponse `json:"article,omitempty"`
Workflow *approvalWorkflowsResponse.ApprovalWorkflowsResponse `json:"workflow,omitempty"`
StepLogs []*articleApprovalStepLogsResponse.ArticleApprovalStepLogsResponse `json:"stepLogs,omitempty"`
2025-09-28 01:53:09 +00:00
}
type ArticleApprovalFlowsDetailResponse struct {
ID uint `json:"id"`
ArticleID uint `json:"articleId"`
WorkflowID uint `json:"workflowId"`
CurrentStep int `json:"currentStep"`
Status string `json:"status"`
SubmittedBy uint `json:"submittedBy"`
SubmittedByName string `json:"submittedByName"`
SubmittedAt time.Time `json:"submittedAt"`
CompletedAt *time.Time `json:"completedAt"`
RejectedAt *time.Time `json:"rejectedAt"`
RejectionReason *string `json:"rejectionReason"`
RevisionRequestedAt *time.Time `json:"revisionRequestedAt"`
RevisionReason *string `json:"revisionReason"`
ResubmittedAt *time.Time `json:"resubmittedAt"`
CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"`
// Relations with full details
2025-09-30 13:34:56 +00:00
Article *articlesResponse.ArticlesResponse `json:"article"`
Workflow *approvalWorkflowsResponse.ApprovalWorkflowsWithStepsResponse `json:"workflow"`
StepLogs []*articleApprovalStepLogsResponse.ArticleApprovalStepLogsResponse `json:"stepLogs"`
2025-09-28 01:53:09 +00:00
}
type ArticleApprovalFlowsSummaryResponse struct {
ID uint `json:"id"`
ArticleID uint `json:"articleId"`
ArticleTitle string `json:"articleTitle"`
WorkflowName string `json:"workflowName"`
CurrentStep int `json:"currentStep"`
TotalSteps int `json:"totalSteps"`
Status string `json:"status"`
SubmittedBy uint `json:"submittedBy"`
SubmittedByName string `json:"submittedByName"`
SubmittedAt time.Time `json:"submittedAt"`
DaysInApproval int `json:"daysInApproval"`
}
type ApprovalQueueResponse struct {
2025-09-30 13:34:56 +00:00
ID uint `json:"id"`
ArticleID uint `json:"articleId"`
ArticleTitle string `json:"articleTitle"`
ArticleAuthor string `json:"articleAuthor"`
WorkflowName string `json:"workflowName"`
CurrentStepName string `json:"currentStepName"`
SubmittedAt time.Time `json:"submittedAt"`
DaysWaiting int `json:"daysWaiting"`
Priority string `json:"priority"`
RequiresComment bool `json:"requiresComment"`
2025-09-28 01:53:09 +00:00
}
type ApprovalDashboardStatsResponse struct {
PendingApprovals int `json:"pendingApprovals"`
MyPendingApprovals int `json:"myPendingApprovals"`
ApprovedToday int `json:"approvedToday"`
RejectedToday int `json:"rejectedToday"`
RevisionRequested int `json:"revisionRequested"`
OverdueApprovals int `json:"overdueApprovals"`
AverageApprovalTime int `json:"averageApprovalTime"` // in hours
}
type ApprovalWorkloadStatsResponse struct {
ApproverID uint `json:"approverId"`
ApproverName string `json:"approverName"`
PendingCount int `json:"pendingCount"`
ApprovedThisWeek int `json:"approvedThisWeek"`
RejectedThisWeek int `json:"rejectedThisWeek"`
AverageResponseTime int `json:"averageResponseTime"` // in hours
}
type ApprovalAnalyticsResponse struct {
Period string `json:"period"`
TotalSubmissions int `json:"totalSubmissions"`
TotalApproved int `json:"totalApproved"`
TotalRejected int `json:"totalRejected"`
TotalRevisions int `json:"totalRevisions"`
ApprovalRate float64 `json:"approvalRate"`
AverageApprovalTime float64 `json:"averageApprovalTime"` // in hours
2025-09-30 13:34:56 +00:00
}