From 510d1419ac4f923bec07a25e2ad98cbb75e04c15 Mon Sep 17 00:00:00 2001 From: Sam Peters Date: Fri, 16 Feb 2024 13:43:15 -0600 Subject: [PATCH] feat(notifications): add new declined reasons --- core/notifications/locales/en.yml | 8 ++++-- core/notifications/proto/notifications.proto | 4 +++ core/notifications/src/grpc/server/convert.rs | 14 +++++++++- core/notifications/src/messages/mod.rs | 26 ++++++++++++++++++- core/notifications/src/notification_event.rs | 6 ++++- 5 files changed, 53 insertions(+), 5 deletions(-) diff --git a/core/notifications/locales/en.yml b/core/notifications/locales/en.yml index 876d806d0f..49c6e84347 100644 --- a/core/notifications/locales/en.yml +++ b/core/notifications/locales/en.yml @@ -15,12 +15,16 @@ circle_threshold_reached.inner.body: "You have welcomed %{threshold} people to B circle_threshold_reached.outer.title: "Outer Circle gains 💪" circle_threshold_reached.outer.body: "Your Outer Circle reached %{threshold} people. You are driving Bitcoin adoption!" -identity_verification_approved.title: "Your Identity has been verified!" +identity_verification_approved.title: "Your identity has been verified!" identity_verification_approved.body: "The documents for your verification have been processed." identity_verification_declined.reason.documents_not_clear: "the uploaded documents were not clear" identity_verification_declined.reason.photo_not_clear: "the picture you submitted was not clear" -identity_verification_declined.title: "Your Identity could not be verified!" +identity_verification_declined.reason.documents_do_not_match: "the documents you submitted did not match your selfie and/or the information you provided" +identity_verification_declined.reason.documents_expired: "the documents you submitted were expired" +identity_verification_declined.reason.documents_not_supported: "the documents you submitted are not supported" +identity_verification_declined.reason.other: "an error occurred, please contact support" +identity_verification_declined.title: "Your identity could not be verified!" identity_verification_declined.body: "We were not able to process your documents because %{reason}." identity_verification_review_pending.title: "Your verification is in process!" diff --git a/core/notifications/proto/notifications.proto b/core/notifications/proto/notifications.proto index 8298a7be4a..b55e2fda50 100644 --- a/core/notifications/proto/notifications.proto +++ b/core/notifications/proto/notifications.proto @@ -170,6 +170,10 @@ message IdentityVerificationApproved { enum DeclinedReason { DOCUMENTS_NOT_CLEAR = 0; VERIFICATION_PHOTO_NOT_CLEAR = 1; + DOCUMENTS_NOT_SUPPORTED = 2; + DOCUMENTS_EXPIRED = 3; + DOCUMENTS_DO_NOT_MATCH = 4; + OTHER = 5; } message IdentityVerificationDeclined { diff --git a/core/notifications/src/grpc/server/convert.rs b/core/notifications/src/grpc/server/convert.rs index 7c121af7a0..1ae9cb6087 100644 --- a/core/notifications/src/grpc/server/convert.rs +++ b/core/notifications/src/grpc/server/convert.rs @@ -89,7 +89,19 @@ impl From for notification_event::IdentityVerificationDec notification_event::IdentityVerificationDeclinedReason::DocumentsNotClear } proto::DeclinedReason::VerificationPhotoNotClear => { - notification_event::IdentityVerificationDeclinedReason::VerificationPhotoNotClear + notification_event::IdentityVerificationDeclinedReason::SelfieNotClear + } + proto::DeclinedReason::DocumentsNotSupported => { + notification_event::IdentityVerificationDeclinedReason::DocumentsNotSupported + } + proto::DeclinedReason::DocumentsExpired => { + notification_event::IdentityVerificationDeclinedReason::DocumentsExpired + } + proto::DeclinedReason::Other => { + notification_event::IdentityVerificationDeclinedReason::Other + } + proto::DeclinedReason::DocumentsDoNotMatch => { + notification_event::IdentityVerificationDeclinedReason::DocumentsDoNotMatch } } } diff --git a/core/notifications/src/messages/mod.rs b/core/notifications/src/messages/mod.rs index f3aa19da6d..0be17e02a2 100644 --- a/core/notifications/src/messages/mod.rs +++ b/core/notifications/src/messages/mod.rs @@ -76,12 +76,36 @@ impl Messages { locale = locale ) } - IdentityVerificationDeclinedReason::VerificationPhotoNotClear => { + IdentityVerificationDeclinedReason::SelfieNotClear => { t!( "identity_verification_declined.reason.photo_not_clear", locale = locale ) } + IdentityVerificationDeclinedReason::DocumentsNotSupported => { + t!( + "identity_verification_declined.reason.documents_not_supported", + locale = locale + ) + } + IdentityVerificationDeclinedReason::DocumentsExpired => { + t!( + "identity_verification_declined.reason.documents_expired", + locale = locale + ) + } + IdentityVerificationDeclinedReason::DocumentsDoNotMatch => { + t!( + "identity_verification_declined.reason.documents_do_not_match", + locale = locale + ) + } + IdentityVerificationDeclinedReason::Other => { + t!( + "identity_verification_declined.reason.other", + locale = locale + ) + } }; let title = t!( "identity_verification_declined.title", diff --git a/core/notifications/src/notification_event.rs b/core/notifications/src/notification_event.rs index cf55cf5073..2b3bb0d3e8 100644 --- a/core/notifications/src/notification_event.rs +++ b/core/notifications/src/notification_event.rs @@ -170,7 +170,11 @@ impl From for NotificationEventPayload { #[derive(Debug, Serialize, Deserialize)] pub enum IdentityVerificationDeclinedReason { DocumentsNotClear, - VerificationPhotoNotClear, + SelfieNotClear, + DocumentsNotSupported, + DocumentsExpired, + DocumentsDoNotMatch, + Other, } #[derive(Debug, Serialize, Deserialize)]