Feat: notes - #73
Draft
khanzadimahdi wants to merge 1 commit into
Draft
Conversation
A note is a short, body-only piece of content — no title, no cover. It is
multilingual the same way an article is: identity is the CorrelationUUID
and each language version is its own document keyed by
(correlationUUID, languageCode).
- domain/note with its repository port, MongoDB repository, and a mock
- GET /api/notes/{uuid} and GET /api/authors/{identity}/notes
- Dashboard CRUD under notes.*, plus the same operations scoped to the
caller's own notes under self.notes.*
- Notes can be bookmarked and commented on: both domains grow an
ObjectTypeNote and an IsValidObjectType, replacing the equality checks
against ObjectTypeArticle that were spread across seven request validators
- getArticlesByHashtag becomes hashtag/getContentsByHashtag and returns
articles and notes side by side, so a hashtag page can tab between them
- getArticlesByAuthor gains a totals block (articles, notes) so an author
page can label both tabs without a second round-trip
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A note is a short, body-only piece of content — no title, no cover image. It is multilingual the same way an article is: identity is the
CorrelationUUID, and each language version is its own document keyed by(correlationUUID, languageCode).What's here
Domain —
domain/note: theNotetype, its repository port, a MongoDB repository, and a mock for the use-case tests.Public endpoints
GET /api/notes/{uuid}GET /api/authors/{identity}/notesDashboard endpoints — full CRUD under
notes.*, and the same five operations scoped to the caller's own notes underself.notes.*(/api/dashboard/my/notes). The repository takes anauthorUUIDthat is empty for "every author" and set for the own-notes listing, so one query serves both.Changes to existing code
These are the parts worth a careful look, since they touch code that already worked:
domain/bookmarkanddomain/commenteach growObjectTypeNoteand anIsValidObjectTypehelper. That helper replaces ther.ObjectType != ObjectTypeArticleequality check in seven request validators — same behaviour for articles, one place to extend next time.getArticlesByHashtag→hashtag/getContentsByHashtag. The use case moved package and now returns articles and notes side by side, so a hashtag page can tab between them. This is a rename plus a widening; the article half of the response is unchanged.getArticlesByAuthorgains atotalsblock ({articles, notes}), so an author page can label both content tabs without a second round-trip. It takes anote.Repositoryfor the count only.Notes for review
excludedAuthorUUIDsparameter on the hashtag queries keeps the count and the page consistent when an author keeps their notes private.go generate). Alongside the new note paths you'll see/dashboard/files,/dashboard/languagesand/dashboard/my/bookmarksappear as removed-and-re-added — that's alphabetical repositioning from the insertion, not a change to those endpoints.Relationship to the other PRs
Split out of one working branch alongside contact-us and block users. All three are cut from
mainand can be merged in any order, but each touchesdomain/permission/permission.go, the permissions collection, andinfrastructure/ioc/providers/blog.go. Conflicts there are additive on both sides — keep both. Re-rungo generateafter merging to settle the OpenAPI docs.Verification
go build ./...,go vet ./...andgo test ./...all pass on this branch alone.🤖 Generated with Claude Code