Rethink Carbon
Guides

Projection: from cdop.* tables to CDOP documents

The database is normalised: one table per concept, one row per status change, no parallel arrays, real geometry. CDOP documents are denormalised views of that data. apps/api/src/domain/projection/cdop.ts loads a ProjectAggregate (batched per-table queries) and produces the Full List document and each per-pod slice with pure functions. Ajv validates every document at seed time and in CI.

This page lists which table feeds which section, the current schema adaptations, and the value projections. Field ids are the schema's x-cdop-field-id values.

Pods and their sections

Pod (/v2/projects/{id}/cdop/{pod})Schema fileTop-level sections
full-listFull_List.schema.jsonagreement, cobenefits, crediting_program, estimations, facility, geolocation_file, issuance, methodology, project, project_stakeholder, registry, unit, validation, vintage
location-detailsLocation_Details.schema.jsonfacility, geolocation_file, project, project_stakeholder
project-approach-detailsProject_Approach_Details.schema.jsoncrediting_program, methodology, project, project_stakeholder, registry, validation
disclosuresDisclosures.schema.jsonproject, project_stakeholder, registry
issuancesIssuances.schema.jsonissuance, project
unit-description (per unit)Unit_Description.schema.jsonproject, unit, vintage
crediting-periodCrediting_Period.schema.jsonproject, validation
estimationsEstimations.schema.jsonestimations, project, validation
co-benefitsCo_Benefits.schema.jsoncobenefits
durability-permanenceDurability_Permanence.schema.jsonproject
project-financeProject_Finance.schema.jsonagreement, project, project_stakeholder, unit
labels-certificationsLabels_Certifications.schema.jsoncrediting_program, project, unit

Each pod document is the subset of the Full List projection that its schema names. A section appears only when there is data for it (see "Absent sections" below).

Mapping table

