Feat: contact-us messages - #72
Merged
Merged
Conversation
Lets a visitor send a message without an account, and gives the dashboard a place to read and triage what comes in. - domain/contact: Message, its repository port, and phone-number validation - POST /api/contact-us, open to anonymous visitors. The sender must leave an email or a phone number (either one, both accepted) so there is a way to reply - Dashboard: list, show, delete, and mark-as-read, each behind its own contactus.* permission - MongoDB repository and a mock for the tests - Two new validation messages in en/fa Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
khanzadimahdi
force-pushed
the
feat/contact-us
branch
from
August 4, 2026 10:46
d871d9b to
10a0d2c
Compare
khanzadimahdi
marked this pull request as ready for review
August 4, 2026 10:57
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.
Lets a visitor send a message without having an account, and gives the dashboard a place to read and triage what comes in.
What's here
Domain —
domain/contact:Message(subject, body, email, phone,ReadAt,CreatedAt), its repository port, and phone-number validation (digits only, at least four).Public endpoint —
POST /api/contact-us, open to anonymous visitors. The sender must leave an email or a phone number; either one is enough, both are accepted, and whichever is filled in still has to be well-formed. That rule is the reason for the two new translation keys.Dashboard endpoints — each behind its own permission:
GET /api/dashboard/contact-uscontactus.indexGET /api/dashboard/contact-us/{uuid}contactus.showDELETE /api/dashboard/contact-us/{uuid}contactus.deletePUT /api/dashboard/contact-us/{uuid}/readcontactus.markAsReadStorage — MongoDB repository plus a mock for the use-case tests.
Notes for review
IsRead()derives from it.permission.go, the permissions collection,en.go/fa.go, and the IOC wiring inblog.go. Those five are the ones that will conflict with the sibling PRs — see below.resources/docs/are regenerated (go generate); the diff there is pure addition of the four paths above.Relationship to the other PRs
This was split out of one working branch alongside notes and block users. All three are cut from
mainand can be merged in any order, but each touchesdomain/permission/permission.go, the permissions collection, the translation files, andinfrastructure/ioc/providers/blog.go. Expect conflicts in those on the second and third merge — they are additive in every case, so resolution is keeping both sides. Re-rungo generateafter merging to settle the OpenAPI docs.Verification
go build ./...andgo test ./...both pass on this branch alone.🤖 Generated with Claude Code