Skip to content

Commit

Permalink
CRIMAPP-1577 store court_type and overall_result for decisions (#360)
Browse files Browse the repository at this point in the history
  • Loading branch information
timpeat authored Jan 17, 2025
1 parent 88db0fc commit c8f1233
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 22 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
40 changes: 21 additions & 19 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: 99982c0576a5fe9defeaccab89e16f6e3c11fd93
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 @@ -112,13 +112,13 @@ GEM
aws-eventstream (~> 1, >= 1.0.2)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.8)
bigdecimal (3.1.9)
brakeman (6.1.2)
racc
builder (3.3.0)
byebug (11.1.3)
coderay (1.1.3)
concurrent-ruby (1.3.4)
concurrent-ruby (1.3.5)
connection_pool (2.4.1)
crack (1.0.0)
bigdecimal
Expand All @@ -135,32 +135,34 @@ GEM
dotenv (= 2.8.1)
railties (>= 3.2)
drb (2.2.1)
dry-configurable (1.2.0)
dry-core (~> 1.0, < 2)
dry-configurable (1.3.0)
dry-core (~> 1.1)
zeitwerk (~> 2.6)
dry-core (1.0.1)
dry-core (1.1.0)
concurrent-ruby (~> 1.0)
logger
zeitwerk (~> 2.6)
dry-inflector (1.1.0)
dry-initializer (3.1.1)
dry-logic (1.5.0)
dry-inflector (1.2.0)
dry-initializer (3.2.0)
dry-logic (1.6.0)
bigdecimal
concurrent-ruby (~> 1.0)
dry-core (~> 1.0, < 2)
dry-core (~> 1.1)
zeitwerk (~> 2.6)
dry-schema (1.13.4)
dry-schema (1.14.0)
concurrent-ruby (~> 1.0)
dry-configurable (~> 1.0, >= 1.0.1)
dry-core (~> 1.0, < 2)
dry-initializer (~> 3.0)
dry-logic (>= 1.4, < 2)
dry-types (>= 1.7, < 2)
dry-core (~> 1.1)
dry-initializer (~> 3.2)
dry-logic (~> 1.5)
dry-types (~> 1.8)
zeitwerk (~> 2.6)
dry-struct (1.6.0)
dry-core (~> 1.0, < 2)
dry-types (>= 1.7, < 2)
ice_nine (~> 0.11)
zeitwerk (~> 2.6)
dry-types (1.7.2)
dry-types (1.8.0)
bigdecimal (~> 3.0)
concurrent-ruby (~> 1.0)
dry-core (~> 1.0)
Expand Down Expand Up @@ -374,7 +376,7 @@ GEM
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.6.18)
zeitwerk (2.7.1)

PLATFORMS
ruby
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 c8f1233

Please sign in to comment.