Enhance tender service to exclude company-rejected tenders from recommendations
- Updated the tender service to include a new dependency for listing rejected tenders by company, allowing for more refined tender recommendations. - Introduced a new field in the SearchForm to specify whether to exclude rejected tenders from the recommendation results. - Enhanced the Recommend method to filter out rejected tenders based on the new exclusion logic, improving the relevance of AI-ranked tender recommendations. - Added unit tests to verify the exclusion logic for rejected tenders, ensuring robust functionality. This update improves the tender recommendation process by ensuring that company-rejected tenders are not included in the results, enhancing user experience and satisfaction.
This commit is contained in:
@@ -326,7 +326,7 @@ func (h *TenderHandler) GetPublicTenders(c echo.Context) error {
|
||||
|
||||
// RecommendTenders returns AI-ranked tender recommendations for the authenticated customer's company
|
||||
// @Summary Get recommended tenders
|
||||
// @Description Retrieve AI-ranked tenders with full tender details. Only active tenders whose publication-based submission window has not passed are returned (submission_deadline, or 48 working hours after publication_date). AI tender_id values use PROC_{contract_folder_id}/{notice_publication_id}; each item includes rank, analysis, procedure_ref, and the standard tender fields.
|
||||
// @Description Retrieve AI-ranked tenders with full tender details. Only active tenders whose publication-based submission window has not passed are returned (submission_deadline, or 48 working hours after publication_date). Company-rejected tenders are excluded. AI tender_id values use PROC_{contract_folder_id}/{notice_publication_id}; each item includes rank, analysis, procedure_ref, and the standard tender fields.
|
||||
// @Tags Tenders
|
||||
// @Produce json
|
||||
// @Param limit query int false "Number of items per page (default: 10, max: 100)"
|
||||
@@ -352,6 +352,7 @@ func (h *TenderHandler) RecommendTenders(c echo.Context) error {
|
||||
|
||||
form.Status = []string{string(TenderStatusActive)}
|
||||
form.OnlyActiveDeadlines = true
|
||||
form.ExcludeRejectedTenders = true
|
||||
|
||||
if customerCompanyID, ok := c.Get("company_id").(string); ok && customerCompanyID != "" {
|
||||
form.CompanyID = &customerCompanyID
|
||||
|
||||
Reference in New Issue
Block a user