Update .gitignore, adjust TED scraper configuration, and enhance Tender entity structure

- Added 'ted_samples/' to .gitignore to exclude TED sample files from version control.
- Updated the TED scraper configuration to extend the cleanup duration from 24 hours to 72 hours, allowing for better resource management.
- Enhanced the Tender entity by adding new fields: TenderDeadline, SubmissionDeadline, ApplicationDeadline, and SubmissionURL, improving the data model for tender management.
- Updated the TenderResponse structure to include the new fields, ensuring consistency in API responses.
- Implemented logic in the TED scraper to calculate submission and application deadlines based on tender deadlines, enhancing the scraping functionality.
This commit is contained in:
n.nakhostin
2025-08-25 13:13:40 +03:30
parent b26d77b4cf
commit f67e179ffc
5 changed files with 86 additions and 11 deletions
+6 -2
View File
@@ -31,7 +31,6 @@ type ListTendersResponse struct {
type TenderResponse struct {
ID string `json:"id"`
NoticePublicationID string `json:"notice_publication_id"`
PublicationDate int64 `json:"publication_date"`
Title string `json:"title"`
Description string `json:"description"`
ProcurementTypeCode string `json:"procurement_type_code"`
@@ -40,8 +39,11 @@ type TenderResponse struct {
Currency string `json:"currency"`
Duration string `json:"duration"`
DurationUnit string `json:"duration_unit"`
PublicationDate int64 `json:"publication_date"`
TenderDeadline int64 `json:"tender_deadline"`
SubmissionDeadline int64 `json:"submission_deadline"`
ApplicationDeadline int64 `json:"application_deadline"`
SubmissionURL string `json:"submission_url"`
CountryCode string `json:"country_code"`
BuyerOrganization *OrganizationResponse `json:"buyer_organization"`
Status TenderStatus `json:"status"`
@@ -56,7 +58,6 @@ func (t *Tender) ToTenderResponse() *TenderResponse {
response := &TenderResponse{
ID: t.ID.Hex(),
NoticePublicationID: t.NoticePublicationID,
PublicationDate: t.PublicationDate,
Title: t.Title,
Description: t.Description,
ProcurementTypeCode: t.ProcurementTypeCode,
@@ -65,8 +66,11 @@ func (t *Tender) ToTenderResponse() *TenderResponse {
Currency: t.Currency,
Duration: t.Duration,
DurationUnit: t.DurationUnit,
PublicationDate: t.PublicationDate,
TenderDeadline: t.TenderDeadline,
SubmissionDeadline: t.SubmissionDeadline,
ApplicationDeadline: t.ApplicationDeadline,
SubmissionURL: t.SubmissionURL,
CountryCode: t.CountryCode,
BuyerOrganization: &OrganizationResponse{Name: t.BuyerOrganization.Name},
Status: t.Status,