Browse Source

CLDC-3704: Allow equity/stairowned/stairbought to have 1 decimal place

pull/2746/head
Rachael Booth 8 months ago
parent
commit
2b8baab1e3
  1. 2
      app/models/form/sales/questions/equity.rb
  2. 2
      app/models/form/sales/questions/staircase_bought.rb
  3. 2
      app/models/form/sales/questions/staircase_owned.rb
  4. 6
      db/migrate/20241031102744_allow_decimal_stairbought_and_stairowned.rb
  5. 6
      db/schema.rb

2
app/models/form/sales/questions/equity.rb

@ -7,7 +7,7 @@ class Form::Sales::Questions::Equity < ::Form::Question
@type = "numeric" @type = "numeric"
@min = 0 @min = 0
@max = 100 @max = 100
@step = 1 @step = 0.1
@width = 5 @width = 5
@suffix = "%" @suffix = "%"
@hint_text = "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)" @hint_text = "Enter the amount of initial equity held by the purchaser (for example, 25% or 50%)"

2
app/models/form/sales/questions/staircase_bought.rb

@ -8,7 +8,7 @@ class Form::Sales::Questions::StaircaseBought < ::Form::Question
@width = 5 @width = 5
@min = 0 @min = 0
@max = 100 @max = 100
@step = 1 @step = 0.1
@suffix = "%" @suffix = "%"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
@top_guidance_partial = "financial_calculations_shared_ownership" @top_guidance_partial = "financial_calculations_shared_ownership"

2
app/models/form/sales/questions/staircase_owned.rb

@ -8,7 +8,7 @@ class Form::Sales::Questions::StaircaseOwned < ::Form::Question
@width = 5 @width = 5
@min = 0 @min = 0
@max = 100 @max = 100
@step = 1 @step = 0.1
@suffix = "%" @suffix = "%"
@question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max] @question_number = QUESTION_NUMBER_FROM_YEAR[form.start_date.year] || QUESTION_NUMBER_FROM_YEAR[QUESTION_NUMBER_FROM_YEAR.keys.max]
end end

6
db/migrate/20241031102744_allow_decimal_stairbought_and_stairowned.rb

@ -0,0 +1,6 @@
class AllowDecimalStairboughtAndStairowned < ActiveRecord::Migration[7.0]
def change
change_column :sales_logs, :stairbought, :decimal
change_column :sales_logs, :stairowned, :decimal
end
end

6
db/schema.rb

@ -10,7 +10,7 @@
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2024_10_11_112158) do ActiveRecord::Schema[7.0].define(version: 2024_10_31_102744) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"
@ -627,8 +627,8 @@ ActiveRecord::Schema[7.0].define(version: 2024_10_11_112158) do
t.integer "deposit_value_check" t.integer "deposit_value_check"
t.integer "frombeds" t.integer "frombeds"
t.integer "staircase" t.integer "staircase"
t.integer "stairbought" t.decimal "stairbought"
t.integer "stairowned" t.decimal "stairowned"
t.decimal "mrent", precision: 10, scale: 2 t.decimal "mrent", precision: 10, scale: 2
t.datetime "exdate" t.datetime "exdate"
t.integer "exday" t.integer "exday"

Loading…
Cancel
Save