Add admin group CRUD#597
Conversation
🎉 Deployed to Cloudflare!
|
There was a problem hiding this comment.
Code Review
This pull request implements the administrative CRUD operations for equipment groups, including creation, update, and deletion endpoints with associated contribution logging. Feedback focuses on improving maintainability by centralizing the GroupRecord interface and enhancing the robustness of the API by wrapping database operations and audit logging in transactions to ensure atomicity. Additionally, it is recommended to refine error handling to distinguish between server-side failures and client-side constraint violations.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c8c49a4184
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- ✨ Add admin create, update, and delete group handlers - ✅ Cover group validation and handlers with unit tests - 🧹 Align brand delete contribution target id formatting
c8c49a4 to
be71739
Compare
Summary
This PR adds the missing admin CRUD flow for equipment groups 😎
POST /api/equipment/groupsfor admin-only group creationPATCH /api/equipment/groups/[id]andDELETE /api/equipment/groups/[id]with contribution loggingMotivation
Groups already had public read support, but admin management was still incomplete 🤏
This closes that gap, keeps route conventions aligned with brands, and makes the contribution log consistent for group mutations too 🧰
Related Issues
Testing
pnpm run lint:markdownpnpm run test:typecheckpnpm run test:unit:agentpnpm run lint:oxlintpnpm run buildpnpm run test:e2e:ci