Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(notifications): add new declined reasons #4014

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -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 {
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
Loading