Refactor Tender Approval Logic and Update Statistics Structure
- Modified the Reject method in the TenderApproval entity to reset the SubmissionMode field upon rejection, ensuring proper state management. - Simplified the TenderApprovalStatsResponse and CompanyTenderApprovalStatsResponse structures by removing unnecessary fields related to submission modes, streamlining the data model for tender approval statistics. - Updated the GetTenderApprovalStats and GetCompanyTenderApprovalStats methods in the repository to reflect the changes in the statistics structure, enhancing clarity and maintainability. - These adjustments improve the overall functionality and data handling of the tender management system.
This commit is contained in:
@@ -61,25 +61,21 @@ type TenderApprovalSearchForm struct {
|
||||
|
||||
// TenderApproval statistics DTOs
|
||||
type TenderApprovalStatsResponse struct {
|
||||
TotalApprovals int64 `json:"total_approvals"`
|
||||
ApprovedTenders int64 `json:"approved_tenders"`
|
||||
RejectedTenders int64 `json:"rejected_tenders"`
|
||||
ApprovalsByStatus map[string]int64 `json:"approvals_by_status"`
|
||||
ApprovalsBySubmission map[string]int64 `json:"approvals_by_submission"`
|
||||
LastUpdated int64 `json:"last_updated"`
|
||||
TotalApprovals int64 `json:"total_approvals"`
|
||||
ApprovedTenders int64 `json:"approved_tenders"`
|
||||
RejectedTenders int64 `json:"rejected_tenders"`
|
||||
LastUpdated int64 `json:"last_updated"`
|
||||
}
|
||||
|
||||
// CompanyTenderApprovalStatsResponse represents company-specific tender approval statistics
|
||||
type CompanyTenderApprovalStatsResponse struct {
|
||||
CompanyID string `json:"company_id"`
|
||||
TotalApprovals int64 `json:"total_approvals"`
|
||||
ApprovedTenders int64 `json:"approved_tenders"`
|
||||
RejectedTenders int64 `json:"rejected_tenders"`
|
||||
SelfApplyCount int64 `json:"self_apply_count"`
|
||||
PartnershipCount int64 `json:"partnership_count"`
|
||||
ApprovalsByStatus map[string]int64 `json:"approvals_by_status"`
|
||||
ApprovalsBySubmission map[string]int64 `json:"approvals_by_submission"`
|
||||
LastUpdated int64 `json:"last_updated"`
|
||||
CompanyID string `json:"company_id"`
|
||||
TotalApprovals int64 `json:"total_approvals"`
|
||||
ApprovedTenders int64 `json:"approved_tenders"`
|
||||
RejectedTenders int64 `json:"rejected_tenders"`
|
||||
SelfApplyCount int64 `json:"self_apply_count"`
|
||||
PartnershipCount int64 `json:"partnership_count"`
|
||||
LastUpdated int64 `json:"last_updated"`
|
||||
}
|
||||
|
||||
// ToggleTenderApprovalForm represents the form for toggling a tender approval
|
||||
|
||||
Reference in New Issue
Block a user