This repository was archived by the owner on Apr 20, 2026. It is now read-only.
feat(KLEF-138): Project Collaboration - #37
Merged
Conversation
…e error reporting, and add backward compatibility for construct data
isaacwallace123
approved these changes
Apr 20, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Pull Request
Summary
ListInvitesreturning accepted/expired invites (caused 404 on revoke)Related Issues
Closes #
Changes
What's Included
projects/adapters/persistence/store.go—ListInvitesnow filtersaccepted_at IS NULL AND expires_at > NOW(), returning only pending invitesnotifications/ports/repository.go— addedMarkReadByInviteID(ctx, userID, inviteID)to the repository interfacenotifications/adapters/persistence/store.go— implementedMarkReadByInviteIDusing the Postgres JSON operatordata->>'invite_id'to locate the matchingproject_invitationnotificationnotifications/application/service.go— addedMarkReadByInviteIDservice method delegating to the repositoryprojects/adapters/http/handler.go—acceptInvitecallsnotifications.MarkReadByInviteIDafter a successful accept, then creates a "You joined a project" notificationworkloads/adapters/http/handler.go—provisionWorkloadnow checks the caller's project role viaGetMember; returns403if rank is below DeveloperWhat's Not Included
Testing
How Was This Tested?
ListInvitesbefore/after: accepted invites no longer appear in the pending listRevokeInviteno longer returns 404 for an invite that was recently acceptedproject_invitationnotification is marked read immediately afteracceptInvite403 forbidden: requires developer role or higherwhen callingPOST /api/v1/projects/{id}/workloadsTest Coverage
Breaking Changes
Security Considerations
The workload creation endpoint now enforces a minimum project role of Developer. Any caller with a valid JWT but only Viewer membership will receive a 403. Org admins who are not explicit project members are unaffected (they bypass the member check path).
Documentation
UI/UX (If Applicable)
N/A — backend only.
Pre-Merge Checklist
feat:,fix:,chore:,docs:,refactor:,test:)Reviewer Notes
MarkReadByInviteIDusesdata->>'invite_id'(Postgres JSON text extraction). Thedatacolumn isjsonb, so this is indexed-friendly; no schema change requiredif memberErr == nil && rank < developer) — ifGetMembererrors (e.g. cross-org user with no explicit membership), the check is skipped and the existing org-ownership check inProvisionWorkloadCommandstill applies