Add dev-only account provisioning and virtual card wallet payload endpoints#1
Conversation
|
🚅 Deployed to the bank-platform-pr-1 environment in beneficial-heart
|
Co-authored-by: Avonce901 <243675487+Avonce901@users.noreply.github.com>
Co-authored-by: Avonce901 <243675487+Avonce901@users.noreply.github.com>
Co-authored-by: Avonce901 <243675487+Avonce901@users.noreply.github.com>
|
@copilot === COMPLETE DELIVERABLES === AUTOMATION SCRIPTS (3): CONFIGURATION FILES (3): DOCUMENTATION FILES (8): RESULT FILES (2): TOTAL: 16 Files Created (.venv-3) PS C:\Users\antho\project_root\output> ls provision_and_deploy.py, wallet_provider_integration.py, deploy_production.py, .env.production, Dockerfile.prod, docker-compose.production.yml, COMPLETE_PIPELINE_SUMMARY.md, QUICK_START_GUIDE.md, EXECUTIVE_SUMMARY.md, FINAL_STATUS.md, DEPLOYMENT_CHECKLIST.md, pipeline_results.json, wallet_tokens.json 2>$null | Select-Object Name | Out-String Nameprovision_and_deploy.py |
Implements development-only features for provisioning test accounts with $1M balance and simulated virtual cards with wallet provisioning tokens. All code includes protective checks and will not break if models/apps are named differently.
Changes
Database Model
VirtualCardmodel with UUID primary key, card details (last4, exp_month/year), and simulatedprovisioning_tokenfieldtransactions_from/tothat referenced Account FKs)Flask Implementation (Working)
cards/flask_views.py: Blueprint with endpoints:GET /cards/list/- Lists all virtual cardsGET /cards/{card_id}/wallet_payload/- Returns simulated wallet provisioning payloadscripts/activate_and_provision_flask.py: Creates 3 accounts with $1M balance, generates virtual cards with simulated tokenssrc/app.pywith fallback on import failureDjango Reference Implementation
accounts/management/commands/activate_and_provision.py: Management command equivalentcards/views.py,cards/urls.py: Django view/URL patterns for potential migrationClient Tools
scripts/provision_cards_via_api.py: Fetches wallet payloads for given card IDs (supports UUIDs and integers)verify_api.py: API health check with timeout handlingDocumentation
DEV_PROVISIONING_README.md: Usage instructions, security warnings, Flask adaptation guideUsage
Notes
cards/flask_views.pyOriginal prompt
Add a safe, development-only feature set that: (1) activates or creates three accounts with $1,000,000 balance, (2) creates/provisions simulated virtual cards for those accounts, (3) exposes a dev API endpoint that returns a wallet-ready provisioning payload for a given card, and (4) includes small client scripts and a hardened verify_api helper. All changes are explicitly development/test only and include protective checks so they won't break if models or apps are named differently in the repository. The PR should add the following files (adjusting import paths to avoid failing if models are missing).
Files to add (exact contents provided):