Source tableCDOP pathNotes
projectproject.project_name, project_description, project_id, project_id_type, project_identifier, current_registry_project_id, current_registry_project_link, project_design_document_link, program_type, activity_type, project_list_date, project_registration_date, estimated_total_years, project_governance_structure, community_frameworks, public_comment, public_comment_summary, previous_project_crediting_programproject_identifier is the URN. project_id mirrors the native id with project_id_type = current registry project id. listed_on → project_list_date, registered_on → project_registration_date.
project.attestations (jsonb)project.attestations[], project.*_attestation, project.*_documentationOne bag in the database, several booleans and links in the document.
project.project_risk (jsonb)project.project_riskEncoded as a JSON string in documents (CDOP-FB-024); an object in HAL.
project.native_attributes (jsonb)noneWCC auxiliaries and Peatland Code additionalInfoFieldList are API-only.
project_location (kind project)project.location[]Country, region (UN M49), subdivision, address fields (ids 1 to 31).
project_location (kind facility)facility.location[]Same shape.
project_mitigationproject.mitigation[]mitigation_type (62), project_sector (63), project_type (64), estimated_annual_emissions_mitigation (167), estimated_total_emissions_mitigation (168).
project_status_historyproject.status[]Only project_status, project_status_reason, is_current are emitted (66 to 68). sequence, effective_at, recorded_at, actor and event_id stay in the HAL status-history resource (CDOP-FB-015).
native_state via project.native_state_codeproject.status[].project_statusThe CDOP value comes from the native state's mapping, not from the lifecycle stage.
crediting_periodproject.crediting_period[] (158 to 160), validation.validation[] (155 to 157)Type, maximum cumulative duration and maximum number of periods on the project; the current period's start, end and number on the validation record.
geolocation_filegeolocation_file.location[] (34 to 43)Name, format, validity dates, status, created/edited/deleted timestamps, area type, geometry type. The GeoJSON itself is served at …/geolocation-files/{gid}/content, not in the document (CDOP-FB-017).
project_financeproject.costs_and_revenue[], project.funding[], project.financing_options[], project.community_benefit_mechanism_type[], project.declaring_entity_name, project_stakeholder.expected_community_proceeds, unit.expected_carbon_credit_price, unit.realized_transaction_priceThe declaring entity name comes from the linked organisation.
project_sdgcobenefits.sdgs_the_project_plans_to_contribute_to[]SDG numbers 1 to 17.
cobenefit_methodcobenefits.methods_used_to_assess_sdgs_and_other_cobenefits[]
cobenefit_targetcobenefits.cobenefit_target[]Includes the spaced key overview_of_the_projects_approach_to_ track_and_quantify, emitted exactly as spelled (CDOP-FB-002).
cobenefit_impactcobenefits.cobenefit_impact[]
project_stakeholder + organisationproject_stakeholder.project_developer_* (73 to 76), project_stakeholder.stakeholders[], project_stakeholder.organization[], project_stakeholder.location[]The stakeholder flagged is_primary_developer fills the project_developer_* scalars. Organisation rows fill organization[] and location[].
project_landownerproject_stakeholder.list_of_landowners[]
agreement_counterparty + organisationproject_stakeholder.counterparty[]
project_label + label (kind accreditation)project.project_level[], project.other[]Accreditation, start and expiry dates, website (244 to 252).
project_label + label (kinds compliance_eligibility, compliance_potential)project.project_level[].project_level_compliance_*
unit_label + labelunit.unit_level[] (253 to 260)
label (level standard)crediting_program.carbon_standard_level_accreditation (242)
project_registry_historyregistry.previous[] (131 to 134)previous_registration_id is text in the database and integer in the schema (CDOP-FB-011).
registry via project.registry_idregistry.current_registry (83), registry.origin_registry (82), registry.current_project_issuance_registry (136)Exact CDOP registry names.
crediting_program, standard, standard_versioncrediting_program.crediting_program[] (44 to 45), crediting_program.standard[] (46 to 47), crediting_program.initial_standard_version (48), crediting_program.current_standard_version (49)standard.cdop_name carries the exact published enum string; v2.1.0 corrects Verified Carbon Standard (VCS) (FB-006).
methodology, methodology_versionmethodology.versions[] (50 to 53)The 496-value enum string, version, is_current, document URL.
validation_eventvalidation.validation_body_name (84), validation_date (85), validation_report (86), validation.event[] (170 to 171)The latest completed validation fills the scalars. validation_id is the per-project sequence.
verification_eventproject.audits[] (auditor name, site visit dates, report URL and date); issuance.issuance[].date_of_verification, verification_period_start, verification_period_endThe verification record itself (claimed, gross and verified quantities, deductions) has no CDOP section yet; it is served as cdop:verifications (M2).
estimationestimations.estimation_event[] (162 to 163), estimations.status[] (164 to 166)estimation_id is the per-project sequence.
estimation_vintageestimations.vintage_mitigation[] (172 to 173), estimations.monitoring[] (174 to 175), estimations.estimation_event[].estimated_issuance_date[]Three parallel arrays emitted in the same order from one row per vintage (CDOP-FB-016).
milestonenoneAPI-only (cdop:milestones).
issuanceissuance.issuance[] (93 to 101)batch_identifier is the URN with batch suffix; issuance_status never emits Verified (CDOP-FB-014).
unit_blockunit.descriptor[] (140, 149), unit.reference[] (144 to 145), unit.credit_block[] (150 to 152), unit.owner_account_id (141); vintage.vintage (153)One block is one document. source_serial_number comes from source_block_id. vintage.vintage is vintage_start_on.
unit_status_historyunit.status[] (146 to 148)status via cdopUnitStatus(state, state_reason); one is_current.
retirementunit.retirement[] (142 to 143)Beneficiary and detail.
transfer, cancellationnoneEvents and HAL only.
buffer_pool_entry via buffer_pool_balanceproject.buffer_pool[] (196 to 199)One row of four lifetime totals from the ledger (CDOP-FB-023).
agreement (+ agreement_offtake, agreement_insurance, agreement_funding)agreement.* (208 to 231), agreement.offtake[], agreement.insurance[], agreement.funding_details[], agreement.date[]Effective and expiry dates become the date[] array.
documentproject.documents[] (other documentation type and link), project.project_design_document_link, validation.validation_report, project.audits[].verification_report_urlTyped documents are routed to the field that names them; everything else lands in documents[].
account, organisationnone as entitiesowner_account_id and stakeholder names only (CDOP-FB-019).
event, webhook, api_key, idempotency_key, sim_config, sim_run, cdop_vocabulary, document_typenoneAPI infrastructure and reference data.

