Complete package for generating ocds structs (with extensions) in golang

This commit is contained in:
bwilliams committed 2026-10-01 14:50:07 +01:00
1 parent da726550d4
commit 35974fa070
47 files changed
+9861 -299

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
module example.com/myapp
go 1.22
require git.avsdev.uk/Go/go-ocds v0.0.0
require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/spf13/cobra v1.10.2 // indirect
github.com/spf13/pflag v1.0.9 // indirect
)
// For this example only: use the copy of the module in the parent directory.
// In a real project, delete this line and `go get git.avsdev.uk/Go/go-ocds@v1.x.y`.
replace git.avsdev.uk/Go/go-ocds => ../
+10
View File
@@ -0,0 +1,10 @@
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.10.2 h1:DMTTonx5m65Ic0GOoRY2c16WCbHxOOw6xxezuLaBpcU=
github.com/spf13/cobra v1.10.2/go.mod h1:7C1pvHqHw5A4vrJfjNwvOdzYu0Gml16OCs2GRiTUUS4=
github.com/spf13/pflag v1.0.9 h1:9exaQaMOCwffKiiiYk6/BndUBv+iRViNW+4lEMi0PvY=
github.com/spf13/pflag v1.0.9/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+7
View File
@@ -0,0 +1,7 @@
{
"releaseSchema": "https://raw.githubusercontent.com/open-contracting/standard/1.1/schema/release-schema.json",
"releasePackageSchema": "https://raw.githubusercontent.com/open-contracting/standard/1.1/schema/release-package-schema.json",
"extensions": [
"https://raw.githubusercontent.com/open-contracting-extensions/ocds_budget_breakdown_extension/master/extension.json"
]
}
+4
View File
@@ -0,0 +1,4 @@
// Package budgets holds OCDS types generated with the extensions in extensions.json.
package budgets
//go:generate go run git.avsdev.uk/Go/go-ocds/cmd/ocdsgen generate -c extensions.json -o ocds_gen.go -p budgets
+665
View File
@@ -0,0 +1,665 @@
// Code generated by ocdsgen from extensions.json. DO NOT EDIT.
// Package budgets contains Go types for OCDS releases with these extensions applied
// (dependencies first, in the order their patches were merged):
//
// - Budget Breakdown (declared)
// https://raw.githubusercontent.com/open-contracting-extensions/ocds_budget_breakdown_extension/master/extension.json
package budgets
import (
"encoding/json"
"fmt"
"time"
)
// DeclaredExtensions are the extension URLs to list in ReleasePackage.Extensions.
var DeclaredExtensions = []string{
"https://raw.githubusercontent.com/open-contracting-extensions/ocds_budget_breakdown_extension/master/extension.json",
}
// ReleasePackage: The release package contains a list of releases along with some publishing
// metadata.
type ReleasePackage struct {
// The URI of this package that identifies it uniquely in the world.
URI string `json:"uri"`
// The version of the OCDS schema used in this package, expressed as major.minor For example:
// 1.0 or 1.1
Version string `json:"version"`
// An array of OCDS extensions used in this package, in which each array item is the URL of an
// extension.json file.
Extensions []string `json:"extensions,omitempty"`
// The date that this package was published.
PublishedDate time.Time `json:"publishedDate"`
// An array of one or more OCDS releases.
Releases []Release `json:"releases"`
// Information to uniquely identify the publisher of this package.
Publisher *ReleasePackagePublisher `json:"publisher"`
// A link to the license that applies to the data in this package.
License string `json:"license,omitempty"`
// A link to a document describing the publishers [publication
// policy](https://standard.open-contracting.org/{{version}}/{{lang}}/guidance/publish/#finalize-your-publication-policy).
PublicationPolicy string `json:"publicationPolicy,omitempty"`
}
// ReleasePackagePublisher: Information to uniquely identify the publisher of this package.
type ReleasePackagePublisher struct {
// The name of the organization or department responsible for publishing this data.
Name string `json:"name"`
// The scheme that holds the unique identifiers used to identify the item being identified.
Scheme string `json:"scheme,omitempty"`
// The unique ID for this entity under the given ID scheme.
Uid string `json:"uid,omitempty"`
// A URI to identify the publisher.
URI string `json:"uri,omitempty"`
}
// Release: Each release provides data about a single contracting process at a particular
// point in time.
type Release struct {
// A globally unique identifier for this Open Contracting Process.
OCID string `json:"ocid"`
// An identifier for this particular release of information.
ID string `json:"id"`
// The date on which the information contained in the release was first recorded in, or
// published by, any system.
Date time.Time `json:"date"`
// One or more values from the closed
// [releaseTag](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#release-tag)
// codelist. Codelist: releaseTag.csv (closed).
Tag []string `json:"tag"`
// The type of initiation process used for this contract, from the closed
// [initiationType](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#initiation-type)
// codelist. Codelist: initiationType.csv (closed).
InitiationType string `json:"initiationType"`
// Information on the parties (organizations, economic operators and other participants) who
// are involved in the contracting process and their roles, e.g.
Parties []Organization `json:"parties,omitempty"`
// A buyer is an entity whose budget will be used to pay for goods, works or services related
// to a contract.
Buyer *OrganizationReference `json:"buyer,omitempty"`
// Information from the planning phase of the contracting process.
Planning *Planning `json:"planning,omitempty"`
// The activities undertaken in order to enter into a contract.
Tender *Tender `json:"tender,omitempty"`
// Information from the award phase of the contracting process.
Awards []Award `json:"awards,omitempty"`
// Information from the contract creation phase of the procurement process.
Contracts []Contract `json:"contracts,omitempty"`
// The default language of the data using either two-letter
// [ISO639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), or extended [BCP47
// language tags](https://www.w3.org/International/articles/language-tags/).
Language string `json:"language,omitempty"`
// The details of related processes: for example, if this process follows on from one or more
// other processes, represented under a separate open contracting identifier (ocid).
RelatedProcesses []RelatedProcess `json:"relatedProcesses,omitempty"`
}
// Address: An address.
type Address struct {
// The street address.
StreetAddress string `json:"streetAddress,omitempty"`
// The locality.
Locality string `json:"locality,omitempty"`
// The region.
Region string `json:"region,omitempty"`
// The postal code.
PostalCode string `json:"postalCode,omitempty"`
// The country name.
CountryName string `json:"countryName,omitempty"`
}
// Amendment: Amendment information
type Amendment struct {
// The date of this amendment.
Date *time.Time `json:"date,omitempty"`
// An explanation for the amendment.
Rationale string `json:"rationale,omitempty"`
// An identifier for this amendment: often the amendment number
ID string `json:"id,omitempty"`
// A free text, or semi-structured, description of the changes made in this amendment.
Description string `json:"description,omitempty"`
// Provide the identifier (release.id) of the OCDS release (from this contracting process)
// that provides the values for this contracting process **before** the amendment was made.
AmendsReleaseID string `json:"amendsReleaseID,omitempty"`
// Provide the identifier (release.id) of the OCDS release (from this contracting process)
// that provides the values for this contracting process **after** the amendment was made.
ReleaseID string `json:"releaseID,omitempty"`
// An array of change objects describing the fields changed, and their former values.
// Deprecated: since OCDS 1.1. A free-text or semi-structured string describing the changes
// made in each amendment can be provided in the amendment.description field.
Changes []AmendmentChanges `json:"changes,omitempty"`
}
type AmendmentChanges struct {
// The property name that has been changed relative to the place the amendment is.
Property string `json:"property,omitempty"`
// The previous value of the changed property, in whatever type the property is.
FormerValue json.RawMessage `json:"former_value,omitempty"`
}
// Award: An award for the given procurement.
type Award struct {
// The identifier for this award.
ID ID `json:"id"`
// Award title
Title string `json:"title,omitempty"`
// Award description
Description string `json:"description,omitempty"`
// The current status of the award, from the closed
// [awardStatus](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#award-status)
// codelist. Codelist: awardStatus.csv (closed).
Status string `json:"status,omitempty"`
// The date of the contract award.
Date *time.Time `json:"date,omitempty"`
// The total value of this award.
Value *Value `json:"value,omitempty"`
// The suppliers awarded this award.
Suppliers []OrganizationReference `json:"suppliers,omitempty"`
// The goods and services awarded in this award, broken into line items wherever possible.
Items []Item `json:"items,omitempty"`
// The period for which the contract has been awarded.
ContractPeriod *Period `json:"contractPeriod,omitempty"`
// All documents and attachments related to the award, including any notices.
Documents []Document `json:"documents,omitempty"`
// An award amendment is a formal change to the details of the award, and generally involves
// the publication of a new award notice/release.
Amendments []Amendment `json:"amendments,omitempty"`
// The use of individual amendment objects has been deprecated.
// Deprecated: since OCDS 1.1. The single amendment object has been deprecated in favour of
// including amendments in an amendments (plural) array.
Amendment *Amendment `json:"amendment,omitempty"`
}
// Budget: This section contains information about the budget line, and associated projects,
// through which this contracting process is funded.
type Budget struct {
// An identifier for the budget line item which provides funds for this contracting process.
ID ID `json:"id,omitempty"`
// A short free text description of the budget source.
Description string `json:"description,omitempty"`
// The value reserved in the budget for this contracting process.
Amount *Value `json:"amount,omitempty"`
// The name of the project through which this contracting process is funded (if applicable).
Project string `json:"project,omitempty"`
// An external identifier for the project that this contracting process forms part of, or is
// funded via (if applicable).
ProjectID ID `json:"projectID,omitempty"`
// A URI pointing directly to a machine-readable record about the budget line-item or
// line-items that fund this contracting process.
URI string `json:"uri,omitempty"`
// (Deprecated in 1.1) Used to point either to a corresponding Budget Data Package, or to a
// machine or human-readable source where users can find further information on the budget
// line item identifiers, or project identifiers, provided here.
// Deprecated: since OCDS 1.1. The budget data source field was intended to link to
// machine-readable data about the budget for a contracting process, but has been widely
// mis-used to provide free-text descriptions of budget providers.
Source string `json:"source,omitempty"`
// A detailed breakdown of the budget by period and/or participating funders.
BudgetBreakdown []BudgetBreakdown `json:"budgetBreakdown,omitempty"`
}
// BudgetBreakdown: This section allows a detailed budget breakdown to be expressed, covering
// multiple budget sources and multiple periods
type BudgetBreakdown struct {
// An identifier for this particular budget entry.
ID ID `json:"id"`
// A short free text description of this budget entry.
Description string `json:"description,omitempty"`
// The value of the budget line item.
Amount *Value `json:"amount,omitempty"`
// A URI pointing directly to a machine-readable information about this budget entry.
URI string `json:"uri,omitempty"`
// The period covered by this budget entry.
Period *Period `json:"period,omitempty"`
// The organization providing the funds for this budget entry.
SourceParty *OrganizationReference `json:"sourceParty,omitempty"`
}
// Classification: A classification consists of at least two parts: an identifier for the list
// (scheme) from which the classification is taken, and an identifier for the category from
// that list being applied.
type Classification struct {
// The scheme or codelist from which the classification code is taken. Codelist:
// itemClassificationScheme.csv (open).
Scheme string `json:"scheme,omitempty"`
// The classification code taken from the scheme.
ID ID `json:"id,omitempty"`
// A textual description or title for the classification code.
Description string `json:"description,omitempty"`
// A URI to uniquely identify the classification code.
URI string `json:"uri,omitempty"`
}
// ContactPoint: A person, contact point or department to contact in relation to this
// contracting process.
type ContactPoint struct {
// The name of the contact person, department, or contact point, for correspondence relating
// to this contracting process.
Name string `json:"name,omitempty"`
// The e-mail address of the contact point/person.
Email string `json:"email,omitempty"`
// The telephone number of the contact point/person.
Telephone string `json:"telephone,omitempty"`
// The fax number of the contact point/person.
FaxNumber string `json:"faxNumber,omitempty"`
// A web address for the contact point/person.
URL string `json:"url,omitempty"`
}
// Contract: Information regarding the signed contract between the buyer and supplier(s).
type Contract struct {
// The identifier for this contract.
ID ID `json:"id"`
// The award.id against which this contract is being issued.
AwardID ID `json:"awardID"`
// Contract title
Title string `json:"title,omitempty"`
// Contract description
Description string `json:"description,omitempty"`
// The current status of the contract, from the closed
// [contractStatus](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#contract-status)
// codelist. Codelist: contractStatus.csv (closed).
Status string `json:"status,omitempty"`
// The start and end date for the contract.
Period *Period `json:"period,omitempty"`
// The total value of this contract.
Value *Value `json:"value,omitempty"`
// The goods, services, and any intangible outcomes in this contract.
Items []Item `json:"items,omitempty"`
// The date the contract was signed.
DateSigned *time.Time `json:"dateSigned,omitempty"`
// All documents and attachments related to the contract, including any notices.
Documents []Document `json:"documents,omitempty"`
// Information related to the implementation of the contract in accordance with the
// obligations laid out therein.
Implementation *Implementation `json:"implementation,omitempty"`
// The details of related processes: for example, if this process is followed by one or more
// contracting processes, represented under a separate open contracting identifier (ocid).
RelatedProcesses []RelatedProcess `json:"relatedProcesses,omitempty"`
// A list of milestones associated with the finalization of this contract.
Milestones []Milestone `json:"milestones,omitempty"`
// A contract amendment is a formal change to, or extension of, a contract, and generally
// involves the publication of a new contract notice/release, or some other documents
// detailing the change.
Amendments []Amendment `json:"amendments,omitempty"`
// The use of individual amendment objects has been deprecated.
// Deprecated: since OCDS 1.1. The single amendment object has been deprecated in favour of
// including amendments in an amendments (plural) array.
Amendment *Amendment `json:"amendment,omitempty"`
}
// Document: Links to, or descriptions of, external documents can be attached at various
// locations within the standard.
type Document struct {
// A local, unique identifier for this document.
ID ID `json:"id"`
// A classification of the document described, using the open
// [documentType](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#document-type)
// codelist. Codelist: documentType.csv (open).
DocumentType string `json:"documentType,omitempty"`
// The document title.
Title string `json:"title,omitempty"`
// A short description of the document.
Description string `json:"description,omitempty"`
// A direct link to the document or attachment.
URL string `json:"url,omitempty"`
// The date on which the document was first published.
DatePublished *time.Time `json:"datePublished,omitempty"`
// Date that the document was last modified
DateModified *time.Time `json:"dateModified,omitempty"`
// The format of the document, using the open [IANA Media
// Types](https://www.iana.org/assignments/media-types/media-types.xhtml) codelist (see the
// values in the 'Template' column), or using the 'offline/print' code if the described
// document is published offline.
Format string `json:"format,omitempty"`
// The language of the linked document using either two-letter
// [ISO639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), or extended [BCP47
// language tags](https://www.w3.org/International/articles/language-tags/).
Language string `json:"language,omitempty"`
}
// Identifier: A unique identifier for a party (organization).
type Identifier struct {
// Organization identifiers should be taken from an existing organization identifier list.
Scheme string `json:"scheme,omitempty"`
// The identifier of the organization in the selected scheme.
ID ID `json:"id,omitempty"`
// The legally registered name of the organization.
LegalName string `json:"legalName,omitempty"`
// A URI to identify the organization, such as those provided by [Open
// Corporates](https://opencorporates.com) or some other relevant URI provider.
URI string `json:"uri,omitempty"`
}
// Implementation: Information during the performance / implementation stage of the contract.
type Implementation struct {
// A list of the spending transactions made against this contract
Transactions []Transaction `json:"transactions,omitempty"`
// As milestones are completed, the milestone's status and dates should be updated.
Milestones []Milestone `json:"milestones,omitempty"`
// Documents and reports that are part of the implementation phase e.g.
Documents []Document `json:"documents,omitempty"`
}
// Item: A good, service, or work to be contracted.
type Item struct {
// A local identifier to reference and merge the items by.
ID ID `json:"id"`
// A description of the goods, services to be provided.
Description string `json:"description,omitempty"`
// The primary classification for the item.
Classification *Classification `json:"classification,omitempty"`
// An array of additional classifications for the item.
AdditionalClassifications []Classification `json:"additionalClassifications,omitempty"`
// The number of units to be provided.
Quantity *float64 `json:"quantity,omitempty"`
// A description of the unit in which the supplies, services or works are provided (e.g.
Unit *ItemUnit `json:"unit,omitempty"`
}
// ItemUnit: A description of the unit in which the supplies, services or works are provided
// (e.g.
type ItemUnit struct {
// The list from which identifiers for units of measure are taken, using the open
// [unitClassificationScheme](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#unit-classification-scheme)
// codelist. Codelist: unitClassificationScheme.csv (open).
Scheme string `json:"scheme,omitempty"`
// The identifier from the codelist referenced in the `scheme` field.
ID string `json:"id,omitempty"`
// Name of the unit.
Name string `json:"name,omitempty"`
// The monetary value of a single unit.
Value *Value `json:"value,omitempty"`
// The machine-readable URI for the unit of measure, provided by the scheme.
URI string `json:"uri,omitempty"`
}
// Milestone: The milestone block can be used to represent a wide variety of events in the
// lifetime of a contracting process.
type Milestone struct {
// A local identifier for this milestone, unique within this block.
ID ID `json:"id"`
// Milestone title
Title string `json:"title,omitempty"`
// The nature of the milestone, using the open
// [milestoneType](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#milestone-type)
// codelist. Codelist: milestoneType.csv (open).
Type string `json:"type,omitempty"`
// A description of the milestone.
Description string `json:"description,omitempty"`
// Milestone codes can be used to track specific events that take place for a particular kind
// of contracting process.
Code string `json:"code,omitempty"`
// The date the milestone is due.
DueDate *time.Time `json:"dueDate,omitempty"`
// The date on which the milestone was met.
DateMet *time.Time `json:"dateMet,omitempty"`
// The date the milestone was last reviewed or modified and the status was altered or
// confirmed to still be correct.
DateModified *time.Time `json:"dateModified,omitempty"`
// The status that was realized on the date provided in `dateModified`, from the closed
// [milestoneStatus](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#milestone-status)
// codelist. Codelist: milestoneStatus.csv (closed).
Status string `json:"status,omitempty"`
// List of documents associated with this milestone (Deprecated in 1.1).
// Deprecated: since OCDS 1.1. Inclusion of documents at the milestone level is now
// deprecated.
Documents []Document `json:"documents,omitempty"`
}
// Organization: A party (organization)
type Organization struct {
// A common name for this organization or other participant in the contracting process.
Name string `json:"name,omitempty"`
// The ID used for cross-referencing to this party from other sections of the release.
ID string `json:"id,omitempty"`
// The primary identifier for this organization or participant.
Identifier *Identifier `json:"identifier,omitempty"`
// A list of additional / supplemental identifiers for the organization or participant, using
// the [organization identifier
// guidance](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/identifiers/).
AdditionalIdentifiers []Identifier `json:"additionalIdentifiers,omitempty"`
// An address.
Address *Address `json:"address,omitempty"`
// Contact details that can be used for this party.
ContactPoint *ContactPoint `json:"contactPoint,omitempty"`
// The party's role(s) in the contracting process, using the open
// [partyRole](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#party-role)
// codelist. Codelist: partyRole.csv (open).
Roles []string `json:"roles,omitempty"`
// Additional classification information about parties can be provided using partyDetail
// extensions that define particular fields and classification schemes.
Details map[string]any `json:"details,omitempty"`
}
// OrganizationReference: The id and name of the party being referenced.
type OrganizationReference struct {
// The name of the party being referenced.
Name string `json:"name,omitempty"`
// The id of the party being referenced.
ID ID `json:"id,omitempty"`
// The primary identifier for this organization.
// Deprecated: since OCDS 1.1. From version 1.1, organizations should be referenced by their
// identifier and name in a document, and detailed legal identifier information should only be
// provided in the relevant cross-referenced entry in the parties section at the top level of
// a release.
Identifier *Identifier `json:"identifier,omitempty"`
// (Deprecated outside the parties section)
// Deprecated: since OCDS 1.1. From version 1.1, organizations should be referenced by their
// identifier and name in a document, and address information should only be provided in the
// relevant cross-referenced entry in the parties section at the top level of a release.
Address *Address `json:"address,omitempty"`
// (Deprecated outside the parties section) A list of additional / supplemental identifiers
// for the organization, using the [organization identifier
// guidance](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/identifiers/).
// Deprecated: since OCDS 1.1. From version 1.1, organizations should be referenced by their
// identifier and name in a document, and additional identifiers for an organization should be
// provided in the relevant cross-referenced entry in the parties section at the top level of
// a release.
AdditionalIdentifiers []Identifier `json:"additionalIdentifiers,omitempty"`
// (Deprecated outside the parties section)
// Deprecated: since OCDS 1.1. From version 1.1, organizations should be referenced by their
// identifier and name in a document, and contact point information for an organization should
// be provided in the relevant cross-referenced entry in the parties section at the top level
// of a release.
ContactPoint *ContactPoint `json:"contactPoint,omitempty"`
}
// Period: Key events during a contracting process may have a known start date, end date,
// duration, or maximum extent (the latest date the period can extend to).
type Period struct {
// The start date for the period.
StartDate *time.Time `json:"startDate,omitempty"`
// The end date for the period.
EndDate *time.Time `json:"endDate,omitempty"`
// The period cannot be extended beyond this date.
MaxExtentDate *time.Time `json:"maxExtentDate,omitempty"`
// The maximum duration of this period in days.
DurationInDays *int `json:"durationInDays,omitempty"`
}
// Planning: Information from the planning phase of the contracting process.
type Planning struct {
// The rationale for the procurement provided in free text.
Rationale string `json:"rationale,omitempty"`
// Details of the budget that funds this contracting process.
Budget *Budget `json:"budget,omitempty"`
// A list of documents related to the planning process.
Documents []Document `json:"documents,omitempty"`
// A list of milestones associated with the planning stage.
Milestones []Milestone `json:"milestones,omitempty"`
}
// RelatedProcess: A reference to a related contracting process: generally one preceding or
// following on from the current process.
type RelatedProcess struct {
// A local identifier for this relationship, unique within this array.
ID string `json:"id,omitempty"`
// The type of relationship, using the open
// [relatedProcess](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#related-process)
// codelist. Codelist: relatedProcess.csv (open).
Relationship []string `json:"relationship,omitempty"`
// The title of the related process, where referencing an open contracting process, this field
// should match the tender/title field in the related process.
Title string `json:"title,omitempty"`
// The identification scheme used by this cross-reference, using the open
// [relatedProcessScheme](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#related-process-scheme)
// codelist. Codelist: relatedProcessScheme.csv (open).
Scheme string `json:"scheme,omitempty"`
// The identifier of the related process.
Identifier string `json:"identifier,omitempty"`
// A URI pointing to a machine-readable document, release or record package containing the
// identified related process.
URI string `json:"uri,omitempty"`
}
// Tender: Data regarding tender process - publicly inviting prospective contractors to submit
// bids for evaluation and selecting a winner or winners.
type Tender struct {
// An identifier for this tender process.
ID ID `json:"id"`
// A title for this tender.
Title string `json:"title,omitempty"`
// A summary description of the tender.
Description string `json:"description,omitempty"`
// The current status of the tender, from the closed
// [tenderStatus](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#tender-status)
// codelist. Codelist: tenderStatus.csv (closed).
Status string `json:"status,omitempty"`
// The entity managing the procurement.
ProcuringEntity *OrganizationReference `json:"procuringEntity,omitempty"`
// The goods and services to be purchased, broken into line items wherever possible.
Items []Item `json:"items,omitempty"`
// The total upper estimated value of the procurement.
Value *Value `json:"value,omitempty"`
// The minimum estimated value of the procurement.
MinValue *Value `json:"minValue,omitempty"`
// The procurement method, from the closed
// [method](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#method)
// codelist. Codelist: method.csv (closed).
ProcurementMethod string `json:"procurementMethod,omitempty"`
// Additional detail on the procurement method used.
ProcurementMethodDetails string `json:"procurementMethodDetails,omitempty"`
// Rationale for the chosen procurement method.
ProcurementMethodRationale string `json:"procurementMethodRationale,omitempty"`
// The primary category describing the main object of this contracting process, from the
// closed
// [procurementCategory](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#procurement-category)
// codelist. Codelist: procurementCategory.csv (closed).
MainProcurementCategory string `json:"mainProcurementCategory,omitempty"`
// Any additional categories describing the objects of this contracting process, using the
// open
// [extendedProcurementCategory](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#extended-procurement-category)
// codelist. Codelist: extendedProcurementCategory.csv (open).
AdditionalProcurementCategories []string `json:"additionalProcurementCategories,omitempty"`
// The award criteria for the procurement, using the open
// [awardCriteria](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#award-criteria)
// codelist. Codelist: awardCriteria.csv (open).
AwardCriteria string `json:"awardCriteria,omitempty"`
// Any detailed or further information on the award or selection criteria.
AwardCriteriaDetails string `json:"awardCriteriaDetails,omitempty"`
// The methods by which bids are submitted, using the open
// [submissionMethod](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#submission-method)
// codelist. Codelist: submissionMethod.csv (open).
SubmissionMethod []string `json:"submissionMethod,omitempty"`
// Any detailed or further information on the submission method.
SubmissionMethodDetails string `json:"submissionMethodDetails,omitempty"`
// The period when the tender is open for submissions.
TenderPeriod *Period `json:"tenderPeriod,omitempty"`
// The period during which potential bidders may submit questions and requests for
// clarification to the entity managing procurement.
EnquiryPeriod *Period `json:"enquiryPeriod,omitempty"`
// A true/false field to indicate whether any enquiries were received during the tender
// process.
HasEnquiries *bool `json:"hasEnquiries,omitempty"`
// A description of any eligibility criteria for potential suppliers.
EligibilityCriteria string `json:"eligibilityCriteria,omitempty"`
// The period for decision making regarding the contract award.
AwardPeriod *Period `json:"awardPeriod,omitempty"`
// The period over which the contract is estimated or required to be active.
ContractPeriod *Period `json:"contractPeriod,omitempty"`
// The number of parties who submit a bid.
NumberOfTenderers *int `json:"numberOfTenderers,omitempty"`
// All parties who submit a bid on a tender.
Tenderers []OrganizationReference `json:"tenderers,omitempty"`
// All documents and attachments related to the tender, including any notices.
Documents []Document `json:"documents,omitempty"`
// A list of milestones associated with the tender.
Milestones []Milestone `json:"milestones,omitempty"`
// A tender amendment is a formal change to the tender, and generally involves the publication
// of a new tender notice/release.
Amendments []Amendment `json:"amendments,omitempty"`
// The use of individual amendment objects has been deprecated.
// Deprecated: since OCDS 1.1. The single amendment object has been deprecated in favour of
// including amendments in an amendments (plural) array.
Amendment *Amendment `json:"amendment,omitempty"`
}
// Transaction: A spending transaction related to the contracting process.
type Transaction struct {
// A unique identifier for this transaction.
ID ID `json:"id"`
// Used to point either to a corresponding Fiscal Data Package, IATI file, or machine or
// human-readable source where users can find further information on the budget line item
// identifiers, or project identifiers, provided here.
Source string `json:"source,omitempty"`
// The date of the transaction
Date *time.Time `json:"date,omitempty"`
// The value of the transaction.
Value *Value `json:"value,omitempty"`
// An organization reference for the organization from which the funds in this transaction
// originate.
Payer *OrganizationReference `json:"payer,omitempty"`
// An organization reference for the organization which receives the funds in this
// transaction.
Payee *OrganizationReference `json:"payee,omitempty"`
// A URI pointing directly to a machine-readable record about this spending transaction.
URI string `json:"uri,omitempty"`
// (Deprecated in 1.1.
// Deprecated: since OCDS 1.1. This field has been replaced by the `transaction.value` field
// for consistency with the use of value and amount elsewhere in the standard.
Amount *Value `json:"amount,omitempty"`
// (Deprecated in 1.1.
// Deprecated: since OCDS 1.1. This field has been replaced by the `transaction.payer` field
// to resolve ambiguity arising from 'provider' being interpreted as relating to the goods or
// services procured rather than the flow of funds between the parties.
ProviderOrganization *Identifier `json:"providerOrganization,omitempty"`
// (Deprecated in 1.1.
// Deprecated: since OCDS 1.1. This field has been replaced by the `transaction.payee` field
// to resolve ambiguity arising from 'receiver' being interpreted as relating to the goods or
// services procured rather than the flow of funds between the parties.
ReceiverOrganization *Identifier `json:"receiverOrganization,omitempty"`
}
// Value: Financial values should be published with a currency attached.
type Value struct {
// Amount as a number.
Amount *float64 `json:"amount,omitempty"`
// The currency of the amount, from the closed
// [currency](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#currency)
// codelist. Codelist: currency.csv (closed).
Currency string `json:"currency,omitempty"`
}
// ID is used for schema fields typed as ["string", "integer"], such as Item.id
// and Award.id. It accepts a JSON string or number and always encodes as a string.
type ID string
func (id *ID) UnmarshalJSON(b []byte) error {
if string(b) == "null" {
*id = ""
return nil
}
var s string
if err := json.Unmarshal(b, &s); err == nil {
*id = ID(s)
return nil
}
var n json.Number
if err := json.Unmarshal(b, &n); err != nil {
return fmt.Errorf("ID must be a string or integer, got %s", b)
}
*id = ID(n.String())
return nil
}
+8
View File
@@ -0,0 +1,8 @@
{
"releaseSchema": "https://raw.githubusercontent.com/open-contracting/standard/1.1/schema/release-schema.json",
"releasePackageSchema": "https://raw.githubusercontent.com/open-contracting/standard/1.1/schema/release-package-schema.json",
"extensions": [
"https://raw.githubusercontent.com/open-contracting-extensions/ocds_lots_extension/master/extension.json",
"https://raw.githubusercontent.com/open-contracting-extensions/ocds_suitability_extension/master/extension.json"
]
}
+4
View File
@@ -0,0 +1,4 @@
// Package tenders holds OCDS types generated with the extensions in extensions.json.
package tenders
//go:generate go run git.avsdev.uk/Go/go-ocds/cmd/ocdsgen generate -c extensions.json -o ocds_gen.go -p tenders
+764
View File
@@ -0,0 +1,764 @@
// Code generated by ocdsgen from extensions.json. DO NOT EDIT.
// Package tenders contains Go types for OCDS releases with these extensions applied
// (dependencies first, in the order their patches were merged):
//
// - Lots (declared)
// https://raw.githubusercontent.com/open-contracting-extensions/ocds_lots_extension/master/extension.json
// - Suitability (declared)
// https://raw.githubusercontent.com/open-contracting-extensions/ocds_suitability_extension/master/extension.json
package tenders
import (
"encoding/json"
"fmt"
"time"
)
// DeclaredExtensions are the extension URLs to list in ReleasePackage.Extensions.
var DeclaredExtensions = []string{
"https://raw.githubusercontent.com/open-contracting-extensions/ocds_lots_extension/master/extension.json",
"https://raw.githubusercontent.com/open-contracting-extensions/ocds_suitability_extension/master/extension.json",
}
// ReleasePackage: The release package contains a list of releases along with some publishing
// metadata.
type ReleasePackage struct {
// The URI of this package that identifies it uniquely in the world.
URI string `json:"uri"`
// The version of the OCDS schema used in this package, expressed as major.minor For example:
// 1.0 or 1.1
Version string `json:"version"`
// An array of OCDS extensions used in this package, in which each array item is the URL of an
// extension.json file.
Extensions []string `json:"extensions,omitempty"`
// The date that this package was published.
PublishedDate time.Time `json:"publishedDate"`
// An array of one or more OCDS releases.
Releases []Release `json:"releases"`
// Information to uniquely identify the publisher of this package.
Publisher *ReleasePackagePublisher `json:"publisher"`
// A link to the license that applies to the data in this package.
License string `json:"license,omitempty"`
// A link to a document describing the publishers [publication
// policy](https://standard.open-contracting.org/{{version}}/{{lang}}/guidance/publish/#finalize-your-publication-policy).
PublicationPolicy string `json:"publicationPolicy,omitempty"`
}
// ReleasePackagePublisher: Information to uniquely identify the publisher of this package.
type ReleasePackagePublisher struct {
// The name of the organization or department responsible for publishing this data.
Name string `json:"name"`
// The scheme that holds the unique identifiers used to identify the item being identified.
Scheme string `json:"scheme,omitempty"`
// The unique ID for this entity under the given ID scheme.
Uid string `json:"uid,omitempty"`
// A URI to identify the publisher.
URI string `json:"uri,omitempty"`
}
// Release: Each release provides data about a single contracting process at a particular
// point in time.
type Release struct {
// A globally unique identifier for this Open Contracting Process.
OCID string `json:"ocid"`
// An identifier for this particular release of information.
ID string `json:"id"`
// The date on which the information contained in the release was first recorded in, or
// published by, any system.
Date time.Time `json:"date"`
// One or more values from the closed
// [releaseTag](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#release-tag)
// codelist. Codelist: releaseTag.csv (closed).
Tag []string `json:"tag"`
// The type of initiation process used for this contract, from the closed
// [initiationType](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#initiation-type)
// codelist. Codelist: initiationType.csv (closed).
InitiationType string `json:"initiationType"`
// Information on the parties (organizations, economic operators and other participants) who
// are involved in the contracting process and their roles, e.g.
Parties []Organization `json:"parties,omitempty"`
// A buyer is an entity whose budget will be used to pay for goods, works or services related
// to a contract.
Buyer *OrganizationReference `json:"buyer,omitempty"`
// Information from the planning phase of the contracting process.
Planning *Planning `json:"planning,omitempty"`
// The activities undertaken in order to enter into a contract.
Tender *Tender `json:"tender,omitempty"`
// Information from the award phase of the contracting process.
Awards []Award `json:"awards,omitempty"`
// Information from the contract creation phase of the procurement process.
Contracts []Contract `json:"contracts,omitempty"`
// The default language of the data using either two-letter
// [ISO639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), or extended [BCP47
// language tags](https://www.w3.org/International/articles/language-tags/).
Language string `json:"language,omitempty"`
// The details of related processes: for example, if this process follows on from one or more
// other processes, represented under a separate open contracting identifier (ocid).
RelatedProcesses []RelatedProcess `json:"relatedProcesses,omitempty"`
}
// Address: An address.
type Address struct {
// The street address.
StreetAddress string `json:"streetAddress,omitempty"`
// The locality.
Locality string `json:"locality,omitempty"`
// The region.
Region string `json:"region,omitempty"`
// The postal code.
PostalCode string `json:"postalCode,omitempty"`
// The country name.
CountryName string `json:"countryName,omitempty"`
}
// Amendment: Amendment information
type Amendment struct {
// The date of this amendment.
Date *time.Time `json:"date,omitempty"`
// An explanation for the amendment.
Rationale string `json:"rationale,omitempty"`
// An identifier for this amendment: often the amendment number
ID string `json:"id,omitempty"`
// A free text, or semi-structured, description of the changes made in this amendment.
Description string `json:"description,omitempty"`
// Provide the identifier (release.id) of the OCDS release (from this contracting process)
// that provides the values for this contracting process **before** the amendment was made.
AmendsReleaseID string `json:"amendsReleaseID,omitempty"`
// Provide the identifier (release.id) of the OCDS release (from this contracting process)
// that provides the values for this contracting process **after** the amendment was made.
ReleaseID string `json:"releaseID,omitempty"`
// An array of change objects describing the fields changed, and their former values.
// Deprecated: since OCDS 1.1. A free-text or semi-structured string describing the changes
// made in each amendment can be provided in the amendment.description field.
Changes []AmendmentChanges `json:"changes,omitempty"`
// The identifiers of the lots to which this amendment relates.
RelatedLots []string `json:"relatedLots,omitempty"`
}
type AmendmentChanges struct {
// The property name that has been changed relative to the place the amendment is.
Property string `json:"property,omitempty"`
// The previous value of the changed property, in whatever type the property is.
FormerValue json.RawMessage `json:"former_value,omitempty"`
}
// Award: An award for the given procurement.
type Award struct {
// The identifier for this award.
ID ID `json:"id"`
// Award title
Title string `json:"title,omitempty"`
// Award description
Description string `json:"description,omitempty"`
// The current status of the award, from the closed
// [awardStatus](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#award-status)
// codelist. Codelist: awardStatus.csv (closed).
Status string `json:"status,omitempty"`
// The date of the contract award.
Date *time.Time `json:"date,omitempty"`
// The total value of this award.
Value *Value `json:"value,omitempty"`
// The suppliers awarded this award.
Suppliers []OrganizationReference `json:"suppliers,omitempty"`
// The goods and services awarded in this award, broken into line items wherever possible.
Items []Item `json:"items,omitempty"`
// The period for which the contract has been awarded.
ContractPeriod *Period `json:"contractPeriod,omitempty"`
// All documents and attachments related to the award, including any notices.
Documents []Document `json:"documents,omitempty"`
// An award amendment is a formal change to the details of the award, and generally involves
// the publication of a new award notice/release.
Amendments []Amendment `json:"amendments,omitempty"`
// The use of individual amendment objects has been deprecated.
// Deprecated: since OCDS 1.1. The single amendment object has been deprecated in favour of
// including amendments in an amendments (plural) array.
Amendment *Amendment `json:"amendment,omitempty"`
// The identifiers of the lots to which this award relates.
RelatedLots []string `json:"relatedLots,omitempty"`
}
// Budget: This section contains information about the budget line, and associated projects,
// through which this contracting process is funded.
type Budget struct {
// An identifier for the budget line item which provides funds for this contracting process.
ID ID `json:"id,omitempty"`
// A short free text description of the budget source.
Description string `json:"description,omitempty"`
// The value reserved in the budget for this contracting process.
Amount *Value `json:"amount,omitempty"`
// The name of the project through which this contracting process is funded (if applicable).
Project string `json:"project,omitempty"`
// An external identifier for the project that this contracting process forms part of, or is
// funded via (if applicable).
ProjectID ID `json:"projectID,omitempty"`
// A URI pointing directly to a machine-readable record about the budget line-item or
// line-items that fund this contracting process.
URI string `json:"uri,omitempty"`
// (Deprecated in 1.1) Used to point either to a corresponding Budget Data Package, or to a
// machine or human-readable source where users can find further information on the budget
// line item identifiers, or project identifiers, provided here.
// Deprecated: since OCDS 1.1. The budget data source field was intended to link to
// machine-readable data about the budget for a contracting process, but has been widely
// mis-used to provide free-text descriptions of budget providers.
Source string `json:"source,omitempty"`
}
// Classification: A classification consists of at least two parts: an identifier for the list
// (scheme) from which the classification is taken, and an identifier for the category from
// that list being applied.
type Classification struct {
// The scheme or codelist from which the classification code is taken. Codelist:
// itemClassificationScheme.csv (open).
Scheme string `json:"scheme,omitempty"`
// The classification code taken from the scheme.
ID ID `json:"id,omitempty"`
// A textual description or title for the classification code.
Description string `json:"description,omitempty"`
// A URI to uniquely identify the classification code.
URI string `json:"uri,omitempty"`
}
// ContactPoint: A person, contact point or department to contact in relation to this
// contracting process.
type ContactPoint struct {
// The name of the contact person, department, or contact point, for correspondence relating
// to this contracting process.
Name string `json:"name,omitempty"`
// The e-mail address of the contact point/person.
Email string `json:"email,omitempty"`
// The telephone number of the contact point/person.
Telephone string `json:"telephone,omitempty"`
// The fax number of the contact point/person.
FaxNumber string `json:"faxNumber,omitempty"`
// A web address for the contact point/person.
URL string `json:"url,omitempty"`
}
// Contract: Information regarding the signed contract between the buyer and supplier(s).
type Contract struct {
// The identifier for this contract.
ID ID `json:"id"`
// The award.id against which this contract is being issued.
AwardID ID `json:"awardID"`
// Contract title
Title string `json:"title,omitempty"`
// Contract description
Description string `json:"description,omitempty"`
// The current status of the contract, from the closed
// [contractStatus](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#contract-status)
// codelist. Codelist: contractStatus.csv (closed).
Status string `json:"status,omitempty"`
// The start and end date for the contract.
Period *Period `json:"period,omitempty"`
// The total value of this contract.
Value *Value `json:"value,omitempty"`
// The goods, services, and any intangible outcomes in this contract.
Items []Item `json:"items,omitempty"`
// The date the contract was signed.
DateSigned *time.Time `json:"dateSigned,omitempty"`
// All documents and attachments related to the contract, including any notices.
Documents []Document `json:"documents,omitempty"`
// Information related to the implementation of the contract in accordance with the
// obligations laid out therein.
Implementation *Implementation `json:"implementation,omitempty"`
// The details of related processes: for example, if this process is followed by one or more
// contracting processes, represented under a separate open contracting identifier (ocid).
RelatedProcesses []RelatedProcess `json:"relatedProcesses,omitempty"`
// A list of milestones associated with the finalization of this contract.
Milestones []Milestone `json:"milestones,omitempty"`
// A contract amendment is a formal change to, or extension of, a contract, and generally
// involves the publication of a new contract notice/release, or some other documents
// detailing the change.
Amendments []Amendment `json:"amendments,omitempty"`
// The use of individual amendment objects has been deprecated.
// Deprecated: since OCDS 1.1. The single amendment object has been deprecated in favour of
// including amendments in an amendments (plural) array.
Amendment *Amendment `json:"amendment,omitempty"`
}
// Document: Links to, or descriptions of, external documents can be attached at various
// locations within the standard.
type Document struct {
// A local, unique identifier for this document.
ID ID `json:"id"`
// A classification of the document described, using the open
// [documentType](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#document-type)
// codelist. Codelist: documentType.csv (open).
DocumentType string `json:"documentType,omitempty"`
// The document title.
Title string `json:"title,omitempty"`
// A short description of the document.
Description string `json:"description,omitempty"`
// A direct link to the document or attachment.
URL string `json:"url,omitempty"`
// The date on which the document was first published.
DatePublished *time.Time `json:"datePublished,omitempty"`
// Date that the document was last modified
DateModified *time.Time `json:"dateModified,omitempty"`
// The format of the document, using the open [IANA Media
// Types](https://www.iana.org/assignments/media-types/media-types.xhtml) codelist (see the
// values in the 'Template' column), or using the 'offline/print' code if the described
// document is published offline.
Format string `json:"format,omitempty"`
// The language of the linked document using either two-letter
// [ISO639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes), or extended [BCP47
// language tags](https://www.w3.org/International/articles/language-tags/).
Language string `json:"language,omitempty"`
// The identifiers of the lots to which this document relates.
RelatedLots []string `json:"relatedLots,omitempty"`
}
// Identifier: A unique identifier for a party (organization).
type Identifier struct {
// Organization identifiers should be taken from an existing organization identifier list.
Scheme string `json:"scheme,omitempty"`
// The identifier of the organization in the selected scheme.
ID ID `json:"id,omitempty"`
// The legally registered name of the organization.
LegalName string `json:"legalName,omitempty"`
// A URI to identify the organization, such as those provided by [Open
// Corporates](https://opencorporates.com) or some other relevant URI provider.
URI string `json:"uri,omitempty"`
}
// Implementation: Information during the performance / implementation stage of the contract.
type Implementation struct {
// A list of the spending transactions made against this contract
Transactions []Transaction `json:"transactions,omitempty"`
// As milestones are completed, the milestone's status and dates should be updated.
Milestones []Milestone `json:"milestones,omitempty"`
// Documents and reports that are part of the implementation phase e.g.
Documents []Document `json:"documents,omitempty"`
}
// Item: A good, service, or work to be contracted.
type Item struct {
// A local identifier to reference and merge the items by.
ID ID `json:"id"`
// A description of the goods, services to be provided.
Description string `json:"description,omitempty"`
// The primary classification for the item.
Classification *Classification `json:"classification,omitempty"`
// An array of additional classifications for the item.
AdditionalClassifications []Classification `json:"additionalClassifications,omitempty"`
// The number of units to be provided.
Quantity *float64 `json:"quantity,omitempty"`
// A description of the unit in which the supplies, services or works are provided (e.g.
Unit *ItemUnit `json:"unit,omitempty"`
// The identifier of the lot to which this item relates.
RelatedLot string `json:"relatedLot,omitempty"`
}
// ItemUnit: A description of the unit in which the supplies, services or works are provided
// (e.g.
type ItemUnit struct {
// The list from which identifiers for units of measure are taken, using the open
// [unitClassificationScheme](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#unit-classification-scheme)
// codelist. Codelist: unitClassificationScheme.csv (open).
Scheme string `json:"scheme,omitempty"`
// The identifier from the codelist referenced in the `scheme` field.
ID string `json:"id,omitempty"`
// Name of the unit.
Name string `json:"name,omitempty"`
// The monetary value of a single unit.
Value *Value `json:"value,omitempty"`
// The machine-readable URI for the unit of measure, provided by the scheme.
URI string `json:"uri,omitempty"`
}
// Lot: A lot is a grouping of items within a tender that can be bid on or awarded together.
type Lot struct {
// A local identifier for this lot, such as a lot number.
ID string `json:"id"`
// Identifiers for this lot.
Identifiers []SimpleIdentifier `json:"identifiers,omitempty"`
// A title for this lot.
Title string `json:"title,omitempty"`
// A description of this lot.
Description string `json:"description,omitempty"`
// The current status of the process related to this lot. Codelist: tenderStatus.csv (closed).
Status string `json:"status,omitempty"`
// The maximum estimated value of this lot.
Value *Value `json:"value,omitempty"`
// The estimated minimum value of the lot.
MinimumValue *Value `json:"minimumValue,omitempty"`
// The period when this lot is open for submissions.
TenderPeriod *Period `json:"tenderPeriod,omitempty"`
// The period over which the contract is estimated or specified to be active.
ContractPeriod *Period `json:"contractPeriod,omitempty"`
// The organization aiming to conclude a contract with a supplier or to use the goods, works
// or services in this lot.
Buyer *OrganizationReference `json:"buyer,omitempty"`
// Additional classifications for this lot.
AdditionalClassifications []Classification `json:"additionalClassifications,omitempty"`
// The primary category describing the main object of this lot, using the closed
// procurementCategory codelist. Codelist: procurementCategory.csv (closed).
MainProcurementCategory string `json:"mainProcurementCategory,omitempty"`
// Any additional categories describing the objects of this lot, using the open
// extendedProcurementCategory codelist. Codelist: extendedProcurementCategory.csv (open).
AdditionalProcurementCategories []string `json:"additionalProcurementCategories,omitempty"`
// The period during which potential bidders may submit questions and requests for
// clarification about this lot to the buyer or the procuring entity.
EnquiryPeriod *Period `json:"enquiryPeriod,omitempty"`
// Milestones associated with this lot.
Milestones []Milestone `json:"milestones,omitempty"`
// Information about the methods by which bids are submitted for this lot.
SubmissionMethodDetails string `json:"submissionMethodDetails,omitempty"`
// Information about how, when and where tenderers need to submit their bids.
SubmissionTerms json.RawMessage `json:"submissionTerms,omitempty"`
// Information about the suitability of the lot to different types of tenderers.
Suitability *Suitability `json:"suitability,omitempty"`
}
// LotGroup: Where the buyer reserves the right to combine lots, or wishes to specify the
// total value for a group of lots, a lot group is used to capture this information.
type LotGroup struct {
// A local identifier for this group of lots.
ID string `json:"id"`
// Identifiers for this lot group.
Identifiers []SimpleIdentifier `json:"identifiers,omitempty"`
// A title for this lot group.
Title string `json:"title,omitempty"`
// A description of this lot group.
Description string `json:"description,omitempty"`
// A list of the identifiers of the lots that form this group.
RelatedLots []string `json:"relatedLots,omitempty"`
// The buyer reserves the right to combine the lots in this group when awarding a contract.
OptionToCombine *bool `json:"optionToCombine,omitempty"`
// The maximum estimated value of the lots in this group.
MaximumValue *Value `json:"maximumValue,omitempty"`
// Information about the suitability of the lot group to different types of tenderers.
Suitability *Suitability `json:"suitability,omitempty"`
}
// Milestone: The milestone block can be used to represent a wide variety of events in the
// lifetime of a contracting process.
type Milestone struct {
// A local identifier for this milestone, unique within this block.
ID ID `json:"id"`
// Milestone title
Title string `json:"title,omitempty"`
// The nature of the milestone, using the open
// [milestoneType](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#milestone-type)
// codelist. Codelist: milestoneType.csv (open).
Type string `json:"type,omitempty"`
// A description of the milestone.
Description string `json:"description,omitempty"`
// Milestone codes can be used to track specific events that take place for a particular kind
// of contracting process.
Code string `json:"code,omitempty"`
// The date the milestone is due.
DueDate *time.Time `json:"dueDate,omitempty"`
// The date on which the milestone was met.
DateMet *time.Time `json:"dateMet,omitempty"`
// The date the milestone was last reviewed or modified and the status was altered or
// confirmed to still be correct.
DateModified *time.Time `json:"dateModified,omitempty"`
// The status that was realized on the date provided in `dateModified`, from the closed
// [milestoneStatus](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#milestone-status)
// codelist. Codelist: milestoneStatus.csv (closed).
Status string `json:"status,omitempty"`
// List of documents associated with this milestone (Deprecated in 1.1).
// Deprecated: since OCDS 1.1. Inclusion of documents at the milestone level is now
// deprecated.
Documents []Document `json:"documents,omitempty"`
// The identifiers of the lots to which this milestone relates.
RelatedLots []string `json:"relatedLots,omitempty"`
}
// Organization: A party (organization)
type Organization struct {
// A common name for this organization or other participant in the contracting process.
Name string `json:"name,omitempty"`
// The ID used for cross-referencing to this party from other sections of the release.
ID string `json:"id,omitempty"`
// The primary identifier for this organization or participant.
Identifier *Identifier `json:"identifier,omitempty"`
// A list of additional / supplemental identifiers for the organization or participant, using
// the [organization identifier
// guidance](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/identifiers/).
AdditionalIdentifiers []Identifier `json:"additionalIdentifiers,omitempty"`
// An address.
Address *Address `json:"address,omitempty"`
// Contact details that can be used for this party.
ContactPoint *ContactPoint `json:"contactPoint,omitempty"`
// The party's role(s) in the contracting process, using the open
// [partyRole](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#party-role)
// codelist. Codelist: partyRole.csv (open).
Roles []string `json:"roles,omitempty"`
// Additional classification information about parties can be provided using partyDetail
// extensions that define particular fields and classification schemes.
Details map[string]any `json:"details,omitempty"`
}
// OrganizationReference: The id and name of the party being referenced.
type OrganizationReference struct {
// The name of the party being referenced.
Name string `json:"name,omitempty"`
// The id of the party being referenced.
ID ID `json:"id,omitempty"`
// The primary identifier for this organization.
// Deprecated: since OCDS 1.1. From version 1.1, organizations should be referenced by their
// identifier and name in a document, and detailed legal identifier information should only be
// provided in the relevant cross-referenced entry in the parties section at the top level of
// a release.
Identifier *Identifier `json:"identifier,omitempty"`
// (Deprecated outside the parties section)
// Deprecated: since OCDS 1.1. From version 1.1, organizations should be referenced by their
// identifier and name in a document, and address information should only be provided in the
// relevant cross-referenced entry in the parties section at the top level of a release.
Address *Address `json:"address,omitempty"`
// (Deprecated outside the parties section) A list of additional / supplemental identifiers
// for the organization, using the [organization identifier
// guidance](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/identifiers/).
// Deprecated: since OCDS 1.1. From version 1.1, organizations should be referenced by their
// identifier and name in a document, and additional identifiers for an organization should be
// provided in the relevant cross-referenced entry in the parties section at the top level of
// a release.
AdditionalIdentifiers []Identifier `json:"additionalIdentifiers,omitempty"`
// (Deprecated outside the parties section)
// Deprecated: since OCDS 1.1. From version 1.1, organizations should be referenced by their
// identifier and name in a document, and contact point information for an organization should
// be provided in the relevant cross-referenced entry in the parties section at the top level
// of a release.
ContactPoint *ContactPoint `json:"contactPoint,omitempty"`
}
// Period: Key events during a contracting process may have a known start date, end date,
// duration, or maximum extent (the latest date the period can extend to).
type Period struct {
// The start date for the period.
StartDate *time.Time `json:"startDate,omitempty"`
// The end date for the period.
EndDate *time.Time `json:"endDate,omitempty"`
// The period cannot be extended beyond this date.
MaxExtentDate *time.Time `json:"maxExtentDate,omitempty"`
// The maximum duration of this period in days.
DurationInDays *int `json:"durationInDays,omitempty"`
}
// Planning: Information from the planning phase of the contracting process.
type Planning struct {
// The rationale for the procurement provided in free text.
Rationale string `json:"rationale,omitempty"`
// Details of the budget that funds this contracting process.
Budget *Budget `json:"budget,omitempty"`
// A list of documents related to the planning process.
Documents []Document `json:"documents,omitempty"`
// A list of milestones associated with the planning stage.
Milestones []Milestone `json:"milestones,omitempty"`
}
// RelatedProcess: A reference to a related contracting process: generally one preceding or
// following on from the current process.
type RelatedProcess struct {
// A local identifier for this relationship, unique within this array.
ID string `json:"id,omitempty"`
// The type of relationship, using the open
// [relatedProcess](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#related-process)
// codelist. Codelist: relatedProcess.csv (open).
Relationship []string `json:"relationship,omitempty"`
// The title of the related process, where referencing an open contracting process, this field
// should match the tender/title field in the related process.
Title string `json:"title,omitempty"`
// The identification scheme used by this cross-reference, using the open
// [relatedProcessScheme](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#related-process-scheme)
// codelist. Codelist: relatedProcessScheme.csv (open).
Scheme string `json:"scheme,omitempty"`
// The identifier of the related process.
Identifier string `json:"identifier,omitempty"`
// A URI pointing to a machine-readable document, release or record package containing the
// identified related process.
URI string `json:"uri,omitempty"`
// The identifiers of the lots in the related process to which this process relates.
RelatedLots []string `json:"relatedLots,omitempty"`
}
// SimpleIdentifier: An unambiguous reference to a resource within a given context.
type SimpleIdentifier struct {
// The list, register or system from which the identifier is taken.
Scheme string `json:"scheme,omitempty"`
// The identifier taken from the scheme.
ID string `json:"id,omitempty"`
}
// Suitability: Information about the suitability of a contracting process, lot or lot group
// to different types of tenderers.
type Suitability struct {
// Whether the contracting process, lot or lot group is suitable to small and medium
// enterprises.
SME *bool `json:"sme,omitempty"`
}
// Tender: Data regarding tender process - publicly inviting prospective contractors to submit
// bids for evaluation and selecting a winner or winners.
type Tender struct {
// An identifier for this tender process.
ID ID `json:"id"`
// A title for this tender.
Title string `json:"title,omitempty"`
// A summary description of the tender.
Description string `json:"description,omitempty"`
// The current status of the tender, from the closed
// [tenderStatus](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#tender-status)
// codelist. Codelist: tenderStatus.csv (closed).
Status string `json:"status,omitempty"`
// The entity managing the procurement.
ProcuringEntity *OrganizationReference `json:"procuringEntity,omitempty"`
// The goods and services to be purchased, broken into line items wherever possible.
Items []Item `json:"items,omitempty"`
// The total upper estimated value of the procurement.
Value *Value `json:"value,omitempty"`
// The minimum estimated value of the procurement.
MinValue *Value `json:"minValue,omitempty"`
// The procurement method, from the closed
// [method](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#method)
// codelist. Codelist: method.csv (closed).
ProcurementMethod string `json:"procurementMethod,omitempty"`
// Additional detail on the procurement method used.
ProcurementMethodDetails string `json:"procurementMethodDetails,omitempty"`
// Rationale for the chosen procurement method.
ProcurementMethodRationale string `json:"procurementMethodRationale,omitempty"`
// The primary category describing the main object of this contracting process, from the
// closed
// [procurementCategory](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#procurement-category)
// codelist. Codelist: procurementCategory.csv (closed).
MainProcurementCategory string `json:"mainProcurementCategory,omitempty"`
// Any additional categories describing the objects of this contracting process, using the
// open
// [extendedProcurementCategory](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#extended-procurement-category)
// codelist. Codelist: extendedProcurementCategory.csv (open).
AdditionalProcurementCategories []string `json:"additionalProcurementCategories,omitempty"`
// The award criteria for the procurement, using the open
// [awardCriteria](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#award-criteria)
// codelist. Codelist: awardCriteria.csv (open).
AwardCriteria string `json:"awardCriteria,omitempty"`
// Any detailed or further information on the award or selection criteria.
AwardCriteriaDetails string `json:"awardCriteriaDetails,omitempty"`
// The methods by which bids are submitted, using the open
// [submissionMethod](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#submission-method)
// codelist. Codelist: submissionMethod.csv (open).
SubmissionMethod []string `json:"submissionMethod,omitempty"`
// Any detailed or further information on the submission method.
SubmissionMethodDetails string `json:"submissionMethodDetails,omitempty"`
// The period when the tender is open for submissions.
TenderPeriod *Period `json:"tenderPeriod,omitempty"`
// The period during which potential bidders may submit questions and requests for
// clarification to the entity managing procurement.
EnquiryPeriod *Period `json:"enquiryPeriod,omitempty"`
// A true/false field to indicate whether any enquiries were received during the tender
// process.
HasEnquiries *bool `json:"hasEnquiries,omitempty"`
// A description of any eligibility criteria for potential suppliers.
EligibilityCriteria string `json:"eligibilityCriteria,omitempty"`
// The period for decision making regarding the contract award.
AwardPeriod *Period `json:"awardPeriod,omitempty"`
// The period over which the contract is estimated or required to be active.
ContractPeriod *Period `json:"contractPeriod,omitempty"`
// The number of parties who submit a bid.
NumberOfTenderers *int `json:"numberOfTenderers,omitempty"`
// All parties who submit a bid on a tender.
Tenderers []OrganizationReference `json:"tenderers,omitempty"`
// All documents and attachments related to the tender, including any notices.
Documents []Document `json:"documents,omitempty"`
// A list of milestones associated with the tender.
Milestones []Milestone `json:"milestones,omitempty"`
// A tender amendment is a formal change to the tender, and generally involves the publication
// of a new tender notice/release.
Amendments []Amendment `json:"amendments,omitempty"`
// The use of individual amendment objects has been deprecated.
// Deprecated: since OCDS 1.1. The single amendment object has been deprecated in favour of
// including amendments in an amendments (plural) array.
Amendment *Amendment `json:"amendment,omitempty"`
// A tender process can be divided into lots, where bidders can bid on one or more lots.
Lots []Lot `json:"lots,omitempty"`
// Details of any criteria that apply to bidding on the lots in this tender.
LotDetails *TenderLotDetails `json:"lotDetails,omitempty"`
// Where the buyer reserves the right to combine lots, or wishes to specify the total value
// for a group of lots, a lot group is used to capture this information.
LotGroups []LotGroup `json:"lotGroups,omitempty"`
// Information about the suitability of the contracting process to different types of
// tenderers.
Suitability *Suitability `json:"suitability,omitempty"`
}
// TenderLotDetails: Details of any criteria that apply to bidding on the lots in this tender.
type TenderLotDetails struct {
// The maximum number of lots that one supplier can bid on as part of this contracting
// process.
MaximumLotsBidPerSupplier *int `json:"maximumLotsBidPerSupplier,omitempty"`
// The maximum number of lots that can be awarded to one supplier as part of this contracting
// process.
MaximumLotsAwardedPerSupplier *int `json:"maximumLotsAwardedPerSupplier,omitempty"`
// Any detailed or further information on the award or selection criteria.
AwardCriteriaDetails string `json:"awardCriteriaDetails,omitempty"`
}
// Transaction: A spending transaction related to the contracting process.
type Transaction struct {
// A unique identifier for this transaction.
ID ID `json:"id"`
// Used to point either to a corresponding Fiscal Data Package, IATI file, or machine or
// human-readable source where users can find further information on the budget line item
// identifiers, or project identifiers, provided here.
Source string `json:"source,omitempty"`
// The date of the transaction
Date *time.Time `json:"date,omitempty"`
// The value of the transaction.
Value *Value `json:"value,omitempty"`
// An organization reference for the organization from which the funds in this transaction
// originate.
Payer *OrganizationReference `json:"payer,omitempty"`
// An organization reference for the organization which receives the funds in this
// transaction.
Payee *OrganizationReference `json:"payee,omitempty"`
// A URI pointing directly to a machine-readable record about this spending transaction.
URI string `json:"uri,omitempty"`
// (Deprecated in 1.1.
// Deprecated: since OCDS 1.1. This field has been replaced by the `transaction.value` field
// for consistency with the use of value and amount elsewhere in the standard.
Amount *Value `json:"amount,omitempty"`
// (Deprecated in 1.1.
// Deprecated: since OCDS 1.1. This field has been replaced by the `transaction.payer` field
// to resolve ambiguity arising from 'provider' being interpreted as relating to the goods or
// services procured rather than the flow of funds between the parties.
ProviderOrganization *Identifier `json:"providerOrganization,omitempty"`
// (Deprecated in 1.1.
// Deprecated: since OCDS 1.1. This field has been replaced by the `transaction.payee` field
// to resolve ambiguity arising from 'receiver' being interpreted as relating to the goods or
// services procured rather than the flow of funds between the parties.
ReceiverOrganization *Identifier `json:"receiverOrganization,omitempty"`
}
// Value: Financial values should be published with a currency attached.
type Value struct {
// Amount as a number.
Amount *float64 `json:"amount,omitempty"`
// The currency of the amount, from the closed
// [currency](https://standard.open-contracting.org/{{version}}/{{lang}}/schema/codelists/#currency)
// codelist. Codelist: currency.csv (closed).
Currency string `json:"currency,omitempty"`
}
// ID is used for schema fields typed as ["string", "integer"], such as Item.id
// and Award.id. It accepts a JSON string or number and always encodes as a string.
type ID string
func (id *ID) UnmarshalJSON(b []byte) error {
if string(b) == "null" {
*id = ""
return nil
}
var s string
if err := json.Unmarshal(b, &s); err == nil {
*id = ID(s)
return nil
}
var n json.Number
if err := json.Unmarshal(b, &n); err != nil {
return fmt.Errorf("ID must be a string or integer, got %s", b)
}
*id = ID(n.String())
return nil
}
+32
View File
@@ -0,0 +1,32 @@
// Command myapp shows three packages, each with its own extension set, used side by side.
package main
import (
"encoding/json"
"fmt"
"log"
"example.com/myapp/internal/budgets"
"example.com/myapp/internal/tenders"
"git.avsdev.uk/Go/go-ocds/profiles/uk"
)
const data = `{"ocid":"ocds-1","id":"r1","date":"2026-09-01T00:00:00Z","tag":["tender"],"initiationType":"tender",
"planning":{"budget":{"id":"B1","budgetBreakdown":[{"id":"BB1","amount":{"amount":500,"currency":"GBP"}}]}},
"tender":{"id":"T1","lots":[{"id":"L1","suitability":{"sme":true}}]}}`
func main() {
// The same JSON decodes into each package; each one sees only the fields
// its extensions define (other fields are ignored on decode).
var t tenders.Release
var b budgets.Release
var u uk.Release
for _, v := range []any{&t, &b, &u} {
if err := json.Unmarshal([]byte(data), v); err != nil {
log.Fatal(err)
}
}
fmt.Println("tenders: lot L1 SME-suitable =", *t.Tender.Lots[0].Suitability.SME)
fmt.Println("budgets: breakdown amount =", *b.Planning.Budget.BudgetBreakdown[0].Amount.Amount)
fmt.Println("uk: lots =", len(u.Tender.Lots))
}
+8
View File
@@ -0,0 +1,8 @@
//go:build tools
// This file records the generator as a module dependency so `go mod tidy`
// keeps it and `go run git.avsdev.uk/Go/go-ocds/cmd/ocdsgen` uses the version
// pinned in go.mod. On Go 1.24+, use `go get -tool` instead (see README).
package tools
import _ "git.avsdev.uk/Go/go-ocds/cmd/ocdsgen"