Skip to content

Endpoint to create a DatasetΒ #42

Description

@rcmtcristian

πŸ› οΈ Create Dataset


πŸ“‹ Endpoints Required

  • POST /api/v1/data_sources/:id/datasets β€” create resource

πŸ—‚οΈ Data Schema

Describe or paste the expected request/response shape below.

{
  name: string,
  definition: { key values of column name, types, other options }, # e.g. { turbidity: { type: decimal } }
  rows: Array of data to insert, must have all the req. columns from defininition,
}

Note: See dataset.test.ts for examples of how to use the Dataset API.

βœ… Acceptance Criteria

  • All endpoints return correct HTTP status codes
  • Input validation is applied to request bodies and query params
  • Errors return consistent, descriptive JSON responses
  • Endpoints are protected by appropriate auth/authorization middleware
  • Pagination supported on the list endpoint
  • Unit tests cover each endpoint (happy path + error cases)
  • Integration tests pass in CI
  • OpenAPI / Swagger docs updated

πŸ”’ Auth & Permissions

N/A

πŸ”— Related


πŸ’¬ Additional Context

This Endpoint will require writing data into a junction table when the dataset is created, called datasets.data_sources_data_sets. The constructor for that model looks like:

{
  data_source_id: number,
  dataset_name: string
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions