et_fake_ccd 0.1.26 → 0.1.27
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 +0 -16
- data/lib/et_fake_ccd/data_store_service.rb +13 -0
- data/lib/et_fake_ccd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 232ea5fdd8a52f3eef798c32422769d34c4fb9b30296f97db08e3a613247b36c
|
4
|
+
data.tar.gz: b35dc423cb11a892e16554f7350d889425214cd3cfba2cdf5f04c3bd8f6ca52a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7a91c2c046f74cdb9b2e7623f32594cc4e430a8b61341042c86522e5fe35eebedff62cde1c36b6c0514496d01172b4394621ad6ac7aceb4babd68e63c0e55f9
|
7
|
+
data.tar.gz: ed4cef33fefb8923ba3276440a596ca4122d8983407b2ed9513c29ed5d013b8d5cad28e92613f7329aa3c364f6d775692db088d021ef5f369ed5ae25029c5f4e
|
data/Gemfile.lock
CHANGED
@@ -18,22 +18,6 @@ module EtFakeCcd
|
|
18
18
|
|
19
19
|
private
|
20
20
|
|
21
|
-
def initialize(*)
|
22
|
-
super
|
23
|
-
data['data']['ethosCaseReference'] = next_case_reference if data.dig('data', 'ethosCaseReference').nil? || data.dig('data', 'ethosCaseReference') == ''
|
24
|
-
end
|
25
|
-
|
26
|
-
def sequence_for_office(office_code)
|
27
|
-
@sequences ||= {}
|
28
|
-
@sequences[office_code] ||= 0
|
29
|
-
@sequences[office_code] += 1
|
30
|
-
end
|
31
|
-
|
32
|
-
def next_case_reference
|
33
|
-
office = data.dig('data', 'feeGroupReference')[0,2].to_i
|
34
|
-
"#{office}#{sequence_for_office(office).to_s.rjust(5, '0')}/#{Time.now.year}"
|
35
|
-
end
|
36
|
-
|
37
21
|
def validate_data
|
38
22
|
validate_claimant_type
|
39
23
|
validate_primary_claimant
|
@@ -46,6 +46,9 @@ module EtFakeCcd
|
|
46
46
|
|
47
47
|
def store(json, jid:, ctid:)
|
48
48
|
self.id = id + 1
|
49
|
+
unless ctid =~ /Multiples/
|
50
|
+
json['data']['ethosCaseReference'] = next_case_reference(json.dig('data', 'feeGroupReference')[0,2].to_i) if json.dig('data', 'ethosCaseReference').nil? || json.dig('data', 'ethosCaseReference') == ''
|
51
|
+
end
|
49
52
|
data[jid] ||= {}
|
50
53
|
data[jid][ctid] ||= {}
|
51
54
|
data[jid][ctid][id.to_s] = json
|
@@ -74,6 +77,16 @@ module EtFakeCcd
|
|
74
77
|
|
75
78
|
attr_accessor :data, :id
|
76
79
|
|
80
|
+
def sequence_for_office(office_code)
|
81
|
+
@sequences ||= {}
|
82
|
+
@sequences[office_code] ||= 0
|
83
|
+
@sequences[office_code] += 1
|
84
|
+
end
|
85
|
+
|
86
|
+
def next_case_reference(office)
|
87
|
+
"#{office}#{sequence_for_office(office).to_s.rjust(5, '0')}/#{Time.now.year}"
|
88
|
+
end
|
89
|
+
|
77
90
|
def filter(list, filters:)
|
78
91
|
return list if filters.nil? || filters.empty?
|
79
92
|
|
data/lib/et_fake_ccd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: et_fake_ccd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gary Taylor
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: roda
|