Skip to content

Conversation

@caseybecking
Copy link
Owner

Features:

  • Edit functionality with pre-populated forms for all entities
  • Delete functionality with confirmation dialogs
  • Referential integrity checks to prevent orphaned records
  • Edit modals with dropdowns for related data (institutions, categories, accounts)
  • Real-time form population via API GET endpoints

API Endpoints Added:

  • GET /api/institution/ - Get single institution
  • PUT /api/institution/ - Update institution
  • DELETE /api/institution/ - Delete institution with account check
  • GET /api/institution/account/ - Get single account
  • PUT /api/institution/account/ - Update account with validation
  • DELETE /api/institution/account/ - Delete account with transaction check
  • GET /api/categories/ - Get single category
  • PUT /api/categories/ - Update category with FK validation
  • DELETE /api/categories/ - Delete category with transaction check
  • GET /api/transaction/ - Get single transaction
  • PUT /api/transaction/ - Update transaction with validation
  • DELETE /api/transaction/ - Delete transaction

Frontend Changes:

  • Added Edit and Delete buttons to all data tables
  • Created edit modals for each entity type
  • JavaScript functions for edit/update/delete operations
  • Error handling with user-friendly alerts
  • Automatic page refresh after successful operations

Referential Integrity:

  • Institutions cannot be deleted if they have linked accounts
  • Accounts cannot be deleted if they have linked transactions
  • Categories cannot be deleted if they have linked transactions
  • Clear error messages indicating number of dependent records

Files Modified:

  • api/institution/controllers.py - Added detail, update, delete endpoints
  • api/institution_account/controllers.py - Added detail, update, delete endpoints
  • api/categories/controllers.py - Added detail, update, delete endpoints
  • api/transaction/controllers.py - Added detail, update, delete endpoints
  • app/transactions/controllers.py - Fixed endpoint name, added data fetching
  • app/templates/institution/index.html - Added edit/delete UI
  • app/templates/institution_account/index.html - Added edit/delete UI
  • app/templates/categories/index.html - Added edit/delete UI
  • app/templates/transactions/index.html - Added edit/delete UI
  • app/static/js/institution/institution.js - Added CRUD functions
  • app/static/js/institution_account/institution_account.js - Added CRUD functions
  • app/static/js/categories/categories.js - Added CRUD functions
  • app/static/js/transactions/transactions.js - Added CRUD functions

…ies, and transactions

Features:
- Edit functionality with pre-populated forms for all entities
- Delete functionality with confirmation dialogs
- Referential integrity checks to prevent orphaned records
- Edit modals with dropdowns for related data (institutions, categories, accounts)
- Real-time form population via API GET endpoints

API Endpoints Added:
- GET /api/institution/<id> - Get single institution
- PUT /api/institution/<id> - Update institution
- DELETE /api/institution/<id> - Delete institution with account check
- GET /api/institution/account/<id> - Get single account
- PUT /api/institution/account/<id> - Update account with validation
- DELETE /api/institution/account/<id> - Delete account with transaction check
- GET /api/categories/<id> - Get single category
- PUT /api/categories/<id> - Update category with FK validation
- DELETE /api/categories/<id> - Delete category with transaction check
- GET /api/transaction/<id> - Get single transaction
- PUT /api/transaction/<id> - Update transaction with validation
- DELETE /api/transaction/<id> - Delete transaction

Frontend Changes:
- Added Edit and Delete buttons to all data tables
- Created edit modals for each entity type
- JavaScript functions for edit/update/delete operations
- Error handling with user-friendly alerts
- Automatic page refresh after successful operations

Referential Integrity:
- Institutions cannot be deleted if they have linked accounts
- Accounts cannot be deleted if they have linked transactions
- Categories cannot be deleted if they have linked transactions
- Clear error messages indicating number of dependent records

Files Modified:
- api/institution/controllers.py - Added detail, update, delete endpoints
- api/institution_account/controllers.py - Added detail, update, delete endpoints
- api/categories/controllers.py - Added detail, update, delete endpoints
- api/transaction/controllers.py - Added detail, update, delete endpoints
- app/transactions/controllers.py - Fixed endpoint name, added data fetching
- app/templates/institution/index.html - Added edit/delete UI
- app/templates/institution_account/index.html - Added edit/delete UI
- app/templates/categories/index.html - Added edit/delete UI
- app/templates/transactions/index.html - Added edit/delete UI
- app/static/js/institution/institution.js - Added CRUD functions
- app/static/js/institution_account/institution_account.js - Added CRUD functions
- app/static/js/categories/categories.js - Added CRUD functions
- app/static/js/transactions/transactions.js - Added CRUD functions
@caseybecking caseybecking self-assigned this Oct 27, 2025
@caseybecking caseybecking merged commit 0e64598 into main Oct 27, 2025
1 check failed
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