et_fake_ccd 0.1.20 → 0.1.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/et_fake_ccd/command/create_case_command.rb +12 -1
- data/lib/et_fake_ccd/service/data_store_app.rb +1 -1
- data/lib/et_fake_ccd/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfcdbc556e045cf1e68ea27f1ecc6800a0172d2923a6073aa12208dd17f1ea00
|
4
|
+
data.tar.gz: '09b240fa45926b68e093bf2a75a7fc36252f5d8e68565a0590e6b774005b09c2'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 909986f0e95303bae35ec99a5e50b43c6f97c44142237f23b25e000ff00ef5c2e438f8e3f05a9bf145fc6042a366dcd0ceac644c5726c9b8413b4ab96691c028
|
7
|
+
data.tar.gz: 85fa142b6dd22ada2c4553b3092d261da6ca8cf96331620104713a07f477f7a7fd85caa21713e2d50fbec52548a975260b70c832bac8c59daac427d7b594ee60
|
data/Gemfile.lock
CHANGED
@@ -6,17 +6,28 @@ module EtFakeCcd
|
|
6
6
|
include ActiveModel::Attributes
|
7
7
|
|
8
8
|
SCHEMA_FILE = File.absolute_path(File.join('..', 'case_create.json'), __dir__)
|
9
|
+
ELMOS_BIRTHDAY = Time.new(2019,9,1).to_f
|
9
10
|
|
10
11
|
attribute :data
|
11
12
|
|
12
13
|
def self.from_json(json)
|
13
|
-
|
14
|
+
modified_json = json.dup
|
15
|
+
modified_json['data']['ethosCaseReference'] = nextCaseReference
|
16
|
+
new data: modified_json
|
14
17
|
end
|
15
18
|
|
16
19
|
validate :validate_data
|
17
20
|
|
18
21
|
private
|
19
22
|
|
23
|
+
def assign_ethos_reference_number
|
24
|
+
data['ethosCaseReference'] = nextCaseReference
|
25
|
+
end
|
26
|
+
|
27
|
+
def nextCaseReference
|
28
|
+
format('%7.4f', Time.now.to_f - ELMOS_BIRTHDAY)[-12..-1].gsub(/\./, '/')
|
29
|
+
end
|
30
|
+
|
20
31
|
def validate_data
|
21
32
|
validate_claimant_type
|
22
33
|
validate_primary_claimant
|
@@ -71,7 +71,7 @@ module EtFakeCcd
|
|
71
71
|
r.halt 400, unknown_event_error_for(r)
|
72
72
|
end
|
73
73
|
if command.valid?
|
74
|
-
id = ::EtFakeCcd::DataStoreService.store_case_data(
|
74
|
+
id = ::EtFakeCcd::DataStoreService.store_case_data(command.data, jid: jid, ctid: ctid)
|
75
75
|
case_created_response(id, uid, jid, ctid)
|
76
76
|
else
|
77
77
|
r.halt 422, render_error_for(command, r)
|
data/lib/et_fake_ccd/version.rb
CHANGED