Update Configuration and Enhance Tender Approval Pagination

- Changed the server port from 8081 to 8082 for the web application.
- Updated MongoDB URI to include authentication credentials for improved security.
- Added new query parameters `limit` and `offset` for pagination in tender approval retrieval, enhancing the API's flexibility.
- Modified the response structure to include metadata for pagination, improving the clarity of responses.
- Updated API documentation to reflect the new pagination parameters and response format, ensuring consistency for API consumers.
This commit is contained in:
n.nakhostin
2025-09-06 12:07:32 +03:30
parent 61a217cf09
commit eb69a842f0
10 changed files with 171 additions and 52 deletions
+8 -5
View File
@@ -3,6 +3,7 @@ package tender_approval
import (
"time"
"tm/pkg/mongo"
"tm/pkg/response"
)
// ApprovalStatus represents the approval status of a tender by a company
@@ -63,6 +64,12 @@ type TenderApprovalWithTenderResponse struct {
Tender *TenderDetails `json:"tender,omitempty"`
}
// TenderApprovalWithTenderResponse represents the response data for tender approval with tender details
type TenderApprovalWithTenderListResponse struct {
Approvals []*TenderApprovalWithTenderResponse `json:"tenders"`
Metadata *response.Meta `json:"metadata"`
}
// TenderDetails represents essential tender information for the response
type (
TenderDetails struct {
@@ -103,11 +110,7 @@ type TenderApprovalSearchCriteria struct {
// TenderApprovalListResponseWithTender represents a paginated list of tender approvals with tender details
type TenderApprovalListResponseWithTender struct {
TenderApprovals []*TenderApprovalWithTenderResponse `json:"tender_approvals"`
Total int64 `json:"total"`
Limit int `json:"limit"`
Offset int `json:"offset"`
Page int `json:"page"`
Pages int `json:"pages"`
Metadata *response.Meta `json:"metadata"`
}
// TenderApprovalStatistics represents statistics for tender approvals