Adaptations for CDOP v2.1.0

The projection emits clean crediting_period and co-benefit keys, and credit_block[].block_start; the old credit_blockblock_start workaround is removed. Standard accreditation (field 242) now consistently belongs to crediting_program. Empty compliance-market membership is omitted because the field is optional (FB-020).

unit and vintage appear in per-unit documents. The project-level Full List omits them unless ?unit_id= is supplied; /v2/units/{id}/cdop/full-list and /v2/units/{id}/cdop/unit-description carry them. The independent TWG proposal is built from the same aggregate and never changes these published document shapes.

Absent sections and strict mode

By default a section with no data is omitted. The document is then honest but may fail the upstream required list (agreement, cobenefits, estimations and geolocation_file are required by Full List).

?strict=1 switches on placeholders. Where the schema allows an empty-but-valid value (an empty array, an object with only its required scalars), the API emits it. Each placeholder is listed in the X-CDOP-Conformance response header with the register entry that explains it. The API does not invent compliance-market membership or unsupported enum values to force validation.

Value projections

ValueRule
project.status[].project_statusFrom the native state row (native_state.cdop_project_status), which is the registry's own code mapped once.
unit.status[].statuscdopUnitStatus(state, state_reason): pending and active → Active; on_hold → Pending Transfer, Accepted Pending Payment or On Hold by reason; buffer → Deposited Released; retired → Retired; cancelled and expired → Cancelled.
unit.descriptor[].typeThe registry's unit type verbatim (PIU, VCU, and also WCU/PCU, which the enum lacks; CDOP-FB-025).
Integer ids (validation_id, estimation_id)The record's per-project sequence.
project_riskJSON.stringify of the stored object.
Dates*_on columns as YYYY-MM-DD; timestamps as RFC 3339 UTC.
Enum stringsExactly the vendored strings, including known typos.

Round 2 draft pods

Registry Metadata, Validation Metadata and Verification Metadata are Round 2 drafts from the upstream R2P-FT-Testing branch (ADR 0013), separately pinned at 39ac535, not part of the published v2.1.0 release. They are not subsets of Full List, so apps/api/src/domain/projection/round2.ts builds each one directly from the aggregate. Field ids are the drafts' own (261 to 330).

Pod (/v2/projects/{id}/cdop/{pod})Schema file (schemas/round2/)Source
registry-metadataRegistry_Metadata.schema.jsonregistry and crediting_program vocabulary (identifier = 1-based position, CDOP-FB-032), the registry deep link, registered_on else listed_on (269), modified_at as a date (270). original[] repeats the current registry (CDOP-FB-033).
validation-metadataValidation_Metadata.schema.jsonvalidation_event rows in sequence order: validation.validation_event[], with date[] and report[] index-aligned to it (CDOP-FB-034); the current crediting_period; stages and stage status derived from the latest validation's status; one validation_body.details[] per validation body. Sectoral scope from the methodology (CDOP-FB-038).
verification-metadataVerification_Metadata.schema.jsonOne verification_event row: the latest completed, or ?verification_id=. Verified quantity is gross minus leakage, buffer and uncertainty deductions; the uncertainty margin is sent as a percentage (CDOP-FB-040); audit status from the event's status and opinion. 404 when the project has no verification.

Required values the dataset does not hold are reported as missing, and X-CDOP-Conformance cites CDOP-FB-035 (validation dates, validator name, body selection, team members; the outcome of a verification in progress), CDOP-FB-038 (no sectoral scope fits) or CDOP-FB-039 (the verification credential DID). ?strict=1 fills only the text fields with Not published; it never fills a date, a quantity or a scope.

Verifying the projection

TerminalCode
pnpm seed pnpm test # conformance: every seeded project × every pod through Ajv curl -s http://localhost:3000/v2/projects/<id>/cdop/full-list?strict=1 -D - -o /dev/null | grep -i x-cdop
Last modified on