Skip to content

Commit

Permalink
CRIMAPP-1577 store court_type and overall_result for decisions
Browse files Browse the repository at this point in the history
  • Loading branch information
timpeat committed Jan 17, 2025
1 parent 88db0fc commit d1f72b0
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ gem 'aws-sdk-sns'

gem 'laa-criminal-legal-aid-schemas',
github: 'ministryofjustice/laa-criminal-legal-aid-schemas',
tag: 'v1.5.1'
tag: 'v1.5.2'

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
Expand Down
8 changes: 4 additions & 4 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GIT
remote: https://github.com/ministryofjustice/laa-criminal-legal-aid-schemas.git
revision: 35163d1b4b46a921fb997f1b158fa1debc622f5b
tag: v1.5.1
revision: 8371d60c8ec53d60433a7395335698ff13dd1501
tag: v1.5.2
specs:
laa-criminal-legal-aid-schemas (1.5.0)
laa-criminal-legal-aid-schemas (1.5.2)
dry-schema (~> 1.13)
dry-struct (~> 1.6.0)
json-schema (~> 4.0.0)
Expand Down Expand Up @@ -142,7 +142,7 @@ GEM
concurrent-ruby (~> 1.0)
zeitwerk (~> 2.6)
dry-inflector (1.1.0)
dry-initializer (3.1.1)
dry-initializer (3.2.0)
dry-logic (1.5.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
Expand Down
2 changes: 2 additions & 0 deletions app/api/datastore/v1/reviewing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class Reviewing < Base
optional :means, type: JSON
requires :funding_decision, type: String
optional :comment, type: String
optional :court_type, type: String
optional :overall_result, type: String
end
end

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddCourtTypeAndOverallResultToDecisions < ActiveRecord::Migration[7.1]
def change
add_column :decisions, :court_type, :string
add_column :decisions, :overall_result, :string
end
end
4 changes: 3 additions & 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.1].define(version: 2024_11_01_173540) do
ActiveRecord::Schema[7.1].define(version: 2025_01_17_095032) do
# These are extensions that must be enabled in order to support this database
enable_extension "citext"
enable_extension "plpgsql"
Expand Down Expand Up @@ -61,6 +61,8 @@
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "case_id"
t.string "court_type"
t.string "overall_result"
t.index ["crime_application_id"], name: "index_decisions_on_crime_application_id"
end

Expand Down
6 changes: 5 additions & 1 deletion spec/api/datastore/v1/reviewing/complete_application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@
'interests_of_justice' => interests_of_justice,
'means' => means,
'funding_decision' => 'granted',
'comment' => 'test comment'
'comment' => 'test comment',
'court_type' => 'crown',
'overall_result' => 'Granted - failed means'
}.as_json
]
end
Expand Down Expand Up @@ -138,6 +140,8 @@
expect(decisions.first.means).to eq(means)
expect(decisions.first.funding_decision).to eq('granted')
expect(decisions.first.comment).to eq('test comment')
expect(decisions.first.court_type).to eq('crown')
expect(decisions.first.overall_result).to eq('Granted - failed means')
end
end
end
Expand Down

0 comments on commit d1f72b0

Please sign in to comment.