feat: replace Stripe Global Payouts with manual bank transfer system for France compliance

- Replace Stripe automatic payouts with manual admin-processed bank transfers
- Add banking information fields (IBAN, bank name, account holder) to User model
- Implement manual payout workflow: pending → approved → processing → completed
- Add comprehensive admin interface for payout review and processing
- Update Payout model with manual processing fields and workflow methods
- Add transfer reference tracking and rejection/failure handling
- Consolidate all migration fragments into clean "create" migrations
- Add comprehensive documentation for manual payout workflow
- Fix Event payout_status enum definition and database column issues

This addresses France's lack of Stripe Global Payouts support by implementing
a complete manual bank transfer workflow while maintaining audit trails and
proper admin controls.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
kbe
2025-09-17 11:55:07 +02:00
parent 3c1e17c2af
commit 1889ee7fb2
20 changed files with 838 additions and 141 deletions

View File

@@ -55,6 +55,11 @@ class DeviseCreateUsers < ActiveRecord::Migration[8.0]
# Link user to Stripe account for promoter payout
t.string :stripe_connected_account_id
# Banking information for manual payouts
t.string :iban
t.string :bank_name
t.string :account_holder_name
t.timestamps null: false
end

View File

@@ -23,7 +23,7 @@ class CreateEvents < ActiveRecord::Migration[8.0]
t.boolean :allow_booking_during_event, default: false, null: false
# Payout fields
t.integer :payout_status
t.integer :payout_status, default: 0, null: false
t.datetime :payout_requested_at
t.timestamps

View File

@@ -17,5 +17,6 @@ class CreateTickets < ActiveRecord::Migration[8.0]
end
add_index :tickets, :qr_code, unique: true
add_index :tickets, [:status, :order_id]
end
end

View File

@@ -14,5 +14,7 @@ class CreateEarnings < ActiveRecord::Migration[8.0]
t.timestamps
end
add_index :earnings, :status
end
end

View File

@@ -11,10 +11,17 @@ class CreatePayouts < ActiveRecord::Migration[8.0]
t.references :user, null: false, foreign_key: false
t.references :event, null: false, foreign_key: false
# Manual processing fields
t.references :processed_by, null: true, foreign_key: { to_table: :users }
t.datetime :processed_at
t.text :rejection_reason
t.string :bank_transfer_reference
t.timestamps
end
add_index :payouts, :status
add_index :payouts, :stripe_payout_id, unique: true
add_index :payouts, [:event_id, :status]
end
end

View File

@@ -1,5 +0,0 @@
class AddIndexToPayoutsOnEventIdAndStatus < ActiveRecord::Migration[7.1]
def change
add_index :payouts, [ :event_id, :status ]
end
end

View File

@@ -1,5 +0,0 @@
class AddIndexToEarningsOnStatus < ActiveRecord::Migration[7.1]
def change
add_index :earnings, :status
end
end

View File

@@ -1,5 +0,0 @@
class AddIndexToTicketsOnStatusAndOrderId < ActiveRecord::Migration[7.1]
def change
add_index :tickets, [ :status, :order_id ]
end
end