Update Tender Approval Status to Include Submitted State and Revise API Documentation

- Changed the approval status from "approved" to "submitted" in various locations, including entity definitions, forms, and service methods, to accurately reflect the tender approval process.
- Updated API documentation in Swagger JSON, YAML, and Go files to describe the new status options ("submitted" and "rejected") and their corresponding descriptions.
- Enhanced the tender approval statistics structures to include a count for submitted tenders, improving the overall data model for tender management.
- These changes ensure clarity in the tender approval workflow and enhance the usability of the API for clients interacting with tender approvals.
This commit is contained in:
n.nakhostin
2025-08-25 13:51:14 +03:30
parent 0e14a11daf
commit 3024998e7e
9 changed files with 89 additions and 88 deletions
+8 -8
View File
@@ -9,8 +9,8 @@ import (
type ApprovalStatus string
const (
ApprovalStatusApproved ApprovalStatus = "approved" // Company approved the tender
ApprovalStatusRejected ApprovalStatus = "rejected" // Company rejected the tender
ApprovalStatusSubmitted ApprovalStatus = "submitted" // Company submitted the tender
ApprovalStatusRejected ApprovalStatus = "rejected" // Company rejected the tender
)
// SubmissionMode represents the submission mode of a tender by a company
@@ -121,9 +121,9 @@ func (ta *TenderApproval) GetID() string {
return ta.ID.Hex()
}
// IsApproved returns true if the tender was approved
func (ta *TenderApproval) IsApproved() bool {
return ta.Status == ApprovalStatusApproved
// IsSubmitted returns true if the tender was submitted
func (ta *TenderApproval) IsSubmitted() bool {
return ta.Status == ApprovalStatusSubmitted
}
// IsRejected returns true if the tender was rejected
@@ -133,12 +133,12 @@ func (ta *TenderApproval) IsRejected() bool {
// HasDecision returns true if a decision has been made
func (ta *TenderApproval) HasDecision() bool {
return ta.Status == ApprovalStatusApproved || ta.Status == ApprovalStatusRejected
return ta.Status == ApprovalStatusSubmitted || ta.Status == ApprovalStatusRejected
}
// Approve approves the tender with optional notes
func (ta *TenderApproval) Approve() {
ta.Status = ApprovalStatusApproved
func (ta *TenderApproval) Submit() {
ta.Status = ApprovalStatusSubmitted
ta.CreatedAt = time.Now().Unix()
}