zaig 1.0.4 → 1.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/zaig/entities/response.rb +29 -2
- data/lib/zaig/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: 4d7e5e123adff444d932edaf15cf93f0d56c036e19a12391957736cdb5b3a0f1
|
4
|
+
data.tar.gz: 6dff02d64d11a052be1a9dc47f77b6a490d3208b1de8b84d487527259099e546
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06ea034e23aef7a39e5dd7fe35260746b31d8095ce9f524bb45f60b02b92d6285fe24bd305e43c1f24b49b3d0cb9e61777d6612430741bc49de0f384c88d6f7f
|
7
|
+
data.tar.gz: f637d5ab308c48793bda590598a41fdff30d8103f395c03cfaf38e87eba2446b4ef77cfe30d3020d174f397e10990802477865559610d80859d4f14f6382bad8
|
@@ -7,9 +7,18 @@ module Zaig
|
|
7
7
|
attr_reader :analysis_status, :credit_proposal_legal_person_key, :message,
|
8
8
|
:raw_data, :reason, :request, :status_code, :zaig_id
|
9
9
|
|
10
|
+
# Collection with all the approval statuses.
|
11
|
+
APPROVAL_STATUS = %i[automatically_approved manually_approved].freeze
|
12
|
+
|
13
|
+
# Collection with all the pending statuses.
|
14
|
+
PENDING_STATUS = %i[pending in_manual_analysis in_manual_analysis].freeze
|
15
|
+
|
16
|
+
# Colllection with all the reproval statuses.
|
17
|
+
REPROVAL_STATUS = %i[automatically_reproved manually_reproved].freeze
|
18
|
+
|
10
19
|
def initialize(analysis_status: nil, credit_proposal_legal_person_key: nil, message: nil,
|
11
20
|
raw_data: nil, reason: nil, request: nil, status_code: nil, zaig_id: nil)
|
12
|
-
@analysis_status = analysis_status
|
21
|
+
@analysis_status = analysis_status.nil? ? nil : analysis_status.to_s.strip.downcase.to_sym
|
13
22
|
@credit_proposal_legal_person_key = credit_proposal_legal_person_key
|
14
23
|
@message = message
|
15
24
|
@raw_data = raw_data
|
@@ -19,9 +28,27 @@ module Zaig
|
|
19
28
|
@zaig_id = zaig_id
|
20
29
|
end
|
21
30
|
|
31
|
+
# Retrieve all the available statuses.
|
32
|
+
def self.statuses
|
33
|
+
%i[automatically_approved automatically_reproved in_manual_analysis manually_approved manually_reproved waiting_for_data pending]
|
34
|
+
end
|
35
|
+
|
36
|
+
# Check if the registration is approved.
|
22
37
|
def approved?
|
23
|
-
analysis_status
|
38
|
+
APPROVAL_STATUS.include?(analysis_status)
|
24
39
|
end
|
40
|
+
|
41
|
+
# Check if the registration still not done.
|
42
|
+
def pending?
|
43
|
+
PENDING_STATUS.include?(analysis_status)
|
44
|
+
end
|
45
|
+
|
46
|
+
# Check if the registration is reproved.
|
47
|
+
def rejected?
|
48
|
+
REPROVAL_STATUS.include?(analysis_status)
|
49
|
+
end
|
50
|
+
|
51
|
+
alias not_approved? rejected?
|
25
52
|
end
|
26
53
|
end
|
27
54
|
end
|
data/lib/zaig/version.rb
CHANGED
@@ -8,5 +8,5 @@ module Zaig
|
|
8
8
|
# Major - Incremented for incompatible changes with previous release (or big enough new features)
|
9
9
|
# Minor - Incremented for new backwards-compatible features + deprecations
|
10
10
|
# Patch - Incremented for backwards-compatible bug fixes
|
11
|
-
VERSION = "1.0.
|
11
|
+
VERSION = "1.0.5"
|
12
12
|
end
|