Skip to content

Commit

Permalink
feat(notifications): add new declined reasons (#4014)
Browse files Browse the repository at this point in the history
  • Loading branch information
UncleSamtoshi authored Feb 19, 2024
1 parent fb6a4b9 commit a24b356
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 5 deletions.
8 changes: 6 additions & 2 deletions core/notifications/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down
4 changes: 4 additions & 0 deletions core/notifications/proto/notifications.proto
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,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 {
Expand Down
14 changes: 13 additions & 1 deletion core/notifications/src/grpc/server/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,19 @@ impl From<proto::DeclinedReason> 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
}
}
}
Expand Down
26 changes: 25 additions & 1 deletion core/notifications/src/messages/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 5 additions & 1 deletion core/notifications/src/notification_event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,11 @@ impl From<IdentityVerificationApproved> for NotificationEventPayload {
#[derive(Debug, Serialize, Deserialize)]
pub enum IdentityVerificationDeclinedReason {
DocumentsNotClear,
VerificationPhotoNotClear,
SelfieNotClear,
DocumentsNotSupported,
DocumentsExpired,
DocumentsDoNotMatch,
Other,
}

#[derive(Debug, Serialize, Deserialize)]
Expand Down

0 comments on commit a24b356

Please sign in to comment.