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:
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user