Implement accounts API routes #25

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

Goal

Implement Slugkit account/link management routes for contact, source, and site owners.

Spec: docs/specs/06-accounts-routes.md

Requirements

  • Implement all account routes and data shapes from the spec.
  • Support ownerType values contact, source, and site.
  • Support owner-scoped accounts for websites, social profiles, feeds, newsletters, and other externally addressable resources through generic kind and protocol fields.
  • Validate that ownerId exists for contact and source owners; handle site-owned accounts as documented.
  • Support label, url, avatarUrl, kind, protocol, isDefault, and sortOrder fields.
  • Enforce sensible default-account behavior per owner/kind where specified by the spec.
  • Use accounts to represent source feed URLs instead of a source-level feedUrl.
  • Use shared auth, validation, not-found, and conflict errors.
  • Document every route in OpenAPI with the operation IDs from the spec.
  • Add tests for contact-owned, source-owned, and site-owned accounts.

Acceptance criteria

  • Can list accounts.
  • Can create contact-owned, source-owned, and site-owned accounts.
  • Can get, update, and delete an account by ID.
  • Invalid owners return shared validation/not-found errors.
  • Default account behavior is deterministic and tested.
  • Source feed URLs can be represented with ownerType: "source", kind: "feed", and a feed protocol such as rss.
  • Every accounts route appears in OpenAPI with documented operation IDs.
  • Relevant lint/test checks pass.

Dependencies

  • task-c272cbda
  • task-69937fe4
  • task-e8b46ccd
  • task-43f5a652
## Goal Implement Slugkit account/link management routes for contact, source, and site owners. Spec: `docs/specs/06-accounts-routes.md` ## Requirements - Implement all account routes and data shapes from the spec. - Support `ownerType` values `contact`, `source`, and `site`. - Support owner-scoped accounts for websites, social profiles, feeds, newsletters, and other externally addressable resources through generic `kind` and `protocol` fields. - Validate that `ownerId` exists for `contact` and `source` owners; handle site-owned accounts as documented. - Support `label`, `url`, `avatarUrl`, `kind`, `protocol`, `isDefault`, and `sortOrder` fields. - Enforce sensible default-account behavior per owner/kind where specified by the spec. - Use accounts to represent source feed URLs instead of a source-level `feedUrl`. - Use shared auth, validation, not-found, and conflict errors. - Document every route in OpenAPI with the operation IDs from the spec. - Add tests for contact-owned, source-owned, and site-owned accounts. ## Acceptance criteria - [ ] Can list accounts. - [ ] Can create contact-owned, source-owned, and site-owned accounts. - [ ] Can get, update, and delete an account by ID. - [ ] Invalid owners return shared validation/not-found errors. - [ ] Default account behavior is deterministic and tested. - [ ] Source feed URLs can be represented with `ownerType: "source"`, `kind: "feed"`, and a feed protocol such as `rss`. - [ ] Every accounts route appears in OpenAPI with documented operation IDs. - [ ] Relevant lint/test checks pass. ## Dependencies - task-c272cbda - task-69937fe4 - task-e8b46ccd - task-43f5a652
Collaborator

Synced from todu comment by @todu on 2026-05-30T21:39:23.513Z

Review update

  • PR: #74
  • Result: approved
  • Verification: make check, ./scripts/pre-pr.sh, and Forgejo CI CI / build-lint-test (pull_request) passed.
  • Acceptance criteria: 8/8 met.
  • Follow-up: waiting for explicit human merge approval.
_Synced from todu comment by @todu on 2026-05-30T21:39:23.513Z_ ### Review update - PR: https://forge.caradoc.com/erik/slugkit/pulls/74 - Result: approved - Verification: `make check`, `./scripts/pre-pr.sh`, and Forgejo CI `CI / build-lint-test (pull_request)` passed. - Acceptance criteria: 8/8 met. - Follow-up: waiting for explicit human merge approval.
caradoc 2026-05-30 18:37:38 -05:00
Collaborator

Synced from todu comment by @todu on 2026-05-30T23:33:28.245Z

Completed

  • Implemented Slugkit accounts API routes: list, create, get, update, and delete.
  • Added account persistence for contact, source, and site owners.
  • Added owner filtering and deterministic default-account clearing.
  • Added source-owned account embedding in source responses, including feed accounts represented with ownerType: "source", kind: "feed", and protocol: "rss".
  • Added OpenAPI documentation for account routes and schemas with operation IDs from the spec.
  • Added tests for contact-owned, source-owned, and site-owned accounts, invalid owners, default behavior, source feed account representation, route coverage, and migration coverage.
  • Verified with make check, ./scripts/pre-pr.sh, and passing Forgejo CI.
  • Merged PR #74 into main.
_Synced from todu comment by @todu on 2026-05-30T23:33:28.245Z_ ### Completed - Implemented Slugkit accounts API routes: list, create, get, update, and delete. - Added account persistence for contact, source, and site owners. - Added owner filtering and deterministic default-account clearing. - Added source-owned account embedding in source responses, including feed accounts represented with `ownerType: "source"`, `kind: "feed"`, and `protocol: "rss"`. - Added OpenAPI documentation for account routes and schemas with operation IDs from the spec. - Added tests for contact-owned, source-owned, and site-owned accounts, invalid owners, default behavior, source feed account representation, route coverage, and migration coverage. - Verified with `make check`, `./scripts/pre-pr.sh`, and passing Forgejo CI. - Merged PR #74 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#25
No description provided.