feat: prevent duplicate membership applications and fees

- Add UNIQUE constraint on membership_application.user_id (one app per user)
- Add UNIQUE constraint on membership_fees.user_id (one fee record per user)
- Add validation checks in process_application.php before inserting
- Improve error messages for duplicate submission attempts
- Add migration script to clean up existing duplicates before constraints
- Update checkMembershipApplication to set session message on redirect
- Add comprehensive documentation of duplicate prevention architecture

Individual payments/EFTs are tracked separately in payments table
This commit is contained in:
twotalesanimation
2025-12-05 09:42:42 +02:00
parent 9133b7bbc6
commit 05f74f1b86
4 changed files with 175 additions and 5 deletions

View File

@@ -1434,6 +1434,10 @@ function checkMembershipApplication($user_id)
// Check if the record exists and redirect
if ($count > 0) {
// Set a session message before redirecting
if (!isset($_SESSION['message'])) {
$_SESSION['message'] = 'You have already submitted a membership application.';
}
header("Location: membership_details.php");
exit();
}