feat: add promoter payouts controller and routes
This commit is contained in:
10
app/controllers/promoter/payouts_controller.rb
Normal file
10
app/controllers/promoter/payouts_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
class Promoter::PayoutsController < ApplicationController
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def show
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
end
|
||||||
2
app/helpers/promoter/payouts_helper.rb
Normal file
2
app/helpers/promoter/payouts_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
module Promoter::PayoutsHelper
|
||||||
|
end
|
||||||
2
app/views/promoter/payouts/create.html.erb
Normal file
2
app/views/promoter/payouts/create.html.erb
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<h1>Promoter::Payouts#create</h1>
|
||||||
|
<p>Find me in app/views/promoter/payouts/create.html.erb</p>
|
||||||
2
app/views/promoter/payouts/index.html.erb
Normal file
2
app/views/promoter/payouts/index.html.erb
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<h1>Promoter::Payouts#index</h1>
|
||||||
|
<p>Find me in app/views/promoter/payouts/index.html.erb</p>
|
||||||
2
app/views/promoter/payouts/show.html.erb
Normal file
2
app/views/promoter/payouts/show.html.erb
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
<h1>Promoter::Payouts#show</h1>
|
||||||
|
<p>Find me in app/views/promoter/payouts/show.html.erb</p>
|
||||||
@@ -78,6 +78,9 @@ Rails.application.routes.draw do
|
|||||||
|
|
||||||
# === Promoter Routes ===
|
# === Promoter Routes ===
|
||||||
namespace :promoter do
|
namespace :promoter do
|
||||||
|
get "payouts/index"
|
||||||
|
get "payouts/show"
|
||||||
|
get "payouts/create"
|
||||||
resources :events do
|
resources :events do
|
||||||
member do
|
member do
|
||||||
patch :publish
|
patch :publish
|
||||||
|
|||||||
@@ -52,7 +52,8 @@ class DeviseCreateUsers < ActiveRecord::Migration[8.0]
|
|||||||
# Add onboarding check on user model
|
# Add onboarding check on user model
|
||||||
t.boolean :onboarding_completed, default: false, null: false
|
t.boolean :onboarding_completed, default: false, null: false
|
||||||
|
|
||||||
# add_column :users, :stripe_connected_account_id, :string
|
# Link user to Stripe account for promoter payout
|
||||||
|
t.string :stripe_connected_account_id
|
||||||
|
|
||||||
t.timestamps null: false
|
t.timestamps null: false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
class AddPayoutFieldsToEvents < ActiveRecord::Migration[8.0]
|
|
||||||
def change
|
|
||||||
add_column :events, :payout_requested_at, :datetime
|
|
||||||
add_column :events, :payout_status, :integer
|
|
||||||
end
|
|
||||||
end
|
|
||||||
18
test/controllers/promoter/payouts_controller_test.rb
Normal file
18
test/controllers/promoter/payouts_controller_test.rb
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
require "test_helper"
|
||||||
|
|
||||||
|
class Promoter::PayoutsControllerTest < ActionDispatch::IntegrationTest
|
||||||
|
test "should get index" do
|
||||||
|
get promoter_payouts_index_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get show" do
|
||||||
|
get promoter_payouts_show_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
|
||||||
|
test "should get create" do
|
||||||
|
get promoter_payouts_create_url
|
||||||
|
assert_response :success
|
||||||
|
end
|
||||||
|
end
|
||||||
Reference in New Issue
Block a user