Skip to content

Phase 2.7: Observations Methods #11

@Sam-Bolling

Description

@Sam-Bolling

Task

Implement all 9 Observations methods in url_builder.ts and add Observations method tests to url_builder.spec.ts.

Resolution (commit b9cd3df)

All acceptance criteria met:

  • url_builder.ts contains all 9 Observations methods (8 new + createObservation from Issue Phase 2.6: DataStreams Methods #10)
  • Each method validates resource availability before constructing a URL
  • Each method uses buildResourceUrl() and buildQueryString() helpers
  • createObservation (Issue Phase 2.6: DataStreams Methods #10) already correctly routes to /datastreams/{id}/observations
  • All new methods have complete JSDoc documentation with @param, @returns, @see
  • url_builder.spec.ts contains 17 new Observations tests covering temporal filtering, resultTime=latest, cursor pagination, obsFormat encoding, CRUD, associations (singular sub-paths), history, and resource validation
  • Existing tests still pass — 262 total (245 prior + 17 new)
  • No TypeScript errors (npx tsc --noEmit)

Methods added: getObservations, getObservation, updateObservation, deleteObservation, getObservationDatastream (singular), getObservationSamplingFeature (singular), getObservationSystem (singular), getObservationHistory

Design note: Association endpoints use singular sub-paths (/datastream, /samplingFeature, /system) because each observation belongs to exactly one parent — unlike DataStreams which use plural forms for many-to-many associations.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions