Skip to content

Commit

Permalink
Update financial incentives
Browse files Browse the repository at this point in the history
  • Loading branch information
gms-gs committed Oct 10, 2024
1 parent d2317f6 commit 2bb318b
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 1 deletion.
32 changes: 32 additions & 0 deletions app/services/subjects/financial_incentive_creator_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,38 @@ def initialize(year:, subject: Subject, financial_incentive: FinancialIncentive)

def subject_and_financial_incentives
subject_and_financial_incentives = {
2025 => {
%w[Mathematics Physics Chemistry Computing] => {
bursary_amount: '29000',
scholarship: '31000'
},
%w[French German Spanish] => {
bursary_amount: '26000',
scholarship: '28000'
},
[
'Italian',
'Japanese',
'Latin',
'Mandarin',
'Modern languages (other)',
'Russian',
'Italian',
'Ancient Greek',
'Ancient Hebrew'
] => {
bursary_amount: '26000'
},
['Geography', 'Biology', 'Design and technology'] => {
bursary_amount: '26000'
},
['Art and design', 'Music', 'Religious education'] => {
bursary_amount: '10000'
},
['English'] => {
bursary_amount: '5000'
}
},
2024 => {
%w[Mathematics Physics Chemistry Computing] => {
bursary_amount: '28000',
Expand Down
23 changes: 23 additions & 0 deletions db/migrate/20241010085441_add2025_financial_incentives.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# frozen_string_literal: true

class Add2025FinancialIncentives < ActiveRecord::Migration[7.2]
def up
say_with_time 'populating 2025 financial incentives' do
FinancialIncentive.destroy_all

year = 2025

Subjects::FinancialIncentiveCreatorService.new(year:).execute
end
end

def down
say_with_time 'populating 2024 financial incentives' do
FinancialIncentive.destroy_all

year = 2024

Subjects::FinancialIncentiveCreatorService.new(year:).execute
end
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.2].define(version: 2024_09_26_204405) do
ActiveRecord::Schema[7.2].define(version: 2024_10_10_085441) do
# These are extensions that must be enabled in order to support this database
enable_extension "btree_gin"
enable_extension "btree_gist"
Expand Down
Binary file modified docs/database-diagram.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2bb318b

Please sign in to comment.