Skip to content

Implement risk Accept/ Review endpoints#345

Merged
gusfcarvalho merged 6 commits intomainfrom
codex/implement-bch1182-risk-endpoints
Mar 10, 2026
Merged

Implement risk Accept/ Review endpoints#345
gusfcarvalho merged 6 commits intomainfrom
codex/implement-bch1182-risk-endpoints

Conversation

@gusfcarvalho
Copy link
Contributor

@gusfcarvalho gusfcarvalho commented Mar 10, 2026

this PR adds accept/review endpoints for Risks

Copilot AI review requested due to automatic review settings March 10, 2026 12:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds dedicated AcceptRisk and ReviewRisk service operations to the risk management system, exposing them as new REST endpoints (POST /risks/{id}/accept, POST /risks/{id}/review, and their SSP-scoped variants). The PR also introduces a ValidationError type in the risks package, a RiskReviewDecision enum, and adds a INTEGRATION_RUNS Makefile variable for repeated integration test runs to detect flakiness. A TODO comment is left as a hook for future notification worker wiring.

Changes:

  • New AcceptRisk and ReviewRisk service methods with proper transaction handling, status transition enforcement, and audit event/review record creation
  • New Accept/Review HTTP handler methods with SSP-scoped variants, validation, and Swagger documentation
  • New ValidationError type for structured validation feedback from the service layer; INTEGRATION_RUNS Makefile variable for multi-run flakiness detection

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
internal/service/relational/risks/errors.go New ValidationError type and IsValidationError helper for structured service-layer validation errors
internal/service/relational/risks/reviews.go New RiskReviewDecision enum, IsValid() method, and NormalizeRiskReviewDecision normalizer
internal/service/relational/risks/service.go AcceptRisk and ReviewRisk methods implementing status transitions, event logging, and review records
internal/service/relational/risks/service_test.go Unit tests for AcceptRisk validation/success and ReviewRisk extend/reopen decisions
internal/api/handler/risks.go Accept, Review, AcceptForSSP, ReviewForSSP handler methods with request types and route registration
internal/api/handler/risks_integration_test.go Integration tests for the new accept and review endpoints, including SSP-scoped variants
Makefile Adds INTEGRATION_RUNS variable enabling repeated integration test runs
docs/swagger.yaml, docs/swagger.json, docs/docs.go Auto-generated Swagger docs for the four new endpoints

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gusfcarvalho gusfcarvalho requested a review from Copilot March 10, 2026 13:12
@gusfcarvalho gusfcarvalho changed the title Add TODO hooks for Notification worker wiring Implement risk Accept/ Review endpoints Mar 10, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@gusfcarvalho gusfcarvalho merged commit 15be6ab into main Mar 10, 2026
4 checks passed
@gusfcarvalho gusfcarvalho deleted the codex/implement-bch1182-risk-endpoints branch March 10, 2026 14:22
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.

2 participants