fix(disputes): shared Agreement side effects for dispute status changes#100
Conversation
|
@naninu123 is attempting to deploy a commit to the ManuelJG's projects Team on Vercel. A member of the Team first needs to authorize it. |
Review — LGTM (rebase before merge)Solid fix for #58. Scope matches the issue: shared activity logging + dispute status changes go through a common side-effect path, without public API churn. What looks good
Before merge
Non-blocking nits (optional)
After rebase + green tests, this is good to merge from my side. |
29f705f to
67f1030
Compare
|
Rebased on current main. Ready for re-review. |
Re-review after rebaseThanks @naninu123 — confirmed force-push CI on this SHA: Test / Lint / Build / Format green (Vercel fail expected). Blocker for merge right nowGitHub reports merge conflicts with
Please rebase/resolve and push again before we merge. Maintainer note (also relevant)This PR overlaps open #104 (activity logging + Optional nit (still non-blocking)Check Happy to give a final LGTM as soon as conflicts are resolved and CI is green again. |
…side effects Closes Thalos-Infrastructure#58 Consolidate agreement_activity writes into AgreementActivityService and make DisputesService open/resolve/cancel go through AgreementsService.applyStatusChange so dispute-driven status updates emit the same activity logs and domain events as normal updateStatus. Wire WebhooksService to the shared activity helper.
…fields into shared activity Resolve conflicts with Thalos-Infrastructure#104 (previous_state/new_state): - AgreementActivityService accepts optional state columns - applyStatusChange returns fromStatus + writes state fields - Disputes open/resolve/cancel go through applyStatusChange and check success before dispute events (maintainer nit) - Drop private logActivity / logAgreementActivity duplicates - Update lifecycle expectations for status_changed_to_* entries
67f1030 to
cb08d30
Compare
Rebased + conflicts resolved@Kalchaqui force-pushed rebased branch onto current Conflict resolution
Verify
Ready for final LGTM / merge. |
Re-review — LGTMThanks @naninu123 — Design for #58 still looks right ( Merge-ready once CI is green on this SHA (Vercel auth fail expected / ignore). |
Summary
Closes #58.
Dispute-driven Agreement status changes now go through the same side-effect path as normal Agreement updates:
AgreementActivityService— single shared writer foragreement_activity(replaces 3 privatelogActivitycopies in Agreements / Disputes / Webhooks)AgreementsService.applyStatusChange— shared status update + activity log (status_changed_to_*with{status, from, to}) + domain events (FUNDED/COMPLETED)DisputesServiceopen / resolve / cancel callapplyStatusChangethen log dispute-specific actions (dispute_opened,dispute_resolved,dispute_cancelled)DISPUTE_OPENED/DISPUTE_RESOLVEDemits keptAcceptance criteria
updateStatussharestatus_changed_to_*shapelistByWalletcreator+participant scoping unchangedTest plan
npm test— 280 passednpx tsc --noEmit— cleannpm run lint— 0 errors (pre-existing warnings only)agreement-activity.service.spec.ts,dispute-side-effects.spec.tsagreement-lifecycle.spec.ts,webhooks.spec.ts, integration DINotes
No public API / DTO / route changes. Backward compatible.