Skip to content

feat: implement ResolutionService.resolveFight and ResolutionService.… - #1165

Merged
Ehonrie merged 2 commits into
Netwalls:mainfrom
whiteghost0001:feat/resolution-service-b25-b26
Jul 27, 2026
Merged

feat: implement ResolutionService.resolveFight and ResolutionService.…#1165
Ehonrie merged 2 commits into
Netwalls:mainfrom
whiteghost0001:feat/resolution-service-b25-b26

Conversation

@whiteghost0001

Copy link
Copy Markdown
Contributor

…handleDispute

Closes #1083
Closes #1084

Detailed Explanation of Changes:

  1. Issue B-25: Implement ResolutionService.resolveFight #1083 (B-25) — Implement ResolutionService.resolveFight:

    • What was done: Implemented ResolutionService.resolveFight() to handle market fight outcome resolutions initiated by admin actions.
    • How it was done:
      • Added ResolutionService class and resolveFight method in backend/src/services/resolution.service.ts.
      • Implemented submitResolution in backend/src/services/oracle.service.ts to persist OracleResult entries and set market status to Resolved. * Wired ResolutionService.resolveFight to perform optimistic cache updates (optimisticMarketCache) for instant state retrieval before DB persistence. * Integrated with resolveMarketHandler in backend/src/api/controllers/market.controller.ts, which is routed via admin-authenticated endpoints (/api/admin/markets/resolve) guarded by adminAuth / requireAdmin middleware to enforce that resolution is only callable by authorized admins.
  2. Issue B-26: Implement ResolutionService.handleDispute #1084 (B-26) — Implement ResolutionService.handleDispute:

    • What was done: Implemented ResolutionService.handleDispute() to process admin review decisions on disputed markets.
    • How it was done:
      • Added handleDispute method in backend/src/services/resolution.service.ts accepting disputeId, outcome, admin, and notes.
      • Enforced strict validation requiring decision notes explaining the resolution outcome. * Invoked oracleService.resolveDispute for dispute resolution and market status finalization. * Executed a database transaction storing the decision notes in Dispute.resolution and logging the action to both AdminLog (action: "handleDispute") and AuditLog for complete auditability. * Wired resolveDisputeHandler in backend/src/api/controllers/market.controller.ts to receive dispute resolution requests from admin-authenticated routes (/api/admin/markets/dispute/resolve).

whiteghost0001 and others added 2 commits July 27, 2026 12:36
…handleDispute

Closes Netwalls#1083
Closes Netwalls#1084

Detailed Explanation of Changes:

1. Issue Netwalls#1083 (B-25) — Implement ResolutionService.resolveFight:
   - What was done: Implemented ResolutionService.resolveFight() to handle market fight outcome resolutions initiated by admin actions.
   - How it was done:
     * Added ResolutionService class and resolveFight method in backend/src/services/resolution.service.ts.
     * Implemented submitResolution in backend/src/services/oracle.service.ts to persist OracleResult entries and set market status to Resolved.
     * Wired ResolutionService.resolveFight to perform optimistic cache updates (optimisticMarketCache) for instant state retrieval before DB persistence.
     * Integrated with resolveMarketHandler in backend/src/api/controllers/market.controller.ts, which is routed via admin-authenticated endpoints (/api/admin/markets/resolve) guarded by adminAuth / requireAdmin middleware to enforce that resolution is only callable by authorized admins.

2. Issue Netwalls#1084 (B-26) — Implement ResolutionService.handleDispute:
   - What was done: Implemented ResolutionService.handleDispute() to process admin review decisions on disputed markets.
   - How it was done:
     * Added handleDispute method in backend/src/services/resolution.service.ts accepting disputeId, outcome, admin, and notes.
     * Enforced strict validation requiring decision notes explaining the resolution outcome.
     * Invoked oracleService.resolveDispute for dispute resolution and market status finalization.
     * Executed a database transaction storing the decision notes in Dispute.resolution and logging the action to both AdminLog (action: "handleDispute") and AuditLog for complete auditability.
     * Wired resolveDisputeHandler in backend/src/api/controllers/market.controller.ts to receive dispute resolution requests from admin-authenticated routes (/api/admin/markets/dispute/resolve).
@Ehonrie
Ehonrie merged commit cff3e6d into Netwalls:main Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

B-26: Implement ResolutionService.handleDispute B-25: Implement ResolutionService.resolveFight

2 participants