Repository navigation
Fix/rsk 46 fix risk assessment models - #20
Merged
Merged
Conversation
- Add transfer_type discriminator to RiskAssessment model and serializer. - Support conditional destination_account_id and destination_iban fields. - Add destination_target property to unify blocklist/rule engine lookups. - Update API tests to align with the finalized S3-PAY JWT contract.
bruno tests(RSK-46)
MParsa-ES
requested review from
Abolfazl-Tajik and
AliJohari05
as code owners
November 7, 2026 15:04
Abolfazl-Tajik
approved these changes
Nov 7, 2026
AliJohari05
approved these changes
Nov 8, 2026
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.
Jira Issue & User Story
Summary of Changes
Internal/External Routing: Added transfer_type discriminator to the RiskAssessment model and RiskAssessmentRequestSerializer.
Conditional Destinations: Enforced strict validation rules requiring destination_account_id (and null IBAN) for INTERNAL transfers, and destination_iban (and null account ID) for EXTERNAL transfers.
Unified Rule Target: Created a destination_target model property to seamlessly feed the correct identifier string to the upcoming Rule Engine and Blocklist evaluators without conditional clutter.
Contract Alignment: Updated openapi/s4_rsk.yaml and drf-spectacular annotations to perfectly match the S3-PAY contract (including RFC 9457 Problem mappings and JWT Bearer auth).
Testing: Added a comprehensive Test Matrix, 2 end-to-end integration tests (verifying PostgreSQL CheckConstraints and full API lifecycle), and configured Bruno API collections using the new payment_service JWT authorization.
LabBank Technical Standards Checklist