feat(payouts): implement promoter earnings viewing, request flow, and admin Stripe processing with webhooks

Add model methods for accurate net calculations (€0.50 + 1.5% fees), eligibility, refund handling
Update promoter/payouts controller for index (pending events), create (eligibility checks)
Integrate admin processing via Stripe::Transfer, webhook for status sync
Enhance views: index pending cards, events/show preview/form
Add comprehensive tests (models, controllers, service, integration); run migrations
This commit is contained in:
kbe
2025-09-17 02:07:52 +02:00
parent 47f4f50e5b
commit 3c1e17c2af
31 changed files with 1096 additions and 148 deletions

View File

@@ -1,5 +1,19 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
name: Test Event
slug: test-event
description: This is a test event description that is long enough to meet validation requirements.
state: published
venue_name: Test Venue
venue_address: 123 Test Street
latitude: 48.8566
longitude: 2.3522
start_time: <%= 1.week.from_now %>
end_time: <%= 1.week.from_now + 4.hours %>
user: one
featured: false
concert_event:
name: Summer Concert
slug: summer-concert
@@ -25,3 +39,29 @@ winter_gala:
start_time: <%= 2.weeks.from_now %>
end_time: <%= 2.weeks.from_now + 6.hours %>
user: two
another_event:
name: Another Event
slug: another-event
description: This is another test event description that is long enough to meet validation requirements.
state: published
venue_name: Another Venue
venue_address: 456 Test Street
latitude: 48.8566
longitude: 2.3522
start_time: <%= 1.week.ago %>
end_time: <%= 1.week.ago + 4.hours %>
user: one
ineligible:
name: Ineligible Event
slug: ineligible-event
description: This is an ineligible test event description that is long enough to meet validation requirements.
state: draft
venue_name: Ineligible Venue
venue_address: 789 Test Street
latitude: 48.8566
longitude: 2.3522
start_time: <%= 1.week.from_now %>
end_time: <%= 1.week.from_now + 4.hours %>
user: one

View File

@@ -1,3 +1,13 @@
one:
user: one
event: concert_event
status: paid
total_amount_cents: 2500
payment_attempts: 1
expires_at: <%= 1.hour.from_now %>
created_at: <%= 1.hour.ago %>
updated_at: <%= 1.hour.ago %>
paid_order:
user: one
event: concert_event
@@ -26,4 +36,14 @@ expired_order:
payment_attempts: 1
expires_at: <%= 1.hour.ago %>
created_at: <%= 2.hours.ago %>
updated_at: <%= 1.hour.ago %>
updated_at: <%= 1.hour.ago %>
two:
user: two
event: winter_gala
status: expired
total_amount_cents: 5000
payment_attempts: 2
expires_at: <%= 2.hours.ago %>
created_at: <%= 3.hours.ago %>
updated_at: <%= 2.hours.ago %>

View File

@@ -1,5 +1,15 @@
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
name: Standard
description: Standard ticket type
price_cents: 1000
quantity: 100
sale_start_at: <%= 1.day.ago %>
sale_end_at: <%= 1.day.from_now %>
event: concert_event
requires_id: false
standard:
name: General Admission
description: General admission ticket for the event