feat: Implement promoter payout system for event revenue processing
- Add Payout model with associations to User and Event - Create payout requests for completed events with proper earnings calculation - Exclude refunded tickets from payout calculations - Add promoter dashboard views for managing payouts - Implement admin interface for processing payouts - Integrate with Stripe for actual payment processing - Add comprehensive tests for payout functionality Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
@@ -1,4 +0,0 @@
|
||||
class FixPayoutSystemDefaultsAndIndexes < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
end
|
||||
end
|
||||
19
db/migrate/20250916221454_create_payouts.rb
Normal file
19
db/migrate/20250916221454_create_payouts.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class CreatePayouts < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :payouts do |t|
|
||||
t.references :user, null: false, foreign_key: true
|
||||
t.references :event, null: false, foreign_key: true
|
||||
t.integer :amount_cents, null: false
|
||||
t.integer :fee_cents, null: false, default: 0
|
||||
t.integer :status, null: false, default: 0
|
||||
t.string :stripe_payout_id
|
||||
t.integer :total_orders_count, null: false, default: 0
|
||||
t.integer :refunded_orders_count, null: false, default: 0
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :payouts, :status
|
||||
add_index :payouts, :stripe_payout_id, unique: true
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user