et_fake_ccd 0.1.25 → 0.1.26

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02267616e71d6fca923c199517d23d9ccc6fbc1f42326473b9f868d775c2e504
4
- data.tar.gz: f7216cc36a13802acce8d1388dc7ddfd0456ef75ed4c8340c250896b9c7a7b18
3
+ metadata.gz: c6f2fd89e2499a1468f03a04dcaed58328476419cf8289a21a7d7db33d45460c
4
+ data.tar.gz: 6da56fd3b19c379f043e5a9e513dac764b30d86d222327a2fe519513dce70165
5
5
  SHA512:
6
- metadata.gz: 2310ebb8b1b25db086da3dd4bcae5b1fce665b641cf36d3bc696fd6c233c7fe53c46f3dfb1b721f6c6c73efa155448bdfbdbec7d16554172065dccf97b405be5
7
- data.tar.gz: 9d1ed82851d1ab1496f4483414a21607401a9c455580f106dc2610a349d91f7eda96abf697967a56ceb5aaa1ff5700f56720fbad717c3e0fb71c1fbefa8504ba
6
+ metadata.gz: 40a43f31402d58598ce9913a52cf5ae78706645e7f8d018f553a23a5519f1124e7654373c4860c38ed63df9c40d40787d251da553e710f5c3af7f60eab0c8c12
7
+ data.tar.gz: ceda02b9369c5e69a47cc70c7f0460156e3128263ddaf093a31fffc545d200256fc4b476d4d38053b06d790d27105c782fe7d1cdca1468ce735124c7c0b2d151
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- et_fake_ccd (0.1.25)
4
+ et_fake_ccd (0.1.26)
5
5
  activemodel (~> 5.2, >= 5.2.3)
6
6
  puma (~> 3.12)
7
7
  roda (~> 3.21)
@@ -23,8 +23,15 @@ module EtFakeCcd
23
23
  data['data']['ethosCaseReference'] = next_case_reference if data.dig('data', 'ethosCaseReference').nil? || data.dig('data', 'ethosCaseReference') == ''
24
24
  end
25
25
 
26
+ def sequence_for_office(office_code)
27
+ @sequences ||= {}
28
+ @sequences[office_code] ||= 0
29
+ @sequences[office_code] += 1
30
+ end
31
+
26
32
  def next_case_reference
27
- format('%7.4f', Time.now.to_f - ELMOS_BIRTHDAY).rjust(12, '0')[-12..-1].gsub(/\./, '/')
33
+ office = data.dig('data', 'feeGroupReference')[0,2].to_i
34
+ "#{office}#{sequence_for_office(office).to_s.rjust(5, '0')}/#{Time.now.year}"
28
35
  end
29
36
 
30
37
  def validate_data
@@ -1,3 +1,3 @@
1
1
  module EtFakeCcd
2
- VERSION = "0.1.25"
2
+ VERSION = "0.1.26"
3
3
  end
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.25
4
+ version: 0.1.26
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-04 00:00:00.000000000 Z
11
+ date: 2019-09-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: roda