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:
@@ -475,14 +475,14 @@ func (r *tenderApprovalRepository) CountByCompanyID(ctx context.Context, company
|
||||
func (r *tenderApprovalRepository) GetTenderApprovalStats(ctx context.Context) (*TenderApprovalStatsResponse, error) {
|
||||
// Get basic counts
|
||||
totalApprovals, _ := r.Count(ctx)
|
||||
approvedTenders, _ := r.CountByStatus(ctx, ApprovalStatusApproved)
|
||||
submittedTenders, _ := r.CountByStatus(ctx, ApprovalStatusSubmitted)
|
||||
rejectedTenders, _ := r.CountByStatus(ctx, ApprovalStatusRejected)
|
||||
|
||||
stats := &TenderApprovalStatsResponse{
|
||||
TotalApprovals: totalApprovals,
|
||||
ApprovedTenders: approvedTenders,
|
||||
RejectedTenders: rejectedTenders,
|
||||
LastUpdated: time.Now().Unix(),
|
||||
TotalApprovals: totalApprovals,
|
||||
SubmittedTenders: submittedTenders,
|
||||
RejectedTenders: rejectedTenders,
|
||||
LastUpdated: time.Now().Unix(),
|
||||
}
|
||||
|
||||
return stats, nil
|
||||
@@ -494,23 +494,23 @@ func (r *tenderApprovalRepository) GetCompanyTenderApprovalStats(ctx context.Con
|
||||
totalApprovals, _ := r.CountByCompanyID(ctx, companyID)
|
||||
|
||||
// Count by status for this company
|
||||
approvedFilter := bson.M{"company_id": companyID, "status": string(ApprovalStatusApproved)}
|
||||
approvedTenders, _ := r.ormRepo.Count(ctx, approvedFilter)
|
||||
submittedFilter := bson.M{"company_id": companyID, "status": string(ApprovalStatusSubmitted)}
|
||||
submittedTenders, _ := r.ormRepo.Count(ctx, submittedFilter)
|
||||
|
||||
rejectedFilter := bson.M{"company_id": companyID, "status": string(ApprovalStatusRejected)}
|
||||
rejectedTenders, _ := r.ormRepo.Count(ctx, rejectedFilter)
|
||||
|
||||
// Count by submission mode for this company
|
||||
selfApplyFilter := bson.M{"company_id": companyID, "status": string(ApprovalStatusApproved), "submission_mode": string(SubmissionModeSelfApply)}
|
||||
selfApplyFilter := bson.M{"company_id": companyID, "status": string(ApprovalStatusSubmitted), "submission_mode": string(SubmissionModeSelfApply)}
|
||||
selfApplyCount, _ := r.ormRepo.Count(ctx, selfApplyFilter)
|
||||
|
||||
partnershipFilter := bson.M{"company_id": companyID, "status": string(ApprovalStatusApproved), "submission_mode": string(SubmissionModePartnership)}
|
||||
partnershipFilter := bson.M{"company_id": companyID, "status": string(ApprovalStatusSubmitted), "submission_mode": string(SubmissionModePartnership)}
|
||||
partnershipCount, _ := r.ormRepo.Count(ctx, partnershipFilter)
|
||||
|
||||
stats := &CompanyTenderApprovalStatsResponse{
|
||||
CompanyID: companyID,
|
||||
TotalApprovals: totalApprovals,
|
||||
ApprovedTenders: approvedTenders,
|
||||
SubmittedTenders: submittedTenders,
|
||||
RejectedTenders: rejectedTenders,
|
||||
SelfApplyCount: selfApplyCount,
|
||||
PartnershipCount: partnershipCount,
|
||||
|
||||
Reference in New Issue
Block a user