diff --git a/Gemfile b/Gemfile index 51937a3..d9da10f 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index de0f624..21f399b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -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 @@ -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) @@ -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 diff --git a/app/api/datastore/v1/reviewing.rb b/app/api/datastore/v1/reviewing.rb index 6f4982d..ada2c0e 100644 --- a/app/api/datastore/v1/reviewing.rb +++ b/app/api/datastore/v1/reviewing.rb @@ -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 diff --git a/db/migrate/20250117095032_add_court_type_and_overall_result_to_decisions.rb b/db/migrate/20250117095032_add_court_type_and_overall_result_to_decisions.rb new file mode 100644 index 0000000..4938ad5 --- /dev/null +++ b/db/migrate/20250117095032_add_court_type_and_overall_result_to_decisions.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 9568b28..6a00e74 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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" @@ -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 diff --git a/spec/api/datastore/v1/reviewing/complete_application_spec.rb b/spec/api/datastore/v1/reviewing/complete_application_spec.rb index 2c2662d..1c9b38f 100644 --- a/spec/api/datastore/v1/reviewing/complete_application_spec.rb +++ b/spec/api/datastore/v1/reviewing/complete_application_spec.rb @@ -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 @@ -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