Refactor Tender Entity and TED Parser for Clarity and Consistency
- Updated the Tender entity to remove redundant comments on Unix timestamp fields, enhancing code readability. - Renamed the AwardedEntity type to Awarded for improved clarity and consistency in naming conventions. - Removed the transformPriorInformationNoticeToContractNotice method from TEDParser, streamlining the parser's functionality and reducing legacy code.
This commit is contained in:
@@ -17,12 +17,12 @@ type Tender struct {
|
|||||||
NoticeTypeCode string `bson:"notice_type_code" json:"notice_type_code"`
|
NoticeTypeCode string `bson:"notice_type_code" json:"notice_type_code"`
|
||||||
NoticeSubTypeCode string `bson:"notice_sub_type_code" json:"notice_sub_type_code"`
|
NoticeSubTypeCode string `bson:"notice_sub_type_code" json:"notice_sub_type_code"`
|
||||||
NoticeLanguageCode string `bson:"notice_language_code" json:"notice_language_code"`
|
NoticeLanguageCode string `bson:"notice_language_code" json:"notice_language_code"`
|
||||||
IssueDate int64 `bson:"issue_date" json:"issue_date"` // Unix milliseconds
|
IssueDate int64 `bson:"issue_date" json:"issue_date"`
|
||||||
IssueTime int64 `bson:"issue_time" json:"issue_time"` // Unix milliseconds
|
IssueTime int64 `bson:"issue_time" json:"issue_time"`
|
||||||
TenderDeadline int64 `bson:"tender_deadline" json:"tender_deadline"` // Unix milliseconds
|
TenderDeadline int64 `bson:"tender_deadline" json:"tender_deadline"`
|
||||||
PublicationDate int64 `bson:"publication_date" json:"publication_date"` // Unix milliseconds
|
PublicationDate int64 `bson:"publication_date" json:"publication_date"`
|
||||||
SubmissionDeadline int64 `bson:"submission_deadline" json:"submission_deadline"` // Unix milliseconds
|
SubmissionDeadline int64 `bson:"submission_deadline" json:"submission_deadline"`
|
||||||
ApplicationDeadline int64 `bson:"application_deadline" json:"application_deadline"` // Unix milliseconds
|
ApplicationDeadline int64 `bson:"application_deadline" json:"application_deadline"`
|
||||||
GazetteID string `bson:"gazette_id" json:"gazette_id"`
|
GazetteID string `bson:"gazette_id" json:"gazette_id"`
|
||||||
Title string `bson:"title" json:"title"`
|
Title string `bson:"title" json:"title"`
|
||||||
Description string `bson:"description" json:"description"`
|
Description string `bson:"description" json:"description"`
|
||||||
@@ -64,7 +64,7 @@ type Tender struct {
|
|||||||
SuspensionReason string `bson:"suspension_reason,omitempty" json:"suspension_reason,omitempty"`
|
SuspensionReason string `bson:"suspension_reason,omitempty" json:"suspension_reason,omitempty"`
|
||||||
SuspensionDate int64 `bson:"suspension_date,omitempty" json:"suspension_date,omitempty"` // Unix milliseconds
|
SuspensionDate int64 `bson:"suspension_date,omitempty" json:"suspension_date,omitempty"` // Unix milliseconds
|
||||||
Modifications []TenderModification `bson:"modifications,omitempty" json:"modifications,omitempty"`
|
Modifications []TenderModification `bson:"modifications,omitempty" json:"modifications,omitempty"`
|
||||||
AwardedEntities []AwardedEntity `bson:"awarded_entities,omitempty" json:"awarded_entities,omitempty"`
|
AwardedEntities []Awarded `bson:"awarded,omitempty" json:"awarded,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Organization represents organization information
|
// Organization represents organization information
|
||||||
@@ -118,7 +118,7 @@ type TenderModification struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AwardedEntity represents an entity that has been awarded a contract
|
// AwardedEntity represents an entity that has been awarded a contract
|
||||||
type AwardedEntity struct {
|
type Awarded struct {
|
||||||
Name string `bson:"name" json:"name"`
|
Name string `bson:"name" json:"name"`
|
||||||
Address string `bson:"address,omitempty" json:"address,omitempty"`
|
Address string `bson:"address,omitempty" json:"address,omitempty"`
|
||||||
Country string `bson:"country,omitempty" json:"country,omitempty"`
|
Country string `bson:"country,omitempty" json:"country,omitempty"`
|
||||||
|
|||||||
@@ -387,11 +387,6 @@ func (p *TEDParser) transformToContractNotice(xmlData []byte, docType string) []
|
|||||||
return []byte(xmlStr)
|
return []byte(xmlStr)
|
||||||
}
|
}
|
||||||
|
|
||||||
// transformPriorInformationNoticeToContractNotice transforms a PriorInformationNotice XML to ContractNotice format
|
|
||||||
func (p *TEDParser) transformPriorInformationNoticeToContractNotice(xmlData []byte) []byte {
|
|
||||||
return p.transformToContractNotice(xmlData, "PriorInformationNotice")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Legacy methods for backward compatibility
|
// Legacy methods for backward compatibility
|
||||||
// ParseXMLAsContractNotice parses XML specifically as ContractNotice (legacy method)
|
// ParseXMLAsContractNotice parses XML specifically as ContractNotice (legacy method)
|
||||||
func (p *TEDParser) ParseXMLAsContractNotice(xmlData []byte) (*ContractNotice, error) {
|
func (p *TEDParser) ParseXMLAsContractNotice(xmlData []byte) (*ContractNotice, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user