From e60b49261003758cb4c4ccba9f1f2e30d1eb1891 Mon Sep 17 00:00:00 2001 From: jeznorth Date: Fri, 5 Jun 2020 12:06:17 -0700 Subject: [PATCH 1/3] [entity3208] Transaction Filters UI Clean-up (#749) --- auth-web/src/components/auth/Transactions.vue | 196 ++++++++++-------- 1 file changed, 107 insertions(+), 89 deletions(-) diff --git a/auth-web/src/components/auth/Transactions.vue b/auth-web/src/components/auth/Transactions.vue index 6b1f6f1ce..be1affdb1 100644 --- a/auth-web/src/components/auth/Transactions.vue +++ b/auth-web/src/components/auth/Transactions.vue @@ -1,9 +1,9 @@ - - - - +
+ + - - - - - - - - -
- - Apply - - - - Cancel - -
- - -

- {{showDateRangeSelected}} -

- + + + + + +
+ + Apply + + - - + class="flex-grow-1 ml-2" + @click="showDateFilter=false" + > + Cancel + +
+
+
+
+ {{showDateRangeSelected}} +
+ +
-
+
Export CSV
-
-

{{totalTransactionsCount}} Records found

+
+
{{totalTransactionsCount}} Records found
From 51b046dd3230eb52ed75256a522ab689714ec985 Mon Sep 17 00:00:00 2001 From: Sumesh Punakkal Kariyil Date: Fri, 5 Jun 2020 12:15:23 -0700 Subject: [PATCH 2/3] 3947: Changes for affiliation and name for CONDITIONAL name requests --- auth-api/src/auth_api/services/affiliation.py | 15 ++++++++++++--- auth-api/src/auth_api/utils/enums.py | 14 ++++++++++++++ 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/auth-api/src/auth_api/services/affiliation.py b/auth-api/src/auth_api/services/affiliation.py index 5b732bf10..937499c92 100644 --- a/auth-api/src/auth_api/services/affiliation.py +++ b/auth-api/src/auth_api/services/affiliation.py @@ -30,6 +30,7 @@ from auth_api.utils.passcode import validate_passcode from auth_api.utils.roles import ALL_ALLOWED_ROLES, CLIENT_AUTH_ROLES, STAFF from .rest_service import RestService +from auth_api.utils.enums import NRNameStatus, NRStatus @ServiceTracing.trace(ServiceTracing.enable_tracing, ServiceTracing.should_be_tracing) @@ -182,7 +183,11 @@ def create_new_business_affiliation(org_id, business_identifier=None, # pylint: nr_phone = nr_json.get('applicants').get('phoneNumber') nr_email = nr_json.get('applicants').get('emailAddress') - if status not in ('APPROVED', 'CONDITIONAL'): + if status not in (NRStatus.APPROVED.value, NRStatus.CONDITIONAL.value): + raise BusinessException(Error.NR_NOT_APPROVED, None) + + # If consentFlag is not R, N or Null for a CONDITIONAL NR throw error + if status == NRStatus.CONDITIONAL.value and nr_json.get('consentFlag', None) not in (None, 'R', 'N'): raise BusinessException(Error.NR_NOT_APPROVED, None) if (phone and phone != nr_phone) or (email and email != nr_email): @@ -191,8 +196,12 @@ def create_new_business_affiliation(org_id, business_identifier=None, # pylint: # Create an entity with the Name from NR if entity doesn't exist if not entity: # Filter the names from NR response and get the name which has status APPROVED as the name. - name = next( - (name.get('name') for name in nr_json.get('names') if name.get('state', None) == 'APPROVED'), None) + # Filter the names from NR response and get the name which has status CONDITION as the name. + nr_name_state = NRNameStatus.APPROVED.value if status == NRStatus.APPROVED.value \ + else NRNameStatus.CONDITION.value + name = next((name.get('name') for name in nr_json.get('names') if + name.get('state', None) == nr_name_state), None) + entity = EntityService.save_entity({ 'businessIdentifier': business_identifier, 'name': name, diff --git a/auth-api/src/auth_api/utils/enums.py b/auth-api/src/auth_api/utils/enums.py index cbf4d1d75..50a5aa91e 100644 --- a/auth-api/src/auth_api/utils/enums.py +++ b/auth-api/src/auth_api/utils/enums.py @@ -80,3 +80,17 @@ class DocumentType(Enum): TERMS_OF_USE = 'termsofuse' TERMS_OF_USE_DIRECTOR_SEARCH = 'termsofuse_directorsearch' + + +class NRStatus(Enum): + """NR statuses.""" + + APPROVED = 'APPROVED' + CONDITIONAL = 'CONDITIONAL' + + +class NRNameStatus(Enum): + """NR name statuses.""" + + APPROVED = 'APPROVED' + CONDITION = 'CONDITION' From 23b71067a3e4b20c6a2d2f2899e2e7590375bf42 Mon Sep 17 00:00:00 2001 From: Sumesh Punakkal Kariyil Date: Fri, 5 Jun 2020 12:18:12 -0700 Subject: [PATCH 3/3] Fixing lint errors --- auth-api/src/auth_api/services/affiliation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth-api/src/auth_api/services/affiliation.py b/auth-api/src/auth_api/services/affiliation.py index 937499c92..a959483e8 100644 --- a/auth-api/src/auth_api/services/affiliation.py +++ b/auth-api/src/auth_api/services/affiliation.py @@ -27,10 +27,10 @@ from auth_api.services.entity import Entity as EntityService from auth_api.services.org import Org as OrgService from auth_api.utils.enums import CorpType +from auth_api.utils.enums import NRNameStatus, NRStatus from auth_api.utils.passcode import validate_passcode from auth_api.utils.roles import ALL_ALLOWED_ROLES, CLIENT_AUTH_ROLES, STAFF from .rest_service import RestService -from auth_api.utils.enums import NRNameStatus, NRStatus @ServiceTracing.trace(ServiceTracing.enable_tracing, ServiceTracing.should_be_tracing)