Skip to content

Commit 5a58828

Browse files
authored
Add subprovider field to users & make seperate ENV variable for user visible IBAN (#1160)
* Add subprovider field to users * fix lint * make the option for IBAN Configarable
1 parent 2a40434 commit 5a58828

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ COMPANY_ADDRESS=Oude Markt 24-3, 7511 GB Enschede
2727
COMPANY_WEBSITE=https://societeitflux.nl
2828
COMPANY_KVK=41 032 169
2929

30+
PERSONAL_TRANSACTION_IBAN=NL68 INGB 0008 1654 20
31+
3032
SITE_NAME=S.O.F.I.A.
3133
SITE_SHORT_NAME=SOFIA
3234
SITE_LONG_NAME=Streepsysteem voor de Ordentelijke Festiviteiten van Inleggend Alpha

app/views/users/show.html.erb

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,19 @@
117117
<%= @user.credit <= 0 ? 'Je staat rood!' : 'Inleggen' %>
118118
</h4>
119119
<p class="card-text">
120-
<% if Rails.application.config.x.mollie_api_key.present? %>
120+
<% if Rails.application.config.x.mollie_api_key.present? && Rails.application.config.x.personal_transaction_iban.present? %>
121121
Om je saldo aan te vullen kan je zelf geld overmaken of betalen met iDEAL.
122-
<% else %>
122+
<% elsif Rails.application.config.x.mollie_api_key.present? %>
123+
Om je saldo aan te vullen kan je betalen met iDEAL.
124+
<% elsif Rails.application.config.x.personal_transaction_iban.present? %>
123125
Om je saldo aan te vullen kan je zelf geld overmaken.
126+
<% else %>
127+
Er is geen betaalmethode geconfigureerd om je saldo aan te vullen. Neem contact op met de penningmeester.
128+
<% end %>
129+
<% if Rails.application.config.x.personal_transaction_iban.present? %>
130+
<%= "Dat kan naar #{Rails.application.config.x.personal_transaction_iban} t.n.v. #{Rails.application.config.x.company_name}" %>
131+
<%= 'onder vermelding van je naam en \'Inleg Zatladder\'.' %>
124132
<% end %>
125-
<%= "Dat kan naar #{Rails.application.config.x.company_iban} t.n.v. #{Rails.application.config.x.company_name}" %>
126-
<%= 'onder vermelding van je naam en \'Inleg Zatladder\'.' %>
127-
128133
<% if Rails.application.config.x.mollie_api_key.present? %>
129134
<%= link_to add_payments_path do %>
130135
<%= 'Klik hier om je saldo over te maken via iDEAL ' %>

config/application.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class Application < Rails::Application
6969
config.x.company_address = ENV.fetch('COMPANY_ADDRESS', nil)
7070
config.x.company_website = ENV.fetch('COMPANY_WEBSITE', nil)
7171
config.x.company_kvk = ENV.fetch('COMPANY_KVK', nil)
72+
config.x.personal_transaction_iban = ENV.fetch('PERSONAL_TRANSACTION_IBAN', nil)
7273

7374
config.x.site_name = ENV.fetch('SITE_NAME', 'S.O.F.I.A.')
7475
config.x.site_short_name = ENV.fetch('SITE_SHORT_NAME', 'SOFIA')
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class AddUserSubprovider < ActiveRecord::Migration[7.2]
2+
def change
3+
add_column :users, :sub_provider, :string
4+
add_index :users, :sub_provider
5+
end
6+
end

db/schema.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# It's strongly recommended that you check this file into your version control system.
1212

13-
ActiveRecord::Schema[7.2].define(version: 2025_11_13_094147) do
13+
ActiveRecord::Schema[7.2].define(version: 2025_12_09_160709) do
1414
# These are extensions that must be enabled in order to support this database
1515
enable_extension "plpgsql"
1616

@@ -182,6 +182,8 @@
182182
t.boolean "deactivated", default: false, null: false
183183
t.string "activation_token"
184184
t.datetime "activation_token_valid_till"
185+
t.string "sub_provider"
186+
t.index ["sub_provider"], name: "index_users_on_sub_provider"
185187
t.index ["uid"], name: "index_users_on_uid", unique: true
186188
end
187189

0 commit comments

Comments
 (0)