Skip to content

Commit 814c03c

Browse files
committed
[RUBY-4163] implementing mock mode support for os places postcode lookup
1 parent cbce159 commit 814c03c

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

Gemfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
GIT
22
remote: https://github.com/DEFRA/waste-carriers-engine
3-
revision: 674e64343facbd28457ee4e61a0dbfc92a797ad5
3+
revision: 8919ca7707b6cc2b2ccba3c2f67b6d99e3fd4295
44
branch: feature/RUBY-4163-wcr-tech-debt-implement-os-places-address-lookup-service-in-defra-ruby-address-gem
55
specs:
66
waste_carriers_engine (0.0.1)
@@ -327,19 +327,19 @@ GEM
327327
mime-types (3.7.0)
328328
logger
329329
mime-types-data (~> 3.2025, >= 3.2025.0507)
330-
mime-types-data (3.2026.0224)
330+
mime-types-data (3.2026.0303)
331331
mini_mime (1.1.5)
332332
mini_portile2 (2.8.9)
333333
minitest (6.0.2)
334334
drb (~> 2.0)
335335
prism (~> 1.5)
336-
mongo (2.22.0)
336+
mongo (2.23.0)
337337
base64
338338
bson (>= 4.14.1, < 6.0.0)
339339
mongo_session_store (3.2.1)
340340
actionpack (>= 4.0)
341341
mongo (~> 2.0)
342-
mongoid (8.1.11)
342+
mongoid (8.1.12)
343343
activemodel (>= 5.1, < 8.1, != 7.0.0)
344344
concurrent-ruby (>= 1.0.5, < 2.0)
345345
mongo (>= 2.18.0, < 3.0.0)
@@ -378,7 +378,7 @@ GEM
378378
rack (>= 1.6.13)
379379
rackup (>= 1.0.1)
380380
rake (>= 12.3.3)
381-
phonelib (0.10.15)
381+
phonelib (0.10.16)
382382
pp (0.6.3)
383383
prettyprint
384384
prettyprint (0.2.0)

config/application.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,20 @@ class Application < Rails::Application
6565
ENV["WCRS_COMPANIES_HOUSE_URL"] || "https://api.companieshouse.gov.uk/"
6666
end
6767

68+
# OS Placess postcode lookup config
69+
config.os_places_api_key = ENV.fetch("WCRS_OSPLACES_KEY", nil)
70+
config.os_places_service_url =
71+
if ENV["WCRS_MOCK_ENABLED"].to_s.downcase == "true"
72+
ENV.fetch("WCRS_MOCK_BO_OSPLACES_URL", nil)
73+
else
74+
ENV["WCRS_OSPLACES_URL"] || "https://api.os.uk/search/places/v1"
75+
end
76+
6877
# Paths
6978
# This is the domain to use on URLs for FO services such as renewal and deregistration
7079
config.wcrs_fo_link_domain = ENV["WCRS_RENEWALS_DOMAIN"] || "http://localhost:3002"
71-
7280
config.wcrs_frontend_url = ENV["WCRS_FRONTEND_DOMAIN"] || "http://localhost:3000"
7381
config.wcrs_services_url = ENV["WCRS_SERVICES_DOMAIN"] || "http://localhost:8003"
74-
config.os_places_service_url = ENV["WCRS_OS_PLACES_DOMAIN"] || "http://localhost:8005"
7582
config.host = config.wcrs_fo_link_domain
7683

7784
# Fees

0 commit comments

Comments
 (0)