45cfa24a72
- Updated the document scraper service to include a new ScrapePortalsProvider interface, allowing for dynamic retrieval of supported scraping portals. - Modified the ListPendingTenders and GetTenderByNoticeID methods to filter tenders based on document URLs that match the configured portals. - Introduced new error handling for cases when the scrape portals provider is not configured, returning appropriate service unavailable responses. - Enhanced API documentation to reflect changes in tender retrieval logic and added error response details for unsupported portal scenarios. This update improves the document scraping functionality by integrating AI portal support, enhancing the overall reliability and flexibility of the tender management system.
19 lines
538 B
Go
19 lines
538 B
Go
package document_scraper
|
|
|
|
import "tm/internal/tender"
|
|
|
|
// BuildDocumentScraperTenderResponse maps a stored tender to the scraper API contract.
|
|
func BuildDocumentScraperTenderResponse(t *tender.Tender) *DocumentScraperTenderResponse {
|
|
if t == nil {
|
|
return &DocumentScraperTenderResponse{}
|
|
}
|
|
|
|
return &DocumentScraperTenderResponse{
|
|
ContractFolderID: t.ContractFolderID,
|
|
NoticePublicationID: t.NoticePublicationID,
|
|
DocumentURL: documentURL(t),
|
|
Title: t.Title,
|
|
Description: t.Description,
|
|
}
|
|
}
|