Implement sources API routes #26

Closed
opened 2026-05-19 19:51:45 -05:00 by erik · 2 comments
Owner

Goal

Implement Slugkit source management routes for attribution records such as websites, books, publications, conversations, films, and other origins.

Spec: docs/specs/05-sources-routes.md

Requirements

  • Implement all sources routes and data shapes from the spec.
  • Require name for source creation.
  • Make url optional so offline/non-URL sources are supported.
  • Support description, imageUrl, faviconUrl, and contactIds fields as documented.
  • Validate URL fields only when present.
  • Associate sources with contacts through contactIds.
  • Include contact summaries and account summaries in source responses as documented.
  • Do not implement a top-level feedUrl field; feeds are represented as source-owned accounts.
  • Use shared auth, validation, not-found, and conflict errors.
  • Document every route in OpenAPI with the operation IDs from the spec.
  • Add tests for sources with URLs, sources without URLs, contact associations, validation, and delete behavior.

Acceptance criteria

  • Can list sources.
  • Can create a source with a URL.
  • Can create a source without a URL.
  • Can get, update, and delete a source by ID.
  • Can associate source contacts.
  • Invalid optional URLs and missing contact IDs return shared validation errors.
  • Feed URLs are represented as source-owned accounts, not feedUrl fields.
  • Every sources route appears in OpenAPI with documented operation IDs.
  • Relevant lint/test checks pass.

Dependencies

  • task-c272cbda
  • task-69937fe4
  • task-e8b46ccd
## Goal Implement Slugkit source management routes for attribution records such as websites, books, publications, conversations, films, and other origins. Spec: `docs/specs/05-sources-routes.md` ## Requirements - Implement all sources routes and data shapes from the spec. - Require `name` for source creation. - Make `url` optional so offline/non-URL sources are supported. - Support `description`, `imageUrl`, `faviconUrl`, and `contactIds` fields as documented. - Validate URL fields only when present. - Associate sources with contacts through `contactIds`. - Include contact summaries and account summaries in source responses as documented. - Do not implement a top-level `feedUrl` field; feeds are represented as source-owned accounts. - Use shared auth, validation, not-found, and conflict errors. - Document every route in OpenAPI with the operation IDs from the spec. - Add tests for sources with URLs, sources without URLs, contact associations, validation, and delete behavior. ## Acceptance criteria - [ ] Can list sources. - [ ] Can create a source with a URL. - [ ] Can create a source without a URL. - [ ] Can get, update, and delete a source by ID. - [ ] Can associate source contacts. - [ ] Invalid optional URLs and missing contact IDs return shared validation errors. - [ ] Feed URLs are represented as source-owned accounts, not `feedUrl` fields. - [ ] Every sources route appears in OpenAPI with documented operation IDs. - [ ] Relevant lint/test checks pass. ## Dependencies - task-c272cbda - task-69937fe4 - task-e8b46ccd
Collaborator

Synced from todu comment by @todu on 2026-05-30T19:59:35.907Z

Review update

  • PR: #73
  • Result: approved
  • Verification: make check, ./scripts/pre-pr.sh, and Forgejo CI CI / build-lint-test (pull_request) passed.
  • Acceptance criteria: 9/9 met.
  • Follow-up: waiting for explicit human merge approval.
_Synced from todu comment by @todu on 2026-05-30T19:59:35.907Z_ ### Review update - PR: https://forge.caradoc.com/erik/slugkit/pulls/73 - Result: approved - Verification: `make check`, `./scripts/pre-pr.sh`, and Forgejo CI `CI / build-lint-test (pull_request)` passed. - Acceptance criteria: 9/9 met. - Follow-up: waiting for explicit human merge approval.
caradoc 2026-05-30 15:40:42 -05:00
Collaborator

Synced from todu comment by @todu on 2026-05-30T20:40:21.786Z

Completed

  • Implemented Slugkit sources API routes: list, create, get, update, and delete.
  • Added source persistence and source/contact association storage.
  • Added OpenAPI documentation for source routes and schemas with operation IDs from the spec.
  • Added tests for URL and non-URL sources, contact associations, validation, missing resources, delete behavior, no top-level feedUrl, and migration coverage.
  • Verified with make check, ./scripts/pre-pr.sh, and passing Forgejo CI.
  • Merged PR #73 into main.
_Synced from todu comment by @todu on 2026-05-30T20:40:21.786Z_ ### Completed - Implemented Slugkit sources API routes: list, create, get, update, and delete. - Added source persistence and source/contact association storage. - Added OpenAPI documentation for source routes and schemas with operation IDs from the spec. - Added tests for URL and non-URL sources, contact associations, validation, missing resources, delete behavior, no top-level `feedUrl`, and migration coverage. - Verified with `make check`, `./scripts/pre-pr.sh`, and passing Forgejo CI. - Merged PR #73 into `main`.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit#26
No description provided.