Start and end dates are now the contract's, with a new closing date

Find a Tender never sends tender.tenderPeriod.startDate, so an
opportunity's start date was always empty, and its end date was the
bid deadline. Start and end are now the contract period: from the
contracts' periods, else the awards' contract periods, else the lots'
contract periods, each date on its own, taking the earliest start and
the latest end of several.

The bid deadline (tenderPeriod.endDate) moves to a new closing_date
column (migration 00009), in the API as closing_date. EU Supply's
pages give no contract period, so its start and end are left empty
and its response deadline is the closing date.
This commit is contained in:
bwilliams committed 2026-10-21 14:31:12 +01:00
1 parent 43f9ef3223
commit 50ee510520
9 files changed
+191 -27

No files matched your search

+3 -1
View File
@@ -12,7 +12,8 @@ var ErrWonAndLost = errors.New("types: an opportunity cannot be both won and los
// Opportunity is a procurement opportunity (an OCDS contracting process,
// identified by UUID) as of its latest release, with its classifications,
// releases and the user's marks. Fields tagged db:"-" are stored in their
// own tables.
// own tables. StartDate and EndDate are the contract's period; ClosingDate
// is when bids must be in by.
type Opportunity struct {
UUID string `db:"uuid" json:"uuid"`
UUIDType string `db:"uuid_type" json:"uuid_type"`
@@ -29,6 +30,7 @@ type Opportunity struct {
VCSESuitable bool `db:"vcse_suitable" json:"vcse_suitable"`
StartDate *time.Time `db:"start_date" json:"start_date" extensions:"x-nullable"`
EndDate *time.Time `db:"end_date" json:"end_date" extensions:"x-nullable"`
ClosingDate *time.Time `db:"closing_date" json:"closing_date" extensions:"x-nullable"`
GrossValue float64 `db:"gross_value" json:"gross_value"`
HasDocuments bool `db:"has_documents" json:"has_documents"`
Source string `db:"source" json:"source"`