refactor(feedback): consume dunite-feedback (DEV-516) #444
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/DEV-516-consume-feedback"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Consume the shared
dunite-feedbackcrate (DEV-516, under the DEV-495 epic), replacing bunyip's local feedback model + repository. First consumer; a8n-tools follows.Changes
crates/bunyip-domain/src/models/feedback.rsandrepositories/feedback.rsbecome thin re-exports ofdunite_feedback, so everycrate::models::*/FeedbackRepository::*path across bunyip-domain and bunyip-api stays unchanged. The crate was lifted from this repo's own superset, so there is no reconciliation on bunyip's side.sqlx::Error). Handler call sites keep?(mapped viaFrom<sqlx::Error> for AppError); the seed path gains a smallFrom<sqlx::Error> for LoadError; and the two now-boolmethods (delete,archive_one) raiseAppError::not_found("Feedback")onfalsein the handlers. SQL and behaviour are unchanged.Tests
Model unit tests moved to dunite (tested there). bunyip's handler + seed feedback unit tests (8) pass;
cargo clippy -p bunyip-domain -p bunyip-apiandcargo fmt --checkclean.Merge order
Depends on dunite PR #28. Pinned to that crate's branch rev; the three dunite pins (core / stripe-core / feedback) collapse to one merged rev in a follow-up. a8n-tools adoption is a separate PR (it needs a migration for
submitter_ip/user_agentand a reconcile of its list filter + React admin).🤖 Generated with Claude Code
https://claude.ai/code/session_01QLd9c7niucrqx68v4AxVss
Replace bunyip's local feedback model + repository with the shared dunite-feedback crate (also to be consumed by a8n-tools), extracted from this crate's own superset. bunyip-domain's models/feedback.rs and repositories/feedback.rs become thin re-exports so every `crate::models::*` / `FeedbackRepository::*` path across bunyip-domain and bunyip-api is unchanged. The shared repository is error-agnostic (returns sqlx::Error): handler call sites keep `?` (mapped via From<sqlx::Error> for AppError), the seed path gains a From<sqlx::Error> for LoadError, and the two now-bool methods (delete, archive_one) raise AppError::not_found("Feedback") on false in the handlers. Behaviour and SQL are unchanged; the model unit tests moved to dunite, and bunyip's handler/seed feedback unit tests pass. Pinned to the crate's branch rev; the dunite pins collapse to one merged rev in a follow-up. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QLd9c7niucrqx68v4AxVss