92 lines
5.4 KiB
Go
92 lines
5.4 KiB
Go
package document_scraper
|
|
|
|
// DocumentScraperListRequest represents the request to list tenders pending document scraping
|
|
type DocumentScraperListRequest struct {
|
|
Limit int `query:"limit" valid:"optional,range(1|100)" default:"20"`
|
|
Offset int `query:"offset" valid:"optional,range(0|1000000)" default:"0"`
|
|
}
|
|
|
|
// DocumentScraperGetRequest represents the request to get a specific tender by notice publication ID
|
|
type DocumentScraperGetRequest struct {
|
|
NoticeID string `param:"notice_id" valid:"required~Notice ID is required"`
|
|
}
|
|
|
|
// DocumentScraperBuyerResponse is buyer/contact and location data exposed to the document scraper.
|
|
type DocumentScraperBuyerResponse struct {
|
|
BuyerName string `json:"buyer_name"`
|
|
BuyerEmail string `json:"buyer_email"`
|
|
BuyerCountry string `json:"buyer_country"`
|
|
BuyerRegionNuts string `json:"buyer_region_nuts"`
|
|
BuyerCity string `json:"buyer_city"`
|
|
BuyerProfileURL string `json:"buyer_profile_url"`
|
|
}
|
|
|
|
// DocumentScraperLotResponse is one procurement lot for the scraper task payload.
|
|
type DocumentScraperLotResponse struct {
|
|
LotID string `json:"lot_id,omitempty"`
|
|
LotTitle string `json:"lot_title"`
|
|
LotDescription string `json:"lot_description"`
|
|
LotMainNature string `json:"lot_main_nature"`
|
|
LotMainClassificationCode string `json:"lot_main_classification_code"`
|
|
LotMainClassificationDescription string `json:"lot_main_classification_description"`
|
|
LotMainClassificationDisplay string `json:"lot_main_classification_display,omitempty"`
|
|
AdditionalClassifications []string `json:"additional_classifications,omitempty"`
|
|
LotDuration string `json:"lot_duration"`
|
|
LotEstimatedValueExclVAT float64 `json:"lot_estimated_value_excl_vat"`
|
|
LotEstimatedValueCurrency string `json:"lot_estimated_value_currency,omitempty"`
|
|
}
|
|
|
|
// DocumentScraperWinnerResponse is a contract winner / winning tenderer for result notices.
|
|
type DocumentScraperWinnerResponse struct {
|
|
OfficialName string `json:"official_name"`
|
|
RegistrationNumber string `json:"registration_number"`
|
|
PostalAddress string `json:"postal_address"`
|
|
Town string `json:"town"`
|
|
Postcode string `json:"postcode"`
|
|
CountrySubdivisionNuts string `json:"country_subdivision_nuts"`
|
|
Country string `json:"country"`
|
|
ContactPoint string `json:"contact_point"`
|
|
Email string `json:"email"`
|
|
Telephone string `json:"telephone"`
|
|
LotID string `json:"lot_id,omitempty"`
|
|
}
|
|
|
|
// DocumentScraperTenderResponse represents the response for a tender returned to the document scraper service.
|
|
//
|
|
// ContractFolderID is the TED procedure identifier (BT-04 / ContractFolderID),
|
|
// included so the scraper can build the MinIO upload path for this notice:
|
|
//
|
|
// PROC_<contract_folder_id>/<notice_publication_id>/documents/<file>
|
|
// PROC_<contract_folder_id>/<notice_publication_id>/tender.json
|
|
type DocumentScraperTenderResponse struct {
|
|
ContractFolderID string `json:"contract_folder_id"`
|
|
NoticePublicationID string `json:"notice_publication_id"`
|
|
DocumentURL string `json:"document_url"`
|
|
Title string `json:"title"`
|
|
Description string `json:"description"`
|
|
NoticeIdentifier string `json:"notice_identifier"`
|
|
NoticeVersion string `json:"notice_version"`
|
|
FormType string `json:"form_type"`
|
|
NoticeType string `json:"notice_type"`
|
|
NoticeSubtype string `json:"notice_subtype"`
|
|
PublicationDate int64 `json:"publication_date"`
|
|
NoticeDispatchDateWithTimezone string `json:"notice_dispatch_date_with_timezone"`
|
|
ProcurementTypeCode string `json:"procurement_type_code"`
|
|
MainClassification string `json:"main_classification"`
|
|
MainClassificationDescription string `json:"main_classification_description"`
|
|
MainClassificationDisplay string `json:"main_classification_display,omitempty"`
|
|
AdditionalClassifications []string `json:"additional_classifications,omitempty"`
|
|
EstimatedValue float64 `json:"estimated_value"`
|
|
EstimatedValueCurrency string `json:"estimated_value_currency,omitempty"`
|
|
EstimatedValueVATBasis string `json:"estimated_value_vat_basis"`
|
|
Status string `json:"status"`
|
|
Buyer DocumentScraperBuyerResponse `json:"buyer"`
|
|
Lots []DocumentScraperLotResponse `json:"lots"`
|
|
Winners []DocumentScraperWinnerResponse `json:"winners"`
|
|
}
|
|
|
|
// DocumentScraperListResponse represents the paginated list response
|
|
type DocumentScraperListResponse struct {
|
|
Tenders []DocumentScraperTenderResponse `json:"tenders"`
|
|
}
|