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:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,5 +14,7 @@ class CreateEarnings < ActiveRecord::Migration[8.0]
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :earnings, :status
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
class AddIndexToPayoutsOnEventIdAndStatus < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_index :payouts, [ :event_id, :status ]
|
||||
end
|
||||
end
|
||||
@@ -1,5 +0,0 @@
|
||||
class AddIndexToEarningsOnStatus < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_index :earnings, :status
|
||||
end
|
||||
end
|
||||
@@ -1,5 +0,0 @@
|
||||
class AddIndexToTicketsOnStatusAndOrderId < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_index :tickets, [ :status, :order_id ]
|
||||
end
|
||||
end
|
||||
20
db/schema.rb
generated
20
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_09_16_230003) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2025_09_16_221454) do
|
||||
create_table "earnings", charset: "utf8mb4", collation: "utf8mb4_uca1400_ai_ci", force: :cascade do |t|
|
||||
t.integer "amount_cents"
|
||||
t.integer "fee_cents"
|
||||
@@ -42,11 +42,11 @@ ActiveRecord::Schema[8.0].define(version: 2025_09_16_230003) do
|
||||
t.decimal "longitude", precision: 10, scale: 6, null: false
|
||||
t.boolean "featured", default: false, null: false
|
||||
t.bigint "user_id", null: false
|
||||
t.boolean "allow_booking_during_event", default: false, null: false
|
||||
t.integer "payout_status"
|
||||
t.datetime "payout_requested_at"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.boolean "allow_booking_during_event", default: false, null: false
|
||||
t.integer "payout_status", default: 0, null: false
|
||||
t.datetime "payout_requested_at"
|
||||
t.index ["featured"], name: "index_events_on_featured"
|
||||
t.index ["latitude", "longitude"], name: "index_events_on_latitude_and_longitude"
|
||||
t.index ["payout_status"], name: "index_events_on_payout_status"
|
||||
@@ -82,8 +82,13 @@ ActiveRecord::Schema[8.0].define(version: 2025_09_16_230003) do
|
||||
t.bigint "event_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.bigint "processed_by_id"
|
||||
t.datetime "processed_at"
|
||||
t.text "rejection_reason"
|
||||
t.string "bank_transfer_reference"
|
||||
t.index ["event_id", "status"], name: "index_payouts_on_event_id_and_status"
|
||||
t.index ["event_id"], name: "index_payouts_on_event_id"
|
||||
t.index ["processed_by_id"], name: "index_payouts_on_processed_by_id"
|
||||
t.index ["status"], name: "index_payouts_on_status"
|
||||
t.index ["stripe_payout_id"], name: "index_payouts_on_stripe_payout_id", unique: true
|
||||
t.index ["user_id"], name: "index_payouts_on_user_id"
|
||||
@@ -138,11 +143,14 @@ ActiveRecord::Schema[8.0].define(version: 2025_09_16_230003) do
|
||||
t.string "company_website"
|
||||
t.string "stripe_customer_id"
|
||||
t.boolean "onboarding_completed", default: false, null: false
|
||||
t.string "stripe_connected_account_id"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "iban"
|
||||
t.string "bank_name"
|
||||
t.string "account_holder_name"
|
||||
t.index ["email"], name: "index_users_on_email", unique: true
|
||||
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
||||
t.index ["stripe_connected_account_id"], name: "index_users_on_stripe_connected_account_id", unique: true
|
||||
end
|
||||
|
||||
add_foreign_key "payouts", "users", column: "processed_by_id"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user