Skip to content

feat: add manual ID document upload for support admin [ENG-371]#21

Open
forge0x wants to merge 3 commits into
mainfrom
fix/eng-371-id-document-upload
Open

feat: add manual ID document upload for support admin [ENG-371]#21
forge0x wants to merge 3 commits into
mainfrom
fix/eng-371-id-document-upload

Conversation

@forge0x
Copy link
Copy Markdown

@forge0x forge0x commented May 4, 2026

Summary

Support staff can now upload ID documents manually from the Account Management page when the user hasn't submitted one.

Changes

  • admin_api.py — new upload_id_document(request_id) endpoint using frappe.upload_file.save_file() to save to Frappe's file system
  • account_management.js — Upload ID Document button when id_document is null and level is PRO/MERCHANT. Uses XHR + CSRF token for file upload, then switches to existing View document flow

Testing

  • Upload button visible when id_document empty + level PRO/MERCHANT
  • Upload button hidden when id_document exists (shows View)
  • Upload button hidden when level ZERO/ONE
  • File uploads successfully via XHR
  • id_document field updates on AccountUpgradeRequest
  • UI switches to View button after upload
  • Error handling: no file, upload failure

Note

No Flash API changes. Files stored in Frappe file system only.

@linear
Copy link
Copy Markdown

linear Bot commented May 4, 2026

@Nodirbek75 Nodirbek75 requested review from Nodirbek75 and brh28 May 6, 2026 16:05
Copy link
Copy Markdown
Contributor

@Nodirbek75 Nodirbek75 left a comment

Choose a reason for hiding this comment

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

Upload failed with following errors:

Replaces Frappe-local file storage with DO Spaces for admin ID
document uploads. Files are uploaded directly to Spaces via pre-signed
URLs, avoiding Frappe's file system entirely.

- account_management.js: upload button with XHR, resets to
  "Upload Another" on success
- admin_api.py: upload_id_document generates pre-signed PUT URL via
  boto3, uploads file, saves fileKey on the upgrade request.
  get_id_document_url generates pre-signed GET URL via boto3
- graphql_client.py: removed ID document methods (no longer needed)
- .gitignore: wkhtmltox exclusion
@forge0x forge0x force-pushed the fix/eng-371-id-document-upload branch from 5494bb1 to c86854c Compare May 7, 2026 18:59
@islandbitcoin islandbitcoin requested a review from Nodirbek75 May 7, 2026 19:02
Copy link
Copy Markdown
Collaborator

@brh28 brh28 left a comment

Choose a reason for hiding this comment

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

Independent changes would ideally be there own PRs but no matter:

Regarding alert users: why are we removing notification types? Only "emergency" can be sent for what I can tell

Regarding id document upload: I see Nick is having testing issues, but I'm also curious what the use case is where admins are uploading the docs rather than going through the app

@islandbitcoin
Copy link
Copy Markdown
Contributor

there should be no alert changes in here, I tried to remove those.

regarding id document upload: its more for the migration process, we have a lot of users already KYC'd and we migrated their records without ID Documents from Supabase. The support team will need a button to upload the file to these migrated records as they get the IDs again.

This was a one-time migration, so if there is a less intrusive way to handle it, i'm open to alternatives.

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.

5 participants