Skip to content

Commit

Permalink
Merge pull request #62 from sanjam-deriv/POA_notification
Browse files Browse the repository at this point in the history
chore: added notifiiction for updates poa requirements
  • Loading branch information
amina-deriv authored Sep 6, 2023
2 parents dd9561c + 3ea5d20 commit 3159ace
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const AppNotificationMessages = ({
'need_fa',
'notify_financial_assessment',
'poi_name_mismatch',
'poa_older_than_six_months',
'poa_address_mismatch_failure',
'poa_address_mismatch_success',
'poa_address_mismatch_warning',
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/Stores/Helpers/client-notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const priority_toast_messages = [
'p2p_daily_limit_increase',
'authenticate',
'notify_financial_assessment',
'poa_older_than_six_months',
'mt5_notification',
...maintenance_notifications,
];
5 changes: 5 additions & 0 deletions packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ export default class ClientStore extends BaseStore {
is_financial_assessment_needed: computed,
is_authentication_needed: computed,
is_identity_verification_needed: computed,
is_poa_older_than_six_months: computed,
real_account_creation_unlock_date: computed,
is_tnc_needed: computed,
is_social_signup: computed,
Expand Down Expand Up @@ -721,6 +722,10 @@ export default class ClientStore extends BaseStore {
return this.account_status?.status?.includes('financial_assessment_notification');
}

get is_poa_older_than_six_months() {
return this.account_status?.status?.includes('poa_expired');
}

get is_authentication_needed() {
return !this.is_fully_authenticated && !!this.account_status?.authentication?.needs_verification?.length;
}
Expand Down
17 changes: 16 additions & 1 deletion packages/core/src/Stores/notification-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ export default class NotificationStore extends BaseStore {
is_pending_proof_of_ownership,
p2p_advertiser_info,
is_p2p_enabled,
is_poa_older_than_six_months,
} = this.root_store.client;
const { upgradable_daily_limits } = p2p_advertiser_info || {};
const { max_daily_buy, max_daily_sell } = upgradable_daily_limits || {};
Expand Down Expand Up @@ -362,7 +363,11 @@ export default class NotificationStore extends BaseStore {
} else {
this.removeNotificationByKey({ key: this.client_notifications.poi_dob_mismatch });
}

if (is_poa_older_than_six_months) {
this.addNotificationMessage(this.client_notifications.poa_older_than_six_months);
} else {
this.removeNotificationByKey({ key: this.client_notifications.poa_older_than_six_months });
}
if (loginid !== LocalStore.get('active_loginid')) return;

if (is_uk && malta_account) {
Expand Down Expand Up @@ -1130,6 +1135,16 @@ export default class NotificationStore extends BaseStore {
type: 'announce',
should_hide_close_btn: false,
},
poa_older_than_six_months: {
key: 'poa_older_than_six_months',
header: <Localize i18n_default_text='Lets get your address verified' />,
message: <Localize i18n_default_text='Please submit your proof of address' />,
type: 'warning',
action: {
route: routes.proof_of_address,
text: localize('Submit now'),
},
},
poi_failed: {
action: {
route: routes.proof_of_identity,
Expand Down
1 change: 1 addition & 0 deletions packages/stores/src/mockStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const mock = (): TStores & { is_mock: boolean } => {
is_logged_in: false,
is_logging_in: false,
is_pending_proof_of_ownership: false,
is_poa_older_than_six_months: false,
is_switching: false,
is_tnc_needed: false,
is_trading_experience_incomplete: false,
Expand Down
1 change: 1 addition & 0 deletions packages/stores/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ type TClientStore = {
is_logging_in: boolean;
is_low_risk: boolean;
is_pending_proof_of_ownership: boolean;
is_poa_older_than_six_months: boolean;
is_switching: boolean;
is_tnc_needed: boolean;
is_trading_experience_incomplete: boolean;
Expand Down

0 comments on commit 3159ace

Please sign in to comment.