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,6 +1,10 @@
Rails.application.routes.draw do
namespace :admin do
resources :payouts, only: [ :index, :create ]
resources :payouts, only: [ :index, :show ] do
member do
post :process
end
end
end
# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html
@@ -78,7 +82,7 @@ Rails.application.routes.draw do
# === Promoter Routes ===
namespace :promoter do
resources :payouts, only: [:index, :show, :create]
resources :payouts, only: [ :index, :show, :create ]
resources :events do
member do
patch :publish
@@ -115,4 +119,6 @@ Rails.application.routes.draw do
# resources :ticket_types, only: [ :index, :show, :create, :update, :destroy ]
end
end
post "/webhooks/stripe", to: "webhooks/stripe#create"
end