44f266189c
- Updated the GetOJS function to accept a base URL parameter, improving flexibility in constructing the calendar URL. - Removed the deprecated eform.go file, streamlining the codebase by eliminating unused components. - Introduced new eform structures for BusinessRegistrationInformationNotice, ContractNotice, ContractAwardNotice, and PriorInformationNotice, enhancing the handling of TED XML data. - Implemented mapping functions to convert eform notices to the Tender entity, improving integration with the tender management system. - Added a service layer to encapsulate business logic related to eform processing, adhering to Clean Architecture principles.
45 lines
2.3 KiB
Go
45 lines
2.3 KiB
Go
package contract_award
|
|
|
|
import (
|
|
"encoding/xml"
|
|
"tm/internal/tender"
|
|
"tm/ted/eform"
|
|
)
|
|
|
|
// ContractAwardNotice represents the UBL ContractAwardNotice structure
|
|
type ContractAwardNotice struct {
|
|
XMLName xml.Name `xml:"ContractAwardNotice"`
|
|
UBLVersionID string `json:"ubl_version_id" xml:"UBLVersionID"`
|
|
CustomizationID string `json:"customization_id" xml:"CustomizationID"`
|
|
ID string `json:"id" xml:"ID"`
|
|
ContractFolderID string `json:"contract_folder_id" xml:"ContractFolderID"`
|
|
IssueDate string `json:"issue_date" xml:"IssueDate"`
|
|
IssueTime string `json:"issue_time,omitempty" xml:"IssueTime,omitempty"`
|
|
VersionID string `json:"version_id,omitempty" xml:"VersionID,omitempty"`
|
|
RegulatoryDomain string `json:"regulatory_domain,omitempty" xml:"RegulatoryDomain,omitempty"`
|
|
NoticeTypeCode string `json:"notice_type_code" xml:"NoticeTypeCode"`
|
|
NoticeLanguageCode string `json:"notice_language_code" xml:"NoticeLanguageCode"`
|
|
ContractingParty eform.ContractingParty `json:"contracting_party" xml:"ContractingParty"`
|
|
TenderingTerms eform.TenderingTerms `json:"tendering_terms,omitempty" xml:"TenderingTerms,omitempty"`
|
|
TenderingProcess eform.TenderingProcess `json:"tendering_process,omitempty" xml:"TenderingProcess,omitempty"`
|
|
ProcurementProject eform.ProcurementProject `json:"procurement_project" xml:"ProcurementProject"`
|
|
ProcurementProjectLot []eform.ProcurementProjectLot `json:"procurement_project_lots,omitempty" xml:"ProcurementProjectLot,omitempty"`
|
|
UBLExtensions eform.UBLExtensions `json:"ubl_extensions,omitempty" xml:"UBLExtensions,omitempty"`
|
|
}
|
|
|
|
// GetID returns the contract award notice ID
|
|
func (can ContractAwardNotice) GetID() string {
|
|
return can.ID
|
|
}
|
|
|
|
// Validate validates the parsed model
|
|
func (can ContractAwardNotice) Validate() error {
|
|
return nil
|
|
}
|
|
|
|
func (notice ContractAwardNotice) MapToTender() *tender.Tender {
|
|
t := new(tender.Tender)
|
|
t.ContractNoticeID = notice.GetID()
|
|
return t
|
|
}
|