in data store the create page the upload doc fixed - #22
Conversation
- Remove custom upload/view endpoints in datasets.py - Use getPresignedUrl and extractDataset from hey-api SDK - Add /s3local proxy in next.config.ts to resolve browser CORS issues
- Add file_id ObjectId lookup in get_presigned_url endpoint to return correct download URL - Clean PUT signature parameters before GET fetch in FileDownloadButton - Trigger instant browser download into Downloads folder using hey-api SDK
| role_ids = user.get("role_id") | ||
| role_name = "user" | ||
| if role_id: | ||
| role = get_role_by_id(role_id) | ||
| if role and role.get("role_name"): | ||
| role_name = role["role_name"] |
There was a problem hiding this comment.
if its plural ids being stored / retrieved, then I'd like to know. like the property should be role_ids then
| role_name = "admin" | ||
| elif roles_found: | ||
| role_name = roles_found[0] | ||
| logger.debug("User role resolved: role_ids=%s role_name=%s", role_ids, role_name) |
There was a problem hiding this comment.
This is generally problematic so we need to have an rbac code that will be used to centralize all the role checking under that. Even admins and superadmins need to have some kind of a flow
There was a problem hiding this comment.
this should fall under tests, don't pollute the directory
| // Clean query parameters to avoid signature mismatch on GET requests | ||
| let cleanUrl = rawUrl ? rawUrl.split("?")[0] : ""; | ||
| if (!cleanUrl && objectName) { | ||
| cleanUrl = `http://localhost:9000/uploads/${objectName}`; |
There was a problem hiding this comment.
you can't hard code this url, this won't work in deployment
| targetUrl = targetUrl.replace( | ||
| /^http:\/\/(localhost|127\.0\.0\.1):9000/, | ||
| `${window.location.origin}/s3local` | ||
| ); |
There was a problem hiding this comment.
You can't assume these are the things, presigned urls should be passing the entire url, not like this please chekc this
| { | ||
| source: "/s3local/:path*", | ||
| destination: "http://localhost:9000/:path*", | ||
| }, |
There was a problem hiding this comment.
I think this can't be setup like this, presigned urls should not be proxied since it might be coming from aws in the future
…ric storage sync engine Phase 1: - Updated csa-erp-client dependency to local editable package (/workspaces/erpnext_client) - Replaced custom REST extraction in erp.py with unified ERPNextClient methods - Supported DocTypes and Query Reports (Stock Balance) via generic client methods - Maintained full backward compatibility for FastAPI endpoints, task runners, and Streamlit dashboards Phase 2: - Added sync_checkpoints collection in database.py to track watermarks and sync states - Enhanced store_to_mongodb() in mongodb_service.py with configurable record merging (upsert) - Prevented duplicate records on re-sync (idempotency) and enabled in-place record updates - Extended pipeline_mapping.py to support sync_strategy (timestamp vs snapshot) and identity_key - Enabled incremental DocType extraction using ERPNext 'modified' timestamps in erp.py - Supported snapshot replacement for Query Reports (Stock Balance) - Updated TaskRunner in task_executor.py to advance checkpoints only after successful MongoDB storage - Organized test suites under backend/tests/
…layer & multi-ERP routing - Implement BaseMapper abstraction with strict schema validation and date/number normalizers - Create dedicated mappers for all 6 dashboards (NFCoordinator, TerritoryTransactions, FarmerIncomeVisits, StockMovement, StockInventory, RevenueAnalysis) - Add Central MapperRegistry for dataset-to-mapper binding with clean unmapped passthrough - Add multi-ERP routing support in erp.py for erp.csa-india.org and erp.fpohub.com - Integrate mapping step in TaskRunner pipeline execution - Document mapping architecture and live ERP schema alignments - Add comprehensive Phase 3 test suite in test_phase3_dashboard_mapping.py
…goDB & dynamic calculations - Implement load_dashboard_data_from_mongodb helper with clean BSON _id exclusion in utilities.py - Migrate Dashboard 1 (NF Coordinator) to 'nf_coordinator_activities' - Migrate Dashboard 2 (Purchase & Sales) to 'territory_transactions' with zero-sales safety - Migrate Dashboard 3 (Farmer Income) to 'farmer_income_visits' with safe null financial metrics - Migrate Dashboard 4 (Stock Movement) to 'stock_movement' - Migrate Dashboard 5 (Stock Inventory) to 'stock_inventory' - Migrate Dashboard 6 (Revenue Analysis) to 'revenue_analysis' & eliminate all hardcoded mockup constants - Preserve all reference CSV files in app/dashboards/data/ as offline fallbacks - Add comprehensive test suites for pilot, stock, commercial, E2E regression, and warehouse integration
…ERPNext - Implement trigger_warehouse_auto_sync in utilities.py reusing existing TaskRunner, ERPNextClient, and MapperRegistry - Add auto_sync support to load_dashboard_data_from_mongodb to trigger synchronous sync prior to querying MongoDB - Update stock_inventory_dashboard and stock_movement_dashboard to trigger auto-sync on mount/refresh - Set @st.cache_data(ttl=10) and add manual 'Sync with ERP' sidebar button - Preserve existing MongoDB documents and freeze checkpoints on ERP failure/outage - Add comprehensive test suite in test_phase5_warehouse_auto_sync.py verifying live sync, idempotency, zero duplication, and fault tolerance
No description provided.