Repository navigation
feat: delivery-scoped chat, profile picture cleanup, admin escrow resolution & escrow expiry - #306
Merged
Tybravo merged 2 commits intoOct 21, 2026
Conversation
…olution, escrow expiry Closes SwiftChainn#241, SwiftChainn#240, SwiftChainn#239, SwiftChainn#238 Co-authored-by: Cursor <cursoragent@cursor.com>
|
@josephchimebuka Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #241
Closes #240
Closes #239
Closes #238
Summary
#241 Delivery-scoped socket chat
join_roomfordelivery:<id>rooms now enforces membership (sender, recipient, driver, or admin); denied joins get achat_error.message,typing,read_receiptsocket events, only accepted from sockets that joined the delivery room and emitted only to that room. Messages carrydeliveryIdand sender metadata (user id + role); the sender is taken from the authenticated socket, not the payload.ChatMessagenow storesdelivery,senderRole,readBy(indexed ondelivery, createdAt).GET /api/v1/deliveries/:id/messages: paginated history, participants/admins only (Controller -> Service -> Repository).#240 Profile picture cleanup
StorageDriver.deleteimplemented for local (path-traversal guarded, ENOENT ignored) and S3 (DeleteObjectCommand).#239 Admin flagged-escrow resolution
GET /api/v1/admin/escrows/flagged?type=disputed|expired|suspiciouspaginated/sorted via the shared query middleware.PATCH /api/v1/admin/escrows/:id/resolvewithresolution:release_to_driver|refund_to_payer|keep_lockedand requiredreason; runs under a Redlock lock, rejects terminal statuses, updates the delivery and writes anAuditLogentry (actor, escrow id, reason).src/routes/index.tsat/api/v1/admin/escrowsbehindauthenticate+requireRole(admin).#238 Escrow expiry
EXPIREDadded to the lock-status enum;expiredAtadded next toexpiresAt.scanForExpiredEscrowstransitionspending/lockedescrows pastexpiresAttoexpired, then cancels the delivery and notifies stakeholders through the notification and webhook services (best effort, per escrow).POST /api/v1/admin/escrows/:id/expired/retrywithaction:refund(re-lock with fresh expiry, delivery back to FUNDED) orcancel(close escrow, delivery CANCELLED); locked and audit-logged.Notes
tsc --noEmitpasses forsrc/; ESLint shows no new errors.Made with Cursor